ModernVGG-BN CIFAR-10 Image Classification (PyTorch)

Status Model Framework Dataset Evaluation


Project Overview

This project implements a VGG-style Convolutional Neural Network for image classification on CIFAR-10 using PyTorch.

The model is trained from scratch with modern deep learning techniques including:

  • Mixed Precision Training (AMP)
  • AdamW optimizer
  • Cosine Annealing Learning Rate Scheduler
  • Gradient Clipping
  • Early Stopping
  • Batch Normalization throughout the network

Dataset

  • CIFAR-10 dataset
  • 10 classes: airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck
  • 32Γ—32 RGB images

Model Architecture

Feature Extractor (VGG-style CNN)

64 β†’ 128 β†’ 256 β†’ 512 β†’ 512

Each block: Conv2D β†’ BatchNorm β†’ ReLU β†’ Conv2D β†’ BatchNorm β†’ ReLU β†’ MaxPool


Classifier Head

  • AdaptiveAvgPool2D (1Γ—1)
  • Flatten
  • Linear (512 β†’ 256)
  • BatchNorm1D
  • ReLU
  • Dropout (0.2)
  • Linear (256 β†’ 10)

Training Pipeline

Each epoch includes:

  1. Forward pass
  2. Loss computation
  3. Backpropagation
  4. Gradient clipping
  5. Optimizer step (AdamW)
  6. Scheduler step (CosineAnnealingLR)
  7. Validation
  8. Metric logging
  9. Best model checkpoint saving
  10. Early stopping monitoring

Regularization Techniques

  • Batch Normalization
  • Dropout (0.2)
  • Gradient Clipping
  • Early Stopping

Results

  • CIFAR-10.1 Accuracy: 78.95%
  • Strong generalization on unseen dataset (CIFAR-10.1)
  • Most confusion between:
    • automobile ↔ truck
    • cat ↔ dog

Inference Pipeline

Image β†’ Resize β†’ Normalize β†’ Model β†’ Softmax β†’ Prediction

Outputs:

  • Predicted class
  • Confidence score
  • Top-5 probabilities

Model Saving Format

torch.save({
    "epoch": epoch,
    "model_state_dict": model.state_dict(),
    "optimizer_state_dict": optimizer.state_dict(),
    "scheduler_state_dict": scheduler.state_dict(),
    "scaler_state_dict": scaler.state_dict(),
    "best_acc": best_acc
}, "best_model.pth")
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

Evaluation results