This repository contains the official implementation for all baseline models used to benchmark our medical imaging dataset CirrMRI600+. It includes training pipelines, model configurations, and preprocessing scripts for 3D liver MRI segmentation tasks.
We provide implementations and training scripts for several popular and effective models in 3D medical image segmentation:
- ✅ Custom: SynergyNet3D
- ✅ MONAI-based:
AttentionUnet
,SwinUNETR
,UNet
- ✅ Official Implementations:
nnUNet
,nnFormer
,MedSegDiff
- Transformer-augmented 3D U-Net.
- Multi-resolution ROI processing.
- Implemented in
synergynet/transunet
. - Trained using
train_lin.py
.
Implemented with MONAI:
UNet
AttentionUnet
SwinUNETR
Used via their own official codebases:
Create a new Python environment (optional) and install dependencies:
pip install -r requirements.txt
torch>=1.10
monai>=1.0.1
nibabel
numpy
scipy
tqdm
The CirrMRI600+ dataset is available for download:
➡️ Download CirrMRI600+ Dataset
📦 Size: ~15 GB
📝 Format: NIfTI (.nii.gz)
Make sure your dataset is organized in the following format:
/data/dataset_path/
├── images/
│ ├── sample_1.nii.gz
│ ├── sample_2.nii.gz
│ └── ...
└── labels/
├── sample_1.nii.gz
├── sample_2.nii.gz
└── ...
Each .nii.gz
volume undergoes the following steps:
- Loading using
nibabel
- Conversion to PyTorch tensors
- Resizing to
(256, 256, 80)
using:monai.transforms.spatial.functional.resize(...)
- Z-score Normalization:
image = (image - torch.mean(image)) / torch.std(image)
After model prediction:
-
Apply sigmoid activation:
probs = torch.sigmoid(output)
-
Optional thresholding:
binary_output = (probs > 0.5).float()
-
Further postprocessing (e.g., connected components) can be added based on task requirements.
To start training:
python train_lin.py
- Model: MaskTransUnet (SynergyNet3D)
- Loss: Dice + Binary Cross Entropy (
DiceBCELoss
) - Optimizer: AdamW
- Learning Rate:
1e-4
- Batch Size:
4
- Epochs:
1000
- Checkpoint: Saved every 5 epochs
Evaluation and metrics scripts will be released in future updates. You may evaluate with:
- Dice Coefficient
- Hausdorff Distance
- Volume Overlap
If you use this dataset or code, please cite:
@article{jha2024cirrmri600+,
title={Large Scale MRI Collection and Segmentation of Cirrhotic Liver},
doi={https://arxiv.org/abs/2410.16296},
author={Jha, Debesh and Susladkar, Onkar Kishor and Gorade, Vandan and Keles, Elif and Antalek, Matthew and Seyithanoglu, Deniz and Cebeci, Timurhan and Aktas, Halil Ertugrul and Kartal, Gulbiz Dagoglu and Kaymakoglu, Sabahattin and others},
journal={Nature Scientific Data},
year={2025}
}
This repository is released under the MIT License.