# Automatic Handgun Detection with Deep Learning in Video Surveillance Images
## 2 Related Works  
The problem of the automatic detection of firearms and bladed weapons hidden inside luggage has been tackled for some years using images obtained with X-ray scanners. To this end, the classical cascade-based learning techniques of _Haar feature detectors_ and _AdaBoost classifiers_[5] have been applied. Indeed, those methods can only work with expensive X-ray scanners and cooperative individuals. A very interesting complementary context is the detection of visible weapons in images captured by CCTV systems, since these systems are already common in video surveillance of public spaces and allow detecting weapons held by noncooperative individuals, regardless of the construction material of such weapons.  
One of the most important challenges when training learning models that are fed with CCTV images is the scarcity of the data. Some early methods employed learning techniques based on color segmentation followed by point of interest detection in segmented RGB images [6; 7]. The more recent work [7] achieved recall values of 94.93% and a false positive rate of 7% for knife detection, while the figures for firearm detection were 35.98% and 3.31%, respectively.  
The use of deep learning techniques to solve computer vision problems [8; 9; 10; 11; 12] has achieved great popularity in the last decade in comparison with traditional machine learning techniques. This popularity is due to both its excellent results and the lack of necessity for the manual selection of features to solve the problem. These networks are based on adjusting or learning the parameters (weights) during their training using the _gradient descent algorithm_, which aims to minimize the network's response error or loss function. In this optimization process, the error is backpropagated through the network to adjust its parameters across all its layers. This process is also known as _error backpropagation_ through the network. The use of convolution operations allows considering the process of adjusting the network weights as that of obtaining filters that focus on the characteristics that solve the problem, even when dealing with heterogeneous datasets [13]. The network depth provides different levels of the abstraction or composition of features associated with the input images.  
CNNs are applied with excellent performance in three related computer vision problems:  
1. _Classification_[11]: Given an image of a foreground object, the objective is to indicate what is the label or class that identifies that type of object (see the example in Figure 2a);
2. _Detection_[8; 10]: Given an image with multiple objects present in it, each object must be located by marking in the image the bounding box (bbox) that contains it. A label indicating the type of object contained and a certainty value (between zero and one) for such a prediction is added to each bbox (see the example in Figure 2b). It is common to consider a prediction valid, successful or not, when the prediction's certainty or confidence score exceeds a threshold value (e.g., 0.5);
3. _Segmentation:_ Given an image, each pixel must be labeled with the class of the object to which that pixel belongs.  
Before a concise review of the most relevant models based on CNNs for object detection--in general--and firearms' detection in video images--in particular--the fundamental metrics for the performance assessment of the detection models included in our present study are described.