-SegFormer: Multi-Resolution Vision Transformers for Sparsely Supervised Segmentation in Electron Microscopy
Organizations: Human Technopole · Technische Universität Dresden
Abstract
Segmenting organelles in electron microscopy (EM) volumes requires dense annotations that take experts months to produce, and every gain in imaging resolution adds to this cost. Sparsely supervised methods reduce this cost to a small fraction of labeled pixels, but the convolutional networks they build on see a limited neighborhood around each pixel, while the identity of an organelle often depends on context far beyond it. We introduce -SegFormer, a multi-resolution Vision Transformer for sparsely supervised semantic segmentation, which builds on the architecture of MuViT and extends the training method of -Seg. For each labeled pixel, -SegFormer samples views at three physical resolutions centered on it, embeds their patches into a single token sequence, and encodes every token's position in image coordinates, so that attention relates all views in one shared frame. A segmentation head classifies the pixel from the tokens around it; during training, the pixel's own token is hidden, so the label must be predicted from context rather than local appearance. The model is trained in a single stage, without pretraining, with an auxiliary reconstruction loss. On the BetaSeg FIB-SEM dataset, -SegFormer learns from about 10,000 labeled pixels among the 670 million voxels inside three cells, and, given the cell mask, segments nuclei, mitochondria and insulin granules in a slice of a fourth, unseen cell with an average Dice of 0.89 (0.91 after post-processing). Ablations show that coarser views improve accuracy and that a compact head on local tokens works best, with the wider context entering through attention in the encoder.
Figures & tables
| MuViT | ||||
| Step | Avg. Dice | Avg. Dice | ||
| 1) No Aug., no padding | 0.8009 | – | 0.7904 | – |
| 2) + Aug. | 0.8778 | 0.8659 | ||
| 3) + Aug. + Border padding | 0.8787 | 0.8824 | ||
| View / patch (px) | S.H. kernel | Raw | +TTA3 | +Post | +TTA3 +Post |
| MuViT | |||||
| / | 0.8819 | 0.8889 | 0.9056 | 0.9076 | |
| (507 tokens) | ( 0.0081) | ( 0.0094) | ( 0.0060) | ( 0.0069) | |
| 0.8837 | 0.8913 | 0.9041 | 0.9068 | ||
| ( 0.0048) | ( 0.0048) | ( 0.0073) | ( 0.0070) | ||
| / | 0.8808 | 0.8871 | 0.9038 | 0.9049 | |
Appendix figures & tables18 assets
Supplementary material from the paper’s appendix.
Appendix
| Shared with MuViT | ||
| Blocks | Pre-LN transformer blocks with full attention across all resolution levels. | |
| Positions | 2D RoPE on world coordinates. | |
| Masking | Masked tokens are dropped from the encoder and re-inserted before the decoder. | |
| Reconstruction | Masked-patch reconstruction loss on raw pixels. | |
| Per-level decoder | Linear–GELU–LayerNorm input projection and two layers: layer 1 cross-attends to all levels, layer 2 self-attends within the level; a linear unpatchify layer ends the decoder. | |
| Ours | MuViT | |
| Class frequency (%) | Labels | ||||||||
| Cell | Shape ( ) | In-cell (%) | Unc. | Nuc. | Gran. | Mito. | Slices (train/val) | Training | Validation |
| c1 | 42.3 | 60.3 | 12.5 | 20.5 | 6.7 | 912/162 | 3,399 | 1,236 | |
| c2 | 37.0 | 58.0 | 13.9 | 18.4 | 9.7 | 841/149 | 3,302 | 1,178 | |
| c3 | 37.5 | 55.4 | 11.4 | 28.2 | 4.9 | 858/152 | 3,328 | 1,182 | |
| c1–c3 | 39.0 | 58.0 | 12.6 | 22.4 | 7.0 | 2,611/463 | 10,029 | 3,596 | |
| high_c4 (evaluation) | 32.1 | 55.6 | 13.4 | 19.1 | 11.9 | none | none | ||
| Transformation | Probability | Parameters |
| Any augmentation | 0.8 | – |
| Geometry | ||
| Flip (one axis) | 0.5 | – |
| Quarter turns | 0.5 | turns of , uniform |
| Rotation | 0.3 | angle |
| Elastic deformation | 0.3 | control grid, displacement per component, (slice px), zero at the center |
| Seed | Nuc. | Gran. | Mito. | Unc. | Avg. Dice |
| TTA3 and post-processing | |||||
| 54 | 0.9794 | 0.8169 | 0.9201 | 0.9279 | 0.9111 |
| 74 | 0.9782 | 0.8169 | 0.9274 | 0.9270 | 0.9124 |
| 313 | 0.9757 | 0.8023 | 0.9173 | 0.9186 | 0.9035 |
| Mean | 0.9778 | 0.8120 | 0.9216 | 0.9245 | 0.9090 |
| 0.0048 | |||||
| View / patch size (px) | S.H. kernel | M1 | M2 | M3 | M4 | ||
| / | 0.7114 | 0.7479 | 0.7502 | 0.7334 | |||
| / | 0.7352 | 0.7503 | 0.7642 | 0.7622 | |||
| 0.7333 | 0.7446 | 0.7600 | 0.7600 | ||||
| / | 0.7688 | 0.7626 | 0.7470 | 0.7483 | |||
| 0.7437 | 0.7733 | 0.7734 | 0.7758 | ||||
| / | 0.7860 | 0.7843 | 0.7584 | 0.7946 |
| Center token in every view | 54 | 74 | 313 | Mean SD |
| Base | 0.8951 | 0.8938 | 0.8819 | 0.8903 0.0073 |
| Visible | 0.8770 | 0.8903 | 0.8805 | 0.8826 0.0069 |
| Avg. Dice | ||||
| View / patch size (px) | S.H. kernel | Without aug. | With aug. | |
| / | 0.7999 | 0.8762 | ||
| 0.8194 | 0.8738 | |||
| / | 0.7593 | 0.8507 | ||
| 0.7829 | 0.8630 | |||
| Avg. Dice | ||||
| View / patch size (px) | S.H. kernel | Without pad. | With pad. | |
| / | 0.8762 | 0.8843 | ||
| 0.8738 | 0.8811 | |||
| / | 0.8507 | 0.8768 | ||
| 0.8630 | 0.8873 | |||
| (a) Labels and scored pixels | ||
| Training labels, without pad. | 9,922 | 8,365 |
| Training labels, with pad. | 10,029 | 10,029 |
| Added by padding | ( ) | ( ) |
| Validation labels, without pad. | 3,551 | 3,022 |
| Validation labels, with pad. | 3,596 | 3,596 |
| View / patch (px) | Scales | 54 | 74 | 313 | Mean SD |
| MuViT | |||||
| 0.8375 | 0.8531 | 0.8540 | 0.8482 0.0093 | ||
| 0.8702 | 0.8778 | 0.8662 | 0.8714 0.0059 | ||
| 0.8627 | 0.8635 | 0.8621 | 0.8627 0.0007 | ||
| 0.8882 | 0.8843 | 0.8786 | 0.8837 0.0048 | ||
| Avg. Dice, scales | ||||
| View / patch size (px) | S.H. kernel | |||
| / | 0.8843 | 0.8865 | ||
| 0.8811 | 0.8843 | |||
| (all) | 0.8389 | 0.8523 | ||
| / | 0.8768 | 0.8712 | ||
| MuViT | |||||||
| View / patch size (px) | Patch grid | Tokens | S.H. kernel | Avg. Dice | Avg. Dice | ||
| (a) Before augmentation, patches | |||||||
| / | 243 | 0.7999 | – | 0.8298 | – | ||
| 0.8194 | – | 0.8130 | – | ||||
| / | 1323 | 0.7719 | 0.7787 | ||||
| 0.8069 | 0.7933 | ||||||
| Raw | TTA3 | Post | TTA3 + Post | Epoch | |||||||||||||
| View / patch size (px) | Tokens | S.H. kernel | Params (M) | 54 | 74 | 313 | Mean SD | Mean SD | 54 | 74 | 313 | Mean SD | Mean SD | 54 | 74 | 313 | Mean |
| MuViT | |||||||||||||||||
| / | 507 | 6.47 | 0.8911 | 0.8791 | 0.8756 | 0.8819 | 0.8889 | 0.9116 | 0.9055 | 0.8996 | 0.9056 | 0.9076 | 210 | 166 | 196 | 190.7 | |
| 0.0081 | 0.0094 | 0.0060 | 0.0069 | ||||||||||||||
| 7.25 | 0.8882 | 0.8843 | 0.8786 | 0.8837 | 0.8913 | 0.9123 | 0.9020 | 0.8981 | 0.9041 | 0.9068 | 201 | 210 | 126 | 179.0 | |||
| 0.0048 | 0.0048 | 0.0073 | 0.0070 | ||||||||||||||
| Raw | Post | TTA3 | ||||||||
| View / patch size (px) | S.H. kernel | 577 | 627 | 577 | 627 | 577 | 627 | |||
| MuViT | ||||||||||
| / | 0.8804 | 0.8819 | 0.9046 | 0.9056 | 0.8878 | 0.8889 | ||||
| 0.0065 | 0.0081 | 0.0053 | 0.0060 | 0.0066 | 0.0094 | |||||
| 0.8827 | 0.8837 | 0.9038 | 0.9041 | 0.8907 | 0.8913 | |||||
| 0.0041 | 0.0048 | 0.0087 | 0.0073 | 0.0039 | 0.0048 | |||||
| Raw | TTA3, no post-processing | TTA3 and post-processing | |||||||||||||
| Slice | Nuc. | Gran. | Mito. | Unc. | Avg. Dice | Nuc. | Gran. | Mito. | Unc. | Avg. Dice | Nuc. | Gran. | Mito. | Unc. | Avg. Dice |
| 251 | 0.9369 | 0.8245 | 0.8015 | 0.8959 | 0.8647 | 0.9435 | 0.8367 | 0.8196 | 0.9041 | 0.8760 | 0.9496 | 0.8501 | 0.8766 | 0.9194 | 0.8989 |
| 276 | 0.9695 | 0.7700 | 0.8186 | 0.8946 | 0.8632 | 0.9711 | 0.7821 | 0.8316 | 0.9013 | 0.8715 | 0.9746 | 0.8026 | 0.8770 | 0.9184 | 0.8931 |
| 301 | 0.9652 | 0.7619 | 0.8392 | 0.8875 | 0.8635 | 0.9668 | 0.7729 | 0.8529 | 0.8943 | 0.8717 | 0.9706 | 0.7885 | 0.8808 | 0.9063 | 0.8865 |
| 326 | 0.9593 | 0.7885 | 0.8635 | 0.8881 | 0.8748 | 0.9600 | 0.7981 | 0.8752 | 0.8937 | 0.8818 | 0.9616 | 0.8055 | 0.9012 | 0.9037 | 0.8930 |
| 351 | 0.9699 | 0.7772 | 0.7808 | 0.8867 | 0.8537 | 0.9704 | 0.7875 | 0.7895 | 0.8928 | 0.8600 | 0.9700 | 0.7953 | 0.8495 | 0.9054 | 0.8801 |