A deep learning–based MRI brain tumor classification system built using EfficientNet-B0 and deployed through a Flask web application. The system enables real-time tumor prediction from MRI images and provides an analytical dashboard for evaluating model performance.
This project was developed as part of the MCA Capstone (CMR University, 2023–2025).
- Project Overview
- Features
- Tech Stack
- Dataset
- Project Structure
- Installation
- Usage
- API Documentation
- Model Performance
- Training Workflow
- Future Enhancements
- Acknowledgements
- License
This project implements an automated MRI tumor detection system using a deep learning classifier trained on brain MRI images. The trained model (modelfinal.h5) categorizes MRIs into:
- glioma
- meningioma
- notumor
- pituitary
A Flask web application allows users to upload MRI images for prediction and provides an interactive dashboard showing ROC curves, confusion matrices, classification reports, and dataset analytics.
- EfficientNet-B0–based deep learning classifier
- Real-time MRI tumor prediction via Flask app
- Dashboard visualizations:
- Dataset distribution
- ROC curve
- Confusion matrix
- Classification report
- Training accuracy/loss curves
- Pre-trained model included (
modelfinal.h5) - JSON data exports for evaluation metrics
- Python
- Flask
- TensorFlow / Keras
- HTML5
- CSS3
- Bootstrap
- JavaScript
- Matplotlib
- Seaborn
- Public brain MRI datasets (Kaggle / BRATS-style)
- Classes: glioma, meningioma, notumor, pituitary
- Images resized to 224×224
- Preprocessing:
- Normalization
- Augmentation (rotation, zoom, flip)
- Split:
- 70% training
- 20% validation
- 10% testing
CAPSTONE_PROJECT/
├── MRI Images/
│ ├── Training/
│ └── Testing/
├── static/
│ ├── charts/
│ ├── data/
│ ├── uploads/
│ └── style.css
├── templates/
│ ├── index.html
│ └── dashboard.html
├── uploads/
├── Brain-Tumor_Detection.ipynb
├── classification_report.json
├── history.json
├── main.py
├── modelfinal.h5
├── test_labels.npy
├── test_predictions.npy
└── README.md
git clone https://github.com/s3ldc/BrainTumorDetection
cd CAPSTONE_PROJECTpython -m venv venvActivate:
# Windows
venv\Scripts\activate
# macOS / Linux
source venv/bin/activateCreate a requirements.txt:
flask
tensorflow
numpy
opencv-python
pillow
matplotlib
scikit-learn
pandas
seaborn
gunicorn
Install the dependencies:
pip install -r requirements.txtpython main.pyhttp://127.0.0.1:5000/
- Homepage — Upload MRI & get prediction
- Dashboard — Evaluation metrics, dataset analysis, charts
Uploads an MRI image and returns a tumor prediction.
Form Data:
file: MRI image (jpg/png)
Sample Response:
{
"prediction": "glioma",
"confidence": 0.9873
}- AUC: 0.99–1.00
- Precision: 0.93–0.99
- Recall: 0.93–1.00
- F1 Score: 0.94–0.99
Visual outputs:
classification_report.jsonhistory.json- dashboard charts
The Jupyter notebook includes:
- Dataset loading
- Preprocessing & augmentation
- EfficientNet-B0 model creation
- Training with callbacks
- Evaluation (ROC, confusion matrix, reports)
- Saving the model and metrics
- Grad-CAM visual explanations
- Hospital PACS (DICOM) Integration
- Cloud Deployment (AWS, Render, GCP)
- Lightweight mobile version
- Tumor segmentation model
- Guide: Prof. Aurangazeb Khan
- Institution: CMR University
- TensorFlow, Flask, Bootstrap communities
- MRI dataset contributors
This project was developed as part of an academic capstone.
For reuse or modification, please credit the author.