Sign inSign up

petermcgor/conflunet

By petermcgor

•Updated 15 days ago

Image
0

902

petermcgor/conflunet repository overview

⁠ConfLUNet Docker Image

This Docker image provides a ready-to-use environment for ConfLUNet, a deep learning model that performs instance segmentation of multiple sclerosis lesions in FLAIR MRI images, based on the nnU-Net framework.

As of 0.3.0, the image ships with a default pre-trained model (Dataset321_WMLIS, FLAIR) baked in, so you can run inference out of the box: no training, no data setup, no model download.

⁠Quick Start: inference with the bundled model

No nnU-Net directory structure is needed. Just point --input_dir at a folder of FLAIR images named with nnU-Net's channel suffix (e.g. sub-001_0000.nii.gz), and give an output folder:

docker run -it --gpus all --shm-size=40gb \
  -v /path/to/your/flair_inputs:/input \
  -v /path/to/your/outputs:/output \
  petermcgor/conflunet:0.3.0 \
  conflunet_predict --dataset_id 321 \
    --input_dir /input --output_dir /output \
    --model ConfLUNet_FLAIR_v24-12-11 --postprocessor ConfLUNet

--dataset_id 321 selects the bundled model. For CPU-only machines, omit --gpus all (inference falls back to CPU automatically; it will be slow).

⁠Running with Singularity / Apptainer

The same image runs on HPC clusters without Docker:

apptainer pull conflunet_0.3.0.sif docker://petermcgor/conflunet:0.3.0
apptainer exec --nv \
  --bind /path/to/inputs:/input --bind /path/to/outputs:/output \
  conflunet_0.3.0.sif \
  conflunet_predict --dataset_id 321 \
    --input_dir /input --output_dir /output \
    --model ConfLUNet_FLAIR_v24-12-11 --postprocessor ConfLUNet

Use --nv for GPU; bind any paths outside your home with --bind. The image is read-only under Apptainer, so for training point the nnUNet_* locations at writable mounted directories.

⁠Using your own models / training

For training or inference with your own models, mount a data directory with the standard nnU-Net structure to /opt/conflunet_resources:

/path/to/your/data/
├── nnUNet_raw/            # DatasetXXX_Name/ with images (*_0000.*) and dataset.json
├── nnUNet_preprocessed/   # populated by preprocessing
└── nnUNet_results/        # populated by training

Preprocessing:

docker run -it --gpus all --shm-size=40gb \
  -v /path/to/your/data:/opt/conflunet_resources \
  petermcgor/conflunet:0.3.0 \
  conflunet_plan_and_preprocess --dataset_id [ID] --check_dataset_integrity

Training:

docker run -it --gpus all --shm-size=40gb \
  -v /path/to/your/data:/opt/conflunet_resources \
  petermcgor/conflunet:0.3.0 \
  conflunet_train --dataset_id [ID] --fold [FOLD] --model_name [NAME]

The bundled model lives in a separate path, so mounting your own data over /opt/conflunet_resources does not hide it; --dataset_id 321 still resolves to the baked model (a dataset of your own numbered 321 is overridden for inference, use a different id).

⁠Prerequisites
  • For GPU: NVIDIA GPU with CUDA support and the NVIDIA Container Toolkit (CPU-only works too, slowly)
  • Adequate disk space (~5.6 GB image) and RAM
  • Shared memory (recommended 40GB, adjustable)
⁠Documentation

Full instructions: Docker instructions⁠ · ConfLUNet GitHub repository⁠

⁠Version Information
  • ConfLUNet bundled model: Dataset321_WMLIS / ConfLUNet_FLAIR_v24-12-11 (FLAIR, single channel)
  • Base image: pytorch/pytorch:2.1.2-cuda11.8-cudnn8-runtime
  • PyTorch 2.1.2 · CUDA 11.8 · nnunetv2 2.5.1
⁠License

MIT License, see the LICENSE⁠ in the GitHub repository.

Tag summary

Content type

Image

Digest

sha256:cdd6b6c3f…

Size

5.6 GB

Last updated

15 days ago

docker pull petermcgor/conflunet:0.3.0