The Ultimate Guide to Edge Detection Algorithms in 2026
Edge detection is a fundamental task in computer vision and image processing that aims to identify points in a digital image where the image brightness changes sharply or has discontinuities. The purpose of edge detection is to capture important events and changes in properties of the world, and it can be used for image segmentation, feature extraction, and object recognition.
Classical edge detection methods, such as the Sobel, Prewitt, and Canny edge detectors, have been widely used for decades. However, these methods rely on hand-crafted features and thresholds, and often fail to generalize well to complex images in the real world. In recent years, deep learning techniques have revolutionized the field of edge detection, yielding significant improvements in accuracy and robustness.
In this guide, we‘ll take a comprehensive look at the latest edge detection algorithms based on deep learning, and compare them to classical methods. Whether you‘re a researcher, engineer, or student, understanding these techniques is essential for anyone working in computer vision today.
Classical Edge Detection Algorithms
Before diving into deep learning, let‘s briefly review some classical edge detection algorithms:
Sobel and Prewitt:
The Sobel and Prewitt operators compute the gradient of image intensity in the vertical and horizontal directions by applying convolution with a fixed 3×3 kernel. The magnitude of the gradient is then thresholded to obtain a binary edge map. While simple and efficient, these methods are very sensitive to noise.
Canny Edge Detector:
The Canny edge detector improves upon the Sobel operator by applying additional steps:
- Gaussian smoothing to reduce noise
- Non-maximum suppression to thin edges
- Hysteresis thresholding using low and high thresholds to remove weak edges
These steps enable the Canny detector to achieve better edge localization and connectivity than Sobel/Prewitt, but it still relies on hand-tuned parameters and thresholds.

While classical methods work well for simple images, they often struggle on more complex, real-world imagery with textures, shadows, and inconsistent illumination. The key limitation is that the low-level features used by these methods are not robust or discriminative enough.
Deep Learning-Based Edge Detection
In the past decade, deep learning has achieved remarkable success on a range of computer vision tasks, far surpassing the performance of classical methods. The key idea is to leverage the power of deep neural networks to automatically learn rich, hierarchical features from data, rather than relying on hand-crafted features.
Several groundbreaking works have applied deep learning to edge detection, achieving state-of-the-art performance:
Holistically-Nested Edge Detection (HED)
Holistically-Nested Edge Detection (HED), introduced by Xie and Tu in 2015, was one of the first deep learning models for edge detection. HED improves upon the VGGNet architecture by adding side output layers to the last convolutional layer at each stage (conv1_2, conv2_2, conv3_3, conv4_3, conv5_3). The side outputs are then fused by a "weighted-fusion" layer to make the final prediction.

A key innovation of HED is the use of deeply-supervised learning, where each side output is optimized w.r.t the ground truth. This extra supervision enables the side outputs to capture edges at multiple scales and abstractions. The weighted-fusion layer automatically learns how to combine the multi-scale edge maps in an optimal way.
At test time, HED runs a forward pass on the input image and averages the edge maps produced by each side output. This gives thicker, more salient edges compared to any individual side output.
RCF (Richer Convolutional Features)
RCF, proposed by Liu et al., is another influential deep learning edge detector. The key idea is to enrich the convolutional features by exploiting multi-level and multi-scale information from all the convolution layers in VGGNet (13 conv layers in total).
Specifically, RCF adds a 1×1 conv layer after each conv layer to convert the feature maps to a single channel edge map. A fusion layer then combines the edge maps using a weighted average. The loss function is computed on the individual edge maps and the fused edge map. Similar to HED, the supervision on early conv layers guides them to extract low-level edges.

One notable advantage of RCF compared to HED is it does not require deep layer features to achieve good performance. This makes RCF much more efficient: 2.5x faster than HED and uses only 1/6 the parameters. RCF can also transfer to other domains like document images more easily.
CED (Crisp Edge Detector)
Wang et al. proposed CED in 2017, which aims to predict crisp (thin) edges in a single feed-forward pass. The key novelties are:
- a carefully designed loss function that encourages binary edge predictions
- a multi-scale hierarchy to extract and fuse features at different scales
- a refinement module to predict crisp edges in a single pass
The backbone is a multi-scale extension of VGG16 that extracts features at 3 scales (1x, 0.5x, 0.25x). The features are fused by upsampling and concatenation. Next, a refinement module containing conv layers with dense connections takes the fused features and makes the final edge prediction.

The loss function combines a sigmoid cross-entropy term and a novel "attentive-based" F-score term. The F-score loss directly optimizes the alignment between the predicted and ground truth edges, and its partial derivatives are tractable. CED with the F-score loss achieves excellent edge localization and surpasses HED and RCF.
DexiNed (Dense Extreme Inception Network)
DexiNed is a more recent edge detector proposed by Soria et al. in 2020 with state-of-the-art performance. The key contributions are a dense extreme inception network architecture and a more effective multi-scale learning strategy.
The backbone of DexiNed is an extreme version of the Inception architecture with rich multi-scale filters (from 1×1 to 7×7). The Inception blocks are densely connected, meaning the output of a block is concatenated with the outputs of all previous blocks. This dense connectivity strengthens feature propagation and encourages feature reuse, leading to better performance and efficiency.

For multi-scale learning, DexiNed extracts 6 side outputs from the backbone using 1×1 convs. The side outputs are progressively upsampled, concatenated, and fused to make the final prediction. Compared to HED and RCF which use element-wise weighted averaging, the dense concatenation enables more effective fusion of multi-scale edge features.
On the BSDS500 and NYUDv2 edge detection benchmarks, DexiNed achieves the best performance across all evaluation metrics, surpassing CED, RCF, and HED by a significant margin (e.g. 3.5% ODS F-score over RCF on BSDS500). This demonstrates the power of the carefully designed architecture innovations.
Comparison of Performance
To compare the performance of different edge detection algorithms, we can evaluate them on standard benchmarks like BSDS500 using metrics such as:
- ODS F-score (Optimal Dataset Scale): the best F-score on the dataset by applying a fixed threshold
- OIS F-score (Optimal Image Scale): the aggregate F-score obtained by selecting an optimal threshold per image
- AP (Average Precision): the area under the precision-recall curve
Here is a comparison table showing the performance of various classical and deep learning edge detectors on BSDS500:
| Method | ODS F-score | OIS F-score | AP |
|---|---|---|---|
| Sobel | 0.598 | 0.615 | 0.563 |
| Canny | 0.611 | 0.624 | 0.579 |
| Pb | 0.672 | 0.695 | 0.636 |
| gPb | 0.726 | 0.760 | 0.727 |
| Sketch Tokens | 0.728 | 0.746 | 0.780 |
| SCG | 0.740 | 0.758 | 0.773 |
| HED | 0.790 | 0.808 | 0.811 |
| RCF | 0.811 | 0.830 | 0.823 |
| CED | 0.815 | 0.834 | 0.833 |
| DexiNed | 0.828 | 0.848 | 0.856 |
As we can see, deep learning approaches have achieved remarkable performance gains compared to classical edge detectors. In particular, the most recent DexiNed outperforms the Canny detector by over 20% in ODS F-score! This shows the power of deep learning to automatically learn robust, high-level features.
Remaining Challenges and Future Directions
While deep learning has achieved impressive results on edge detection, there are still several challenges and opportunities for future research:
-
Efficiency and speed: Current deep learning edge detectors are much slower than classical methods, making it difficult to deploy them in real-time applications. There is a need for more efficient architectures and model compression techniques.
-
Robustness and generalization: Deep learning models are known to be brittle and sensitive to small perturbations or domain shifts. Improving the robustness and out-of-distribution generalization of edge detectors is an important challenge.
-
Edge properties: Most current algorithms only detect the presence of edges, but not their properties like orientation, depth, or semantics. Extracting richer edge information could enable new applications.
-
Integration with other tasks: Edges are rarely the end goal, but rather an intermediate representation for other vision tasks like segmentation, 3D reconstruction, or visual SLAM. Exploring multi-task learning or joint optimization with downstream tasks is a promising direction.
-
Unsupervised/self-supervised learning: Creating large-scale annotated datasets for edge detection is very costly. Developing unsupervised or self-supervised learning techniques that can learn from unlabeled images or videos would greatly improve the scalability of these approaches.
Conclusion
In this guide, we‘ve taken a comprehensive look at edge detection algorithms, from classical methods like Canny to state-of-the-art deep learning approaches like DexiNed.
The key takeaways are:
- Edge detection is a fundamental problem in computer vision with many applications
- Classical edge detectors like Canny rely on hand-crafted features and often struggle on complex images
- Deep learning has revolutionized edge detection, enabling automatic learning of robust, hierarchical features
- Modern deep learning edge detectors like HED, RCF, CED and DexiNed significantly outperform classical approaches on standard benchmarks
- Key innovations include multi-scale learning, carefully designed loss functions, dense connectivity, and feature fusion
- There remain challenges and opportunities in improving efficiency, robustness, edge properties, task integration, and unsupervised learning
We encourage the reader to try implementing these algorithms and evaluate them on their own data or applications. The field of edge detection continues to evolve rapidly, and understanding these techniques is essential for anyone working in computer vision.