NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

High-Resolution Boundary Detection for Medical Image Segmentation with Piece-Wise Two-Sample T-Test Augmented Loss

Yucong Lin, Jinhua Su, Yuhang Li, Yuhao Wei, Hanchao Yan, Saining Zhang, Jiaan Luo, Danni Ai, Hong Song, Jingfan Fan, Tianyu Fu, Deqiang Xiao, Feifei Wang, Jue Hou, Jian YangarXiv 2022

Abstract

Deep learning methods have contributed substantially to the rapid advancement of medical image segmentation, the quality of which relies on the suitable design of loss functions. Popular loss functions, including the cross-entropy and dice losses, often fall short of boundary detection, thereby limiting high-resolution downstream applications such as automated diagnoses and procedures. We developed a novel loss function that is tailored to reflect the boundary information to enhance the boundary detection. As the contrast between segmentation and background regions along the classification boundary naturally induces heterogeneity over the pixels, we propose the piece-wise two-sample t-test augmented (PTA) loss that is infused with the statistical test for such heterogeneity. We demonstrate the improved boundary detection power of the PTA loss compared to benchmark losses without a t-test component.

Introduction

In medical imaging, precise segmentation is essential for downstream clinical tasks such as surgical planning and automated diagnosis. While deep learning models excel at identifying general organ regions, they frequently struggle with boundary precision. Standard loss functions, such as Cross-Entropy or Dice Loss, are primarily region-based, prioritizing the total count of correctly classified pixels. Since boundary pixels constitute only a small fraction of the total image, these models often produce fuzzy or anatomically unrealistic edges. To address this, we propose a loss function specifically designed to sharpen boundaries by leveraging statistical heterogeneity.

Methodology: Piece-wise Two-sample T-test Augmented (PTA) Loss

The PTA loss introduces classical statistical rigor into the training of neural networks. The fundamental intuition is that for an accurate segmentation, the intensity values of pixels just inside the boundary should differ significantly from those just outside.

Statistical Buffer Regions

The method defines two narrow "buffer" regions for a predicted boundary: $B_S^+$ (immediately outside) and $B_S^-$ (immediately inside). These regions serve as the populations for statistical comparison.

Conceptual diagram showing the boundary $\partial S$ and the surrounding buffer regions $B_S^+$ and $B_S^-$.

The Two-Sample T-Test

Rather than a simple comparison of means, the PTA loss employs a two-sample t-test. This approach accounts for variance (heteroscedasticity) within the regions. By considering the noise level of the pixels, the t-test provides a more robust signal; a boundary is deemed "real" only if the difference in pixel values is statistically significant relative to the internal variance of the tissues.

Piece-wise Adaptation

To accommodate complex anatomical structures, the boundary is divided into $K$ local segments. A t-test is calculated for each segment, allowing the model to adapt to varying textures and patterns along the organ's edge. This piece-wise approach provides granular feedback during backpropagation, pinpointing specific areas where the predicted shape deviates from the ground truth.

Practical application of the buffer regions $B_S^+$ (green) and $B_S^-$ (blue) on a cardiac MRI image.

Experimental Setup

The PTA loss was evaluated using two primary datasets:

  1. Synthetic Data: A 60x60 pixel square with Gaussian noise, used to measure sensitivity to boundary shifts, resizing, and blurring.
  2. ACDC Challenge Dataset: Cardiac cine MRI images from 100 patients, featuring gold-standard masks for the Left Ventricle (LV), Right Ventricle (RV), and Myocardium (Myo).

The loss was integrated as an additive term to standard base losses (Dice or Cross-Entropy) across three architectures: FCN, U-Net, and nnU-Net.

Results and Discussion

The inclusion of the PTA loss led to consistent improvements across multiple performance metrics. Notably, boundary-specific metrics showed the most significant gains. For instance, in a U-Net architecture using Cross-Entropy, the addition of PTA loss reduced the Average Symmetric Surface Distance (ASSD) from 0.7901 to 0.6469.

The Right Ventricle (RV), characterized by its complex and elongated boundary, saw the most substantial benefit. Furthermore, PTA outperformed Active Contour Loss (ACL), suggesting that the statistical t-test approach is superior to traditional differential operators for capturing edge information in noisy medical images.

Conclusion and Future Work

The PTA loss successfully bridges classical statistics and deep learning to enhance boundary detection in medical image segmentation. By treating boundary detection as a problem of maximizing statistical significance between pixel populations, it produces sharper, more anatomically accurate results.

However, some limitations remain. The current implementation introduces a hyperparameter $\lambda$ to balance the boundary loss with the region loss, which currently requires grid search for optimization. Additionally, while the method is designed for grayscale images, future work will explore extending it to multi-channel color images and investigating more complex multivariate hypothesis tests to capture richer texture information at the boundaries.

Summary updated

BibTeX
@misc{lin2022high,
  author = {Yucong Lin and Jinhua Su and Yuhang Li and Yuhao Wei and Hanchao Yan and Saining Zhang and Jiaan Luo and Danni Ai and Hong Song and Jingfan Fan and Tianyu Fu and Deqiang Xiao and Feifei Wang and Jue Hou and Jian Yang},
  title = {{High-Resolution Boundary Detection for Medical Image Segmentation with Piece-Wise Two-Sample T-Test Augmented Loss}},
  year = {2022},
  eprint = {2211.02419},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2211.02419},
}
Figure