# amiroseinranjbar/vehicle-classification-project architecture

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

- Interactive diagram: https://gitdiagram.com/amiroseinranjbar/vehicle-classification-project
- Repository: https://github.com/amiroseinranjbar/vehicle-classification-project

## Overview

This is a PyTorch vehicle-image classification research project: it prepares and audits datasets, builds image loaders and augmentation variants, trains CNN/ResNet models, then compares evaluation results and ensembles. The principal workflow runs from dataset inspection and preparation through train/validation loading, model training, saved weights, and evaluation. Source excerpts establish preprocessing, loading, augmentation, model, and training behavior; evaluation, error analysis, and ensemble work are documented in the README and represented by the available experiment/results files, whose contents were not sampled.

Main entry points: [`src/train.py`](https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/src/train.py) (Training loop), [`models`](https://github.com/amiroseinranjbar/vehicle-classification-project/tree/main/models) (Saved weights), [`results/test_results.ipynb`](https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/results/test_results.ipynb) (Model evaluation), [`src/data.py`](https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/src/data.py) (Data loaders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Dataset preparation"]
  node_audit["Dataset audit<br/>[preprocessing.py]"]
  node_prepared[("Merged dataset")]
end

subgraph group_learn["Training pipeline"]
  node_transforms["Augmentation sets<br/>[augmentations.py]"]
  node_loaders["Data loaders<br/>[data.py]"]
  node_architectures["CNN architectures<br/>[models.py]"]
  node_trainer["Training loop<br/>[train.py]"]
end

subgraph group_study["Model experiments"]
  node_weights["Saved weights"]
  node_experiments["Experiment studies<br/>[experiments.ipynb]"]
  node_ensemble["Ensemble experiments"]
end

subgraph group_analysis["Evaluation analysis"]
  node_evaluation["Model evaluation<br/>[test_results.ipynb]"]
  node_comparison["Result comparison"]
  node_error["Error analysis"]
end

node_raw(("Vehicle images"))

node_raw -->|"inspect"| node_audit
node_audit -->|"merge clean data"| node_prepared
node_prepared -->|"load images"| node_loaders
node_transforms -.->|"transform samples"| node_loaders
node_loaders -->|"supply batches"| node_trainer
node_architectures -->|"train model"| node_trainer
node_trainer -.->|"save checkpoints"| node_weights
node_trainer -->|"compare training variants"| node_experiments
node_weights -->|"evaluate models"| node_evaluation
node_evaluation -->|"compare metrics"| node_comparison
node_evaluation -->|"analyze errors"| node_error
node_weights -->|"combine predictions"| node_ensemble

click node_audit "https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/src/preprocessing.py"
click node_transforms "https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/src/augmentations.py"
click node_loaders "https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/src/data.py"
click node_architectures "https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/src/models.py"
click node_trainer "https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/src/train.py"
click node_weights "https://github.com/amiroseinranjbar/vehicle-classification-project/tree/main/models"
click node_experiments "https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/experiments/experiments.ipynb"
click node_evaluation "https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/results/test_results.ipynb"
click node_comparison "https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/results/Overall%20result.ipynb"
click node_error "https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/results/experiments_results.ipynb"
click node_ensemble "https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/models/dataset2/ensemble_weights.json"

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_audit,node_prepared toneBlue
class node_transforms,node_loaders,node_architectures,node_trainer toneAmber
class node_weights,node_experiments,node_ensemble toneMint
class node_evaluation,node_comparison,node_error toneRose
class node_raw toneIndigo
```

## Components

### Dataset preparation

- [Dataset audit](https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/src/preprocessing.py): `src/preprocessing.py`
- **Merged dataset**

### Training pipeline

- [Augmentation sets](https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/src/augmentations.py): `src/augmentations.py`
- [Data loaders](https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/src/data.py): `src/data.py`
- [CNN architectures](https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/src/models.py): `src/models.py`
- [Training loop](https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/src/train.py): `src/train.py`

### Model experiments

- [Saved weights](https://github.com/amiroseinranjbar/vehicle-classification-project/tree/main/models): `models`
- [Experiment studies](https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/experiments/experiments.ipynb): `experiments/experiments.ipynb`
- [Ensemble experiments](https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/models/dataset2/ensemble_weights.json): `models/dataset2/ensemble_weights.json`

### Evaluation analysis

- [Model evaluation](https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/results/test_results.ipynb): `results/test_results.ipynb`
- [Result comparison](https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/results/Overall%20result.ipynb): `results/Overall result.ipynb`
- [Error analysis](https://github.com/amiroseinranjbar/vehicle-classification-project/blob/main/results/experiments_results.ipynb): `results/experiments_results.ipynb`

### Other components

- **Vehicle images**

## Connections

- Vehicle images → Dataset audit: inspect (evidence: `README.md`)
- Dataset audit → Merged dataset: merge clean data (evidence: `src/preprocessing.py`)
- Merged dataset → Data loaders: load images (evidence: `README.md`)
- Augmentation sets → Data loaders: transform samples
- Data loaders → Training loop: supply batches (evidence: `src/train.py`)
- CNN architectures → Training loop: train model (evidence: `src/train.py`)
- Training loop → Saved weights: save checkpoints
- Training loop → Experiment studies: compare training variants (evidence: `README.md`)
- Saved weights → Model evaluation: evaluate models (evidence: `README.md`)
- Model evaluation → Result comparison: compare metrics (evidence: `README.md`)
- Model evaluation → Error analysis: analyze errors (evidence: `README.md`)
- Saved weights → Ensemble experiments: combine predictions (evidence: `README.md`)
