Table of Contents
Fetching ...

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.

FocusSDF: Boundary-Aware Learning for Medical Image Segmentation via Signed Distance Supervision

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 -based penalties and distance-based weights governed by parameters such as and . 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.

Paper Structure

This paper contains 9 sections, 4 equations, 5 figures, 2 tables.

Figures (5)

  • Figure 1: Challenges in medical image segmentation across different modalities: (a) DSA: a partially hidden aneurysm behind the cluttered arteries and loops having similar dye contrasts, (b) CTA: an overlapping soft tissues with liver due to low tissue contrast, (c) MRI: an irregular boundaries and identical contrast of stroke and healthy tissue, and (d) Ultrasound: similar tumor and healthy tissue structure in breast.
  • Figure 2: SDF representation of Binary Masks.
  • Figure 3: (a) Visualization of exponential weighting that highlights boundary pixels and suppresses distant regions. (b) Spatial heatmap showing higher weights near boundaries and reduced weights in distant regions for $\gamma = 0.005$.
  • Figure 4: Validation performance of models on aneurysm segmentation dataset.
  • Figure 5: Qualitative comparison of segmentation outputs across datasets. Incorporating the proposed FocusSDF loss alongside the Dice loss yields superior boundary precision and structural continuity preservation compared to using the Dice loss alone. Mispredictions with dice loss are encircled as shown.