Mask-Image Distributional Divergence for Evaluating Medical Image Segmentation
Programs that outline organs in medical scans are usually checked against an expert's hand-drawn outline for every scan. MID checks a whole batch of outlines at once. It compares the batch with a trusted collection of expert-checked scans, so the new scans need no hand-drawn answers.
A mask can look like a perfect liver and still be wrong for the scan it sits on. So MID never looks at masks alone. Every image is encoded together with its mask, and MID compares the joint distribution of a candidate set with the joint distribution of a reference set. No case in one set has to match a case in the other.
A frozen MedSigLIP encoder embeds the image and each class mask. The two 1152-d vectors are joined into one 2304-d point.
PCA fitted on the reference keeps k = 128 components, which hold more than 94% of the reference variance.
A Gaussian is fitted to each set. MID is the squared 2-Wasserstein distance between them, in closed form.
Pick an organ and a corruption. Each blue dot is one scan with its expert mask. Each yellow dot is the same scan with a corrupted mask, made with the corruption code of the paper's sweep. All pairs go through MedSigLIP and a PCA with k = 128 fitted on the blue set. The view shows two of the 128 directions: across, the direction in which this corruption moves the set, and into the depth, the main direction of the reference. MID uses all 128.
What you are looking at.
These points are joint MedSigLIP embeddings of real image–mask pairs from ten datasets, on the first two principal components. CT datasets share one region. MRI datasets sit far along the first component. Pick a reference and a candidate to see how far apart their Gaussians are.
| Candidate (reference: TotalSegmentator CT train) | Modality | MID | × floor |
|---|
Sources. Points are digitised from the paper's PCA figure of joint MedSigLIP embeddings, which shows a subsample of each dataset. The small 2-D readout is the same Gaussian distance computed on these two coordinates only. It shows how the centre shift and the spread add up, but its scale is not the scale of MID. The table is Table 2 of the paper: reference is TotalSegmentator CT train (1105 cases, 6630 vectors, six abdominal organs), scored in the full 128-d projection.
Three published methods segment the brain arteries in IXI MRA. Blue is the ground-truth distribution, yellow is one method's predictions on the same scans. Thin lines join each case to its own prediction. The closer the yellow cloud stays to the blue one, the lower the MID and the better the method.
| Method | MID | Dice |
|---|
Sources. MID, Dice and HD95 are the paper's values (Section 4.5). HD95 was reported for two of the three methods. The points are the 23 cases shown in the paper's latent-space figure, digitised from it. On these two components the Gaussian distance orders the methods the same way as the full MID.
The package pytorch-mid computes MID from joint image–mask vectors. The tutorial covers the whole path: encode the scans with MedSigLIP, fit the projection on the reference, score each model, compare models at one size, and check the image–mask correspondence.
pip install git+https://github.com/erc-caravel/pytorch-mid
@inproceedings{marciano2026mid,
title = {{MID}: Mask-Image Distributional Divergence for
Evaluating Medical Image Segmentation},
author = {Marcian{\`o}, Vincenzo and Zhang, Xiaoming and
Guglielmo, Gianluca and Antonelli, Michela and
Ourselin, S{\'e}bastien and Zuluaga, Maria A.},
booktitle = {Advances in Neural Information Processing Systems},
year = {2026},
eprint = {2610.17354},
archivePrefix = {arXiv}
}