ReCon: Region-Controllable Data Augmentation with Rectification and Alignment for Object Detection

Haowei Zhu, Tianxiang Pan, Rui Qin, Jun-Hai Yong, Bin Wang

Training robust object detection models is a data-hungry process. While generative models like Stable Diffusion have promised a "free lunch" by synthesizing endless training samples, the reality is often messier. Current generative augmentation tools frequently suffer from content-position mismatches (putting a dog where a car should be) and semantic leakage (blending features of a zebra into a horse).

A new paper introduces ReCon (Region-Controllable Data Augmentation), a training-free framework that "rectifies" these errors during the image generation process itself.

TL;DR

ReCon is a plug-and-play framework that improves generative data augmentation by using a perception model to detect and fix "hallucinations" during the diffusion sampling process. By combining real-time region rectification with spatially-constrained attention, it produces high-fidelity synthetic data that significantly boosts detector performance, especially in data-scarce scenarios.

What Problem Does This Paper Address?

Generative data augmentation aims to expand small datasets by creating new, annotated images. However, even "controllable" models like ControlNet or GLIGEN aren't perfect. They often ignore layout constraints or "leak" semantics across the image—for instance, if the prompt mentions "person" and "snowboard," the model might accidentally generate snowboard-like textures on the person's clothing.

Existing solutions usually involve either massive fine-tuning on specific datasets (which is expensive) or "generate-and-filter" pipelines that discard a huge percentage of noisy outputs. ReCon aims to solve this by making the generation process self-correcting and spatially aware without requiring any additional training.

Methods

ReCon introduces two primary mechanisms into the standard diffusion sampling pipeline to ensure high-fidelity, layout-accurate image generation.

Overview of the ReCon framework, illustrating the preparation of text embeddings and instance masks, followed by diffusion sampling with region control.
  1. Region-Guided Rectification (RGR): This acts as a real-time feedback loop. At specific stages of the denoising process, ReCon takes a "quick look" at the intermediate latent image using a fast sampler and a pre-trained perception model (like Grounded-SAM). It identifies regions where objects are missing (false negatives) or where "extra" objects have appeared (false positives). It then creates a mask for these erroneous regions and injects noise from the original image to "steer" the model to try again in those specific areas.
  2. Region-Aligned Cross-Attention (RACA): Standard cross-attention allows every pixel in an image to attend to every word in a text prompt. RACA restricts this: it ensures that visual tokens within a specific bounding box only interact with the textual description of that specific object. This effectively "walls off" different objects, preventing the semantic leakage that causes blended or unrealistic features.

Because these methods operate during inference, ReCon is plug-and-play and can be added to existing models like ControlNet or Instance Diffusion.

Datasets

The authors evaluated ReCon on two benchmark datasets for object detection:

  • MS COCO: The gold standard for object detection. They tested on various scales, including 1%, 5%, and 10% subsets to simulate data-scarce environments.
  • PASCAL VOC: Used to demonstrate the framework's generalization capabilities across different data distributions.

Key Insights and Ideas

  • Feedback is better than Filtering: Instead of throwing away a "bad" image after 50 steps of generation, it is more efficient to detect the error at step 10 and fix it.
  • The "Overridability" of Diffusion: The paper leverages the fact that you can replace parts of a latent representation with noisy versions of real data mid-process. This "nudges" the model toward the ground truth without breaking the overall image structure.
  • Small Objects are the Weak Link: The authors' analysis shows that smaller objects are significantly more likely to be misgenerated or ignored by standard models, making region-specific rectification particularly vital for dense or small-scale detection tasks.
  • Disentanglement via Attention: Semantic leakage isn't just a capacity issue; it's an architectural one. Forcing spatial constraints on the cross-attention map is a simple, training-free way to achieve better concept disentanglement.

Key Results

  • State-of-the-Art Performance: On the COCO dataset, ReCon combined with ControlNet achieved a 35.5 mAP, outperforming models like DetDiffusion (35.4) which were specifically fine-tuned on COCO.
  • Data Scarcity Hero: In a 10% data regime, ReCon boosted the baseline mAP from 18.5 to 21.7. In few-shot (30-shot) scenarios using YOLOX-S, it improved performance from 5.4 to 6.7 mAP.
  • Efficiency: While it adds a perception model to the loop, the overhead is modest. It adds roughly 0.8 to 1.0 seconds per sample on an NVIDIA RTX 3090, which is significantly faster than multi-round "generate-then-filter" approaches.

Limitations and Future Work

  • Computational Cost: Although more efficient than filtering, the requirement of an extra perception model (Grounded-SAM) during sampling still increases the inference time and memory footprint.
  • Perception Bottleneck: The quality of the rectification is inherently limited by the accuracy of the "teacher" perception model. If the detector used for feedback misses an object, ReCon cannot fix it.
  • Future Directions: The authors suggest exploring lighter, faster perception models to reduce overhead and integrating more advanced attention libraries to further optimize the RACA mechanism.

Summary updated

BibTeX
@inproceedings{zhu2025recon,
  author = {Haowei Zhu and Tianxiang Pan and Rui Qin and Jun-Hai Yong and Bin Wang},
  title = {{ReCon: Region-Controllable Data Augmentation with Rectification and Alignment for Object Detection}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=2zjH76SmiF},
}
Figure