# Pixel-Level Analysis for Enhancing Threat Detection in Large-Scale X-ray Security Images
## 5 Proposed Method
### Model Selection
#### 5.1.2 Segmentation Models  
To determine the best segmentation model for the task, we evaluated six of the most popular state-of-the-art approaches. **FCN**[31] is one of the earliest approaches to pixel-level classification. It takes the conventional CNN architecture and replaces the fully connected layers with a convolutional layer by arguing that the dense layers can be thought of as doing \(1\times 1\) convolutions. The final convolution layer is then up-sampled using deconvolution to learn non-linear up-sampling and produce a feature map that has a similar size as the input, wherein each pixel corresponds to the predicted classes. **U-Net**[32] builds on top of FCN in that it is also comprised of symmetric encoding and decoding fully convolutional layers that form a U-shape. Additionally, it adds skip-connections between corresponding encoding and decoding layers to reinforce the information that is lost during downsampling. **PSPNet**[33] introduces the pyramid pooling module, which concatenates the feature maps from the layers of the backbone model to capture global context, which is important in providing indications on the distribution of the segmentation classes across the image. Moreover, it uses an auxiliary loss applied at the input of the pooling module to serve as intermediate supervision during the training. **DeepLabV3**[34] adds several techniques to achieve a finer delineation of objects, such as atrous convolutions and spatial pyramid pooling (SPP). SPP is used to capture multi-scale context by applying multiple pooling layers that divide the feature maps of the last convolutional layer into fixed spatial bins and concatenating the output vector to be fed to the subsequent fully connected layer. As this increases the complexity of the model, atrous convolutions, also known as dilated convolutions, are used so that the receptive fields of filters are larger, thereby incorporating a larger context without increasing the number of parameters. **PAN**[35] proposes two new modules to the segmentation framework, namely, feature pyramid attention (FPA) and global attention up-sample (GAU). GAU guides the low-level features by combining them with a global context extracted from performing global average pooling to the high-level features. FPA learns better representation by combining global pooling and spatial pyramid attention on the output of the backbone model. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Method** & **Mean** & **Gun** & **Knife** & **Wrench** & **Pliers** & **Scissors** \\ \hline Faster & & & & & & \\ R-CNN & 86.71 & 96.24 & 82.92 & 86.79 & 82.05 & **85.53** \\ YOLO & 82.84 & 93.04 & 75.84 & 85.26 & 79.87 & 80.19 \\ SSD & 84.32 & 95.31 & 78.90 & 85.41 & 80.10 & 81.91 \\ RetinaNet & 85.68 & **97.06** & 70.33 & **91.61** & **86.18** & 83.21 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Detection mean average precision (%) on the validation set. **MA-Net**[36] also applies attention mechanism in its architecture specifically by introducing two new blocks: point-wise attention block (PAB) and multi-scale fusion attention block (MFAB). PAB captures the spatial dependencies between pixels in the global view, and MFAB captures the channel dependencies between any feature map by multi-scale semantic feature fusion. We only used the pixel-level annotated data to evaluate the segmentation models. We used the detection model selected from the previous model selection experiment to extract patches or regions in the samples that were to be used to train the segmentation models. We added background patches, i.e., regions that do not contain threats, by running negative samples through the chosen detection model. The resulting dataset was then divided into training and validation sets. We also used the same backbone network for all the models, i.e., ResNet-50 [30], and trained them all for 60,000 iterations. Table 3 shows the results on the validation set using various evaluation metrics.