Manuscript Offprint

arXiv:2609.02348

Structured-Prior-Guided Diffusion Inpainting with Physical Consistency for Traffic Sign Augmentation

Luo Li, Chongchong Huang, Jun Jia, Qiang Gao, Xinlong Liu, Gui Yang, Liang Cao

Luo Li

liluo.ll@alibaba-inc.com

AMAP, Alibaba Group

Beijing, China

Chongchong Huang

huangchongchong.hc@alibaba-inc.com

AMAP, Alibaba Group

Beijing, China

Qiang Gao

longmo.gq@autonavi.com

AMAP, Alibaba Group

Beijing, China

Jun Jia

tianchen.jj@alibaba-inc.com

AMAP, Alibaba Group

Beijing, China

Xinlong Liu

wendiao.xl@alibaba-inc.com

AMAP, Alibaba Group

Beijing, China

Liang Cao ∗^{*}

xuanhe.xh@autonavi.com

AMAP, Alibaba Group

Beijing, China

Gui Yang

yanggui.yg@alibaba-inc.com

AMAP, Alibaba Group

Beijing, China

Abstract

Traffic sign detection faces a long-tailed data distribution. Many rare signs matter as much as common ones from a regulatory standpoint, yet they have very few samples. Generative data augmentation is one way out. General-purpose inpainting models, however, distort digits, deform geometry and perspective, and shift colours when applied directly to sign regions. We trace this to a single gap: the conditioning signal is too abstract for the physical composition of a sign. We propose a structured-prior-guided diffusion inpainting framework with physical consistency. It injects the semantic, appearance and geometric priors of a sign through three orthogonal pathways: a JSON-formatted text prompt, a front-view vector template rendered with measured dominant colours (via IP-Adapter), and an affine-aligned vector template (via ControlNet). Two physical consistency losses constrain colour with a CIELAB chromaticity L1L_{1} term and edge structure with a Sobel gradient term. We train by self-supervised reconstruction on a large set of images collected in-house at AMAP, then evaluate zero-shot on the public TT100K-2021 dataset, a different source. Our method uses a Stable Diffusion 1.5 backbone of about 1.4B parameters. It beats seven representative competitors on every metric of reconstruction fidelity, physical consistency and semantic controllability. Its OCR exact-match rate reaches 91.1%, against 44.2% for the 12B industrial model FLUX.1 Fill [dev], and it needs only 1/14 of that model's inference time. Leave-one-out ablations confirm that each of the three prior pathways and both loss terms contribute on their own. In downstream detection, the synthetic data raises the group-pooled AP50 of rare classes by 1.23×1.23\times to 7.40×7.40\times over a real-data-only baseline. Code and pre-trained models are available at https://github.com/52hz-whale/TrafficSignInpaint.

1 Introduction

Traffic sign detection and recognition is a core part of autonomous driving perception and of automated high-definition map production. Large datasets such as TT100K [1] and GTSRB [2] have appeared, and the YOLO [3-6] and DETR [7, 8] detector families have matured. Accuracy on common signs is close to saturated. What still limits usability is the small set of categories in the tail. This tail reflects real-world frequency, not sampling bias. More collection mileage buys very little, and tail categories are usually small objects as well.

Conventional data augmentation has a clear ceiling. Geometric and photometric transforms and Mosaic [9] leave semantic content untouched, so they cannot create new categories. Copy-Paste [10, 11] and its Poisson-blending [12] variants move objects around, but the pasted content still comes from existing instances. Resampling and class-balanced losses [13] only reweight the optimisation. They add no information. Diffusion models [14-17] and the controllable-generation ecosystem around them [18-20] open another route. Suppose we can replace a sign in a real scene with a sign of any chosen category and content, and the new sign keeps the illumination, occlusion, background and viewpoint of the original location. Real scenes then become carriers for long-tailed samples, and the synthetic data inherits the scene diversity of real data. Recent work synthesises traffic visual elements with generative models [21] and detection training data with diffusion models [22-26]. A general-purpose inpainting model applied directly to signs, however, fails in predictable ways.

Three failure modes appear, and they are entangled. The first is distortion of the text on the sign face. The semantic core of a sign is often two or three characters. “Speed limit 100” and “speed limit 10” are entirely different regulatory constraints. Diffusion denoising guarantees nothing about character-level topological correctness [27–29]. A wrong digit is label noise. It does more harm than generating nothing at all. The second is destruction of geometry and perspective. The shape of a sign carries semantics

∗^{*}Corresponding author.

and obeys perspective projection. A circular sign appears as an ellipse whose axis ratio and tilt follow the viewing angle. The three vertices of a triangular sign satisfy a specific perspective relation. Natural language cannot convey these continuous quantities, and generated results come out with incomplete edges and skewed shapes. The third is colour inconsistency with the background. The measured colour of one sign differs enormously under harsh noon sunlight, low-angle dusk light and rainy diffuse light. A model that paints the standard colours produces a result detached from the surrounding illumination. For the downstream detector that is a domain shift.

All three have one cause. The conditioning information sits at the wrong level of abstraction for the target. A traffic sign is a standardised artefact. National standards prescribe its semantics, colour scheme and geometry in detail. It carries little information but is strongly structured. Natural language is a low-precision, ambiguous condition. Driving generation with it asks the model to guess quantities that are already known.

We define the task as follows. A real road image comes with a mask of the sign region and a target category label. Structured priors guide a diffusion model to repaint that region, and the new sign must follow the standard in semantics, colour and geometry. Our idea is to split the known priors of a sign along physical dimensions and give each one the conditioning form it fits. Semantics becomes a structured JSON text prompt. Appearance colour becomes a front-view vector template infused with the measured dominant colours, injected through IP-Adapter [20]. Geometry becomes an affine-aligned vector template, injected through ControlNet [18]. The three pathways are orthogonal, and none substitutes for another. Together they let the model read the priors instead of guessing them.

Our main contributions are as follows.

  • A structured-prior-guided diffusion inpainting framework. We split sign priors into semantics, appearance and geometry, and inject them through separate pathways. An automated pipeline builds all three conditions from raw annotations, using SAM 2 [30] segmentation, analytic geometric fitting and colour clustering. Training is self-supervised reconstruction. On top of the diffusion objective we add a CIELAB chromaticity L1L_1 loss for colour and a Sobel gradient L1L_1 loss for edge structure. At inference, editing the conditions edits category, digits, colour and geometry.

  • Comprehensive leadership in generation quality and controllability. Under a unified TT100K evaluation protocol, our method ranks first on all nine metrics. Structured prior modelling on a vertical task beats merely scaling up a general-purpose model.

  • Substantial gains from synthetic data on rare-class detection. We verify this with YOLO26 on TT100K rare classes. Our synthetic data raises pooled AP50 by 1.23× to 7.40×, and the gain reaches 7.40× when only 10% of the real data is available.