# siddarthreddyk/fashion-mnist-classifier architecture

> Architecture diagram of the GitHub repository siddarthreddyk/fashion-mnist-classifier, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/siddarthreddyk/fashion-mnist-classifier
- Repository: https://github.com/siddarthreddyk/fashion-mnist-classifier

## Overview

This repository trains a Fashion-MNIST CNN and provides a Streamlit interface for image classification. Training loads and preprocesses the dataset, fits the CNN, saves weights, and produces evaluation plots; inference loads those weights, preprocesses an uploaded image, and displays its predicted class and confidence. The README documents these capabilities, and the sampled source confirms the main calls and data transfers shown; unsampled storage details are represented only where the documented paths support them.

Main entry points: [`src/train.py`](https://github.com/siddarthreddyk/fashion-mnist-classifier/blob/main/src/train.py) (Train and evaluate), [`src/predict.py`](https://github.com/siddarthreddyk/fashion-mnist-classifier/blob/main/src/predict.py) (Image prediction), [`app/streamlit_app.py`](https://github.com/siddarthreddyk/fashion-mnist-classifier/blob/main/app/streamlit_app.py) (Image upload app), [`src/data.py`](https://github.com/siddarthreddyk/fashion-mnist-classifier/blob/main/src/data.py) (Load and batch data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data pipeline"]
  node_data_pipeline["Load and batch data<br/>[data.py]"]
  node_dataset_storage[("Dataset storage")]
end

subgraph group_training["Training and evaluation"]
  node_trainer["Train and evaluate<br/>[train.py]"]
  node_cnn["CNN model<br/>[model.py]"]
  node_visualization["Evaluation plots<br/>[visualize.py]"]
end

subgraph group_inference["Inference app"]
  node_streamlit_app["Image upload app<br/>[streamlit_app.py]"]
  node_predictor["Image prediction<br/>[predict.py]"]
end

subgraph group_artifacts["Artifacts"]
  node_checkpoint[("Model checkpoint")]
  node_plot_outputs["Plot outputs"]
end

node_fashion_mnist["Fashion-MNIST"]
node_user(("User"))

node_trainer -->|"requests loaders"| node_data_pipeline
node_data_pipeline -->|"downloads dataset"| node_fashion_mnist
node_data_pipeline -->|"reads and writes"| node_dataset_storage
node_trainer -->|"instantiates"| node_cnn
node_trainer -->|"saves weights"| node_checkpoint
node_trainer -->|"calls plots"| node_visualization
node_visualization -->|"writes plots"| node_plot_outputs
node_user -->|"uploads image"| node_streamlit_app
node_streamlit_app -->|"requests prediction"| node_predictor
node_predictor -->|"loads weights"| node_checkpoint
node_predictor -->|"runs inference"| node_cnn
node_predictor -->|"returns class and confidence"| node_streamlit_app
node_streamlit_app -->|"displays result"| node_user

click node_data_pipeline "https://github.com/siddarthreddyk/fashion-mnist-classifier/blob/main/src/data.py"
click node_dataset_storage "https://github.com/siddarthreddyk/fashion-mnist-classifier/tree/main/data"
click node_trainer "https://github.com/siddarthreddyk/fashion-mnist-classifier/blob/main/src/train.py"
click node_cnn "https://github.com/siddarthreddyk/fashion-mnist-classifier/blob/main/src/model.py"
click node_visualization "https://github.com/siddarthreddyk/fashion-mnist-classifier/blob/main/src/visualize.py"
click node_checkpoint "https://github.com/siddarthreddyk/fashion-mnist-classifier/tree/main/models"
click node_plot_outputs "https://github.com/siddarthreddyk/fashion-mnist-classifier/tree/main/outputs"
click node_streamlit_app "https://github.com/siddarthreddyk/fashion-mnist-classifier/blob/main/app/streamlit_app.py"
click node_predictor "https://github.com/siddarthreddyk/fashion-mnist-classifier/blob/main/src/predict.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_data_pipeline,node_dataset_storage,node_user toneBlue
class node_trainer,node_cnn,node_visualization toneAmber
class node_streamlit_app,node_predictor toneMint
class node_checkpoint,node_plot_outputs toneRose
class node_fashion_mnist toneIndigo
```

## Components

### Data pipeline

- [Load and batch data](https://github.com/siddarthreddyk/fashion-mnist-classifier/blob/main/src/data.py): `src/data.py`
- [Dataset storage](https://github.com/siddarthreddyk/fashion-mnist-classifier/tree/main/data): `data`

### Training and evaluation

- [Train and evaluate](https://github.com/siddarthreddyk/fashion-mnist-classifier/blob/main/src/train.py): `src/train.py`
- [CNN model](https://github.com/siddarthreddyk/fashion-mnist-classifier/blob/main/src/model.py): `src/model.py`
- [Evaluation plots](https://github.com/siddarthreddyk/fashion-mnist-classifier/blob/main/src/visualize.py): `src/visualize.py`

### Inference app

- [Image upload app](https://github.com/siddarthreddyk/fashion-mnist-classifier/blob/main/app/streamlit_app.py): `app/streamlit_app.py`
- [Image prediction](https://github.com/siddarthreddyk/fashion-mnist-classifier/blob/main/src/predict.py): `src/predict.py`

### Artifacts

- [Model checkpoint](https://github.com/siddarthreddyk/fashion-mnist-classifier/tree/main/models): `models`
- [Plot outputs](https://github.com/siddarthreddyk/fashion-mnist-classifier/tree/main/outputs): `outputs`

### Other components

- **Fashion-MNIST**
- **User**

## Connections

- Train and evaluate → Load and batch data: requests loaders
- Load and batch data → Fashion-MNIST: downloads dataset
- Load and batch data → Dataset storage: reads and writes
- Train and evaluate → CNN model: instantiates
- Train and evaluate → Model checkpoint: saves weights
- Train and evaluate → Evaluation plots: calls plots
- Evaluation plots → Plot outputs: writes plots
- User → Image upload app: uploads image
- Image upload app → Image prediction: requests prediction
- Image prediction → Model checkpoint: loads weights
- Image prediction → CNN model: runs inference
- Image prediction → Image upload app: returns class and confidence
- Image upload app → User: displays result
