Papers
Topics
Authors
Recent
Search
2000 character limit reached

XSeg: A Large-scale X-ray Contraband Segmentation Benchmark For Real-World Security Screening

Published 4 Apr 2026 in cs.CV | (2604.03706v1)

Abstract: X-ray contraband detection is critical for public safety. However, current methods primarily rely on bounding box annotations, which limit model generalization and performance due to the lack of pixel-level supervision and real-world data. To address these limitations, we introduce XSeg. To the best of our knowledge, XSeg is the largest X-ray contraband segmentation dataset to date, including 98,644 images and 295,932 instance masks, and contains the latest 30 common contraband categories. The images are sourced from public datasets and our synthesized data, filtered through a custom data cleaning pipeline to remove low-quality samples. To enable accurate and efficient annotation and reduce manual labeling effort, we propose Adaptive Point SAM (APSAM), a specialized mask annotation model built upon the Segment Anything Model (SAM). We address SAM's poor cross-domain generalization and limited capability in detecting stacked objects by introducing an Energy-Aware Encoder that enhances the initialization of the mask decoder, significantly improving sensitivity to overlapping items. Additionally, we design an Adaptive Point Generator that allows users to obtain precise mask labels with only a single coarse point prompt. Extensive experiments on XSeg demonstrate the superior performance of APSAM.

Summary

  • The paper presents a large-scale, finely annotated X-ray contraband segmentation benchmark that addresses occlusion and chromatic distortion challenges.
  • It introduces APSAM, which integrates dual-energy X-ray features with adaptive point generation to achieve superior mIoU and Dice scores while minimizing annotation overhead.
  • The study demonstrates enhanced cross-domain performance and practical impact on real-world security screening and advanced multi-label vision tasks.

XSeg: A Comprehensive Benchmark for X-ray Contraband Segmentation in Security Screening

Motivation and Dataset Construction

X-ray security inspection systems are fundamental to ensuring public safety at airports, transit hubs, and logistics centers, with deep learning-based CAD methods now standard. However, conventional bounding box annotation frameworks prove insufficient due to two core factors: material superposition leading to chromatic distortion and ambiguous occlusions, and coarse bounding box-induced background noise, which degrades specificity and limits real-world generalization.

Existing segmentation benchmarks, including PIDray, PIXray, and STCray, address only part of the annotation granularity problem and suffer from three critical deficiencies: data scarcity and compositional simplicity (typically <50k images, dominated by single-category threats); scanner-specific chromatic variance, which imposes costly retraining barriers (Figure 1); and insufficient category coverage, with current datasets covering fewer than 21 categories despite regulatory expansions. Figure 1

Figure 1: Chromatic variance across PIDray, PIXray, and HiXray datasets, underscoring the need for robust cross-domain adaptation in X-ray segmentation.

In response, XSeg is introduced as the most expansive and diverse real-world X-ray contraband segmentation dataset to date, spanning 98,644 images, 295,932 instance masks, and 30 contraband categories, reflecting realistic occlusion and multi-object scenarios. Images are drawn from 114Xray, PIDray, and PIXray, augmented with samples from operational settings, and rigorously curated via an automated cleaning pipeline filtering based on resolution, aspect ratio, and Laplacian variance, followed by expert annotation and iterative refinement (Figure 2). Figure 2

Figure 2: The XSeg cleaning and annotation pipeline combining algorithmic filtering, expert annotation, model-assisted mask generation, and iterative boundary refinement.

Segmentation annotation quality is prioritized via closed-loop validation, integrating MobileSAM, SAM fine-tuning, and multi-stage expert review. Domain-aware set splits preserve acquisition protocol integrity and facilitate cross-domain evaluation. Beyond binary masks, XSeg provides fine-grained semantic subdivisions (Figure 3), with major categories split by functional or material attributes, enabling multi-label downstream vision tasks. Figure 3

Figure 3: Hierarchical structure for fine-grained semantic annotation in XSeg, supporting complex layering and functional classification.

Adaptive Point SAM: Model Architecture and Innovations

To reduce annotation overhead and tackle the domain gap, XSeg proposes APSAM—a specialized contraband segmentation model grounded in the Segment Anything Model (SAM) but redesigned for X-ray imaging physics and operational scenarios.

APSAM architecture integrates an Energy-Aware Encoder (EAE) to leverage X-ray dual-energy response, retaining both high- and low-energy grayscale projections for optimal contraband localization. These projections are processed by convolutional blocks and location initializer modules, extracting discriminative spatial tokens (Figure 4). During prompt generation, APSAM employs an Adaptive Point Generator (APG) that expands a user-provided point into multiple informative prompts based on K-means clustering within soft mask regions, balancing robust coverage and minimal user interaction. Figure 5

Figure 5: APSAM framework architecture highlighting dual-energy feature extraction, fine-tuned visual encoder, adaptive point generation, and mask decoding.

Figure 4

Figure 4: Energy-Aware Encoder pipeline and Location Initializer workflow, with channel selection and Top-kk token filtering for target region localization.

APSAM's initialization leverages grayscale maxima and minima, reflecting material density and occlusion prominence (Figure 6). This dual-channel token concatenation underpins robust attention and mask refinement for occluded or cluttered threats. Figure 6

Figure 6: Example display of contraband image with corresponding maximum and minimum grayscale projections.

Numerical Results and Empirical Evaluation

APSAM was evaluated on the XSeg benchmark, showing robust improvements over conventional CNN and Transformer-based schemes, as well as state-of-the-art segmentation methods adapted to X-ray domains. APSAM achieves a marked performance advantage, with mIoU (72.83%) and Dice (82.31%) scores outperforming fine-tuned SAM (mIoU 67.87%, Dice 77.45%) and SAMUS (mIoU 68.56%, Dice 78.46%) while retaining a lower parameter footprint (APSAM: 11.91M vs. SAMUS: 43.21M).

Ablation studies confirm the EAE and APG contributions: omitting either yields a significant drop in mIoU and Dice, validating the role of energy-aware feature processing and adaptive prompt expansion. APG, when utilized for two-point prompt generation, yields superior segmentation performance compared to random two-point or single-point prompting strategies, while maintaining user simplicity.

APSAM's boundary segmentation is visually more precise and complete than frozen SAM and fine-tuned variants, with enhanced holistic target perception and structural continuity—even for highly concealed or stacked objects (Figure 7). Figure 7

Figure 7: APSAM visual segmentation results with clear, complete boundaries surpassing prior SAM-type approaches.

APSAM generalizes well to other benchmarks (PIDray and PIXray), achieving SOTA transfer performance, with mIoU and Dice gains of 4–5% over SAMUS and previous Transformer-based schemes, indicating robust domain migration capability.

Practical and Theoretical Implications

XSeg fundamentally improves the landscape of contraband detection benchmarks by combining multi-domain, multi-source image acquisition, rigorous annotation curation, and fine-grained category structuring. This enables robust evaluation and transfer learning for segmentation models under operationally realistic occlusion and chromatic shift conditions.

APSAM demonstrates that embedding physical feature priors—specifically dual-energy X-ray responses—into modern segmentation networks delivers superior item localization and boundary precision, particularly in scenarios where conventional RGB pseudo-coloring is insufficient.

Fine-grained semantic annotation augments downstream vision tasks and supports regulatory-driven category expansion, paving the way for advanced multi-modal and open-vocabulary models in security screening. In practical deployments, APSAM’s prompt efficiency and minimal user interaction offer viable pathways to scalable annotation, accelerating dataset iteration and enabling rapid adaptation to emerging threat types.

Theoretically, the success of APSAM stresses the importance of integrating domain physics into segmentation architectures for specialty imaging modalities. Future developments may include energy response modeling as a backbone, unified architectures for simultaneous segmentation and detection, and vision-language alignment for zero-shot adaptation across device protocols and threat categories.

Conclusion

XSeg represents the largest, highest-quality X-ray segmentation benchmark for contraband detection, with comprehensive occlusion and category coverage aligning with real-world screening requirements. APSAM, built upon domain-aware feature priors and adaptive prompt expansion, achieves leading segmentation accuracy and generalization, setting a new baseline for both practical deployment and research evaluation in X-ray security imaging.

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.