EDMB: Edge Detector with Mamba

Yachuan Li, Xavier Soria Poma, Yun Bai, Qian Xiao, Chaozhi Yang, Guanlin Li, Zongmin LiWACV 2025

TL;DR

This paper introduces EDMB, a novel edge detection model that leverages the efficiency of Vision Mamba to capture both global and fine-grained image features. EDMB addresses the high computational cost of Transformer-based detectors while enabling the generation of multi-granularity edges without requiring multi-label data, a significant advancement for single-label datasets.

What Problem Does This Paper Address?

Edge detection is a fundamental computer vision task crucial for many downstream applications like image segmentation and retrieval. While deep learning has significantly advanced edge detection, existing methods face two major challenges:

  1. High Computational Cost: Transformer-based models, while powerful at capturing long-range dependencies, are computationally expensive, limiting their use on resource-constrained devices and in real-time applications.
  2. Multi-Granularity Edges: Human perception of edges varies, and different tasks require different levels of detail (granularity). Current methods for generating multi-granularity edges typically rely on multi-label datasets, which are scarce. This limits their applicability to more common single-label datasets.

Methods

EDMB proposes a novel architecture that combines Mamba with a global-local approach and introduces a new method for generating multi-granularity edges.

  • Global-Local Mamba Architecture:
    • A global Mamba encoder captures broad contextual information from the image.
  • A fine-grained Mamba encoder focuses on local details within image windows.
  • A CNN-based high-resolution feature encoder is used to preserve precise location information without incurring the high computational cost of Mamba on high-resolution features. This encoder is lightweight, using only a few convolutional layers.
  • Learnable Gaussian Distributions Decoder (LGD):
    • Features from the global, fine-grained, and high-resolution encoders are fused.
  • A decoder predicts the mean ($\mu$) and variance ($\sigma^2$) of learnable Gaussian distributions. These distributions represent edge probabilities.
  • The final edge map is generated by sampling from these distributions.
  • Multi-Granularity Edge Generation without Multi-Label Data:
    • The key innovation is generating multi-granularity edges by adjusting the variance of the learned Gaussian distributions. This is achieved by sampling from $N(\mu, \sigma^2)$ with different values of $\gamma$ in the formula $P = \mu + \gamma\sigma^2$.
  • Crucially, this process is supervised using an Evidence Lower Bound (ELBO) loss. ELBO loss, which includes KL divergence and weighted cross-entropy, allows the model to learn these distributions and their variances without needing explicit multi-label annotations for different granularities. This makes EDMB applicable to single-label datasets.
  • Training Strategy: The model is trained in a multi-stage approach, first focusing on global context and then on local refinement, which helps stabilize training and reduce computational overhead.

Datasets

The paper evaluates EDMB on the following datasets:

  • BSDS500: A popular natural scenes dataset for edge detection, used for both multi-label and single-label evaluation.
  • NYUDv2: An indoor scene dataset, where edge ground truth is derived from segmentation maps.
  • BIPED: A dataset of high-resolution Barcelona Street View images.

Key Insights and Ideas

  • Mamba for Edge Detection: Vision Mamba offers a compelling alternative to Transformers for capturing long-range dependencies in images, providing a significant efficiency advantage without sacrificing performance.
  • Bridging Global and Local: The EDMB architecture effectively combines Mamba's global context modeling with fine-grained Mamba and a lightweight CNN for local details, creating a robust feature representation for edge detection.
  • ELBO for Multi-Granularity Edges: The use of ELBO loss to supervise learnable Gaussian distributions is a breakthrough. It decouples multi-granularity edge generation from the need for multi-label data, vastly expanding the applicability of such methods.
  • Sampling for Granularity: The ability to control edge granularity by sampling from learned Gaussian distributions with varying variances is an elegant and effective approach.

Key Results

  • State-of-the-Art Performance: On the BSDS500 dataset, EDMB achieves a competitive single-granularity ODS of 0.837 and a multi-granularity ODS of 0.851, outperforming many existing methods.
  • Efficiency: EDMB is significantly more efficient than Transformer-based methods like DiffusionEdge, with a model size that is only 1/3 and computational cost reduced by half.
  • Single-Label Dataset Success: EDMB demonstrates strong performance on single-label datasets like NYUDv2 (ODS 0.783) and BIPED (ODS 0.924), achieving new state-of-the-art results on BIPED.
  • Multi-Granularity without Multi-Label: EDMB (the multi-granularity version) achieves the best ODS of 0.851 on BSDS500, surpassing methods like UAED and MuGE*, while importantly not requiring multi-label data.

Limitations and Future Work

  • Computational Cost: While more efficient than Transformers, EDMB's computational cost is still higher than traditional CNNs.
  • Downstream Task Application: The paper acknowledges a lack of discussion on how the generated multi-granularity edges can be effectively utilized in downstream tasks. Future work could explore this integration.
  • Hyperparameter Tuning: The effectiveness of multi-granularity generation is influenced by hyperparameter choices (e.g., $\gamma$), and further research could explore more automated or robust methods for selecting these parameters.

Summary updated

BibTeX
@inproceedings{li2025edmb,
  author = {Yachuan Li and Xavier Soria Poma and Yun Bai and Qian Xiao and Chaozhi Yang and Guanlin Li and Zongmin Li},
  title = {{EDMB: Edge Detector with Mamba}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2025},
}
Figure