A deep learning project for brain tumor MRI analysis that performs:
- Classification – Detects whether a brain tumor is present in an MRI slice.
- Multiclass Segmentation – Identifies and highlights tumor subregions.
- Uncertainty & Confidence Estimation – Provides per-pixel entropy/confidence maps for reliable predictions.
Built with PyTorch and deployed with Streamlit.
- Tumor Classification: CNN-based classifier for MRI slices.
- Multiclass Tumor Segmentation: U-Net-style model segmenting multiple tumor classes (e.g., edema, enhancing core, necrosis).
- Uncertainty & Confidence Maps: Pixel-level entropy/confidence visualization.
- Interactive Visualization: Overlay masks and uncertainty maps on MRI scans.
- Deployment: Lightweight Streamlit web app for local demo.
├── .streamlit # Streamlit theme config
├── notebooks/ # Colab/Kaggle notebooks for training
├── scales/ # Images of scales used in output overlays
├── srcipts/ # Core code
│ ├── __init__.py
│ ├── classification.py
│ ├── segmentation.py
│ ├── loader.py
├── weights/ # Trained model weights
├── app.py # Streamlit app
├── requirements.txt
├── requirements-dev.txt
├── README.md
└── demo/ # Example outputs
- Classification: Brain Tumor MRI Dataset @Kaggle
- Segmentation: BraTS20 Dataset @Kaggle
- Modalities used: FLAIR and T1ce only.
-
Classifier: Mobile-Net-V2
-
Segmenter: Efficient-Net-B0 encoder based U-Net.
-
Loss Functions:
- Classification → CrossEntropyLoss
- Segmentation → Dice Loss + CrossEntropy
git clone https://github.com/yourusername/brain-tumor-mri.git
cd brain-tumor-mripip install -r requirements.txtstreamlit run app.py- Accuracy: 99%
- Precision: 99%
- F1 score: 99%
- IOU Score (average): 74.76%
Output from segmentation mode, both flair and t1ce modalities were passed, the result has less uncertainty and the model is more confident
Output from segmentation mode, only flair modality was pass this time leading to large uncertainty and less confidence
- Extend to all four modalities (FLAIR, T1, T1ce, T2).
- Implement 3D tumor segmentation.
- Improve runtime efficiency for clinical deployment.
- BraTS dataset organizers.
- PyTorch.
- Kaggle.
- Streamlit for deployment.
