Lightweight 3D U-Net for glioma segmentation on the BraTS-Africa 2024 dataset β CPU-only training and Streamlit deployment.
# BraTS-Africa 3D U-Net Segmentation
**π Live demo:** brats-africa-3dunet.streamlit.app
Lightweight 3D U-Net for automated glioma segmentation on Sub-Saharan African MRI data (BraTS-Africa 2024), trained end-to-end on **CPU only** and deployed as an interactive Streamlit app.
> **Attribution:** This project adapts the open-access SPARK / MAI Lab tutorial *"Lightweight Brain Tumor Segmentation on Low-Resource Systems: A Step-by-Step Guide with 3D U-Net"* (Oladele et al., 2025). The pipeline, 3D U-Net implementation, and Streamlit app are built on that tutorial and on Bhattiprolu's U-Net reference. See Acknowledgements for full credit and My contributions for what I added on top. This repository is a learning and portfolio project β it is **not** a validated clinical tool.
---
## Overview
Automated brain tumor segmentation delineates tumor sub-regions on multi-modal MRI to support diagnosis, treatment planning, and monitoring. Most production models depend on GPUs, which limits training and skills development in resource-constrained settings.
This project implements a **lightweight 3D U-Net** that trains and runs on a standard CPU, using the **BraTS-Africa 2024** dataset β a collection built specifically to improve representation of African populations in brain tumor imaging benchmarks. The goal is a reproducible, CPU-only segmentation pipeline from raw NIfTI volumes through preprocessing, training, evaluation, and deployment.
The workflow is organised in four phases:
1. **Data collection, preparation & preprocessing** β load NIfTI, scale intensities, stack modalities, crop, filter low-tumor volumes, split.
2. **Model building** β a reduced-capacity 3D U-Net with patch extraction and augmentation for memory efficiency.
3. **Training & evaluation** β combined Dice + focal loss, per-region Dice / IoU / HD95 metrics, resource tracking.
4. **Deployment** β local inference script and a Streamlit app for uploading scans and downloading predictions.
---
## Dat β¦