# shayan-zavvarei/quickdraw_cnn architecture

> Architecture diagram of the GitHub repository shayan-zavvarei/quickdraw_cnn, 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/shayan-zavvarei/quickdraw_cnn
- Repository: https://github.com/shayan-zavvarei/quickdraw_cnn

## Overview

This repository is an educational assignment and reference implementation for training and evaluating a PyTorch CNN on QuickDraw drawings. The workflow loads labeled image folders, splits them into training and test sets, trains a 100-class model, evaluates and plots metrics, then saves weights for later evaluation. The README also requires a PDF report; the supplied tree contains report guidance, but no notebook or report-generation implementation. Source excerpts are partial, so the graph omits uncertain wiring.

Main entry points: [`QuickDraw_CNN_Code.py`](https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py) (DataLoaders), [`Report_Template.md`](https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/Report_Template.md) (PDF report)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_dataset["QuickDraw dataset"]
  node_transforms["Image transforms"]
  node_split["Train/test split"]
  node_loaders["DataLoaders"]
end

subgraph group_model["Model training"]
  node_cnn["CNN model"]
  node_training["Training loop"]
  node_train_eval["Epoch evaluation"]
end

subgraph group_outputs["Evaluation and deliverables"]
  node_history["Metric history"]
  node_plots["Metric plots"]
  node_detailed_eval["Detailed evaluation"]
  node_weights["Saved weights"]
  node_reload_eval["Reload evaluation"]
  node_report["PDF report<br/>[Report_Template.md]"]
end

node_student(("Student"))
node_images[("Class images")]

node_student -->|"runs workflow"| node_dataset
node_images -->|"loads images"| node_dataset
node_dataset -->|"applies"| node_transforms
node_dataset -->|"provides samples"| node_split
node_split -->|"creates loaders"| node_loaders
node_loaders -->|"batches data"| node_training
node_training -->|"updates weights"| node_cnn
node_training -->|"evaluates epochs"| node_train_eval
node_train_eval -->|"records metrics"| node_history
node_history -->|"plots metrics"| node_plots
node_loaders -->|"supplies test data"| node_detailed_eval
node_cnn -->|"predicts classes"| node_detailed_eval
node_training -->|"saves state"| node_weights
node_weights -->|"loads state"| node_reload_eval
node_loaders -->|"supplies test data"| node_reload_eval
node_cnn -->|"provides architecture"| node_reload_eval
node_plots -.->|"supports report"| node_report
node_detailed_eval -.->|"provides results"| node_report

click node_dataset "https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py"
click node_transforms "https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py"
click node_split "https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py"
click node_loaders "https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py"
click node_cnn "https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py"
click node_training "https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py"
click node_train_eval "https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py"
click node_history "https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py"
click node_plots "https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py"
click node_detailed_eval "https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py"
click node_weights "https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py"
click node_reload_eval "https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py"
click node_report "https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/Report_Template.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_dataset,node_transforms,node_split,node_loaders toneBlue
class node_cnn,node_training,node_train_eval,node_images toneAmber
class node_history,node_plots,node_detailed_eval,node_weights,node_reload_eval,node_report toneMint
class node_student toneIndigo
```

## Components

### Data preparation

- [QuickDraw dataset](https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py): `QuickDraw_CNN_Code.py`
- [Image transforms](https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py): `QuickDraw_CNN_Code.py`
- [Train/test split](https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py): `QuickDraw_CNN_Code.py`
- [DataLoaders](https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py): `QuickDraw_CNN_Code.py`

### Model training

- [CNN model](https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py): `QuickDraw_CNN_Code.py`
- [Training loop](https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py): `QuickDraw_CNN_Code.py`
- [Epoch evaluation](https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py): `QuickDraw_CNN_Code.py`

### Evaluation and deliverables

- [Metric history](https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py): `QuickDraw_CNN_Code.py`
- [Metric plots](https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py): `QuickDraw_CNN_Code.py`
- [Detailed evaluation](https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py): `QuickDraw_CNN_Code.py`
- [Saved weights](https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py): `QuickDraw_CNN_Code.py`
- [Reload evaluation](https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/QuickDraw_CNN_Code.py): `QuickDraw_CNN_Code.py`
- [PDF report](https://github.com/shayan-zavvarei/quickdraw_cnn/blob/main/Report_Template.md): `Report_Template.md`

### Other components

- **Student**
- **Class images**

## Connections

- Student → QuickDraw dataset: runs workflow
- Class images → QuickDraw dataset: loads images
- QuickDraw dataset → Image transforms: applies
- QuickDraw dataset → Train/test split: provides samples
- Train/test split → DataLoaders: creates loaders
- DataLoaders → Training loop: batches data
- Training loop → CNN model: updates weights
- Training loop → Epoch evaluation: evaluates epochs
- Epoch evaluation → Metric history: records metrics
- Metric history → Metric plots: plots metrics
- DataLoaders → Detailed evaluation: supplies test data
- CNN model → Detailed evaluation: predicts classes
- Training loop → Saved weights: saves state
- Saved weights → Reload evaluation: loads state
- DataLoaders → Reload evaluation: supplies test data
- CNN model → Reload evaluation: provides architecture
- Metric plots → PDF report: supports report
- Detailed evaluation → PDF report: provides results
