## 3 X-ray Image Recognition Experiment  
### Experimental Dataset  
Most deep learning object detection models are based on optical color images. Public optical image datasets are easy to obtain, and the production costs of such datasets are low;  
Figure 5: Two successive Swin transformer blocks.  
however, it is challenging to obtain X-ray images. Current, X-ray datasets applicable to the detection of contraband include the GDXray and SIXray datasets [27; 28].  
The GDXray dataset was the first public large-scale dataset of X-ray images (8150 X-ray baggage images). The GDXray dataset contains images of guns, swords, and other blade contraband. The data in the GDXray dataset are grayscale images, in which the target contour is clear and easy to distinguish, the background is simple, and object overlap and occlusion are less. Example images from the GDXray dataset are shown in Figure 6a.  
The SIXray dataset contains more than one million X-ray images, including six types of targets, i.e., guns, knives, wrenches, pliers, scissors, and hammers, and 8929 marked images containing these targets. The stacking randomness of the target objects is quite large in the SIXray dataset, the image backgrounds are complex, and there are instances of severe overlap and occlusion. Example images from the SIXray dataset are shown in Figure 6b.  
In this study, we created the GDXray-Expanded dataset. This dataset is integrated according to the real-world dangerous goods encountered during the security inspections at stations and airports in mainland China, primarily including guns, scissors, knives, and four types of explosives of different shapes and sizes. It is also the primary dataset mainly used in our experiments. Example images from the GDXray-Expanded dataset are shown in Figure 7. X-ray transmission experiments obtained the GDXray-Expanded dataset images. There are few dangerous species in the GDXray dataset, the image background is simple, and there are almost no occlusion and overlap between objects, which is not conducive to detection in the actual security inspection scene; thus, we took a large number of images ourselves. Fundamentally, considering that the GDXray dataset is a real gray image dataset, it is completely consistent with the real situation of the security camera.  
Figure 6: Example images: (**a**) GDXray dataset; (**b**) SIXray dataset.  
Figure 7: Example images from the GDXray-Expanded dataset.  
Our experiment was based on the basic principles of X-ray transmission imaging. The experimental system comprised an X-ray source and a detector. Here, the X-ray source uses electrons to bombard a tungsten target to generate continuous and characteristic X-rays with an energy of 30-120 keV. More specifically, we use amorphous silicon detectors here. Amorphous silicon detectors are mainly composed of a scintillator, light sensing panel and charge readout circuit. When the X-ray is incident, the scintillator converts the attenuated X-ray passing through the object into visible light and then converts the visible light into an electrical signal through the amorphous silicon photodiode sensor array, forming a storage charge on the capacitance of the photodiode itself. After that, the control circuit scans and reads out the storage charge of each pixel, outputs digital signals after signal amplification and A/D conversion, and transmits them to the computer for image processing to form an X-ray image. To carry out our X-ray transmission experiment, it was necessary to place the target object in the front of the flat panel detector and set the exposure time of the radiation source to obtain a high-resolution two-dimensional grayscale image. Figure 8a,b show the set-up for penetration imaging and the experimental system, respectively. During this experiment, the X-ray source voltage was set to 120 kV, and the detector integration time was 1 s.