SIGMMA-141M
SIGMMA is a multi-scale contrastive model that aligns H&E histology with spatial transcriptomics (Xenium). This repository provides the SIGMMA-141M weights, trained on HST-Corpus-141M (640 Xenium sections, ~141.7M cells; in-house Wellcome Sanger Institute cohorts plus HEST-1k public sections).
What is in this repository
| file | content |
|---|---|
sigmma_140M_step2000_adapter.safetensors |
SIGMMA-specific weights only (60.7M parameters, fp32, 243 MB): LoRA adapters on the UNI2-h backbone (3.57M; r=16, alpha=32, on patch_embed.proj, attn.qkv, attn.proj), the spatial (cell-graph) encoder, and the multi-scale attention-pool / MLP heads |
config.yaml |
model configuration used for training (paths removed) |
The UNI2-h backbone weights are not included. The UNI2-h backbone was kept frozen during training (only LoRA adapters were trained), so the released adapter applies on top of the original, unmodified UNI2-h weights. Request access to MahmoodLab/UNI2-h and download it yourself.
Usage
import yaml, safetensors.torch
from ml_collections.config_dict import ConfigDict
from sigmma.utils.train_utils import load_model
cfg = ConfigDict(yaml.safe_load(open("config.yaml")))
cfg.model.pretrained_image_encoder_ckpt_path = "/path/to/UNI2-h/" # dir with pytorch_model.bin
model = load_model(cfg, pretrained_image_encoder="UNI", train=False) # builds UNI2-h + LoRA + heads
res = model.load_state_dict(
safetensors.torch.load_file("sigmma_140M_step2000_adapter.safetensors"), strict=False)
assert not res.unexpected_keys # missing keys = UNI2-h backbone tensors only (loaded above)
model.eval()
Loading the adapter this way reproduces the original training checkpoint exactly (all 583 state-dict tensors identical; image-feature forward-pass difference 0).
Training
- Data: all 640 sections of HST-Corpus-141M. No held-out split was used. The validation set during training was a subset of the training sections and served only for loss monitoring.
- Objective: multi-scale (3 resolutions) image–spatial contrastive loss with a gene-expression-aware soft target (spatially variable gene panels, alpha=0.1).
- Schedule: 2,000 steps, batch 128 x 10 gradient-accumulation steps, AdamW (lr 1e-4, weight decay 1e-3), warmup-cosine schedule. Released checkpoint: step 2,000.
Limitations
- Every HST-Corpus-141M section, including sections used as test sets elsewhere, was used for training. Do not use this checkpoint to benchmark on any HST-Corpus-141M section (including the in-house test split and HEST-1k sections in the corpus); use external cohorts only.
- Research use only. Not a medical device. Not validated for clinical decision-making.
License and terms of use
- SIGMMA-141M weights: CC BY-NC-ND 4.0, non-commercial academic research only.
- The model depends on UNI2-h (Mahmood Lab, CC BY-NC-ND 4.0), which must be obtained separately under its own terms. Under those terms, commercial use of UNI2-h derivatives requires prior approval from Mahmood Lab.
Attribution
SIGMMA-141M builds on UNI2-h. Please cite UNI: Chen, R.J. et al. Towards a general-purpose foundation model for computational pathology. Nature Medicine 30, 850–862 (2024).
- Downloads last month
- -
Model tree for lotfollahi-lab/SIGMMA-141M
Base model
MahmoodLab/UNI2-h