B-MIM: Biased Masked Image Modeling for Generalizable Segmentation of Fine-Grained Anatomical Structures

Sebastián González, Karen Sánchez, José M. Saavedra, Marcelo Pizarro, Bernard Ghanem
deepCVL, Universidad de los Andes, Santiago, Chile · KAUST, Saudi Arabia
MedAGI Workshop, MICCAI 2026

Computer Vision Lab · Universidad de los Andes

B-MIM CT encoder and its use in a downstream segmentation task

B-MIM pretrains a 3D CT encoder on 9,955 unlabelled abdominal studies with a masked-image objective biased towards local detail. The encoder keeps thin vessels connected on hospitals it never saw, and adapts to new tasks by training as few as 16k parameters.

9,955abdominal CT studies from 17 public sources, 1.99 M slices
+18.5%vessel topology (clDice) on an unseen dataset: 0.491 → 0.582
16,344trainable parameters in the lightest adaptation
p = 0.3probability of keeping the global loss at each step

Abstract

Self-supervised pretraining enables transferable representations for medical imaging, yet most CT encoders remain biased toward coarse semantic understanding, limiting their sensitivity to fine-grained anatomical structures such as vessels or small tumors. In this paper, we introduce Biased Masked Image Modeling (B-MIM), a modification of the iBOT objective that stochastically reduces global semantic alignment to prioritize local patch reconstruction. This bias encourages the encoder to capture high-frequency morphological details and structural continuity.

We curate a multi-institutional CT abdominal dataset of 9,955 filtered studies from 17 public sources and pretrain a 3D Swin Transformer backbone using B-MIM. Across inter-dataset experiments on liver vessel segmentation, the proposed encoder improves topological fidelity (clDice) and achieves competitive Dice scores in tumor segmentation, compared to fully fine-tuned baselines, despite updating only a fraction of the parameters. Our results suggest that reducing global semantic pressure during pretraining enhances generalization to intricate anatomical structures.

Why fine-grained structures

Self-supervised encoders have transformed medical imaging, but the ones available for CT (VoCo, or the backbones of tools such as TotalSegmentator) are trained to understand organs. They capture coarse, global semantics and lose the high-frequency detail of thin vessels and small tumours.

Those details are exactly what clinicians need: the liver's vascular tree defines how a resection is planned, and a small lesion found early changes a cancer treatment. B-MIM is a CT encoder designed for them, and evaluated the hard way: trained on one dataset and tested on hospitals it never saw.

Biased masked image modelling

B-MIM starts from iBOT, a teacher–student self-distillation framework with two losses: a global loss that aligns the [CLS] tokens of two views of a scan, and a masked-image loss (MIM) that asks the student to reconstruct the features of masked patches.

Our change is small and deliberate. At each training step the global loss is kept only with probability p:
L = 𝟙p · LCLS + LMIM, 𝟙p ~ Bernoulli(p)

With p = 0.3, global supervision disappears in most batches and the encoder must rely on local reconstruction. Unlike simply down-weighting the loss, removing it intermittently breaks the co-adaptation between global and local objectives, and the encoder learns the continuity of thin, tubular structures.

  • Backbone: 3D Swin Transformer with shifted-window attention, capturing local texture and long-range context.
  • Pretraining: 200 epochs, batch size 6, AdamW with 10 warm-up epochs and a cosine schedule from 7.5×10⁻⁴ to 2×10⁻⁶, on one NVIDIA RTX 6000 Ada (48 GB).
  • Downstream: the encoder stays frozen and feeds a lightweight nnU-Net decoder.

A curated abdominal CT cohort

We gathered 13,784 abdominal CTs from 17 public sources (DICOM and NIfTI) and filtered them with one protocol: adult patients only, no localizers or inconsistent orientations, at least 20 slices after cropping, and liver plus at least one kidney present. Every volume was reoriented to LPS and cropped automatically from the top of the liver to L4 or the kidneys. TotalSegmentator is used only to find that region; no vessel or tumour label is ever seen during pretraining.

The pretraining cohort after filtering. The full list of sources is in the repository; the cohort will be released upon acceptance.
StreamStudies2D slicesLargest sources
DICOM5,6131,529,954RSNA 2023 Abdominal (3,147), CT Colonography (831), TCGA-KIRC (362)
NIfTI4,342463,240AMOS (2,338), AbdomenCT-1K (1,061), KiTS23 (480)
Total9,9551,993,19417 public sources

Code and data list on GitHub

Train in one hospital, test in others

Downstream models are trained only on CRLM (197 studies, 5-fold cross-validation) and tested, without any retraining, on IRCAD (20 studies) and MSD (303 studies), which differ in scanners, protocols and anatomy. We compare three ways of plugging the encoder into the decoder:

  • B-MIM-A: multi-scale features concatenated into the decoder; only 16,344 encoder-side parameters are trained.
  • B-MIM-B: full fine-tuning of the same architecture (5,716,410 parameters).
  • B-MIM-C: low-rank adaptation (LoRA) of the bottleneck with the backbone frozen.

Results

Vessels benefit most. Under the shift from CRLM to IRCAD, B-MIM-C raises clDice, the metric that rewards connected vessel trees, from 0.491 to 0.582 (+0.091, +18.5% relative), a much larger gain than in Dice. The lightest variant, B-MIM-A, matches the fully trained baseline while updating 16k parameters.

Liver vessel and tumour segmentation: ground truth, Swin-UNETR, VoComni and B-MIM
Top: liver vessels. B-MIM-C keeps thin branches connected where Swin-UNETR and VoComni fragment them. Bottom: tumours, where B-MIM-B follows the ground-truth boundary more closely. Insets enlarge the highlighted regions.
Dice and clDice for liver vessels and Dice for tumours. Models are trained on CRLM; IRCAD and MSD are unseen. Best value per column in bold.
ModelVessels CRLM DiceclDiceIRCAD DiceclDiceMSD DiceclDiceTumours CRLMIRCADMSD
Swin-nnUNet0.7460.7800.4000.4910.5980.6240.6460.5720.374
VoCo-SSL0.6160.6450.3820.4370.4880.4800.6500.3690.288
VoComni0.6320.6620.4550.4940.5720.5880.6660.5000.423
B-MIM-A0.7440.7770.4130.5000.6110.6310.6310.4970.357
B-MIM-B0.7450.7800.4010.4900.6040.6300.6510.5780.395
B-MIM-C0.7460.7790.4920.5820.5670.5950.6370.5060.269

Tumours are harder: their size, shape and contrast vary far more between patients than the tubular geometry of vessels. Full fine-tuning (B-MIM-B) gives the best tumour Dice on IRCAD.

Takeaways

  • Reducing the pressure of global semantics during pretraining makes a CT encoder better at thin anatomy, and that advantage survives a change of hospital.
  • A good encoder can be adapted with a tiny fraction of its parameters, which matters for hospitals with limited computing power.
  • Next: evaluation stratified by lesion size, a systematic study of p, and extension to MRI.

BibTeX

@inproceedings{gonzalez2026bmim,
  title     = {{B-MIM}: Biased Masked Image Modeling for Generalizable Segmentation of Fine-Grained Anatomical Structures},
  author    = {Gonz{\'a}lez, Sebasti{\'a}n and S{\'a}nchez, Karen and Saavedra, Jose M. and Pizarro, Marcelo and Ghanem, Bernard},
  booktitle = {MICCAI 2026 Workshop on Medical Artificial General Intelligence (MedAGI)},
  year      = {2026},
  eprint    = {2608.24364},
  archivePrefix = {arXiv}
}