Nausad/Vision_Transformer_Based_Image_Classification_Model
0
๐ CIFAR-10 Vision Transformer Classifier
A web-based image classification application powered by a custom Vision Transformer (ViT) trained from scratch on the CIFAR-10 dataset. Upload any image and get real-time predictions across 10 categories.
๐ Demo
Upload any image via drag-and-drop or file browser. The model resizes it to 32ร32 pixels (the native CIFAR-10 resolution) and predicts one of 10 classes with confidence scores.
Supported Classes: airplane ยท automobile ยท bird ยท cat ยท deer ยท dog ยท frog ยท horse ยท ship ยท truck
๐ง Model Architecture
Training Details
๐ ๏ธ Tech Stack
- Backend: Flask (Python)
- ML Framework: PyTorch
- Frontend: HTML5 ยท Vanilla CSS ยท JavaScript
- Model: Custom Vision Transformer (no pretrained weights)
- Containerization: Docker
๐ Project Structure
โโโ flask_app.py # Flask server (routes: /, /predict, /model-info)
โโโ cifar10_model.pth # Trained model weights
โโโ requirements.txt # Python dependencies
โโโ Dockerfile # Container configuration
โโโ templates/
โโโ index.html # Full-featured web UIโ๏ธ Run Locally
# 1. Install dependencies
pip install -r requirements.txt
# 2. Start the Flask server
python flask_app.py
# 3. Open in browser
# โ http://127.0.0.1:5000๐ณ Run with Docker
# Build the image
docker build -t cifar10-vit .
# Run the container
docker run -p 7860:7860 cifar10-vit
# Open in browser
# โ http://localhost:7860๐ Features
- ๐ผ๏ธ Drag & Drop upload โ supports JPEG, PNG, WEBP, BMP
- ๐ฒ 32ร32 pixel simulator โ see exactly what the model processes
- ๐ Animated probability bars for all 10 classes
- โก Real-time inference with latency display (milliseconds)
- ๐จ Warm beige premium UI with glassmorphism cards
๐ค Author
Nausad Ali Built with โค๏ธ and a Cup of Coffee
๐ License
This project is licensed under the MIT License.
