histocartography.ml.models.hact_model module

Summary

Classes:

HACTModel

HACT model.

class HACTModel(cg_gnn_params: Dict, tg_gnn_params: Dict, classification_params: Dict, cg_node_dim: int, tg_node_dim: int, **kwargs)[source]

Bases: histocartography.ml.models.base_model.BaseModel

HACT model. The information for grading tumors lies at different scales. By building 2 graphs, one at the cell level and one at the object level (modeled with super pixels), we can extract graph embeddings that once combined provide a multi-scale representation of a RoI. This implementation is using GNN layers and spatial assignment matrix to fuse the 2 layers.

__init__(cg_gnn_params: Dict, tg_gnn_params: Dict, classification_params: Dict, cg_node_dim: int, tg_node_dim: int, **kwargs)None[source]

TissueGraphModel model constructor

Parameters
  • cg_gnn_params (Dict) – Cell Graph GNN configuration parameters.

  • tg_gnn_params (Dict) – Tissue Graph GNN configuration parameters.

  • classification_params (Dict) – classification configuration parameters.

  • cg_node_dim (int) – Cell node feature dimension.

  • tg_node_dim (int) – Tissue node feature dimension.

forward(cell_graph: Union[dgl.graph.DGLGraph, dgl.graph.batch], tissue_graph: Union[dgl.graph.DGLGraph, dgl.graph.batch], assignment_matrix: torch.Tensor)torch.Tensor[source]

Foward pass.

Parameters
  • cell_graph (Union[dgl.DGLGraph, dgl.batch]) – Cell graph or Batch of cell graphs.

  • tissue_graph (Union[dgl.DGLGraph, dgl.batch]) – Tissue graph or Batch of tissue graphs.

  • assignment_matrix (torch.Tensor) – List of assignment matrices

Returns

model output.

Return type

torch.Tensor

set_rlp(with_rlp)[source]
rlp(out_relevance_score)[source]

Reference

If you use histocartography in your projects, please cite the following:

@inproceedings{pati2021,
    title = {Hierarchical Graph Representations for Digital Pathology},
    author = {Pushpak Pati, Guillaume Jaume, Antonio Foncubierta, Florinda Feroce, Anna Maria Anniciello, Giosuè Scognamiglio, Nadia Brancati, Maryse Fiche, Estelle Dubruc, Daniel Riccio, Maurizio Di Bonito, Giuseppe De Pietro, Gerardo Botti, Jean-Philippe Thiran, Maria Frucci, Orcun Goksel, Maria Gabrani},
    booktitle = {https://arxiv.org/pdf/2102.11057},
    year = {2021}
}