# ntmt-hust/deepcamcs architecture

> Architecture diagram of the GitHub repository ntmt-hust/deepcamcs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ntmt-hust/deepcamcs
- Repository: https://github.com/ntmt-hust/deepcamcs

## Overview

DeepCamCS turns aligned mRNA, methylation, and CNV profiles into multi-channel images, trains and evaluates cancer-subtype classifiers with explanation-guided feedback, then maps attributions to candidate genes and performs downstream biological analyses. The graph includes the documented gene-selection, omics-filtering, and enrichment branches. Relationships among the unsampled post-processing modules follow README descriptions; source excerpts do not establish their internal call wiring.

Main entry points: [`StratifiedKFoldCrossValidation.py`](https://github.com/ntmt-hust/deepcamcs/blob/main/StratifiedKFoldCrossValidation.py) (Cross-Validation), [`ChooseGenes.py`](https://github.com/ntmt-hust/deepcamcs/blob/main/ChooseGenes.py) (Gene Selection), [`train.py`](https://github.com/ntmt-hust/deepcamcs/blob/main/train.py) (Training CLI), [`produceIMG.py`](https://github.com/ntmt-hust/deepcamcs/blob/main/produceIMG.py) (Image Generation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_image_prep["Omics Imaging"]
  node_produce_img["Image Generation<br/>[produceIMG.py]"]
end

subgraph group_classification["Classification"]
  node_dataset["Image Dataset<br/>[Dataset.py]"]
  node_cv["Cross-Validation"]
  node_classifier["EfficientNet Classifier"]
  node_focal_loss["Focal Loss<br/>[FocalLoss.py]"]
  node_gradcam["Grad-CAM Feedback<br/>[GradCAM.py]"]
  node_sparse_ig["Sparse Integrated Gradients"]
  node_evaluation["Metrics and Evaluation"]
  node_train["Training CLI<br/>[train.py]"]
end

subgraph group_biomarkers["Biomarker Discovery"]
  node_heatmap["Attribution Mapping"]
  node_choose_genes["Gene Selection<br/>[ChooseGenes.py]"]
  node_merge_genes["Gene Aggregation"]
  node_filter_omics["Omics Filtering"]
end

subgraph group_biology["Biological Analysis"]
  node_pathway["Pathway Enrichment"]
  node_go_kegg["GO and KEGG"]
end

node_researcher(("Researcher"))

node_researcher -->|"generates images"| node_produce_img
node_produce_img -->|"provides images"| node_dataset
node_researcher -->|"runs training"| node_train
node_train -->|"runs folds"| node_cv
node_train -->|"maps attributions"| node_heatmap
node_cv -->|"loads samples"| node_dataset
node_cv -->|"instantiates"| node_classifier
node_cv -->|"computes loss"| node_focal_loss
node_cv -->|"generates feedback"| node_gradcam
node_cv -->|"computes attributions"| node_sparse_ig
node_cv -->|"uses metrics"| node_evaluation
node_heatmap -->|"scores genes"| node_choose_genes
node_choose_genes -->|"selects genes"| node_merge_genes
node_merge_genes -->|"filters matrices"| node_filter_omics
node_choose_genes -->|"enriches genes"| node_pathway
node_choose_genes -->|"tests pathways"| node_go_kegg

click node_produce_img "https://github.com/ntmt-hust/deepcamcs/blob/main/produceIMG.py"
click node_dataset "https://github.com/ntmt-hust/deepcamcs/blob/main/Dataset.py"
click node_cv "https://github.com/ntmt-hust/deepcamcs/blob/main/StratifiedKFoldCrossValidation.py"
click node_classifier "https://github.com/ntmt-hust/deepcamcs/blob/main/EfficientNetB1Classifier.py"
click node_focal_loss "https://github.com/ntmt-hust/deepcamcs/blob/main/FocalLoss.py"
click node_gradcam "https://github.com/ntmt-hust/deepcamcs/blob/main/GradCAM.py"
click node_sparse_ig "https://github.com/ntmt-hust/deepcamcs/blob/main/sparse_integrated_gradients.py"
click node_evaluation "https://github.com/ntmt-hust/deepcamcs/blob/main/additional_function.py"
click node_train "https://github.com/ntmt-hust/deepcamcs/blob/main/train.py"
click node_heatmap "https://github.com/ntmt-hust/deepcamcs/blob/main/ProcessHeatMapResult.py"
click node_choose_genes "https://github.com/ntmt-hust/deepcamcs/blob/main/ChooseGenes.py"
click node_merge_genes "https://github.com/ntmt-hust/deepcamcs/blob/main/merge_genes_omics.py"
click node_filter_omics "https://github.com/ntmt-hust/deepcamcs/blob/main/filter_omics_by_unique_genes.py"
click node_pathway "https://github.com/ntmt-hust/deepcamcs/blob/main/pathway_analysis.py"
click node_go_kegg "https://github.com/ntmt-hust/deepcamcs/blob/main/go_kegg_enrichment.R"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_produce_img toneBlue
class node_dataset,node_cv,node_classifier,node_focal_loss,node_gradcam,node_sparse_ig,node_evaluation,node_train toneAmber
class node_heatmap,node_choose_genes,node_merge_genes,node_filter_omics toneMint
class node_pathway,node_go_kegg toneRose
class node_researcher toneIndigo
```

## Components

### Omics Imaging

- [Image Generation](https://github.com/ntmt-hust/deepcamcs/blob/main/produceIMG.py): `produceIMG.py`

### Classification

- [Image Dataset](https://github.com/ntmt-hust/deepcamcs/blob/main/Dataset.py): `Dataset.py`
- [Cross-Validation](https://github.com/ntmt-hust/deepcamcs/blob/main/StratifiedKFoldCrossValidation.py): `StratifiedKFoldCrossValidation.py`
- [EfficientNet Classifier](https://github.com/ntmt-hust/deepcamcs/blob/main/EfficientNetB1Classifier.py): `EfficientNetB1Classifier.py`
- [Focal Loss](https://github.com/ntmt-hust/deepcamcs/blob/main/FocalLoss.py): `FocalLoss.py`
- [Grad-CAM Feedback](https://github.com/ntmt-hust/deepcamcs/blob/main/GradCAM.py): `GradCAM.py`
- [Sparse Integrated Gradients](https://github.com/ntmt-hust/deepcamcs/blob/main/sparse_integrated_gradients.py): `sparse_integrated_gradients.py`
- [Metrics and Evaluation](https://github.com/ntmt-hust/deepcamcs/blob/main/additional_function.py): `additional_function.py`
- [Training CLI](https://github.com/ntmt-hust/deepcamcs/blob/main/train.py): `train.py`

### Biomarker Discovery

- [Attribution Mapping](https://github.com/ntmt-hust/deepcamcs/blob/main/ProcessHeatMapResult.py): `ProcessHeatMapResult.py`
- [Gene Selection](https://github.com/ntmt-hust/deepcamcs/blob/main/ChooseGenes.py): `ChooseGenes.py`
- [Gene Aggregation](https://github.com/ntmt-hust/deepcamcs/blob/main/merge_genes_omics.py): `merge_genes_omics.py`
- [Omics Filtering](https://github.com/ntmt-hust/deepcamcs/blob/main/filter_omics_by_unique_genes.py): `filter_omics_by_unique_genes.py`

### Biological Analysis

- [Pathway Enrichment](https://github.com/ntmt-hust/deepcamcs/blob/main/pathway_analysis.py): `pathway_analysis.py`
- [GO and KEGG](https://github.com/ntmt-hust/deepcamcs/blob/main/go_kegg_enrichment.R): `go_kegg_enrichment.R`

### Other components

- **Researcher**

## Connections

- Researcher → Image Generation: generates images (evidence: `README.md`)
- Image Generation → Image Dataset: provides images (evidence: `README.md`)
- Researcher → Training CLI: runs training (evidence: `README.md`)
- Training CLI → Cross-Validation: runs folds (evidence: `train.py`)
- Training CLI → Attribution Mapping: maps attributions (evidence: `train.py`)
- Cross-Validation → Image Dataset: loads samples (evidence: `StratifiedKFoldCrossValidation.py`)
- Cross-Validation → EfficientNet Classifier: instantiates (evidence: `StratifiedKFoldCrossValidation.py`)
- Cross-Validation → Focal Loss: computes loss (evidence: `StratifiedKFoldCrossValidation.py`)
- Cross-Validation → Grad-CAM Feedback: generates feedback (evidence: `StratifiedKFoldCrossValidation.py`)
- Cross-Validation → Sparse Integrated Gradients: computes attributions (evidence: `StratifiedKFoldCrossValidation.py`)
- Cross-Validation → Metrics and Evaluation: uses metrics (evidence: `StratifiedKFoldCrossValidation.py`)
- Attribution Mapping → Gene Selection: scores genes (evidence: `README.md`)
- Gene Selection → Gene Aggregation: selects genes (evidence: `README.md`)
- Gene Aggregation → Omics Filtering: filters matrices (evidence: `README.md`)
- Gene Selection → Pathway Enrichment: enriches genes (evidence: `README.md`)
- Gene Selection → GO and KEGG: tests pathways (evidence: `README.md`)
