Holistically-Nested Edge Detection

Saining Xie, Zhuowen Tu

Abstract

We develop a new edge detection algorithm that addresses two critical issues in this long-standing vision problem: (1) holistic image training, and (2) multi-scale feature learning. Our proposed method, holistically-nested edge detection (HED), turns pixel-wise edge classification into image-to-image prediction by means of a deep learning model that leverages fully convolutional neural networks and deeply-supervised nets. HED automatically learns rich hierarchical representations (guided by deep supervision on side responses) that are crucially important in order to approach the human ability to resolve the challenging ambiguity in edge and object boundary detection. We significantly advance the state-of-the-art on the BSD500 dataset (ODS F-score of 0.782) and the NYU Depth dataset (ODS F-score of 0.746), and do so with an improved speed (0.4 second per image) that is orders of magnitude faster than recent CNN-based edge detection algorithms.

Introduction

Edge detection is a fundamental yet challenging problem in computer vision. The primary difficulty lies in the inherent ambiguity of boundaries: a system must distinguish between low-level texture gradients and high-level semantic object boundaries. Traditional methods, such as the Canny detector, rely heavily on local intensity gradients and often fail to capture the "big picture" of a scene.

Early deep learning approaches attempted to solve this by classifying local image patches. However, these methods were computationally inefficient—often taking seconds or hours per image—and struggled to integrate holistic information. Holistically-Nested Edge Detection (HED) addresses these limitations by treating edge detection as an end-to-end image-to-image prediction task, combining the efficiency of fully convolutional networks with the power of multi-scale feature learning.

The HED Architecture

HED is built upon a modified VGG-16 backbone. To transform the classification network into an edge detector, the authors removed the final pooling layer and all fully connected layers. This creates a Fully Convolutional Network (FCN) capable of producing a full-resolution edge map from an input image of any size.

The core innovation of HED is its "nested" structure. The network is divided into five stages, each with a progressively larger receptive field. By attaching "side output" layers to each stage, the model can predict edges at multiple scales simultaneously. To ensure these intermediate layers learn meaningful features, the authors employed "deep supervision," applying a loss function to each side output during training. This forces early layers to focus on fine-grained details while deeper layers capture abstract object contours.

Multi-Scale Learning and Deep Supervision

One of the most significant insights of HED is that hierarchical supervision is essential for resolving edge ambiguity. Without explicit guidance at each layer, intermediate maps often become noisy. In HED, the side outputs are combined through a weighted fusion layer that learns the optimal way to merge multi-scale information into a single, unified prediction.

Figure 1: Visual comparison of HED results. (a) Original image; (b) Ground truth; (c) Final HED output; (d-f) Side outputs at different stages showing hierarchical feature learning; (g-i) Canny detector results at varying scales.

To handle the extreme class imbalance typical of edge detection—where roughly 90% of pixels are non-edges—HED utilizes a class-balanced cross-entropy loss function. This cost-sensitive approach automatically reweights the importance of edge versus non-edge pixels, preventing the model from becoming biased toward the background.

Experimental Results

The authors evaluated HED on two major benchmarks: the BSDS500 and NYU Depth v2 datasets.

  • BSDS500: HED achieved a state-of-the-art ODS F-score of 0.782, significantly outperforming previous methods like Structured Edges (0.746) and nearing the human consistency limit of 0.80.
  • NYU Depth v2: The model demonstrated strong generalization to multi-modal data, achieving an ODS F-score of 0.746 using HHA encoding to process depth information.
  • Efficiency: Perhaps most impressively, HED processes images at 0.4 seconds per frame on a GPU. This represents a 1,000x to 10,000x speedup over previous CNN-based detectors like DeepEdge, making it viable for real-time vision pipelines.

Conclusion and Future Directions

HED represents a major leap in edge detection by successfully merging holistic image training with nested multi-scale learning. While the results are qualitatively and quantitatively superior to traditional methods, some limitations remain. The current model predicts pixel labels independently, occasionally resulting in "thick" edges that require post-processing like non-maximal suppression. Future work may involve integrating structured output methods, such as Conditional Random Fields (CRFs), to further refine edge continuity and thinness.

Summary updated

BibTeX
@inproceedings{xie2015holistically,
  author = {Saining Xie and Zhuowen Tu},
  title = {{Holistically-Nested Edge Detection}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2015},
  url = {https://openreview.net/forum?id=Sy41M-fu-r},
}
Figure