Skip to content

Modular implementation of a Convolutional Neural Network (CNN) architecture built natively with PyTorch, trained and validated on the CIFAR-10 dataset. Demonstrates core deep learning fundamentals, data augmentation techniques, model training workflow, and performance analysis.

Notifications You must be signed in to change notification settings

ashbix23/Advanced-Image-Classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advanced Image Classifier (CIFAR-100 + ResNet50)

Python PyTorch Gradio License: MIT Stars

A production-ready deep learning pipeline that classifies 100 image categories with explainable AI visualizations — deployed live on Hugging Face Spaces → Try the Demo


Overview

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.


Key Highlights

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

Model Performance

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

Try the Demo

Launch on Hugging Face Spaces
Upload an image or click on an example and see:

  • The Top-5 predicted classes with probabilities

How to Run Locally

Installation

git clone https://github.com/ashbix23/Image-Classifier.git
cd Image-Classifier
pip install -r requirements.txt

Train the Model

Use GPU if available. A pre-trained checkpoint (cifar100_resnet50_final.pth) is included.

python src/train.py

Launch the Web App

python app/app.py

Then open http://127.0.0.1:7860 in your browser.


Project Structure

.
├── 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

About

Modular implementation of a Convolutional Neural Network (CNN) architecture built natively with PyTorch, trained and validated on the CIFAR-10 dataset. Demonstrates core deep learning fundamentals, data augmentation techniques, model training workflow, and performance analysis.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published