EasyControlEdge: A Foundation-Model Fine-Tuning for Edge Detection

Hiroki Nakamura, Hiroto Iino, Masashi Okada, Tadahiro Taniguchi

Abstract

We propose EasyControlEdge, adapting an image-generation foundation model to edge detection. In real-world edge detection (e.g., floor-plan walls, satellite roads/buildings, and medical organ boundaries), crispness and data efficiency are crucial, yet producing crisp raw edge maps with limited training samples remains challenging. Although image-generation foundation models perform well on many downstream tasks, their pretrained priors for data-efficient transfer and iterative refinement for high-frequency detail preservation remain underexploited for edge detection. To enable crisp and data-efficient edge detection using these capabilities, we introduce an edge-specialized adaptation of image-generation foundation models. To better specialize the foundation model for edge detection, we incorporate an edge-oriented objective with an efficient pixel-space loss. At inference, we introduce guidance based on unconditional dynamics, enabling a single model to control the edge density through a guidance scale. Experiments on BSDS500, NYUDv2, BIPED, and CubiCasa compare against state-of-the-art methods and show consistent gains, particularly under no-post-processing crispness evaluation and with limited training data.

Introduction

Edge detection is a fundamental computer vision task, yet it faces two persistent challenges: achieving "crispness" (thin, well-localized edges) and maintaining performance with limited training data. Most deep learning models produce thick or blurry edge maps due to architectural constraints, often requiring fragile post-processing like Non-Maximum Suppression (NMS). Furthermore, annotating edges is labor-intensive, making data efficiency a critical requirement for specialized domains like medical imaging or architectural floor plans.

EasyControlEdge addresses these issues by repurposing large-scale image-generation foundation models, specifically the FLUX.1-dev Diffusion Transformer (DiT). By leveraging the rich geometric priors and iterative refinement capabilities of these models, we achieve sharp, vector-like edge maps and high performance even with extremely scarce training data.

Methods

The framework is built upon FLUX.1-dev, utilizing its Rectified Flow Matching backbone. The adaptation process involves three key components:

  1. Lightweight Adaptation (LoRA): To maintain the foundation model's powerful priors while minimizing computational overhead, we keep the backbone frozen and use a "Condition Injection LoRA" to integrate the input image.
  2. Edge-Specialized Pixel Loss: While standard diffusion models denoise in latent space, edge detection requires pixel-perfect accuracy. We introduce a weighted cross-entropy loss in the pixel space. To avoid the high cost of backpropagating through a heavy VAE decoder, we employ a "proxy-gradient" trick, injecting supervision directly into the latent space.
  3. Controllable Inference via CFG: We adapt Classifier-Free Guidance (CFG) to control edge density. By adjusting a guidance scale ($\gamma$) at inference time, the model can transition between sparse (major boundaries) and dense (including subtle textures) edge maps without retraining.
Overview of the EasyControlEdge training and inference pipeline.

Results and Discussion

EasyControlEdge was evaluated on BSDS500, NYUDv2, BIPED, and CubiCasa. A key finding is the superiority of iterative refinement; as shown in the visual comparison below, increasing the number of sampling steps $K$ significantly improves edge crispness and localization.

Effect of the number of sampling steps K on edge crispness.

Key Performance Metrics

  • Superior Crispness: On BIPED and NYUDv2, EasyControlEdge outperformed state-of-the-art models like DiffusionEdge and GED in "CEval," which evaluates raw predictions without post-processing.
  • Extreme Data Efficiency: On the BIPED dataset, the model achieved an ODS score of 0.875 using only 10% of the training data (20 images). On the CubiCasa floor plan dataset, it maintained strong performance with just 1% of the data (42 images).
  • Guidance as a Density Dial: The guidance scale acts as a tunable threshold, allowing a single model to be repurposed for different precision/recall requirements on the fly.

Conclusion

EasyControlEdge demonstrates that generative foundation models possess untapped potential for high-precision discriminative tasks like edge detection. While iterative sampling introduces an inference speed bottleneck, the model's ability to produce crisp edges with minimal data and controllable density makes it a powerful tool for specialized computer vision applications. Future work will explore faster backbones and distillation techniques to enable real-time performance.

Summary updated

Abstract

We propose EasyControlEdge, adapting an image-generation foundation model to edge detection. In real-world edge detection (e.g., floor-plan walls, satellite roads/buildings, and medical organ boundaries), crispness and data efficiency are crucial, yet producing crisp raw edge maps with limited training samples remains challenging. Although image-generation foundation models perform well on many downstream tasks, their pretrained priors for data-efficient transfer and iterative refinement for high-frequency detail preservation remain underexploited for edge detection. To enable crisp and data-efficient edge detection using these capabilities, we introduce an edge-specialized adaptation of image-generation foundation models. To better specialize the foundation model for edge detection, we incorporate an edge-oriented objective with an efficient pixel-space loss. At inference, we introduce guidance based on unconditional dynamics, enabling a single model to control the edge density through a guidance scale. Experiments on BSDS500, NYUDv2, BIPED, and CubiCasa compare against state-of-the-art methods and show consistent gains, particularly under no-post-processing crispness evaluation and with limited training data.
BibTeX
@misc{nakamura2026easycontroledge,
  author = {Hiroki Nakamura and Hiroto Iino and Masashi Okada and Tadahiro Taniguchi},
  title = {{EasyControlEdge: A Foundation-Model Fine-Tuning for Edge Detection}},
  year = {2026},
  eprint = {2602.16238},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2602.16238},
}
Figure