# Deep Convolutional Neural Networks Object Detector for Real-Time Waste Identification
## 3 Results  
The experiments in this paper have been performed using Tensorflow Object Detection API. The training was performed on a Local Deep Learning Server with a GPU RTX 2080 Ti, 11 GB GDDR6 352-bit RAM, 1.6 GHz processor, and 4352 CUDA cores, while the evaluation took place on the server's CPU equipped with i7 Core 8 th gen, 4.6 GHz, 6 cores, and 12 threads. This allowed us to train our SSD models with an average step speed of 0.3 s, meaning that training one network for 300 k steps took around 25 h. As for the Faster R-CNN, the average step speed was 0.7 s, meaning that training one network for 300 k took around 58 h. After training the model, the resulted graph was frozen and transformed into an inference model. Our inference model was run on a Raspberry Pi3+ processor with an USB extension for Neural Network Processing, which led to speeds of 9 frames per second (FPS) for SSD architecture and to 4 FPS for Faster R-CNN.  
In order to obtain the mean average precision and recall of the model, Pascal VOC metrics have been used for evaluation. In addition, Pascal VOC metrics were used in order to evaluate the results per class.  
PASCAL VOC is a popular dataset and an evaluation tool for object detection and classification [39]. The PASCAL VOC evaluation metric implies that a prediction is positive if \(IoU\geq 0.5\). Intersection over Union (\(IoU\)) is defined as the area of the intersection of a predicted bounding box (\(B\)) and a ground-truth box (\(B_{gt}\)) divided by the area of their union.  
\[IoU=\frac{Area\big{(}B\cap B_{gt}\big{)}}{Area\big{(}B\cup B_{gt}\big{)}} \tag{4}\]  
A detection is considered true positive (\(TP\)) only if it satisfies three conditions: confidence score is greater than confidence threshold (0.5 in our case); the predicted class matches the class of a ground truth; the \(IoU\) of the predicted bounding box is greater than a \(IoU\) threshold (0.5 in our case) with the ground-truth. If the last two criteria are not satisfied, the detection is false positive (FP). In addition, PASCAL VOC challenge includes some additional rules to define true/false positives. In case multiple predictions correspond to the same ground-truth, only the one with the highest confidence score counts as a true positive, while the others count as false positives. When the confidence score of a detection that is supposed to detect a ground-truth is lower than the confidence threshold, the detection counts as a false negative (\(FN\)). Based on these assumptions, the equations for precision, recall, and F1-score are as follows:  
\[Precision=\frac{TP}{TP+FP} \tag{5}\]  
\[Recall=\frac{TP}{TP+FN} \tag{6}\]  
\[F1=2.\frac{Precision\text{-}Recall}{Precision+Recall} \tag{7}\]  
Precision is defined as the number of true positives divided by the sum of true positives and false positives. Recall measures the ratio of true object detections to the total number of objects in the dataset. The F1 score measures the accuracy of the model based on the precision and recall harmonic mean:  
In order to evaluate the performances of the object detectors, average precision (\(AP\)) has been used, instead of precision and recall, for example. The AP is a numerical tool that can be used for comparison instead of intersecting curves from precision-recall. For our dataset, the calculation of average precision involves a prediction over five classes. Therefore, the mean average precision (\(mAP\)) is defined as the mean of AP across all five classes:  
\[mAP=\sum_{i=1}^{k}\frac{AP_{i}}{k}. \tag{8}\]