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 behavior
- Effective 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 images
- 10,000 test images
- 10 object categories
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 Function: CrossEntropyLoss
Training Behavior
- Rapid convergence in early epochs (0β10)
- Stable improvement until epoch ~30
- Plateau around 88β89% validation accuracy
- Early stopping triggered due to no improvement
Results
| Metric | Value |
|---|---|
| Training Accuracy | ~99.6% |
| Validation Accuracy | ~89.48% |
| Test Accuracy | ~88.63% |
Inference Pipeline
Image β Resize β Normalize β Model β Softmax β Class Prediction
Model Checkpoint
File: alexnet_cifar10.pth
Contains:
- model_state_dict
- optimizer_state_dict
- num_classes
Deployment
- Hugging Face Model Hub
- Gradio-based Space for inference
- Ready for real-time usage
Project Structure
AlexNet/
βββ data/
βββ notebooks/
βββ src/
βββ saved_trained_model/
βββ main.py
βββ README.md
βββ requirements.txt
βββ .gitignore
Author
Malik Muhammad Mudassir Iqbal
Mudassir-08
Deep Learning Researcher
License
Apache-2.0 License