Source-linked AI summary
Taming Generative Synthetic Data for X-ray Prohibited Item Detection
Jialong Sun, Hongguang Zhu, Weizhe Liu, Yunda Sun, Renshuai Tao, Yunchao Wei
TL;DR
X-ray prohibited item detection requires substantial annotated data, but collecting and labeling it is laborious, and prior synthesis methods add work through foreground preparation. Xsyn uses one-stage text-grounded synthesis with annotation refinement and background-occlusion modeling. Its Xsyn-A variant surpasses SAGAN by 1.2% mAP, and synthetic images improve detection across datasets and detectors.
Problem
Training prohibited item detectors requires substantial annotated X-ray security data, while collecting and annotating these images is time-consuming and laborious.
Source: §I · p. 1Method
Xsyn is a one-stage X-ray image synthesis pipeline using CAR to refine annotations and BOM to model background occlusion.
Source: §I · p. 2Results
1.2% mAP is the reported improvement by which Xsyn-A surpasses SAGAN, and Xsyn synthetic images improve detection across datasets and detectors.
Source: B. Main Results · pp. 6–7Takeaways & Limitations
Xsyn-generated images can supplement real images and improve prohibited item detection performance across public datasets and detector architectures.
Source: §I · p. 2, B. Main Results · p. 7
Abstract
from arXiv · showhide
Training prohibited item detection models requires a large amount of X-ray security images, but collecting and annotating these images is time-consuming and laborious. To address data insufficiency, X-ray security image synthesis methods composite images to scale up datasets. However, previous methods primarily follow a two-stage pipeline, where they implement labor-intensive foreground extraction in the first stage and then composite images in the second stage. Such a pipeline introduces inevitable extra labor cost and is not efficient. In this paper, we propose a one-stage X-ray security image synthesis pipeline (Xsyn) based on text-to-image generation, which incorporates two effective strategies to improve the usability of synthetic images. The Cross-Attention Refinement (CAR) strategy leverages the cross-attention map from the diffusion model to refine the bounding box annotation. The Background Occlusion Modeling (BOM) strategy explicitly models background occlusion in the latent space to enhance imaging complexity. To the best of our knowledge, compared with previous methods, Xsyn is the first to achieve high-quality X-ray security image synthesis without extra labor cost. Experiments demonstrate that our method outperforms all previous methods with 1.2% mAP improvement, and the synthetic images generated by our method are beneficial to improve prohibited item detection performance across various X-ray security datasets and detectors. Code is available at https://github.com/pILLOW-1/Xsyn/.
I. INTRODUCTION
Collecting and annotating X-ray security images is laborious, and prior synthesis methods retain extra labor through foreground preparation. Xsyn replaces that two-stage process with one-stage synthesis and strategies for refining annotations and modeling occlusion.
I. INTRODUCTION
- Xsyn is a one-stage X-ray security image synthesis pipeline that removes labor-intensive foreground preparation used by prior two-stage methods.The paper presents it as a way to generate high-quality images without extra labor cost.Source: §I · pp. 1–2
- CAR automatically refines synthetic annotations, while BOM models background occlusion to enhance synthetic image complexity.CAR uses diffusion cross-attention to refine bounding boxes; BOM models occlusion in the latent space.Source: §I · p. 2
- Experiments report that Xsyn-generated images improve prohibited item detection performance on public X-ray security datasets.The introduction identifies the synthetic images as supplemental training data.Source: §I · p. 2
II. RELATED WORK
- Prior X-ray synthesis methods include TIP-based compositing and GAN-based item generation, but both involve extra labor such as foreground collection or annotation.Examples include mask, trimap, and semantic-label annotation.Source: §II · p. 2
- Natural-image copy-paste synthesis separately generates foregrounds, whereas layout-to-image methods generate whole images from layouts; Xsyn adapts generation to X-ray backgrounds through text-grounded inpainting.The paper identifies background-distribution discrepancy as a reason for this adaptation.Source: §II · p. 2
III. PRELIMINARY
The preliminary section describes latent diffusion generation and its conditioning, then relates inpainting to retaining real baggage backgrounds. For inpainting, the input image and mask are represented in latent space for the denoising model.
III. PRELIMINARY
- A latent diffusion model performs diffusion in latent space, and its denoising UNet is trained to recover a clean latent by predicting added noise.The passage describes a noisy latent at each timestep and a training objective for noise prediction.Source: §III · p. 2
- The paper uses grounded inpainting rather than direct L2I generation because it retains the real baggage background, unlike the shown L2I-generated image.Source: Figure 2 · p. 3
- The condition c is a text prompt for text-to-image generation and also includes grounding information, such as boxes with categories, for layout-to-image generation.Source: §III · p. 3
- For inpainting, the input image is encoded into a latent representation, masked at latent resolution, and supplied with the mask to the UNet.The passage describes the masked input latent and mask as part of the expanded inpainting input.Source: §III · p. 3
IV. METHODOLOGY
Xsyn uses text-grounded inpainting because generated-image backgrounds are uncontrollable and differ from real X-ray backgrounds. It modifies existing prohibited items or adds new ones while avoiding extra labor and preserving the overall background distribution.
A. Generation Pipeline
- Text-grounded inpainting avoids using generated images with uncontrollable backgrounds that differ from real X-ray backgrounds.The pipeline repaints specified grounding regions in an input X-ray image.Source: A. Generation Pipeline · p. 3
- Existing prohibited items are modified using their annotations, while new items are added in randomly selected idle regions identified from SAM-segmented image elements.For added items, the method selects a category from a class group corresponding to specific region areas.Source: A. Generation Pipeline · p. 3
- Xsyn-M and Xsyn-A are two synthetic-data variants generated without extra labor while altering only part of the background and preserving its overall distribution.The passage identifies these variants as constructed using Eq. 4.Source: A. Generation Pipeline · p. 3
B. Cross-Attention Refinement
Cross-Attention Refinement (CAR) refines generated-item annotations rather than forcing generated items to fit their grounding boxes. It uses diffusion cross-attention localization and SAM, with recursively sampled median points helping SAM locate the item.
B. Cross-Attention Refinement
- CAR retains generated items and refines their locations because generated items may not fit tightly within their grounding boxes.The authors state that directly using grounding boxes as annotations can degrade downstream detection performance.Source: B. Cross-Attention Refinement · pp. 3–4
- CAR uses the item's diffusion cross-attention map and grounding location to guide SAM toward a class-discriminative region and produce a refined annotation box.The refined box is assigned from SAM's segmentation of the generated image using sampled points and the grounding location as prompts.Source: B. Cross-Attention Refinement · p. 4
- Median Point Sampling recursively divides the selected region and gathers median-activation foreground points, alongside a minimum-activation background point, for SAM prompts.The median points are intended to represent the prohibited item's central tendency and be less affected by extreme cross-attention activations.Source: B. Cross-Attention Refinement · p. 4
C. Background Occlusion Modeling
Background Occlusion Modeling (BOM) adds realistic background occlusion by recombining regions in latent space, then uses the hidden result as the final synthetic image.
C. Background Occlusion Modeling
- BOM selects a background occluder and recombines its latent region with foreground regions to create an occluded synthetic image.The occluder is selected from the input image's background; the latent recombination occurs after denoising.Source: C. Background Occlusion Modeling · pp. 4–5
- The occlusion coefficient α adjusts the degree of occlusion, and the recombination crops the denoised latent to the corresponding region.The resulting latent is decoded to pixel space for the hidden image.Source: C. Background Occlusion Modeling · p. 5
- The original generated result supports CAR annotation refinement, while the occluded result becomes the final synthetic image.Regional recombination lets a random background item occlude the foreground and enhances imaging complexity.Source: C. Background Occlusion Modeling · p. 5
A. Experimental Setups
The experiments use three X-ray security datasets and evaluate synthetic-image benefits through downstream detection training, with specified generation and detection settings.
A. Experimental Setups
- Experiments use PIDray, OPIXray, and HiXray, which provide annotations across 12, 5, and 8 classes, respectively.Their training/validation image counts are 29,454/18,220 for PIDray, 7,109/1,776 for OPIXray, and 36,295/9,069 for HiXray.Source: A. Experimental Setups · p. 5
- Synthetic images are generated from training annotations, with CAR and BOM applied to create Xsyn-M and Xsyn-A variants.For Xsyn-A, the generated item occupies a random idle background region; synthetic and real images are combined for detector training.Source: A. Experimental Setups · p. 5
- The PIDray comparison evaluates synthesis methods using DINO with a ResNet-50 backbone, reporting difficulty levels and results across 12 prohibited-item classes.The table caption defines Easy, Hard, and Hidden as detection-difficulty levels.Source: Table II · p. 6
- Downstream detection uses MMDetection, with detectors trained for six epochs and performance evaluated using mAP and category- and occlusion-level AP on PIDray.The implementation uses DINO with a ResNet-50 backbone as the default detector.Source: A. Experimental Setups · pp. 5–6
B. Main Results
The results compare Xsyn with prior synthesis methods on PIDray and extend evaluation across datasets and detectors. Xsyn-A improves mAP over SAGAN, and reported gains extend to other datasets and detector architectures.
B. Main Results
- 1.2% mAP: Xsyn-A surpasses SAGAN, while Xsyn-M achieves 69.1% versus 69.5% for SAGAN.Xsyn-M and Xsyn-A improve performance for almost all classes, including a +7.2% result for Gun with Xsyn-A.Source: B. Main Results · p. 6
- On PIDray, synthetic data generated by Xsyn yields better training efficiency and faster convergence than previous methods.The authors interpret this as indicating that the synthetic data has learned the distribution of X-ray prohibited items.Source: B. Main Results · p. 7
- Xsyn improves detection performance on OPIXray and HiXray and shows consistent improvement across CNN- and Transformer-based detectors.The reported evaluations are summarized in Tables III and IV.Source: Table III · p. 6, B. Main Results · p. 7, Table IV · p. 7
- On OPIXray and HiXray, Xsyn outperforms GLIGEN; the paper notes that missing mask annotations and FTI images prevent implementing two-stage methods on these datasets.The comparison is summarized in Table V.Source: B. Main Results · p. 7, Table V · p. 7
C. Ablation Study
The ablations examine CAR, BOM, their parameter choices, and occlusion design. The reported results favor combining both strategies, median point sampling, a moderate occlusion coefficient, and latent-space modeling.
C. Ablation Study
- Best results are achieved when CAR and BOM are both adopted, according to the sequential strategy ablation.The study adds CAR and then BOM on Xsyn-A using PIDray.Source: Table VI · p. 7, C. Ablation Study · p. 7
- For the tested BOM coefficients, performance rises from α=0.1 to α=0.3 and falls from α=0.3 to α=0.7; the authors choose α=0.3.They state that a medium coefficient better enhances imaging complexity than a too-small or too-large coefficient.Source: C. Ablation Study · p. 7, Table VII · p. 7
- For CAR, median point sampling outperforms top-k sampling and shows better scalability for annotation refinement.The comparison is reported in Table VIII.Source: C. Ablation Study · p. 7, Table VIII · p. 8
- Latent-space occlusion performs better than pixel-space occlusion, while applying occlusion at every denoising step performs much worse than the original version.The authors suggest that repeated occlusion may disrupt the foreground distribution in the cross-attention map and affect CAR.Source: C. Ablation Study · pp. 7–8, Table IX · p. 8
D. Qualitative Results
The qualitative results illustrate how CAR refines annotations and BOM adds occlusion, while generated images depict concealed contraband and realistic objects across datasets.
D. Qualitative Results
- CAR tightens boxes around generated prohibited items, while BOM then occludes them to increase imaging complexity without compromising annotation refinement.CAR is applied to the original image before BOM produces the hidden image.Source: D. Qualitative Results · p. 8
- Xsyn-A outputs can simulate contraband concealment in baggage, especially in the second image in the last column.Source: D. Qualitative Results · p. 8
- On OPIXray and HiXray, the qualitative results show realistic generated objects; Figure 9 marks original objects blue and generated objects red.Source: D. Qualitative Results · p. 8
VI. DISCUSSIONS
The discussion identifies CT synthesis as a future direction because CT images are harder to collect and annotate; the conclusion presents Xsyn as a one-stage pipeline whose synthetic images improve detection across datasets and detectors.
VI. DISCUSSIONS
- CT image synthesis is a future direction because CT's 3D volumetric characteristics make its images more challenging to collect and annotate than 2D X-ray images.The discussion also proposes exploring synergy between X-ray and CT imaging modalities.Source: §VI · p. 8
VII. CONCLUSION
- Xsyn is a one-stage pipeline that removes labor-intensive foreground extraction and uses strategies to refine annotations and enhance synthetic-image complexity.Source: §VII · p. 8
- The authors report that Xsyn-generated images improve prohibited item detection performance across public datasets and detectors.Source: §VII · p. 8
- Figure 8 gives prompt examples for Xsyn-M and Xsyn-A with grounding boxes, while Figure 9 distinguishes original objects in blue from generated objects in red.Source: Figure 8 · p. 9, Figure 9 · p. 9
Related papers
This paper cites
- Attention Is All You Need2017
- Learning Transferable Visual Models From Natural Language Supervision2021
- Microsoft COCO: Common Objects in Context2014
- U-Net: Convolutional Networks for Biomedical Image Segmentation2015
- Self-Attention Generative Adversarial Networks2018
- DINO: DETR with Improved DeNoising Anchor Boxes for End-to-End Object Detection2022