CoolFace
Apppublic

Hasibur013/cifar10_image_classifier_gradio

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
App README

๐ŸŽฏ CIFAR-10 Image Classification with Gradio, PyTorch & MLflow

๐Ÿ“Œ Project Overview

This project builds and deploys an image classification model using the CIFAR-10 dataset. The model is trained using PyTorch Lightning, tracked with MLflow, and deployed as a web app using Gradio.

๐Ÿš€ Features

  • โ€”Exploratory Data Analysis (EDA) with pandas and seaborn
  • โ€”Custom Data Pipeline using torchvision.transforms
  • โ€”Model Training using PyTorch Lightning
  • โ€”Experiment Tracking with MLflow
  • โ€”Deployment using Gradio
  • โ€”Pretrained Model (ResNet-18) for High Accuracy(85) using simple it was 79
  • โ€”Supports Image Upload in PNG, JPG Formats

๐Ÿ› ๏ธ Tools & Technologies Used

  • โ€”Python ๐Ÿ
  • โ€”PyTorch & PyTorch Lightning ๐Ÿ”ฅ
  • โ€”MLflow ๐Ÿท๏ธ
  • โ€”Gradio ๐ŸŒ
  • โ€”NumPy & Pandas ๐Ÿ“Š
  • โ€”Seaborn & Matplotlib ๐Ÿ“‰

๐Ÿ“‚ Project Structure

๐Ÿ“ image_classifier
โ”‚-- ๐Ÿ“‚ data
โ”‚-- ๐Ÿ“‚ models
โ”‚-- ๐Ÿ“‚ lightning_logs
โ”‚-- ๐Ÿ“‚ mlruns
โ”‚-- app.py   # Gradio Web App
โ”‚-- model_build.ipynb  # Model Training Script
โ”‚-- requirements.txt
โ”‚-- README.md

๐Ÿ“ธ Model Deployment (Gradio Web App)

Run the following command to launch the web app:

bash
python app.py

The app allows you to upload an image and get predictions from the trained model.

๐ŸŽฅ Project Demo

![Project Demo](https://youtu.be/QcIOw_jK3ag)

๐Ÿ”ง Installation

  1. 1.Clone the repository:
bash
   git clone https://github.com/Hasibur013/cifar10_image_classifier_gradio.git
  1. 1.Navigate to the project folder:
bash
   cd image-classifier
  1. 1.Create virtual Environment:
bash
   Python -m venv venv
  1. 1.Active virtual Environment:
bash
   venv\Scripts\activate
  1. 1.Install dependencies:
bash
   pip install -r requirements.txt

๐Ÿš€ Train the Model

Run the training script:

bash
notebook model_build.ipynb

๐Ÿ“Œ Run MLflow Tracking UI

bash
mlflow ui

Then open http://localhost:5000 in your browser to visualize training metrics.

๐ŸŒŸ Future Enhancements

  • โ€”[ ] Support additional image datasets
  • โ€”[ ] Improve model accuracy with hyperparameter tuning
  • โ€”[ ] Deploy as a cloud-based service

๐Ÿš€ Run Web App

Run the app script:

bash
python app.py

Upload an image (PNG, JPG, etc.) to classify it into one of the CIFAR-10 categories. Image will be airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck.


Made with โค๏ธ by Md. Hasibur Rahman