A production-ready deep learning pipeline that classifies 100 image categories with explainable AI visualizations — deployed live on Hugging Face Spaces → Try the Demo
This project showcases an end-to-end image classification system built with PyTorch and PyTorch Lightning, fine-tuned on the CIFAR-100 dataset using a ResNet-50 backbone.
| Capability | Description |
|---|---|
| Model Architecture | ResNet-50 pre-trained on ImageNet, fine-tuned for 100 CIFAR classes |
| Framework | PyTorch Lightning for modular, mixed-precision GPU training |
| Data Augmentation | Random Crop, Horizontal Flip, and custom Cutout for robust generalization |
| Optimization | AdamW + CosineAnnealingLR + Weight Decay for stable convergence |
| Explainability (XAI) | From-scratch Grad-CAM visualization of early + deep layers |
| Evaluation Metrics | Accuracy (Top-1/Top-5), Macro F1-Score, Macro AUC (OvR) |
| Interactive Demo | Gradio web UI for real-time predictions |
| MLOps Mindset | Clean folder structure, reproducible training script, GPU-ready deployment |
Evaluated on 10 000 test images after 15 epochs
| Metric | Score |
|---|---|
| Top-1 Accuracy | 60.38 % |
| Top-5 Accuracy | 87.27 % |
| Macro F1-Score | 0.6005 |
| Macro AUC (OvR) | 0.9820 |
Launch on Hugging Face Spaces
Upload an image or click on an example and see:
- The Top-5 predicted classes with probabilities
git clone https://github.com/ashbix23/Image-Classifier.git
cd Image-Classifier
pip install -r requirements.txtUse GPU if available. A pre-trained checkpoint (cifar100_resnet50_final.pth) is included.
python src/train.pypython app/app.pyThen open http://127.0.0.1:7860 in your browser.
.
├── app/ # Gradio web app
│ └── app.py
├── data/ # CIFAR-100 dataset (auto-download)
├── models/
│ └── cifar100_resnet50_final.pth
├── notebooks/
│ ├── 01_data_exploration.ipynb
│ ├── 02_model_training.ipynb
│ └── 03_model_evaluation.ipynb
├── src/
│ ├── dataset.py # Data loading + augmentations
│ ├── model.py # ResNet-50 architecture
│ ├── train.py # Training pipeline (Lightning)
│ └── xai.py # Grad-CAM explainability
├── requirements.txt
└── README.md