Skip to content

faranbutt/Image-Segmentation-MRI

Repository files navigation

🧠 3D U-Net Brain Tumor Segmentation – MVP (BRATS Dataset)

This project is a Minimum Viable Product (MVP) for brain tumor segmentation using 3D U-Net trained on the BRATS dataset. Built as part of the InteRussia Fellowship (AI in Medicine Track) at Novosibirsk State University, this solution integrates preprocessing, training, visualization, and model evaluation into a complete pipeline with clinical relevance.


📌 Overview

  • 🎯 Goal: Segment brain tumors (whole tumor, core, enhancing tumor) from multi-modal MRI scans using deep learning.
  • 🧪 Model: Custom 3D U-Net with residual connections and spatial dropout.
  • ⚙️ Frameworks: TensorFlow, Keras, FastAPI (for backend), HTML/CSS/JS (for frontend).
  • 📈 Performance: Achieved 75% average Dice score, meeting clinical viability thresholds.
  • 🌐 Deployment: MVP served via FastAPI interface, visualized in the browser.

🗂️ Dataset

  • BRATS 2020 Dataset
  • Modalities: T1, T1Gd, T2, FLAIR
  • Format: .nii.gz (NIfTI)
  • Preprocessed using nibabel and resized to 160×160×155

🧱 Project Structure

📦brain-tumor-segmentation ┣ 📁extracted_data/ # BRATS Dataset after untar ┣ 📁notebooks/ # Training notebook (dataset_prep.ipynb) ┣ 📜main.py # FastAPI server (optional deployment) ┣ 📜requirements.txt # All dependencies ┣ 📜README.md # You're here! ┗ 📜brain_unet_full_model.keras # Trained model (saved)

⚙️ Features

  • 🧠 3D U-Net with Layer Normalization and Residual Connections
  • 📊 Custom DiceScore metric and combined loss (Dice + Cross-Entropy)
  • 🎞️ MRI visualization tools for slices, sequences, and overlays
  • 🧪 Evaluation of per-class Dice scores (excluding background)
  • 📉 Live training plots: Dice Coefficient and Loss curves
  • ✅ Model checkpointing, early stopping, and reproducibility

🧪 Results

Class Dice Score
Tumor Core (1) 0.77
Whole Tumor (2) 0.74
Enhancing Tumor (3) 0.73
Average 0.75

✅ Satisfies clinical viability threshold for brain tumor segmentation.

🎓 Developed During 🏛️ InteRussia Fellowship 2025 🧠 Track: Artificial Intelligence in Medicine 🌍 Hosted at: Novosibirsk State University, Russia 👥 17 participants from 14 countries 🎯 Built and presented MVP in 4 weeks

Authors Faran Taimoor Butt Shokhrukh Sultanov Annageldi Hydyrov Okdem Yoldashov Vicente Aguero Emamul Islam

InteRussia MVP Team

📄 License This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published