AttnEdge: an enhanced edge detection method based on self-attention mechanism
Ming Wang · 2025
We introduce a novel approach to edge detection named AttnEdge, which combines pixel differential convolution with advanced post-processing techniques to enhance the detection and representation of image edges. This approach utilizes Pixel Difference Convolution (PDC) to directly learn edge features at the pixel level, enhancing the ability to handle complex boundaries and multi-scale features within images. Significantly, AttnEdge integrates a self-attention mechanism to capture global dependencies and refine feature representations, greatly improving the accuracy of edge detection. Attention mechanism plays a key role in edge detection model, which can significantly improve edge recognition accuracy and model robustness by analyzing global dependencies among pixels. It helps the model effectively distinguish between noise and real edges in complex backgrounds and optimizes detection results. The post-processing stage, featuring Gaussian blur and adaptive thresholding, further refines edge detection by reducing noise and dynamically adjusting to local brightness variations, ensuring robust and reliable edge detection across various scenarios. Furthermore, we have augmented the traditional convolution operations with innovations such as channel reduction in the self-attention mechanism, which reduces computational complexity while maintaining high performance. Experiments on the BSDS500 dataset demonstrate the superiority of AttnEdge over existing methods like PiDiNet, particularly in terms of structural similarity and noise resilience, making it a promising solution for advanced edge detection tasks.