How to Submit to MAMA-SYNTH¶
Welcome to the MAMA-SYNTH submission guide! This page walks you through everything you need to package your synthesis model and submit it to the challenge — from a working local test all the way to an uploaded algorithm on Grand Challenge.
Overview¶
MAMA-SYNTH submissions run as Docker containers on the Grand Challenge (GC) platform. Each container receives a single pre-contrast breast MRI slice, runs your synthesis model, and writes the predicted post-contrast slice to a fixed output path. The evaluation pipeline then scores your output automatically.
No special GC SDK is required — only Docker and a working model.
Step 0: Prerequisites¶
Before you start, make sure you have:
- Docker installed and running (
docker --version) - A trained synthesis model (weights + inference code)
- A pre-contrast
.mhaslice for local testing - A Grand Challenge account and team registration for MAMA-SYNTH
Step 1: Understand the I/O Contract¶
The GC platform calls your container once per image. The paths are fixed:
| Direction | Container path | Interface slug |
|---|---|---|
| Input | /input/images/pre-contrast-dce-mri-slice-breast/<uuid>.mha |
pre-contrast-dce-mri-slice-breast |
| Output | /output/images/synthetic-contrast-dce-mri-slice-breast/output.mha |
synthetic-contrast-dce-mri-slice-breast |
Image format: 2-D float32 .mha files, z-score normalised using the MAMA-SYNTH pre-contrast reference statistics (training_pre_stats.json, provided in the challenge repository.
Your container must:
1. Read the single input .mha file from /input/images/pre-contrast-dce-mri-slice-breast/.
2. Write a single output file to /output/images/synthetic-contrast-dce-mri-slice-breast/output.mha.
3. Exit with code 0 on success.
Step 2: Start from a Baseline¶
We provide a ready-to-use baseline in the challenge repository:
| Baseline | Description | When to use |
|---|---|---|
identity-baseline |
Copies input → output (no synthesis) | Start here to verify your Docker setup end-to-end before touching model code |
Clone the repository and copy the baseline that best fits your starting point:
git clone https://github.com/mama-research/mama-synth.git cd mama-synth/src/submission/identity-baseline
Step 3: Adapt inference.py¶
Open inference.py and replace the synthesis logic with your own model. The key section to modify is clearly marked:
# identity-baseline — replace this block: output_image = image # identity copy # with your model inference, for example: import your_model arr = sitk.GetArrayFromImage(image) arr_out = your_model.predict(arr).astype("float32") output_image = sitk.GetImageFromArray(arr_out) output_image.CopyInformation(image) # ← preserve spacing / origin / direction
Important reminders:
-
The output must be
float32and z-score normalised on the same scale as the input (seetraining_pre_stats.json). -
Always call
CopyInformation(input_image)on your output so that spatial metadata is preserved for the evaluation pipeline. - The input image is a single 2-D slice, remove any 3-D model assumptions.
Step 4: Update the Dockerfile¶
Add your dependencies to requirements.txt and place model weights in a models/ subfolder (or any directory you prefer), then COPY them into the image:
Here you can find an example of the dockerfile.
Key requirements for Grand Challenge compatibility:
- Platform must be
linux/amd64(even when building on Apple Silicon or ARM). - The container must run as a non-root user.
- The
/outputdirectory must be writable by that user. - GPU access is available during evaluation; use
CUDA_VISIBLE_DEVICESor setMAMA_GPU_IDas needed.
Step 5: Build the Image Locally¶
chmod +x do_build.sh do_test_run.sh do_save.sh ./do_build.sh
This runs docker build --no-cache and tags the image. The --no-cache flag ensures your latest code changes are always picked up.
Step 6: Test Locally¶
Place a pre-contrast .mha slice in the expected input folder:
cp /path/to/your/DUKE_001.mha \ test/input/images/pre-contrast-dce-mri-slice-breast/
Then run the container against it:
./do_test_run.sh
On success, your synthesised output will be at:
test/output/images/synthetic-contrast-dce-mri-slice-breast/output.mha
You can also run the automated validation tests:
pip install pytest SimpleITK numpy pytest test_algorithm.py -v
These checks verify that the output file exists, has the correct path, is a valid float32 .mha, and has the same spatial dimensions as the input.
Step 7: Export the Container¶
When your local tests pass, export the Docker image for upload:
./do_save.sh
# → mama-synth-<your-algorithm>-v1.0.0.tar.gz
Bump the VERSION variable in do_save.sh before each new upload so that different iterations remain distinguishable.
Step 8: Create an Algorithm on Grand Challenge¶
- Go to grand-challenge.org/algorithms/ and click Create a new algorithm.
- Fill in a name (e.g.
MAMA-SYNTH My Method) and a short description. - Set the inputs interface to
pre-contrast-dce-mri-slice-breastand outputs tosynthetic-contrast-dce-mri-slice-breast. - Under Container Management, click Upload a new container and upload your
.tar.gz. - Wait for GC to validate and activate the image (typically within a few hours, up to 24 h).
Step 9: Submit to the Challenge Phase¶
Once your algorithm is active:
- Navigate to the MAMA-SYNTH challenge page.
- Go to Submit and select the desired phase (Validation or Test).
- Choose your algorithm from the dropdown and confirm the submission.
- Results will appear on the leaderboard once evaluation completes.
Tip: Use the Debug phase to test the upload. For tuning your model, you can submit to Validation Phase upto five times. The Test phase uses the hidden test cohorts and determines the official ranking.
Common Pitfalls¶
| Issue | Fix |
|---|---|
| Container exits with a non-zero code | Check GC logs; the most common cause is a wrong input path or a missing output file |
Output .mha not found |
Ensure you write to /output/images/synthetic-contrast-dce-mri-slice-breast/output.mha exactly |
| Wrong image dtype | Cast your output array to float32 before creating the SimpleITK image |
| Spatial metadata mismatch | Call output_image.CopyInformation(input_image) to preserve spacing and origin |
| Image built for wrong platform | Add --platform linux/amd64 to your docker build command |
Permission denied on /output |
Confirm your Dockerfile creates /output and assigns it to the non-root user |
Resources¶
- Challenge repository (baselines, preprocessing, evaluation): github.com/mama-research/mama-synth
- Grand Challenge documentation: grand-challenge.org/support/
- Algorithm creation guide: grand-challenge.org/algorithms/
- Evaluation details: mamasynth.grand-challenge.org/evaluation/
Questions?¶
If you run into issues not covered here, please reach out:
- Smriti Joshi — smriti.joshi@ub.edu
- Richard Osuala — richard.osuala@gmail.com
- Jarek van Dijk — jarek.vandijk@radboudumc.nl
Good luck, and we look forward to seeing your submissions! 🎯