Skip to content

lokeshpuma/cifar-object-recognition

Repository files navigation

🎯 CIFAR-10 ResNet50 Object Recognition System

An interactive deep learning application that serves a high-performance Transfer Learning model built with ResNet50 to classify CIFAR-10 images. The application is served via a premium, responsive Streamlit dashboard featuring rich glassmorphism layouts, live model confidence visualizations, and deep architecture breakdowns.


🚀 Key Project Highlights

  • Staggering Accuracy: Achieved 94.02% accuracy on the CIFAR-10 test partition using a pre-trained ResNet50 backbone.
  • Deep Transfer Learning: Uses custom input upscaling to feed $32 \times 32 \times 3$ CIFAR-10 inputs through three UpSampling2D layers directly into a pre-trained ResNet50 backbone (retaining rich feature descriptors).
  • Sub-Resolution Inspector: Interactive UI allows users to see both their high-resolution uploaded image and the downscaled $32 \times 32$ matrix parsed by the neural network.
  • Dynamic Emojis & History Log: Responsive charts dynamically display probability scores across all 10 standard CIFAR-10 classes, coupled with a rolling history tracking up to 5 past runs.

🛠️ Deep Learning Model Architecture

Feeding tiny $32 \times 32$ images directly into deep CNNs like ResNet50 is problematic because spatial features disappear in initial convolution/pooling passes. This pipeline uses Input Resolution Scaling to bridge the gap:

graph TD
    A[Input Image: 32x32x3] --> B[UpSampling2D x2]
    B --> C[Intermediate: 64x64x3]
    C --> D[UpSampling2D x2]
    D --> E[Intermediate: 128x128x3]
    E --> F[UpSampling2D x2]
    F --> G[Scaled Input: 256x256x3]
    G --> H[ResNet50 Convolutional Base]
    H --> I[Flatten Layer]
    I --> J[Batch Normalization]
    J --> K[Dense Layer: 128 ReLU]
    K --> L[Dropout: 0.5]
    L --> M[Batch Normalization]
    M --> N[Dense Layer: 64 ReLU]
    N --> O[Dropout: 0.5]
    O --> P[Batch Normalization]
    P --> Q[Output: 10 Class Softmax]
Loading

Model Information

  • Optimizer: RMSprop (Learning Rate = $2 \times 10^{-5}$)
  • Loss: Sparse Categorical Crossentropy
  • Output Classes:
    1. ✈️ Airplane
    2. 🚗 Automobile
    3. 🐦 Bird
    4. 🐱 Cat
    5. 🦌 Deer
    6. 🐶 Dog
    7. 🐸 Frog
    8. 🐴 Horse
    9. 🚢 Ship
    10. 🚚 Truck

💻 Setup & Run Instructions

To deploy and test this project locally, ensure you are using the correct Anaconda virtual environment (tf):

1. Activate Environment

Open your terminal and activate the pre-configured tf environment:

conda activate tf

2. Install Dependencies

Verify the libraries by installing from the package manifest:

pip install -r requirements.txt

3. Launch Streamlit Application

Start the server from the root directory of the repository:

streamlit run app.py

Streamlit will automatically launch in your default web browser (typically served at http://localhost:8501).


🎨 Premium Dashboard Visual Features

  • Sidebar Specs: Comprehensive summary of the model layers and execution metrics available directly inside the drawer.
  • Glassmorphism Design: Beautiful dark-mode UI with linear glowing headers and translucent cards.
  • Real-Time Probabilities: Interactive progress indicators that reflect confidence parameters immediately post-inference.
  • Prediction Logs: Session-persistent log keeping track of previous classifications, making side-by-side performance checks super easy.

About

A high-performance image classification system utilizing ResNet50 Transfer Learning and Streamlit. Features 94.02% test accuracy on the CIFAR-10 dataset with an elegant glassmorphic interactive dashboard.

Topics

Resources

Stars

Watchers

Forks

Contributors