This repository contains the official source code for EMedNeXt: An Enhanced Brain Tumor Segmentation Framework for Sub-Saharan Africa using MedNeXt V2 with Deep Supervision [BraTS SSA 2025, MICCAI 2025].
# BraTS2025_BioMedIAMBZ
## (A) How To Train the Model (Through Model_Training Folder)
### Installation
``` bash
conda create -n brats python=3.8
pip install -r requirements.txt
```
### Data Preprocessing
1. Download the BraTS2023 Adult Glioma dataset and put it on the `dataset/` folder, so it will contain the following:
```
├── dataset
│ ├── ASNR-MICCAI-BraTS2023-GLI-Challenge-TrainingData
│ ├── ASNR-MICCAI-BraTS2023-GLI-Challenge-ValidationData
│ ├── brats21_folds.json
│ ├── BraTS2023_2017_GLI_Mapping.xlsx
```
2. Run `preprocessing.py`, but please check the `source_directory` and `target_directory` variables to make sure everything is correct.
```
conda activate brats-gli
python preprocessing.py
```
### Training
For training a `MedNeXt V2 or V1` model, you can run the following command (but you may need to configure your wandb account beforehand):
```
python mednextv2_train.py or mednext_train.py
```
### 5-Fold CV Dice & HD95
To calculate 5-fold CV Dice and LesionWise, we need to do two things;
- get predictions from 5-fold (`get_predictions.py`).
- run post-processing and evaluation (`get_postprocessing.py`).
- Again check all the directories inside the files.
- The idea of separating `get_predictions.py` and `get_postprocessing.py` is to allow us to tune post-processing faster.
## (B) How To Containarize your model (Through Optimized_Container Folder)
1. Add your model weights inside the Checkpoints folder
2. chmod and run the (run.sh) file
3. You have containarized your model successfully.
4. Test it on actual data.