Mudassir-08/alexnet-cifar10-demo
AlexNet for CIFAR-10 Classification (PyTorch Research Implementation)
Overview
This project implements a modified AlexNet architecture for CIFAR-10 image classification using PyTorch.
The model classifies images into 10 categories: airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck
Implementation Includes:
- Modular PyTorch architecture
- Custom training pipeline
- Early stopping mechanism
- Evaluation metrics (accuracy, confusion matrix)
- Deployment-ready inference system
Key Highlights
- Peak Validation Accuracy: 89.48%
- Test Accuracy: 88.63%
- Early stopping: Epoch 46/90
- Strong convergence and stable training
- Good generalization with minimal overfitting
Model Architecture
Input: 3 × 64 × 64 image
Conv → BatchNorm → ReLU → MaxPool Conv → BatchNorm → ReLU → MaxPool Conv → BatchNorm → ReLU Conv → BatchNorm → ReLU Conv → BatchNorm → ReLU → MaxPool
AdaptiveAvgPool (4×4)
Flatten
FC → ReLU → Dropout FC → ReLU → Dropout FC → Output (10 classes)
Dataset
- CIFAR-10 dataset
- 60,000 images total
- 50,000 training
- 10,000 test
- 10 classes
Training Configuration
- Framework: PyTorch
- Optimizer: SGD (momentum=0.9)
- Learning Rate: 0.1
- Scheduler: ReduceLROnPlateau
- Batch Size: 256
- Epochs: 90 (early stopped at 46)
- Loss: CrossEntropyLoss
Training Behavior
- Fast convergence in early epochs
- Stable improvement until ~epoch 30
- Plateau around 88–89%
- Early stopping triggered
Results
Inference Pipeline
Image → Resize → Normalize → Model → Softmax → Prediction
Model Checkpoint
File: alexnet_cifar10.pth
Contains:
- modelstatedict
- optimizerstatedict
- num_classes
Deployment
- Hugging Face Spaces
- Gradio Interface
- Real-time inference ready
Project Structure
AlexNet/
├── data/
├── notebooks/
├── src/
├── savedtrainedmodel/
├── main.py
├── README.md
├── requirements.txt
└── .gitignore
Author
Malik Muhammad Mudassir Iqbal
Mudassir-08 Deep Learning Researcher
License
Apache-2.0 License
