# Effective Strategies for Enhancing Real-Time Weapons Detection in Industry
## 3 Materials and Methods
### Datasets  
High-quality datasets are essential for obtaining an optimal model. Given the focus of this research on weapons detection, various datasets have been examined. Our objective is to obtain a comprehensive array of datasets and identify the most effective datasets or combinations of datasets that provide the most favourable outcomes in detecting weapons on CCTV systems. As a result of this search, the following weapons detection datasets were found (an overview can be seen in Table 2, along with some examples in Figure 1):  
* **usdataset**[1]. This dataset was created at the University of Seville, capturing a simulated attack through a CCTV system. It encompasses two different scenarios; both cam 1 and cam 7 are directed towards a corridor with a door on one side and two exits in the background, experiencing minimal lighting variations, as they are indoors. Cam 5 is focused on an entrance, introducing ambient lighting and resulting in some lighting variations. The dataset comprises a total of 5149 images at 1080 p resolution, featuring 1520 instances of guns. * **usdataset_Synth**[1]. This dataset is generated through simulation using the Unity engine. Gun annotations were performed automatically by the engine, yielding a substantial number of annotated images without the need for human annotation. The dataset is presented in three versions based on the number of images included: U0.5, U1.0, and U2.5 (500, 1000, 2500, respectively). * **Gun-Dataset**[3]. This dataset consists of over 51,889 labelled images containing weapons. For our purposes, we use 46,242 labelled images, with the majority of weapons positioned in the foreground. * **YouTube-GDD**[4]. This dataset comprises images extracted from YouTube videos. It includes two classes, _gun_ and _person_, but our experiments focus solely on the _gun_ class. The dataset comprises 5000 images at a resolution of 720 p, featuring 16,064 instances of weapons. * **HOD-Dataset**[5]. Utilised to provide the detector with background images of objects that may resemble weapons, this dataset includes over 12,800 images of handheldobjects. In our case, only five classes from the original dataset are used: _mobile phone, keyboard, calculator, cup, mobile HDD_, resulting in a total of 4200 images. Based on the insights from [11], a novel dataset named the _Disarm-Dataset_ has been curated by amalgamating the majority of the previously described datasets. This dataset was further expanded with the inclusion of two new datasets, derived from videos recorded by a CCTV-like system. The first dataset encompasses both weapons and other objects that may resemble weapons, while the second dataset (_FP-Dataset_) intentionally excludes weapons to mitigate false positives. Consequently, the dataset incorporates over 62,000 images and nearly 65,000 instances of weapons (refer to Table 2 for an overview of this dataset). Additionally, a modification is applied by using _usdataset_v2_ instead of _usdataset_, where both cam 5 and cam 7 are utilised for training and validation, while cam 1 is reserved for testing. This modification aims to enhance the training process by incorporating challenging scenarios from cam 5, known for its difficult scenarios, into the detector's learning process. Furthermore, it can be seen that most of the images in each dataset, if not all, are captured in scenes under high ambient light, where Gun-Dataset and Disarm-Dataset are the datasets with the highest percentage of images with darker scenes. Note that in Section 4.3.2, we experiment with the performance of our model with darker scenes, as this type of scenario is one of the most common in the real world.