ECT: Fine-grained edge detection with learned cause tokens

Shaocong Xu, Xiaoxue Chen, Yuhang Zheng, Guyue Zhou, Yurong Chen, Hongbin Zha, Hao Zhao

TL;DR

ECT (Edge Cause Tokens) is a new transformer-based framework that moves beyond simply finding edges to identifying why they exist—whether due to changes in reflectance, illumination, surface normals, or depth. By using a two-stage architecture with learnable "cause tokens" and a novel alignment loss, the model achieves state-of-the-art performance, particularly in the challenging task of detecting illumination-driven edges.

What Problem Does This Paper Address?

Most edge detection algorithms focus on Generic Edges (GEs)—finding any boundary where pixel intensity changes. However, for tasks like shadow removal, 3D reconstruction, or autonomous navigation, knowing the cause of an edge is vital. These are called Fine-grained Edges, categorized into the RIND types:

  1. Reflectance (changes in material/color)
  2. Illumination (shadows or light sources)
  3. Normal (changes in surface orientation)
  4. Depth (occlusions or distance discontinuities)

Previous state-of-the-art methods (like RINDNet) struggled with three main issues:

  • Locality: They relied on Convolutions (CNNs), which have small receptive fields. It is often impossible to tell if an edge is a shadow or a depth change without looking at the wider context of the scene.
  • Fixed Priors: They used fixed prediction heads for each edge type, which couldn't adapt to different image contents.
  • Inconsistency: They often predicted fine-grained edges that didn't actually align with the generic edges, violating the logical rule that every specific edge must also be a general edge.

Methods

The authors propose ECT, a two-stage transformer-based network:

  1. Two-Stage Prediction: The model first predicts generic edges (the "easier" task) and then uses those features to predict the four fine-grained types. This mimics human logic: we see an edge first, then determine its cause.
  2. Learned Cause Tokens: Instead of fixed heads, the authors introduce four learnable "cause tokens" (one for each RIND category). These tokens pass through a Cause-aware Decoder where they interact with image features via cross-attention. This allows the model to dynamically adapt its "understanding" of what constitutes a reflectance or depth edge based on the specific image.
  3. Global Receptive Field: By using a Vision Transformer (ViT) backbone, the model considers the entire image at once, helping it disambiguate local patches that might look identical but have different causes.
  4. Edge Aggregation and Alignment (EA2) Loss: To ensure consistency, the authors developed a loss function that forces the combination of the four fine-grained outputs to match the generic edge output. It even includes a small "Alignment Network" to handle slight spatial offsets between the stages.

Datasets

The model was evaluated on:

  • BSDS-RIND: The standard benchmark for fine-grained edge detection.
  • Newly Derived Benchmarks: To test how well the model generalizes (transferability), the authors created new test sets from existing datasets:
  • IIW (Intrinsic Images in the Wild) for Reflectance.
  • SBU and ISTD for Illumination.
  • NYUDv2 for Normal and Depth edges.

Key Insights and Ideas

  • Context is King: The "aha moment" here is that fine-grained edge detection is a global problem, not a local one. A red box in the paper shows a patch that looks like a depth edge but is actually a shadow; only by seeing the sky and the house (global context) can the model get it right.
  • Dynamic Priors: By treating the "cause" of an edge as a learnable token (similar to object queries in DETR), the model can "ask" the image features where specific types of edges are likely to be, rather than just filtering for them blindly.
  • Logical Constraints: The EA2 loss enforces a hierarchy. If the model says there is a "Depth Edge" at a pixel, it must also agree there is a "Generic Edge" there. This structural constraint significantly reduces false positives.

Key Results

ECT set a new State-of-the-Art (SOTA) across the board:

  • Illumination Edges (IE): This is the most impressive gain. ECT achieved an Average Precision (AP) of 0.318, a massive 9.6% jump over the previous best (0.222).
  • Overall Performance: On the BSDS-RIND benchmark, ECT outperformed RINDNet and the transformer-based EDTER in every category (Reflectance, Illumination, Normal, and Depth).
  • Efficiency: Despite being a transformer, ECT (145M parameters) is significantly smaller and more efficient than other high-end transformer models like EDTER (468M parameters).

Limitations and Future Work

  • Data Quality: The authors note that the "ground truth" for Normal and Depth edges in their new NYUDv2 benchmark isn't perfect because the source depth maps have inherent noise and imperfections.
  • IE Difficulty: While ECT improved Illumination Edge detection significantly, it remains the hardest category (lowest AP) due to the scarcity of training data compared to other edge types.
  • Real-time Constraints: While more efficient than some transformers, 145M parameters may still be too heavy for real-time edge detection on edge devices (like drones or mobile phones) without further optimization or distillation.

Summary updated

BibTeX
@article{xu2024ect,
  author = {Shaocong Xu and Xiaoxue Chen and Yuhang Zheng and Guyue Zhou and Yurong Chen and Hongbin Zha and Hao Zhao},
  title = {{ECT: Fine-grained edge detection with learned cause tokens}},
  journal = {Image and Vision Computing},
  year = {2024},
  url = {https://openreview.net/forum?id=fX2BttuWGd},
}

Loading related content...

Figure