We present CSSL, a contrastive semi-supervised method for medical image segmentation. CSSL samples class-wise patches from labelled images and from confident pseudo-labels, separates their embeddings with a supervised contrastive loss with mixed hard negatives, and uses the Silhouette coefficient of the embedding clusters to set the strength of a feature-perturbation consistency loss. On MoNuSeg, patch embeddings are obtained by masked pooling of the encoder features of the unmasked image, nucleus rims form an additional contrastive class and a memory bank stores past embeddings; on CHAOS, patches are pixel-masked and no memory bank is used. The CSSL losses are added to a weak-to-strong pseudo-labelling recipe. We follow the protocols of published baselines: Self-Loop on MoNuSeg and DAFNet on CHAOS. On MoNuSeg with 50% labels, CSSL reaches 80.87 ± 0.17 nuclei F1 over three label splits, compared with 79.10 for Self-Loop and 78.73 for the same recipe without CSSL. On CHAOS T2 with 25% labels, CSSL reaches 89.01 Dice, compared with 82.0 for DAFNet and 88.94 for the recipe alone. Ablations show that the contrastive branch and, on MoNuSeg, the boundary class and feature-level pooling account for most of the improvement. Code: https://github.com/prinshul/CSSL
Figures & tables
Figure 1: CSSL on top of the recipe. Gray: the weak-to-strong recipe, identical in every semi-supervised run of this paper. Blue: CSSL’s components. Class-wise patches from labels and confident pseudo-labels are embedded by masked pooling of encoder features. A supervised contrastive loss with mixed hard negatives and a memory bank separates them. The Silhouette coefficient of the embedding clusters sets the noise level λ of a feature-perturbation consistency loss. The diagram shows the MoNuSeg configuration. On CHAOS, embeddings come from pixel-masked patches, no memory bank is used, and the boundary class applies to binary tasks only.
Figure 2: What the contrastive branch sees (synthetic illustration). (a) A 64×64 window. (b) Pixel-level masking: a nucleus patch and a background patch with the pixels of the other class set to zero. (c) Feature-level masking encodes the unmasked image and pools encoder features over the cells covered by the class. The cell shading shows the pooling weight mˉ . (d) The boundary class: nucleus pixels within w=2 pixels of the background (orange) form a separate contrastive class.
Figure 3: Main results. Dots are individual label splits (MoNuSeg seeds; DAFNet’s CHAOS splits). Horizontal ticks (MoNuSeg) and diamonds (CHAOS) are means. Dashed lines are the published baselines. CHAOS uses the best-validation checkpoint (DAFNet’s rule).
Table 1: MoNuSeg, 50% labels (15 of 30 training images), nuclei F1 (%) on the 14 test images, final weights. Published numbers are single runs on an unspecified labelled subset. Ours are three random labelled subsets with the same ResUNet-18.
Semi-supervised medical image segmentation uses labeled and unlabeled scans to train models that delineate organs, lesions, and tissues with fewer annotations.