Hasibur013/cifar10_image_classifier_gradio
0
๐ฏ 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
pandasandseaborn - 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:
python app.pyThe app allows you to upload an image and get predictions from the trained model.
๐ฅ Project Demo

๐ง Installation
- Clone the repository:
git clone https://github.com/Hasibur013/cifar10_image_classifier_gradio.git- Navigate to the project folder:
cd image-classifier- Create virtual Environment:
Python -m venv venv- Active virtual Environment:
venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt๐ Train the Model
Run the training script:
notebook model_build.ipynb๐ Run MLflow Tracking UI
mlflow uiThen 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:
python app.pyUpload 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
