Transformer Portfolio Project
Image Classification with a Vision Transformer
A DeiT-tiny Vision Transformer fine-tuned on CIFAR-10 and deployed as a validated ONNX model. All inference runs locally in your browser.
Live inference
Classify an image in your browser
The model supports ten CIFAR-10 classes: airplane, automobile, bird, cat, deer, dog, frog, horse, ship, and truck.
Select an image
This model was trained on the ten CIFAR-10 categories. Images outside those categories can still receive a prediction, but that result may not be reliable.
Run trained-model inference
The validated ONNX model is approximately 23 MB and loads only when required.
Verified evaluation
Real test results—not placeholder values
Both models were evaluated on the same untouched 10,000-image CIFAR-10 test set.
ViT versus ResNet-18
Accuracy, efficiency and latency comparison
| Model | Accuracy | Macro F1 | Parameters | Model size | GPU latency |
|---|---|---|---|---|---|
| Loading real results… | |||||
Interpretability
Vision Transformer attention rollout
Attention rollout summarizes how attention is propagated through the model's transformer layers.
Project methodology
End-to-end transformer engineering
Dataset
CIFAR-10 with a deterministic, stratified 45,000/5,000 training-validation split and the untouched 10,000-image official test set.
Vision Transformer
ImageNet-pretrained DeiT-tiny fine-tuned for ten classes using mixed precision, AdamW, warm-up and cosine learning-rate scheduling.
CNN baseline
A pretrained ResNet-18 was trained on the same split and evaluated with identical metrics for a controlled architecture comparison.
Deployment
The best ViT checkpoint was exported to ONNX, validated across dynamic batch sizes, compared with PyTorch, and prepared for local browser inference.
Project limitations
These limitations are displayed intentionally so the model is not presented as a general real-world image classifier.