DeepScan is a deep learning project for automated brain MRI analysis: distinguishing No Tumor vs Tumor, classifying tumor type (Meningioma, Glioma, Pituitary, No Tumor) and generating a tumor mask (for .mat inputs). It combines research notebooks with a lightweight Flask web interface (OTP‑protected) that emails prediction results.
Graduation Project Completion Date: May 22, 2024. This repository is an archived snapshot of the final project submission
Core objectives:
- Unified preprocessing: skull stripping, noise reduction, contrast enhancement, normalization.
- Data imbalance mitigation: augmentation + SMOTE (classification).
- Two model families: CNN classifier and U-Net style segmentation network.
- Simple deployment path (Flask, previously hosted on AWS EC2).
- Figshare (Jun Cheng): 3,064 T1-weighted MRIs (Meningioma, Glioma, Pituitary).
- Kaggle Brain Tumor MRI: 8,776 images (adds No Tumor class). Combined, standardized to 224×224 grayscale and intensity normalized.
Preprocessing pipeline: resize → skull strip → Gaussian blur → contrast rescale (2–98 percentile) → min–max normalize → augment (rotation, zoom, shear, flips) → SMOTE (classification balancing).
Classifier: CNN (filters 64→128→256, BN, dropout, softmax 4-way).
Segmentation: U-Net style with depthwise separable convolutions, Dice loss/metric.
- Classification Accuracy: 93.8%
- Macro AUC: 0.9918
- Segmentation Dice: 0.7309
Python 3.11 suggested.
git clone <repo-url>
cd "DeepScan Project"
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cd "Flask Deployment"
pip install -r requirements.txt
Add model weight files beside Application.py:
BrainTumorClassfier2.h5
non_fold_unet.h5
Export mail credentials (or modify code to load from env):
export MAIL_USERNAME=your_user
export MAIL_PASSWORD=your_pass
Run locally:
python Application.py
Then visit http://localhost:5000, request OTP, verify, upload an image (.jpg/.jpeg/.png for classification, .mat for classification + segmentation).
- Need broader multi-center data for generalization.
- Segmentation Dice can improve (attention mechanisms, ensembling, post-processing).
- No interpretability (Grad-CAM) yet for classifier.
- Missing containerization and CI pipeline.
Academic / research use only; not for clinical diagnosis without further validation and regulatory approval.
Figshare dataset contributors, Kaggle dataset contributors, and open-source communities behind TensorFlow/Keras, scikit-image, scikit-learn, and Flask.
- Omar Mahmoud Hamdan
- Abdullah Shabib