An Improved Capsule Network for the Detection of X-ray Security Images

Hong Zhang, Baoyang Liu, J Gu, Z Wang, J Kuen, T Vijayakumar, G Huang, Z Liu, L Van Der Maaten, Jen Hwei, Yoshimasa Lin, Zi Tokuyama, Lin Jun, S Woo, J Park, J Y Lee, J Hu, L Shen, G Sun, D Mery, V Riffo, U Zscherpel, K He, X Zhang, S Ren, X Xia, C Xu, NanProceedings of WCSE 2022 Spring Event: 2022 9th International Conference on Industrial Engineering and Applications 2022 · DOI

Abstract

In X-ray security image inspection, traditional convolutional neural networks (CNNs) often require extensive datasets to achieve high performance. Capsule Networks (CapsNets) offer a promising alternative, as they are less constrained by sample size and can encode spatial information such as position, size, and rotation. This paper introduces DR-CapsNet, an improved architecture that integrates DenseNet as a feature extraction backbone and ResNet connections to mitigate overfitting. Additionally, the Convolutional Block Attention Module (CBAM) is incorporated to enhance learning and generalization. Experimental results on the GDXray dataset demonstrate that DR-CapsNet achieves 99% accuracy on small-scale data, outperforming the original CapsNet by 2%.

Introduction

Security screening at airports and transit hubs is a high-stakes environment where human fatigue and the sheer volume of luggage can lead to errors. While automated recognition technology exists, it faces two major hurdles: data scarcity and the inability to model complex spatial relationships. Traditional CNNs like ResNet or Inception require thousands of labeled images and are often "blind" to the relative positions and orientations of object parts. If a threat is disassembled or rotated, standard CNNs may fail to recognize it because they rely on scalar values rather than understanding an object's geometry.

Methodology: The DR-CapsNet Architecture

The proposed DR-CapsNet architecture builds upon the core principles of Capsule Networks. Unlike standard neurons, capsules use vectors to represent features, storing not just the presence of a feature but also its properties like position, size, and rotation angle.

Standard Capsule Network architecture for object recognition.

To make the network more robust for X-ray imagery, three key upgrades were implemented:

  1. DenseNet Backbone: A simplified DenseNet is used to extract features efficiently by connecting every layer to every other layer, encouraging feature reuse.
  2. ResNet Connections: Residual connections are added to connect the input and output of the DenseNet blocks. This prevents overfitting and ensures stability as the network depth increases.
  3. CBAM (Convolutional Block Attention Module): This mechanism allows the network to focus on important spatial regions and feature channels, helping it ignore the complex, noisy backgrounds typical of X-ray scans.
The hybrid DR structure combining DenseNet blocks (Db) and Transition layers (Ts) with ResNet-style skip connections.

Experimental Setup and Datasets

The study utilized a specialized subset of the GDXray dataset, a benchmark for non-destructive testing. The researchers created a small-scale dataset consisting of 1,000 training samples and 200 test samples, covering four threat categories: darts, blades, pistols, and daggers. Images were preprocessed into grayscale, resized to 28x28 pixels, and converted to a binary format for training.

Key Results and Discussion

DR-CapsNet was compared against several industry-standard architectures. The results on the small GDXray dataset were decisive:

  • Accuracy: DR-CapsNet reached 99.00%, outperforming the original CapsNet (97.00%) and significantly beating traditional CNNs like InceptionV3 (94.50%) and ResNet18 (91.00%).
  • Efficiency: Despite its architectural complexity, DR-CapsNet trained in just 70.27 seconds. While slightly slower than the original CapsNet, it was 3 to 6 times faster than traditional CNN models.
  • Stability: Loss curves indicated that DR-CapsNet converged more smoothly and reached a lower final error rate than its competitors, proving the effectiveness of the hybrid DR structure.

Conclusion

DR-CapsNet demonstrates that combining the spatial awareness of Capsule Networks with the feature extraction power of DenseNet and ResNet creates a highly effective tool for security applications. By achieving 99% accuracy on a limited dataset, it provides a viable path for automated threat detection where data is scarce. Future research will explore self-attention mechanisms to further improve performance in extremely cluttered luggage environments.

Summary updated

Abstract

For X-ray security images inspection, the traditional convolutional neural networks require a large number of samples to train, but capsule network is not limited by training sample size, which contains the information of the position, size, and rotation angle of the object which is recognized through its unique capsule structure to achieve better training results with a small size data set.In this paper, we propose an improved capsule network named as DR-CapsNet for the X-ray security images inspection.DR-CapsNet uses DenseNet as the backbone network to extract image features more efficiently, and uses ResNet to connect the input and the output of DenseNet to prevent overfitting caused by deep network, then adds CBAM to the convolutional layer and the primary capsule layer, that can improve the learning ability, generalization ability and recognition accuracy.The experimental results show that the improved capsule network model DR-CapsNet has 99% recognition accuracy on the small size data set based on GDXray.Compared with the original capsule network, DR-CapsNet improves accuracy by 2%.
BibTeX
@inproceedings{zhang2022improved,
  author = {Hong Zhang and Baoyang Liu and J Gu and Z Wang and J Kuen and T Vijayakumar and G Huang and Z Liu and L Van Der Maaten and Jen Hwei and Yoshimasa Lin and Zi Tokuyama and Lin Jun and S Woo and J Park and J Y Lee and J Hu and L Shen and G Sun and D Mery and V Riffo and U Zscherpel and K He and X Zhang and S Ren and X Xia and C Xu and Nan},
  title = {{An Improved Capsule Network for the Detection of X-ray Security Images}},
  booktitle = {Proceedings of WCSE 2022 Spring Event: 2022 9th International Conference on Industrial Engineering and Applications},
  year = {2022},
  doi = {10.18178/wcse.2022.04.013},
}
Figure