# sakiyo212/taresnet architecture

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

- Interactive diagram: https://gitdiagram.com/sakiyo212/taresnet
- Repository: https://github.com/sakiyo212/taresnet

## Overview

TAresnet is a diabetic-retinopathy image-classification research project: its visible runtime script loads labeled images, trains a pretrained ResNet-152 classifier, validates it, and saves the best checkpoint. The README also describes Grad-CAM analysis, but no implementation for that capability appears in the tree. The listed prediction CSVs and research documents are present, but their generation or use is not established by the sampled source, so they are not wired into the runtime flow.

Main entry points: [`main.py`](https://github.com/sakiyo212/taresnet/blob/main/main.py) (Training script)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Training workflow"]
  node_training_script["Training script<br/>[main.py]"]
  node_data_loading["Dataset loading<br/>[main.py]"]
  node_preprocessing["Image preprocessing<br/>[main.py]"]
  node_data_split["Balanced split<br/>[main.py]"]
  node_resnet_model["ResNet-152 model<br/>[main.py]"]
  node_training_loop["Model training<br/>[main.py]"]
  node_validation["Model validation<br/>[main.py]"]
end

subgraph group_artifacts["Research artifacts"]
  node_checkpoint["Best checkpoint<br/>[main.py]"]
  node_default_predictions["Default predictions"]
  node_weighted_predictions["Weighted predictions"]
end

subgraph group_analysis["Model analysis"]
  node_gradcam["Grad-CAM analysis<br/>[README.md]"]
end

node_researcher(("Researcher"))
node_dataset[("Labeled image data")]
node_pretrained_weights["Torch Hub weights"]

node_researcher -->|"runs"| node_training_script
node_training_script -->|"loads data"| node_data_loading
node_dataset -->|"provides labels/images"| node_data_loading
node_data_loading -->|"transforms images"| node_preprocessing
node_data_loading -->|"splits labels"| node_data_split
node_preprocessing -->|"feeds batches"| node_training_loop
node_data_split -->|"feeds training set"| node_training_loop
node_data_split -->|"feeds validation set"| node_validation
node_training_script -->|"creates"| node_resnet_model
node_resnet_model -->|"loads weights"| node_pretrained_weights
node_training_loop -->|"trains"| node_resnet_model
node_validation -->|"evaluates"| node_resnet_model
node_training_script -->|"saves best"| node_checkpoint

click node_training_script "https://github.com/sakiyo212/taresnet/blob/main/main.py"
click node_data_loading "https://github.com/sakiyo212/taresnet/blob/main/main.py"
click node_preprocessing "https://github.com/sakiyo212/taresnet/blob/main/main.py"
click node_data_split "https://github.com/sakiyo212/taresnet/blob/main/main.py"
click node_resnet_model "https://github.com/sakiyo212/taresnet/blob/main/main.py"
click node_training_loop "https://github.com/sakiyo212/taresnet/blob/main/main.py"
click node_validation "https://github.com/sakiyo212/taresnet/blob/main/main.py"
click node_checkpoint "https://github.com/sakiyo212/taresnet/blob/main/main.py"
click node_default_predictions "https://github.com/sakiyo212/taresnet/blob/main/default%20prediction/resnet152val_sorted.csv"
click node_weighted_predictions "https://github.com/sakiyo212/taresnet/blob/main/class_weighted%20pred/resnet152valClass_sorted.csv"
click node_gradcam "https://github.com/sakiyo212/taresnet/blob/main/README.md"

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_training_script,node_data_loading,node_preprocessing,node_data_split,node_resnet_model,node_training_loop,node_validation toneBlue
class node_checkpoint,node_default_predictions,node_weighted_predictions,node_dataset toneAmber
class node_gradcam toneMint
class node_researcher,node_pretrained_weights toneIndigo
```

## Components

### Training workflow

- [Training script](https://github.com/sakiyo212/taresnet/blob/main/main.py): `main.py`
- [Dataset loading](https://github.com/sakiyo212/taresnet/blob/main/main.py): `main.py`
- [Image preprocessing](https://github.com/sakiyo212/taresnet/blob/main/main.py): `main.py`
- [Balanced split](https://github.com/sakiyo212/taresnet/blob/main/main.py): `main.py`
- [ResNet-152 model](https://github.com/sakiyo212/taresnet/blob/main/main.py): `main.py`
- [Model training](https://github.com/sakiyo212/taresnet/blob/main/main.py): `main.py`
- [Model validation](https://github.com/sakiyo212/taresnet/blob/main/main.py): `main.py`

### Research artifacts

- [Best checkpoint](https://github.com/sakiyo212/taresnet/blob/main/main.py): `main.py`
- [Default predictions](https://github.com/sakiyo212/taresnet/blob/main/default%20prediction/resnet152val_sorted.csv): `default prediction/resnet152val_sorted.csv`
- [Weighted predictions](https://github.com/sakiyo212/taresnet/blob/main/class_weighted%20pred/resnet152valClass_sorted.csv): `class_weighted pred/resnet152valClass_sorted.csv`

### Model analysis

- [Grad-CAM analysis](https://github.com/sakiyo212/taresnet/blob/main/README.md): `README.md`

### Other components

- **Researcher**
- **Labeled image data**
- **Torch Hub weights**

## Connections

- Researcher → Training script: runs (evidence: `main.py`)
- Training script → Dataset loading: loads data (evidence: `main.py`)
- Labeled image data → Dataset loading: provides labels/images (evidence: `main.py`)
- Dataset loading → Image preprocessing: transforms images (evidence: `main.py`)
- Dataset loading → Balanced split: splits labels (evidence: `main.py`)
- Image preprocessing → Model training: feeds batches (evidence: `main.py`)
- Balanced split → Model training: feeds training set (evidence: `main.py`)
- Balanced split → Model validation: feeds validation set (evidence: `main.py`)
- Training script → ResNet-152 model: creates (evidence: `main.py`)
- ResNet-152 model → Torch Hub weights: loads weights (evidence: `main.py`)
- Model training → ResNet-152 model: trains (evidence: `main.py`)
- Model validation → ResNet-152 model: evaluates (evidence: `main.py`)
- Training script → Best checkpoint: saves best (evidence: `main.py`)
