# Effective Strategies for Enhancing Real-Time Weapons Detection in Industry
## 4 Results
### Third Phase  
#### 4.3.1 Detection Scheme's Modules  
These experiments aim to assess the impact on performance of using the second classifier, the temporal window, and both in conjunction with the model in terms of accuracy and inference time. As depicted in Table 9, utilising only the trained model achieves better accuracy than using any of the modules. However, using only the temporal window yields the worst results, as many detections are filtered out, since it requires three consecutive frames to be considered a true positive. Using both modules compensates for the poor performance of the temporal window, although it produces inferior results compared to using the model alone or the model with the second classifier. Reducing the confidence of the model significantly affects the number of false positives, with an increase of over 90%. However, it has almost no effect when either the second classifier, the temporal window, or both are added, resulting in increases of 8%, 0%, and 0%, respectively. Figure 10: Comparison between versions of the Scale Match method. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Area** & **Dataset** & **AP50** & **AP75** & **AP** & **F1** & **FP** \\ \hline \multirow{4}{*}{All} & Scale & \multirow{2}{*}{70.00} & \multirow{2}{*}{58.18} & \multirow{2}{*}{48.10} & \multirow{2}{*}{66.70} & \multirow{2}{*}{408} \\  & Match & & & & & \\  & paste & & & & & \\  & Scale & 77.68 & 73.88 & 63.41 & 73.60 & 164 \\  & Match & & & & & \\  & Baseline & 77.23 & 73.06 & 62.77 & 73.10 & 202 \\ \hline \multirow{4}{*}{\(\leq\)\(100^{2}\)} & Scale & \multirow{2}{*}{41.26} & \multirow{2}{*}{30.46} & \multirow{2}{*}{26.09} & \multirow{2}{*}{47.01} & \multirow{2}{*}{407} \\  & Match & & & & & \\ \cline{1-1}  & paste & & & & & \\ \cline{1-1}  & Scale & & & & & \\ \cline{1-1}  & Match & & & & & \\ \cline{1-1}  & Baseline & 49.10 & 42.55 & 36.39 & 54.43 & 199 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Comparison of using different Scale Match versions for training or not. The metrics used were Average Precision (AP), AP50, AP75, F1 score (F1), and False Positives (FP). These were calculated using an IoU of 0.7 and a confidence threshold of 0.5. Note that the results in red are the best and those in blue are the second best. Table 9 illustrates that using only the model yields a significant number of false positives. In contrast, incorporating the second classifier with the model reduces the number of false positives by 71%, but results in a decrease of 13 FPS in the number of frames per second. On the other hand, employing the temporal window in conjunction with the model results in zero false positives while maintaining the inference time. However, using only the temporal window leads to a substantial decrease in the F1-score of the model, as it requires waiting for a certain number of consecutive high-confidence detections of the same object to be confirmed as a true positive. Combining both methods--the temporal window and the second classifier--with the model results in zero false positives and, as expected, a corresponding reduction in frames per second, similar to when using the second classifier, as the temporal window has almost no effect on the inference time. It is worth mentioning that most of the false positives that the baseline captures are everyday objects which have a low aspect ratio and can be seen as a weapon. In Figure 11, it can be seen, in the first row, that a mobile phone held like a gun is detected by the baseline detector. In this case, using the second classifier, the temporal window, or both can eliminate the false positive. The second row demonstrates how the second classifier module enhances the system's performance by elevating the level of confidence in weapon detection for cases with initially low confidence scores (from 0.57 to 0.88). Furthermore, it is evident that relying solely on the temporal window can result in a greater number of true positives being overlooked, underscoring the superiority of a combined approach that incorporates both modules.