NeuroScan is a full-stack medical imaging application that classifies brain MRI scans into four categories using a fine-tuned MobileNetV2 model. Upload an MRI, and the app instantly tells you the tumor type, shows a Grad-CAM heatmap highlighting the affected region, and validates the image is actually an MRI using OpenAI CLIP — all in under 2 seconds.
|
Identifies Glioma, Meningioma, Pituitary tumors, or a healthy scan with 96.8% accuracy. |
Generates visual saliency maps that highlight exactly which brain regions influenced the model's prediction. |
|
Uses OpenAI CLIP to reject non-MRI images before they reach the classifier — no garbage in, no garbage out. |
Returns a full probability breakdown across all four classes for every prediction. |
|
One-click testing using real MRI samples bundled with the application — no upload required. |
Sleek, responsive interface with smooth animations — designed for clarity and ease of use. |
| Base Model | MobileNetV2 — ImageNet pre-trained |
| Input | 224 × 224 RGB |
| Backbone | Depthwise separable convolutions |
| Head | GAP → Dropout(0.5) → Dense(4) → Softmax |
| Accuracy | 96.8% on held-out test set |
| Inference | < 2s on CPU |
| Endpoint | Method | Description |
|---|---|---|
/ |
GET |
API info & version |
/health |
GET |
Health check |
/stats |
GET |
Model & system stats |
/predict |
POST |
Classify an uploaded MRI |
/heatmap |
POST |
Generate Grad-CAM heatmap |
/random |
GET |
Test with a random sample MRI |
| Technologies | |
|---|---|
| Backend | Python · Flask · TensorFlow/Keras · OpenCV · CLIP |
| Frontend | HTML · CSS · Vanilla JavaScript |
| Hosting | Hugging Face Spaces (backend) · Vercel (frontend) |
The Brain Tumor Classification MRI dataset from Kaggle — 3,264 labeled MRI scans across four classes.
| Class | Count | Description |
|---|---|---|
| Glioma | ~826 | Primary tumors from glial cells |
| Meningioma | ~822 | Tumors from the meninges |
| Pituitary | ~827 | Tumors of the pituitary gland |
| No Tumor | ~395 | Healthy brain scans |
# 1. Clone
git clone https://github.com/yashnaiduu/NeuroScan-Brain-Tumor-Classification.git
cd NeuroScan-Brain-Tumor-Classification
# 2. Environment
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
# 3. Start backend
python server1.py # → http://localhost:5050
# 4. Start frontend (new terminal)
cd client && python3 -m http.server 8000 # → http://localhost:8000Tip: Set
PORT=7860when deploying to Hugging Face Spaces.
| Platform | Role | Key Files |
|---|---|---|
| Hugging Face Spaces | Backend API | Dockerfile, entrypoint.sh |
| Vercel | Frontend | vercel.json |
Detailed steps in DEPLOYMENT.md.
MIT — see LICENSE.
