# Effective Strategies for Enhancing Real-Time Weapons Detection in Industry
## 4 Results
### Second Phase  
#### 4.2.1 Data-Augmentation  
Initially, all the augmentations offered by Albumentations' library in the YOLOv8 repository were used, but we looked for the augmentation settings that make the training images similar to real situations in CCTV camera and therefore improving the model's performance, in terms of precision, in these scenarios. The augmentations used are  
* **Blur:** applies a blur with a maximum size of 10 \(\times\) 10 pixels to the image with a probability of 50%.
* **Cutout:** applies three black squares, each 10% of the size of the image, with a probability of 50%.
* **Horizontal Flip:** applies a horizontal flip with a probability of 50%.
* **Color Augmentation:** applies different Hue, Saturation, and Value variations with a probability of 50% (0.015, 0.7, 0.4, respectively).
* **ISONoise:** applies a camera noise to the image with a probability of 50%, a colour variance of between 0.05 and 0.4, and an intensity of between 0.1 and 0.7.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**\% BG** & **AP50** & **AP75** & **AP** & **F1** & **FP** \\ \hline
10\% & 76.35 & 71.90 & 61.99 & 71.60 & 171 \\
7\% & 74.22 & 67.51 & 58.37 & 68.30 & 180 \\
5\% & 77.21 & 73.18 & 62.81 & 72.50 & 293 \\
2\% & 74.30 & 69.83 & 60.24 & 68.90 & 261 \\ Baseline & 77.12 & 68.10 & 59.15 & 72.50 & 348 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Results of models trained with _Disarm-Dataset_ and different background (BG) images’ percentage. 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.  
Figure 9: Comparison between models using _Disarm-Dataset_ with different background images’ percentages, according to average precision (AP) and False Positives (FP).  
* **Random Brightness** applies random image lighting variations with a probability of 50%.
* **Rotate** applies rotation with a probability of 50% and a range from \(-15^{\circ}\) to \(15^{\circ}\).
* **Translate** applies translation of the image with a gain of \(\pm 10\%\).  
The initial configuration utilised was the combination of all augmentations, referred to as _Default_. Subsequently, various combinations were explored, starting by excluding one augmentation at a time to identify the most effective setup. Different combinations were then tested, incorporating the best-performing augmentation configurations from the previous step. The optimal results are presented in Table 7. Generally, omitting the blur augmentation contributes to an improved overall performance, while the removal of other augmentations does not yield enhancements. This could be attributed to certain images having insufficient resolution for such augmentations. When the representation of weapon features is already sub-optimal, the introduction of additional blur further hampers their detection. The addition of other augmentations does not enhance the _Default_ configuration. For subsequent experiments, the model with all augmentations except blur is utilised as the baseline.