## 6 Experimental Results and Analysis  
Several X-ray machine security videos are selected, and different binarization methods are used to compare the extraction of key targets. There are 113 packages in the video. Figure 23 shows some package binarization images obtained by each method. Figure 22: Package detection and tracking extraction process. As can be seen in Figure 23, there are many incomplete packages in the method based on gray binarization. Some packages are missing or truncated in the method based on background difference and the method based on Sobel operator binarization, while the method based on ES-MBD binarization still maintains the integrity of packages after removing noise. Comparing the intercepted package image in the key target with the actual package image, if the intercepted package image is complete, the package is considered to be successfully detected. In addition, if the adjacent package is detected as a whole package by the algorithm, detection fails. The detection results of different methods are shown in Table 2.  
The package detection problem in this paper is not a binary classification problem. Binary classification is a deterministic quantity problem for both P (positive) and N (negative). Packages are treated as positive class. Package detection does not set a fixed value for N (background is negative class), so it is an atypical binary classification problem. The evaluation of this algorithm is performed with the help of evaluation metrics (precision, recall, F\({}_{1}-\)Score, accuracy). Figure 23: Comparison of image binarization methods: (**a**) Original image, (**b**) gray binarization, (**c**) background difference binarization, (**d**) binarization of Sobel operator edge detection, (**e**) ES-MBD binarization. Recall represents the proportion of all input positive samples that are detected:  
\[\text{Recall}\ =\ \frac{\text{TP}}{\text{TP}+\text{FN}}. \tag{19}\]  
\(\text{F}_{1}-\text{Score}\) is a harmonic average of precision and recall used to avoid a situation where one is high and the other is low. The higher the F1-Score, the better the algorithm works:  
\[\text{F}_{1}-\text{Score}\ =\ \frac{2\times\text{Precision}\times\text{ Recall}}{\text{Precision}+\text{Recall}}. \tag{20}\]  
Accuracy represents the proportion of positive and negative samples that the algorithm detects correctly overall. As this algorithm only focuses on the detection effect of positive samples, this metric is only for reference:  
\[\text{Accuracy}\ =\ \frac{\text{TP}+\text{TN}}{\text{TP}+\text{FP}+\text{TN}+ \text{FN}}. \tag{21}\]  
The evaluation of the detection effect of each method is shown in Table 7.  
As can be seen in Table 7, the precision rate of the gray binarization method is 47.8%, the recall rate is 48.7%, and the \(\text{F}_{1}-\text{Score}\) is 0.482. Accuracy is a global metric and is related to both positive and negative samples. Because luggage package detection does not focus on negative samples in this paper, the accuracy rate is not discussed in the result analysis. Among the four binarization methods, the overall effect is the worst. Due to the simple structure, less image information and sensitive background noise, the traditional gray binarization method cannot completely extract the object outline of the luggage package in the X-ray image. The precision rate of the background difference binarization method is 74.8%, the recall rate is 78.8%, and the \(\text{F}_{1}-\text{Score}\) is 0.767. The main problem of the background difference binarization method is that it cannot detect some edge areas of the package whose color is not obvious, resulting in incomplete package. The precision rate of the Sobel operator binarization method is 51.9%, the recall rate is 61.9%, and the \(\text{F}_{1}-\text{Score}\) is 0.565. The Sobel operator binarization method is insensitive to large package regions with fewer homochromatic textures, which can lead to many packages being split into multiple parts with a very high number of false detections.