TRACE: Your Diffusion Model is Secretly an Instance Edge Detector

Sanghyun Jo, Ziseok Lee, Wooyeol Lee, Jonghyun Choi, Jaesik Park, Kyungsu Kim

TL;DR

TRACE (TRAnsforming diffusion Cues to instance Edges) reveals that text-to-image diffusion models naturally act as high-quality instance edge detectors during the early stages of the denoising process. By identifying the exact moment these boundaries emerge and distilling that knowledge into a lightweight, one-step decoder, TRACE achieves state-of-the-art unsupervised instance segmentation that is 81× faster than previous diffusion-based methods.

The Cost of Dense Annotations

High-quality instance segmentation—the task of identifying and outlining every individual object in an image—traditionally requires "dense" annotations. Humans must manually draw masks, boxes, or points for every single object, a process that is expensive, slow, and often inconsistent across different annotators.

Existing unsupervised methods attempt to bypass this bottleneck by using "semantic" backbones (like DINO). However, these models are trained to group pixels by meaning (e.g., "this entire area is cat") rather than by structural boundaries. Consequently, they often fail to separate two adjacent objects of the same class (merging two cats into one) or fragment a single object into multiple pieces. The authors set out to find a source of "instance-aware" signals that doesn't rely on manual labeling or semantic grouping.

The TRACE Framework

The authors introduce TRACE, a framework that extracts hidden boundary priors from diffusion models using three main technical components:

  1. Instance Emergence Point (IEP): During the diffusion denoising process, a model transitions from predicting pure noise to forming structure, and finally to rendering semantic content. The researchers use Kullback–Leibler (KL) divergence to pinpoint the "sweet spot" (the IEP) where instance boundaries are most pronounced in the model's self-attention maps.
Observation of instance cues emerging in self-attention maps during the diffusion denoising process.
  1. Attention Boundary Divergence (ABDiv): Once the diffusion process reaches the IEP, TRACE uses a non-parametric scoring method to compare the self-attention distributions of neighboring pixels. If the attention "diverges" sharply between neighbors, it serves as a strong signal of an instance boundary.
  2. One-step Self-Distillation: Running a full diffusion process for every image is computationally expensive. To solve this, the authors train a tiny, 0.1 MB CNN "edge decoder" to predict these boundaries in a single forward pass. This "student" model learns from the diffusion "teacher," achieving an 81× speedup during inference.

Finally, TRACE uses Background-Guided Propagation (BGP) to integrate these sharp edges into existing segmentation pipelines. The edges act as "fences" that prevent masks from merging or leaking into adjacent objects.

Key Insights

  • Generative vs. Discriminative Priors: Unlike standard vision transformers (like DINO) which focus on semantic grouping, generative diffusion models must establish structural boundaries early in the image synthesis process to generate coherent images. This makes them "secret" experts at edge detection.
  • The "Slow-Fast-Slow" Trajectory: The paper provides a theoretical information-theoretic view showing that row entropy in attention maps changes most rapidly at the IEP. This confirms that the emergence of instance structure is a distinct, measurable phase in the diffusion timeline.
  • Model Agnostic: The IEP phenomenon is consistent across five major diffusion architectures (SD1.5, SDXL, SD3.5, PixArt-α, and FLUX.1), suggesting this is a fundamental property of how these models learn to "see."
  • Efficiency through Distillation: Surprisingly, a minimal 1-layer CNN is sufficient to capture the complex boundary cues from a multi-billion parameter diffusion model, proving that the "intelligence" lies in the cues themselves, not the complexity of the decoder.

Key Results

TRACE was evaluated across an impressive array of 11 real-world benchmarks, spanning general-purpose datasets (COCO, PASCAL VOC), large-scale datasets (Objects365, SA-1B), and specialized domains (autonomous driving, satellite, and medical imagery).

Qualitative and quantitative improvements showing TRACE separating merged instances and boosting AP across benchmarks.
  • Unsupervised Instance Segmentation (UIS): On the COCO benchmark, TRACE improved baseline performance by +5.1 AP, outperforming previous state-of-the-art methods that relied on depth priors.
  • Weakly-supervised Panoptic Segmentation: Using only image-level tags (e.g., "there is a cat in this image"), TRACE outperformed models supervised with manual point annotations by +1.7 PQ.
  • Speed: The distilled edge decoder reduces latency from roughly 3.6 seconds per image to just 45 milliseconds, making it highly practical for real-time applications.
  • Zero-Shot Generalization: When trained on ImageNet and tested on other datasets without further tuning, TRACE consistently outperformed existing unsupervised baselines, demonstrating that it learns a robust, generalizable concept of an "object boundary."

Limitations and Future Work

The authors identify two main failure modes for TRACE. First, it struggles with tiny objects (e.g., objects occupying 0.01% of the area in satellite imagery) due to the spatial compression of the Variational Autoencoder (VAE) used in latent diffusion models, which blurs very fine structures. Second, it performs poorly on out-of-distribution domains like medical histopathology images; because the underlying diffusion models were trained on natural photos, their structural priors do not translate well to specialized microscopic slides. Future work may involve adapting diffusion priors specifically for these domains or developing hybrid schemes that combine TRACE with high-resolution feature extractors.

Summary updated

BibTeX
@inproceedings{jo2026trace,
  author = {Sanghyun Jo and Ziseok Lee and Wooyeol Lee and Jonghyun Choi and Jaesik Park and Kyungsu Kim},
  title = {{TRACE: Your Diffusion Model is Secretly an Instance Edge Detector}},
  booktitle = {International Conference on Learning Representations},
  year = {2026},
  url = {https://openreview.net/forum?id=BjElYlJKMj},
}
Figure