Constrained-CNN losses for weakly supervised segmentation

Hoel Kervadec, Jose Dolz, Meng Tang, Eric Granger, Yuri Boykov, Ismail Ben Ayed

Abstract

Deep learning models for medical image segmentation typically require extensive pixel-level annotations, which are costly and time-consuming to acquire. Weakly supervised methods offer a more efficient alternative but often involve complex, unstable optimization procedures. This paper introduces a simple yet effective approach: a differentiable penalty loss that enforces size constraints directly during training. By incorporating prior knowledge about the target object's volume, the proposed method achieves performance comparable to full supervision using only a fraction of the labeled pixels, while maintaining the computational efficiency of standard cross-entropy training.

Introduction

The "annotation bottleneck" remains a significant challenge in medical image analysis. While fully supervised convolutional neural networks (CNNs) excel at segmentation, they demand exhaustive manual labeling. Weak supervision—utilizing image-level tags, scribbles, or single points—significantly reduces the annotation burden. However, training networks with such sparse signals requires additional guidance, often in the form of spatial or geometric priors.

Previous attempts to integrate these priors, such as Lagrangian dual optimization, are often computationally expensive and difficult to implement. These methods typically alternate between network training and solving secondary optimization problems, leading to instability. This paper proposes a "soft" penalty approach that integrates size constraints directly into the loss function, allowing for seamless optimization via standard stochastic gradient descent (SGD).

Methodology

The proposed framework, termed Constrained-CNN loss, combines two primary components: a partial cross-entropy loss and a differentiable size penalty.

Partial Cross-Entropy

The network is trained on the available weak labels (e.g., a few pixels or a small region) using a standard cross-entropy loss. This ensures the network learns from the ground-truth information provided, however sparse it may be.

Size Constraints as Differentiable Penalties

To guide the network in regions without labels, the authors introduce a penalty term, $C(V_S)$, based on the predicted volume $V_S$ of the target segment. Unlike hard constraints, this term acts as a soft regularizer.

Extracted figure from page 6 of Constrained-CNN losses for weakly supervised segmentation

As shown in the figure above, the penalty is defined such that it is zero if the predicted size $V_S$ falls within a predefined range $[a, b]$. If the prediction falls outside this range, the penalty increases quadratically. Because this function is differentiable, the network can use its gradient to adjust pixel probabilities—effectively expanding the region if it is too small or shrinking it if it is too large.

Experiments and Results

The method was evaluated on three medical imaging datasets: Left-ventricle (LV) cine MRI (ACDC 2017), Vertebral Body (VB) MR-T2, and Prostate MR-T2. Weak supervision was simulated using "eroded" labels or random points, representing as little as 0.02% to 0.1% of the total pixels.

Performance and Accuracy

On the LV dataset, the proposed method achieved a Dice Similarity Coefficient (DSC) of 0.87, nearly matching the 0.88 achieved with full supervision. This significantly outperformed the previous state-of-the-art Lagrangian method, which reached only 0.79. Furthermore, a hybrid training approach—combining 5 fully annotated patients with 145 weakly annotated ones—yielded better results than training on 25 fully annotated patients alone.

Computational Efficiency

A key advantage of the penalty-based approach is its speed. Training time was recorded at 113ms per batch, identical to standard supervised training. In contrast, the Lagrangian approach was up to six times slower (675ms per batch) due to the complexity of the dual optimization steps.

Discussion and Conclusion

The results suggest that a "sub-optimal" penalty approach is more compatible with the stochastic nature of CNN training than theoretically "optimal" Lagrangian methods. The smooth gradients provided by the quadratic penalty avoid the instability and "self-teaching" biases often found in proposal-based weakly supervised methods.

While the method requires prior knowledge of object size and does not provide hard guarantees on constraint satisfaction, its simplicity and performance make it a powerful tool for scaling medical image segmentation. Future work may extend this framework to non-linear constraints, such as shape moments or intensity statistics, further enhancing the robustness of weakly supervised learning.

Summary updated

BibTeX
@article{kervadec2019constrained,
  author = {Hoel Kervadec and Jose Dolz and Meng Tang and Eric Granger and Yuri Boykov and Ismail Ben Ayed},
  title = {{Constrained-CNN losses for weakly supervised segmentation}},
  journal = {Medical Image Analysis},
  year = {2019},
  doi = {10.1016/j.media.2019.02.009},
}
Figure