FocusSDF: Boundary-Aware Learning for Medical Image Segmentation via Signed Distance Supervision
Muzammal Shafique, Nasir Rahim, Jamil Ahmad, Mohammad Siadat, Khalid Malik, Ghaus Malik
TL;DR
FocusSDF tackles boundary preservation in medical image segmentation by introducing a boundary-aware loss based on signed distance functions (SDFs). The loss adaptively weights pixel errors by distance to the nearest boundary and adds a gradient-consistency term to stabilize optimization, with the formulation $ abla$-based penalties and distance-based weights governed by parameters such as $\,\gamma$ and $\lambda$. Extensive experiments across UNet, UNet++, SwinUNetR, TransUNet, and the MedSAM foundation model on four modalities (DSA, CTA, MRI, ultrasound) show that FocusSDF consistently improves boundary accuracy and segmentation overlap, outperforming existing distance-based losses. The results highlight strong generalization across architectures and modalities, while also noting limited but non-negligible transferability of foundation models like MedSAM, motivating future work toward 3D volumetric and multi-class extensions for improved geometric consistency.
Abstract
Segmentation of medical images constitutes an essential component of medical image analysis, providing the foundation for precise diagnosis and efficient therapeutic interventions in clinical practices. Despite substantial progress, most segmentation models do not explicitly encode boundary information; as a result, making boundary preservation a persistent challenge in medical image segmentation. To address this challenge, we introduce FocusSDF, a novel loss function based on the signed distance functions (SDFs), which redirects the network to concentrate on boundary regions by adaptively assigning higher weights to pixels closer to the lesion or organ boundary, effectively making it boundary aware. To rigorously validate FocusSDF, we perform extensive evaluations against five state-of-the-art medical image segmentation models, including the foundation model MedSAM, using four distance-based loss functions across diverse datasets covering cerebral aneurysm, stroke, liver, and breast tumor segmentation tasks spanning multiple imaging modalities. The experimental results consistently demonstrate the superior performance of FocusSDF over existing distance transform based loss functions.
