# sevak-grigoryan/gnn-image-classification architecture

> Architecture diagram of the GitHub repository sevak-grigoryan/gnn-image-classification, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sevak-grigoryan/gnn-image-classification
- Repository: https://github.com/sevak-grigoryan/gnn-image-classification

## Overview

This repository is an image-classification benchmark comparing nine GNN architectures on confidential Car/Human/Noise images. Its main workflow configures a dataset, converts images to pixel-grid graphs, trains and evaluates models, and saves checkpoints and reports; the README also documents saliency and layer-visualization workflows. The graph preserves the architecture variants and shared utilities. Some model-specific training and visualization implementations were not excerpted, so their connections are shown only where documented.

Main entry points: [`utils/train.py`](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/utils/train.py) (Generic trainer), [`utils/directions.py`](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/utils/directions.py) (Shared configuration), [`models/GCN/saliency.py`](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/GCN/saliency.py) (Saliency analysis), [`utils/data_processing.py`](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/utils/data_processing.py) (Image-to-graph data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_config["Shared configuration<br/>[directions.py]"]
  node_graphdata["Image-to-graph data<br/>[data_processing.py]"]
end

subgraph group_models["Model architectures"]
  node_cheb["ChebNet<br/>[model.py]"]
  node_cheb2["ChebNetII<br/>[model.py]"]
  node_cheblayer["ChebNetII layer<br/>[Cheb_Layer.py]"]
  node_gat["GAT<br/>[model_GAT.py]"]
  node_gcn["GCN<br/>[model.py]"]
  node_gin["GIN<br/>[model_GIN.py]"]
  node_gine["GINE<br/>[model.py]"]
  node_ginetw["GINE-TW<br/>[model.py]"]
  node_sage["GraphSAGE<br/>[model.py]"]
  node_hybridcnn["Hybrid CNN<br/>[model_CNN.py]"]
  node_hybridgnn["Hybrid GNN<br/>[model_GNN.py]"]
end

subgraph group_training["Training and evaluation"]
  node_trainer["Generic trainer<br/>[train.py]"]
  node_parametercount["Parameter summary"]
  node_reports["Checkpoints and reports"]
end

subgraph group_inspection["Model inspection"]
  node_saliency["Saliency analysis<br/>[saliency.py]"]
  node_twimportance["GINE-TW layer importance"]
end

node_user(("Benchmark user"))

node_user -->|"sets configuration"| node_config
node_config -->|"configures dataset"| node_graphdata
node_user -->|"runs training"| node_trainer
node_trainer -->|"loads graphs"| node_graphdata
node_trainer -.->|"trains model"| node_gcn
node_trainer -.->|"saves results"| node_reports
node_cheb2 -->|"uses layer"| node_cheblayer
node_user -->|"inspects prediction"| node_saliency
node_saliency -->|"loads model"| node_gcn
node_user -->|"inspects layers"| node_twimportance
node_gin -->|"counts parameters"| node_parametercount
node_hybridgnn -.->|"counts parameters"| node_parametercount

click node_config "https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/utils/directions.py"
click node_graphdata "https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/utils/data_processing.py"
click node_cheb "https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/ChebNet/model.py"
click node_cheb2 "https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/ChebNet_II/model.py"
click node_cheblayer "https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/ChebNet_II/Cheb_Layer.py"
click node_gat "https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/GAT/model_GAT.py"
click node_gcn "https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/GCN/model.py"
click node_gin "https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/GIN/model_GIN.py"
click node_gine "https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/GINE/model.py"
click node_ginetw "https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/GINE_TW/model.py"
click node_sage "https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/GraphSAGE/model.py"
click node_hybridcnn "https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/Hybrid_CNN_GNN/model_CNN.py"
click node_hybridgnn "https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/Hybrid_CNN_GNN/model_GNN.py"
click node_trainer "https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/utils/train.py"
click node_parametercount "https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/utils/count_parameters.py"
click node_saliency "https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/GCN/saliency.py"
click node_twimportance "https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/GINE_TW/layer_importance_vis.py"

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_config,node_graphdata,node_user toneBlue
class node_cheb,node_cheb2,node_cheblayer,node_gat,node_gcn,node_gin,node_gine,node_ginetw,node_sage,node_hybridcnn,node_hybridgnn toneAmber
class node_trainer,node_parametercount,node_reports toneMint
class node_saliency,node_twimportance toneRose
```

## Components

### Data preparation

- [Shared configuration](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/utils/directions.py): `utils/directions.py`
- [Image-to-graph data](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/utils/data_processing.py): `utils/data_processing.py`

### Model architectures

- [ChebNet](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/ChebNet/model.py): `models/ChebNet/model.py`
- [ChebNetII](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/ChebNet_II/model.py): `models/ChebNet_II/model.py`
- [ChebNetII layer](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/ChebNet_II/Cheb_Layer.py): `models/ChebNet_II/Cheb_Layer.py`
- [GAT](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/GAT/model_GAT.py): `models/GAT/model_GAT.py`
- [GCN](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/GCN/model.py): `models/GCN/model.py`
- [GIN](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/GIN/model_GIN.py): `models/GIN/model_GIN.py`
- [GINE](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/GINE/model.py): `models/GINE/model.py`
- [GINE-TW](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/GINE_TW/model.py): `models/GINE_TW/model.py`
- [GraphSAGE](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/GraphSAGE/model.py): `models/GraphSAGE/model.py`
- [Hybrid CNN](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/Hybrid_CNN_GNN/model_CNN.py): `models/Hybrid_CNN_GNN/model_CNN.py`
- [Hybrid GNN](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/Hybrid_CNN_GNN/model_GNN.py): `models/Hybrid_CNN_GNN/model_GNN.py`

### Training and evaluation

- [Generic trainer](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/utils/train.py): `utils/train.py`
- [Parameter summary](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/utils/count_parameters.py): `utils/count_parameters.py`
- **Checkpoints and reports**

### Model inspection

- [Saliency analysis](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/GCN/saliency.py): `models/GCN/saliency.py`
- [GINE-TW layer importance](https://github.com/sevak-grigoryan/gnn-image-classification/blob/main/models/GINE_TW/layer_importance_vis.py): `models/GINE_TW/layer_importance_vis.py`

### Other components

- **Benchmark user**

## Connections

- Benchmark user → Shared configuration: sets configuration (evidence: `README.md`)
- Shared configuration → Image-to-graph data: configures dataset (evidence: `utils/data_processing.py`)
- Benchmark user → Generic trainer: runs training (evidence: `README.md`)
- Generic trainer → Image-to-graph data: loads graphs (evidence: `utils/train.py`)
- Generic trainer → GCN: trains model
- Generic trainer → Checkpoints and reports: saves results
- ChebNetII → ChebNetII layer: uses layer (evidence: `models/ChebNet_II/model.py`)
- Benchmark user → Saliency analysis: inspects prediction (evidence: `README.md`)
- Saliency analysis → GCN: loads model (evidence: `models/GCN/saliency.py`)
- Benchmark user → GINE-TW layer importance: inspects layers (evidence: `README.md`)
- GIN → Parameter summary: counts parameters (evidence: `models/GIN/model_GIN.py`)
- Hybrid GNN → Parameter summary: counts parameters (evidence: `models/Hybrid_CNN_GNN/model_GNN.py`)
