# neatherblok/snowdetection architecture

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

- Interactive diagram: https://gitdiagram.com/neatherblok/snowdetection
- Repository: https://github.com/neatherblok/snowdetection

## Overview

This research prototype prepares sidewalk-image datasets, trains snow/clear classifiers, evaluates individual and ensemble models, and targets mobile inference. The sampled T2T-ViT script also implements model layers, staged training, validation, and testing; its preparation and quantization links are visible in source. README documents synthetic augmentation, spatial attention, VGG-19/ResNet-50 ensembling, evaluation, and mobile use, but several corresponding notebooks were not sampled, so their internal wiring is not inferred.

Main entry points: [`IPYNB/ModelCreation/TrainingT2T_Vit.py`](https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelCreation/TrainingT2T_Vit.py) (T2T-ViT classifier), [`IPYNB/ModelCreation/TrainingVGG_RESNET_(ensemble).ipynb`](https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelCreation/TrainingVGG_RESNET_(ensemble).ipynb) (CNN ensemble), [`IPYNB/ModelQuantization/t2t-vit_quantization.py`](https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelQuantization/t2t-vit_quantization.py) (Mobile optimization), [`IPYNB/DataPreparation/Preparation.py`](https://github.com/neatherblok/snowdetection/blob/main/IPYNB/DataPreparation/Preparation.py) (Image preparation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_preparation["Image preparation<br/>[Preparation.py]"]
  node_synthetic["Synthetic augmentation"]
  node_dataset[("Prepared datasets")]
end

subgraph group_models["Model development"]
  node_t2t["T2T-ViT classifier<br/>[TrainingT2T_Vit.py]"]
  node_attention["Spatial attention CNN"]
  node_vgg["VGG-19 model"]
  node_resnet["ResNet-50 model"]
  node_ensemble["CNN ensemble"]
  node_training["Staged training<br/>[TrainingT2T_Vit.py]"]
  node_checkpoints[("Model checkpoints")]
end

subgraph group_assessment["Evaluation"]
  node_cnn_eval["CNN evaluation"]
  node_ensemble_eval["Ensemble evaluation"]
  node_metrics["Classification metrics"]
end

subgraph group_deployment["Mobile deployment"]
  node_quantization["Mobile optimization"]
  node_mobile_model["Mobile model artifact"]
end

node_images(("Sidewalk images"))
node_pedestrian(("Pedestrian user"))

node_images -->|"provides images"| node_preparation
node_preparation -->|"loads and transforms"| node_dataset
node_synthetic -.->|"augments data"| node_dataset
node_dataset -->|"trains with"| node_training
node_training -->|"optimizes"| node_t2t
node_training -->|"saves weights"| node_checkpoints
node_dataset -.->|"trains with"| node_attention
node_dataset -.->|"trains with"| node_vgg
node_dataset -.->|"trains with"| node_resnet
node_vgg -.->|"contributes predictions"| node_ensemble
node_resnet -.->|"contributes predictions"| node_ensemble
node_t2t -.->|"evaluated by"| node_cnn_eval
node_ensemble -.->|"evaluated by"| node_ensemble_eval
node_cnn_eval -.->|"reports metrics"| node_metrics
node_ensemble_eval -.->|"reports metrics"| node_metrics
node_t2t -->|"imports model"| node_quantization
node_checkpoints -->|"loads weights"| node_quantization
node_quantization -->|"exports optimized model"| node_mobile_model
node_mobile_model -.->|"supports alerts"| node_pedestrian

click node_preparation "https://github.com/neatherblok/snowdetection/blob/main/IPYNB/DataPreparation/Preparation.py"
click node_synthetic "https://github.com/neatherblok/snowdetection/tree/main/IPYNB"
click node_t2t "https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelCreation/TrainingT2T_Vit.py"
click node_attention "https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelCreation/TrainingCNN_(using_spatial_attention).ipynb"
click node_vgg "https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelCreation/TrainingVGG_RESNET_(ensemble).ipynb"
click node_resnet "https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelCreation/TrainingVGG_RESNET_(ensemble).ipynb"
click node_ensemble "https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelCreation/TrainingVGG_RESNET_(ensemble).ipynb"
click node_training "https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelCreation/TrainingT2T_Vit.py"
click node_checkpoints "https://github.com/neatherblok/snowdetection/tree/main/models"
click node_cnn_eval "https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelEvaluation/CNN_Evaluation.ipynb"
click node_ensemble_eval "https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelEvaluation/Ensemble_Evaluation.ipynb"
click node_metrics "https://github.com/neatherblok/snowdetection/tree/main/IPYNB/ModelEvaluation"
click node_quantization "https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelQuantization/t2t-vit_quantization.py"
click node_mobile_model "https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelQuantization/t2t-vit_quantization.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_preparation,node_synthetic,node_dataset,node_pedestrian toneBlue
class node_t2t,node_attention,node_vgg,node_resnet,node_ensemble,node_training,node_checkpoints toneAmber
class node_cnn_eval,node_ensemble_eval,node_metrics toneMint
class node_quantization,node_mobile_model toneRose
class node_images toneIndigo
```

## Components

### Data preparation

- [Image preparation](https://github.com/neatherblok/snowdetection/blob/main/IPYNB/DataPreparation/Preparation.py): `IPYNB/DataPreparation/Preparation.py`
- [Synthetic augmentation](https://github.com/neatherblok/snowdetection/tree/main/IPYNB): `IPYNB`
- **Prepared datasets**

### Model development

- [T2T-ViT classifier](https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelCreation/TrainingT2T_Vit.py): `IPYNB/ModelCreation/TrainingT2T_Vit.py`
- [Spatial attention CNN](https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelCreation/TrainingCNN_(using_spatial_attention).ipynb): `IPYNB/ModelCreation/TrainingCNN_(using_spatial_attention).ipynb`
- [VGG-19 model](https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelCreation/TrainingVGG_RESNET_(ensemble).ipynb): `IPYNB/ModelCreation/TrainingVGG_RESNET_(ensemble).ipynb`
- [ResNet-50 model](https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelCreation/TrainingVGG_RESNET_(ensemble).ipynb): `IPYNB/ModelCreation/TrainingVGG_RESNET_(ensemble).ipynb`
- [CNN ensemble](https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelCreation/TrainingVGG_RESNET_(ensemble).ipynb): `IPYNB/ModelCreation/TrainingVGG_RESNET_(ensemble).ipynb`
- [Staged training](https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelCreation/TrainingT2T_Vit.py): `IPYNB/ModelCreation/TrainingT2T_Vit.py`
- [Model checkpoints](https://github.com/neatherblok/snowdetection/tree/main/models): `models`

### Evaluation

- [CNN evaluation](https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelEvaluation/CNN_Evaluation.ipynb): `IPYNB/ModelEvaluation/CNN_Evaluation.ipynb`
- [Ensemble evaluation](https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelEvaluation/Ensemble_Evaluation.ipynb): `IPYNB/ModelEvaluation/Ensemble_Evaluation.ipynb`
- [Classification metrics](https://github.com/neatherblok/snowdetection/tree/main/IPYNB/ModelEvaluation): `IPYNB/ModelEvaluation`

### Mobile deployment

- [Mobile optimization](https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelQuantization/t2t-vit_quantization.py): `IPYNB/ModelQuantization/t2t-vit_quantization.py`
- [Mobile model artifact](https://github.com/neatherblok/snowdetection/blob/main/IPYNB/ModelQuantization/t2t-vit_quantization.py): `IPYNB/ModelQuantization/t2t-vit_quantization.py`

### Other components

- **Sidewalk images**
- **Pedestrian user**

## Connections

- Sidewalk images → Image preparation: provides images (evidence: `IPYNB/DataPreparation/Preparation.py`)
- Image preparation → Prepared datasets: loads and transforms (evidence: `IPYNB/DataPreparation/Preparation.py`)
- Synthetic augmentation → Prepared datasets: augments data (evidence: `README.md`)
- Prepared datasets → Staged training: trains with (evidence: `IPYNB/ModelCreation/TrainingT2T_Vit.py`)
- Staged training → T2T-ViT classifier: optimizes (evidence: `IPYNB/ModelCreation/TrainingT2T_Vit.py`)
- Staged training → Model checkpoints: saves weights (evidence: `IPYNB/ModelCreation/TrainingT2T_Vit.py`)
- Prepared datasets → Spatial attention CNN: trains with (evidence: `README.md`)
- Prepared datasets → VGG-19 model: trains with (evidence: `README.md`)
- Prepared datasets → ResNet-50 model: trains with (evidence: `README.md`)
- VGG-19 model → CNN ensemble: contributes predictions (evidence: `README.md`)
- ResNet-50 model → CNN ensemble: contributes predictions (evidence: `README.md`)
- T2T-ViT classifier → CNN evaluation: evaluated by (evidence: `README.md`)
- CNN ensemble → Ensemble evaluation: evaluated by (evidence: `README.md`)
- CNN evaluation → Classification metrics: reports metrics (evidence: `README.md`)
- Ensemble evaluation → Classification metrics: reports metrics (evidence: `README.md`)
- T2T-ViT classifier → Mobile optimization: imports model (evidence: `IPYNB/ModelQuantization/t2t-vit_quantization.py`)
- Model checkpoints → Mobile optimization: loads weights (evidence: `IPYNB/ModelQuantization/t2t-vit_quantization.py`)
- Mobile optimization → Mobile model artifact: exports optimized model (evidence: `IPYNB/ModelQuantization/t2t-vit_quantization.py`)
- Mobile model artifact → Pedestrian user: supports alerts (evidence: `README.md`)
