# antonistsiorvas/cifar10-classifiers architecture

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

- Interactive diagram: https://gitdiagram.com/antonistsiorvas/cifar10-classifiers
- Repository: https://github.com/antonistsiorvas/cifar10-classifiers

## Overview

This repository is CIFAR-10 coursework: it loads and prepares image data, compares classical 1-NN/3-NN and nearest-centroid baselines, and trains and evaluates configurable MLP/CNN models across experiments E1–E8. The neural workflow is experiment runner → training run → model and data preparation → saved metrics and predictions. The interim script separately evaluates raw and PCA-reduced data and can produce example predictions and per-class accuracy. Edges are limited to calls and data handling visible in excerpts or explicit README statements; assignment-2 and assignment-3 are marked TBA.

Main entry points: [`assignment-1/train.py`](https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/assignment-1/train.py) (Training and evaluation), [`interim/knn_ncc.py`](https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/interim/knn_ncc.py) (NN and NCC), [`common/cifar10.py`](https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/common/cifar10.py) (CIFAR loader), [`assignment-1/data.py`](https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/assignment-1/data.py) (Tensor preparation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Dataset handling"]
  node_dataset["CIFAR loader<br/>[cifar10.py]"]
  node_prep["Tensor preparation<br/>[data.py]"]
end

subgraph group_classic["Classical baselines"]
  node_classic_eval["NN and NCC<br/>[knn_ncc.py]"]
  node_pca_eval["PCA analysis<br/>[knn_ncc.py]"]
  node_classic_outputs["Baseline reports<br/>[knn_ncc.py]"]
end

subgraph group_neural["Neural experiments"]
  node_experiment_runner["Experiment runner<br/>[experiments.py]"]
  node_trainer["Training and evaluation<br/>[train.py]"]
  node_mlp["MLP architecture<br/>[models.py]"]
  node_cnn["CNN architecture<br/>[models.py]"]
  node_augmentation["Image augmentation<br/>[data.py]"]
  node_run_results["Run results"]
end

node_engineer(("User"))
node_cifar_archive["CIFAR-10 archive"]

node_engineer -->|"runs baseline"| node_classic_eval
node_engineer -->|"runs experiments"| node_experiment_runner
node_cifar_archive -->|"downloads and extracts"| node_dataset
node_prep -->|"loads CIFAR-10"| node_dataset
node_classic_eval -->|"loads CIFAR-10"| node_dataset
node_classic_eval -->|"optionally reduces"| node_pca_eval
node_classic_eval -->|"writes reports"| node_classic_outputs
node_experiment_runner -->|"runs configurations"| node_trainer
node_trainer -->|"loads tensors"| node_prep
node_trainer -->|"constructs MLP"| node_mlp
node_trainer -->|"constructs CNN"| node_cnn
node_trainer -->|"augments batches"| node_augmentation
node_trainer -->|"saves metrics and predictions"| node_run_results

click node_dataset "https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/common/cifar10.py"
click node_prep "https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/assignment-1/data.py"
click node_classic_eval "https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/interim/knn_ncc.py"
click node_pca_eval "https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/interim/knn_ncc.py"
click node_classic_outputs "https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/interim/knn_ncc.py"
click node_experiment_runner "https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/assignment-1/experiments.py"
click node_trainer "https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/assignment-1/train.py"
click node_mlp "https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/assignment-1/models.py"
click node_cnn "https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/assignment-1/models.py"
click node_augmentation "https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/assignment-1/data.py"
click node_run_results "https://github.com/antonistsiorvas/cifar10-classifiers/tree/main/assignment-1/results"

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_dataset,node_prep,node_engineer toneBlue
class node_classic_eval,node_pca_eval,node_classic_outputs toneAmber
class node_experiment_runner,node_trainer,node_mlp,node_cnn,node_augmentation,node_run_results toneMint
class node_cifar_archive toneIndigo
```

## Components

### Dataset handling

- [CIFAR loader](https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/common/cifar10.py): `common/cifar10.py`
- [Tensor preparation](https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/assignment-1/data.py): `assignment-1/data.py`

### Classical baselines

- [NN and NCC](https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/interim/knn_ncc.py): `interim/knn_ncc.py`
- [PCA analysis](https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/interim/knn_ncc.py): `interim/knn_ncc.py`
- [Baseline reports](https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/interim/knn_ncc.py): `interim/knn_ncc.py`

### Neural experiments

- [Experiment runner](https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/assignment-1/experiments.py): `assignment-1/experiments.py`
- [Training and evaluation](https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/assignment-1/train.py): `assignment-1/train.py`
- [MLP architecture](https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/assignment-1/models.py): `assignment-1/models.py`
- [CNN architecture](https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/assignment-1/models.py): `assignment-1/models.py`
- [Image augmentation](https://github.com/antonistsiorvas/cifar10-classifiers/blob/main/assignment-1/data.py): `assignment-1/data.py`
- [Run results](https://github.com/antonistsiorvas/cifar10-classifiers/tree/main/assignment-1/results): `assignment-1/results`

### Other components

- **User**
- **CIFAR-10 archive**

## Connections

- User → NN and NCC: runs baseline (evidence: `README.md`)
- User → Experiment runner: runs experiments (evidence: `README.md`)
- CIFAR-10 archive → CIFAR loader: downloads and extracts (evidence: `common/cifar10.py`)
- Tensor preparation → CIFAR loader: loads CIFAR-10 (evidence: `assignment-1/data.py`)
- NN and NCC → CIFAR loader: loads CIFAR-10 (evidence: `interim/knn_ncc.py`)
- NN and NCC → PCA analysis: optionally reduces (evidence: `interim/knn_ncc.py`)
- NN and NCC → Baseline reports: writes reports (evidence: `interim/knn_ncc.py`)
- Experiment runner → Training and evaluation: runs configurations (evidence: `assignment-1/experiments.py`)
- Training and evaluation → Tensor preparation: loads tensors (evidence: `assignment-1/train.py`)
- Training and evaluation → MLP architecture: constructs MLP (evidence: `assignment-1/train.py`)
- Training and evaluation → CNN architecture: constructs CNN (evidence: `assignment-1/train.py`)
- Training and evaluation → Image augmentation: augments batches (evidence: `assignment-1/train.py`)
- Training and evaluation → Run results: saves metrics and predictions (evidence: `assignment-1/train.py`)
