Brain Tumor Segmentation using nnU-Net

5 min read
Web Application Development

Abstract / Introduction
Brain tumor segmentation is a critical task in medical image analysis, enabling precise detection of tumor regions for diagnosis and treatment planning. In this project, you will develop a deep learning based segmentation model using nnU-Net. nnU-Net is a model that belongs to U-Net family which is used to automatically segment brain tumors from MRI scans in the BraTS 2021 dataset.
In addition to training and evaluating the segmentation model, you will develop a Flask-based web application that allows users to upload MRI images and visualize the predicted segmentation results alongside ground truth masks. 

 

Functional Requirements:
The following are basic requirements:
• Implement nnU-Net for brain tumor segmentation using PyTorch.
• Preprocess the BraTS 2021 dataset (multi-modal MRI images).
• Train the model using Dice Loss + Cross-Entropy Loss and evaluate its performance.
• Display segmentation results as images with ground truth comparison.
• Develop a Flask web application where users can upload an MRI scan and receive the predicted segmentation mask. 

 

Task 1: Understanding the Dataset
Study the U-Net model and nnU-Net model.
• Study the BraTS 2021 dataset (FLAIR, T1, T1ce, T2 modalities).
• Understand tumor segmentation labels (Whole Tumor, Tumor Core, Enhancing Tumor).
• Code to visualize sample MRI images and corresponding masks.


Task 2: Preprocessing & Data Augmentation
• Load and preprocess MRI scans using Nibabel.
• Normalize images and apply augmentations (flipping, rotation, resizing).
• Convert segmentation masks into one-hot encoded format.


Task 3: Implementing nnU-Net for Brain Tumor Segmentation
• Implement the nnU-Net model using PyTorch.
• Define loss function (Dice Loss + Cross-Entropy) and optimizer (AdamW).
• Train the model and monitor performance metrics.

 

Task 4: Model Evaluation & Results Visualization
1. Evaluate the model using Dice Score, IoU.
2. Compare nnU-Net vs U-Net segmentation performance.
3. Display segmentation results alongside ground truth masks.


Task 5: Developing a Flask Web App for Segmentation Visualization
1. Build a Flask-based web interface for MRI scan uploads.
2. Integrate the trained nnU-Net model for segmentation predictions.
3. Display input image, predicted segmentation mask, and ground truth mask.


Bonus Tasks (Optional, if successfully completed any of the following, 5 extra marks will be awarded)
1. Optimize model performance using hyperparameter tuning.
2. Improve segmentation quality using post-processing (CRF, morphological operations).

    Tools & Technologies
  • 1. Operating System: Window 7 and above
  • 2. RAM 8 GB or more (Dataset size is 3 GB so it cannot be executed on small size RAM)
  • 3. Anaconda OR jupyter notebook OR Google Colab (Python)

Share this project:

Faisal Mehmood

Faisal Mehmood Expert in CS619 Final Year Projects and software development.

View all projects