Taming Generative Synthetic Data for X-ray Prohibited Item Detection
Jialong Sun, Hongguang Zhu, Weizhe Liu, Yunda Sun, Renshuai Tao, Yunchao Wei
TL;DR
The paper tackles the data bottleneck for X-ray prohibited item detection by proposing Xsyn, a one-stage synthesis pipeline that uses text-grounded inpainting to generate high-quality synthetic X-ray images without labor-intensive foreground extraction. It introduces two strategies—Cross-Attention Refinement (CAR) to automatically refine synthetic annotations via diffusion cross-attention maps and SAM, and Background Occlusion Modeling (BOM) to simulate realistic occlusions in latent space. Empirical results on PIDray, OPIXray, and HiXray show that synthetic data from Xsyn improves detection performance across multiple detectors, with Xsyn-A achieving the largest gains (e.g., +1.2% mAP on PIDray). The method reduces labeling costs while enhancing dataset realism and diversity, offering practical benefits for training prohibited-item detectors in security scenarios.
Abstract
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/.
