# yashjoshi89/8-sem-project architecture

> Architecture diagram of the GitHub repository yashjoshi89/8-sem-project, 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/yashjoshi89/8-sem-project
- Repository: https://github.com/yashjoshi89/8-sem-project

## Overview

This project loads and normalizes DICOM CT images, trains a CNN for PE classification, and evaluates predictions. Its interactive path lets a user upload a DICOM image, runs classification and a separate image-based location estimate, then displays both results. The graph also includes checkpoint persistence. The README describes prediction and training entry points not present in the supplied tree; those are not represented as separate modules. Connections reflect the shown source and README, not uninspected behavior.

Main entry points: [`model.py`](https://github.com/yashjoshi89/8-sem-project/blob/main/model.py) (PE CNN), [`main.py`](https://github.com/yashjoshi89/8-sem-project/blob/main/main.py) (Training Runner), [`evaluate.py`](https://github.com/yashjoshi89/8-sem-project/blob/main/evaluate.py) (Evaluator), [`gui.py`](https://github.com/yashjoshi89/8-sem-project/blob/main/gui.py) (Analysis GUI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["DICOM Data"]
  node_loader["DICOM Loader<br/>[data_loader.py]"]
end

subgraph group_ml["Model and Evaluation"]
  node_training["Training Runner<br/>[main.py]"]
  node_model["PE CNN<br/>[model.py]"]
  node_weights[("Model Checkpoint")]
  node_evaluation["Evaluator<br/>[evaluate.py]"]
end

subgraph group_app["Interactive Analysis"]
  node_gui["Analysis GUI<br/>[gui.py]"]
  node_location["Location Detector"]
end

node_user(("User"))

node_training -->|"loads training data"| node_loader
node_training -->|"trains and saves"| node_model
node_model -->|"writes checkpoint"| node_weights
node_model -->|"restores checkpoint"| node_weights
node_training -->|"runs evaluation"| node_evaluation
node_evaluation -->|"loads test data"| node_loader
node_evaluation -->|"loads and predicts"| node_model
node_user -->|"uploads DICOM"| node_gui
node_gui -->|"classifies image"| node_model
node_gui -->|"detects location"| node_location

click node_training "https://github.com/yashjoshi89/8-sem-project/blob/main/main.py"
click node_loader "https://github.com/yashjoshi89/8-sem-project/blob/main/data_loader.py"
click node_model "https://github.com/yashjoshi89/8-sem-project/blob/main/model.py"
click node_evaluation "https://github.com/yashjoshi89/8-sem-project/blob/main/evaluate.py"
click node_gui "https://github.com/yashjoshi89/8-sem-project/blob/main/gui.py"
click node_location "https://github.com/yashjoshi89/8-sem-project/blob/main/location_detector.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_loader,node_user toneBlue
class node_training,node_model,node_weights,node_evaluation toneAmber
class node_gui,node_location toneMint
```

## Components

### DICOM Data

- [DICOM Loader](https://github.com/yashjoshi89/8-sem-project/blob/main/data_loader.py): `data_loader.py`

### Model and Evaluation

- [Training Runner](https://github.com/yashjoshi89/8-sem-project/blob/main/main.py): `main.py`
- [PE CNN](https://github.com/yashjoshi89/8-sem-project/blob/main/model.py): `model.py`
- **Model Checkpoint**
- [Evaluator](https://github.com/yashjoshi89/8-sem-project/blob/main/evaluate.py): `evaluate.py`

### Interactive Analysis

- [Analysis GUI](https://github.com/yashjoshi89/8-sem-project/blob/main/gui.py): `gui.py`
- [Location Detector](https://github.com/yashjoshi89/8-sem-project/blob/main/location_detector.py): `location_detector.py`

### Other components

- **User**

## Connections

- Training Runner → DICOM Loader: loads training data (evidence: `main.py`)
- Training Runner → PE CNN: trains and saves (evidence: `main.py`)
- PE CNN → Model Checkpoint: writes checkpoint (evidence: `model.py`)
- PE CNN → Model Checkpoint: restores checkpoint (evidence: `model.py`)
- Training Runner → Evaluator: runs evaluation (evidence: `main.py`)
- Evaluator → DICOM Loader: loads test data (evidence: `evaluate.py`)
- Evaluator → PE CNN: loads and predicts (evidence: `evaluate.py`)
- User → Analysis GUI: uploads DICOM (evidence: `gui.py`)
- Analysis GUI → PE CNN: classifies image (evidence: `gui.py`)
- Analysis GUI → Location Detector: detects location (evidence: `gui.py`)
