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

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Dataset used to train Mudassir-08/alexnet-cifar10