Distance transform regression for spatially-aware deep semantic segmentation

Nicolas Audebert, Alexandre Boulch, Bertrand Le Saux, Sébastien LefèvrearXiv 2019

TL;DR

This paper proposes a simple yet effective multi-task learning strategy to sharpen semantic segmentation boundaries by jointly regressing a signed distance transform (SDT). By teaching deep networks to estimate spatial proximity to class boundaries alongside standard classification, the authors achieve more regular shapes and cleaner segmentations with minimal computational overhead and no complex post-processing.

What Problem Does This Paper Address?

While Fully Convolutional Networks (FCNs) have revolutionized semantic segmentation, they suffer from a fundamental flaw: they are often "spatially blind." Because these networks typically perform independent pixel-wise classification, the resulting maps often feature blurry boundaries, "salt-and-pepper" noise, and objects that lack connectivity or convexity.

To fix this, researchers often turn to post-processing techniques like Conditional Random Fields (CRFs) or complex, hand-crafted loss functions. However, these methods can be computationally expensive, difficult to implement, and often break the elegant end-to-end learning paradigm of deep learning. The authors seek a "straightforward" way to embed spatial awareness directly into the network's loss function.

Methods

The core innovation is treating the Signed Distance Transform (SDT) as a regression target in a multi-task setting.

  1. Signed Distance Transform: Instead of using sparse binary masks (where a pixel is either 0 or 1), the authors convert labels into continuous maps. In an SDT, each pixel's value represents its distance to the nearest boundary. Pixels inside an object have positive values, while those outside have negative values.
  2. Preprocessing: To keep the task manageable for the network's receptive field, distances are clipped and normalized to a $[-1, 1]$ range.
  3. Cascaded Multi-task Architecture: The authors modify standard architectures (like SegNet or PSPNet) to first predict these SDT maps. These predicted distances are then concatenated with the high-level feature maps from the previous layer to inform the final classification.
Fig. 1: Different representations of a segmentation label.
  1. Loss Function: The network is trained using a combined loss: $$L = NLLLoss(Z_{seg}, Y_{seg}) + \lambda L1(Z_{dist}, Y_{dist})$$ where $NLL$ is the standard classification loss, $L1$ is the regression loss for the distance transform, and $\lambda$ is a hyperparameter controlling the regularization strength.
Fig. 2: Multi-task learning framework by performing both distance regression and pixel-wise classification. Convolutional layers are in blue and non-linear activations are in green, while feature maps are in brown.

Datasets

The authors validated their approach across a diverse set of benchmarks to prove its generalizability:

  • ISPRS (Vaihingen & Potsdam): High-resolution aerial imagery for urban classification.
  • INRIA Aerial Image Labeling: A large-scale benchmark focused on building footprint extraction across different cities.
  • SUN RGB-D: Indoor scene understanding using both color and depth information.
  • CamVid: A classic urban driving dataset for road scene segmentation.
  • Data Fusion Contest 2015: Extremely high-resolution aerial data.

Key Insights and Ideas

  • Spatial Cues as Regularizers: Learning the SDT forces the network to learn the underlying spatial structure of the data. It's not just learning "what" a pixel is, but "where" it is relative to object boundaries.
  • Regression vs. Classification: The authors found that regression on the continuous SDT is superior to discretizing/quantizing the distances into classes.
  • Multi-task Synergy: Interestingly, training for regression alone performs worse than classification. The magic happens when the two tasks are learned jointly; the distance regression acts as a powerful proxy that regularizes the main segmentation task.
  • Architecture Agnostic: The method requires almost no structural changes, making it easy to "plug and play" into existing state-of-the-art models like PSPNet or DenseUNet.

Key Results

The inclusion of SDT regression consistently improved performance across all datasets:

  • INRIA Benchmark: The method improved the Intersection over Union (IoU) by 0.47 and helped eliminate many false positives and "holes" in building predictions.
  • CamVid: On the DenseUNet architecture, adding SDT regression boosted the mean IoU (mIoU) by 2.1% and overall accuracy by 1.0%.
  • Qualitative Improvements: The segmentations produced are visibly smoother and more consistent. In aerial imagery, building corners are sharper; in driving scenes, sidewalks and poles maintain better connectivity.
  • Hyperparameter Robustness: The authors found that $\lambda = 2$ was a robust choice, effectively balancing the gradients from both the classification and regression tasks.

Limitations and Future Work

  • Void Pixels: The authors noted that "void" or unlabeled pixels (common in datasets like CamVid) can introduce noise into the distance labels, which slightly degrades performance for classes like "road" or "sky" that border these areas.
  • Computational Bottleneck: Currently, the SDT is computed on the CPU during the first epoch and cached. A fast GPU implementation would further streamline the training process.
  • Fusion Mechanisms: While concatenation worked well, the authors suggest that exploring more sophisticated ways to fuse distance information with feature maps (beyond simple concatenation) could yield even better results.

Summary updated

BibTeX
@misc{audebert2019distance,
  author = {Nicolas Audebert and Alexandre Boulch and Bertrand Le Saux and Sébastien Lefèvre},
  title = {{Distance transform regression for spatially-aware deep semantic segmentation}},
  year = {2019},
  eprint = {1909.01671},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1909.01671},
}
Figure