# Automated Detection and Classification of Returnable Packaging Based on YOLOV4 Algorithm
## 3 Results and Discussion
### Discussion  
As seen from Tables 4 and 5 the entire investigation conducted in this paper can be divided into four different cycles based on max batch sizes, i.e., 6000, 8000, 10,000, and 20,000. The first cycle had 6000 batches with different activation functions and different train/test ratios. The ReLU activation function with a 75/25 ratio had the best performance in this cycle as well it had a low average loss and the best mAP percentage score. In the second cycle of training again ReLU activation function was the best but Mish was close with its performance and metrics while in the third cycle only Mish and ReLU activation functions were evaluated. The main reason for that is because they outperformed the Linear activation function and there is no need to waste time on training the YOLOV4 algorithm with under-performed hyperparameters. In the third cycle, ReLU is not an absolute choice because the only thing that was better while using the Mish activation function is average loss. Referring to Table 5 it is visible in row Average loss that Mish is slightly better than ReLU but still, these metrics are not good enough for implementation in real situations. In the last training cycle, the ReLu and Mish activation functions were re-evaluated for all three train test ratios. All of the metrics are higher, which contributes to the very detection of returnable packaging. A possible explanation for this is the Mish activation function has a low operating cost with a variety of properties and smooth, non-monotonic nature. It is unbounded above and bounded below that means it can avoid saturation which can cause the training to slow down. That results in more flexibility while training the algorithm and improving it [68]. The training of the algorithm was stopped at the moment when the average losses were no longer decreasing. Looking at the fourth cycle it can be noticed that with the Mish activation function in the 75/25 train/test ratio gets outstanding results. The mAP is nearly 100%, the F1 score is 1.00 and the Average IoU is 91.13%. The only thing that can be improved is to minimize the Average loss which is at this moment 0.3643, but there is a risk to Overfit detection algorithm model. At this moment while testing the trained detector if the thresh is put below 0.85%, the algorithm could detect wrong which is not preferable. A Linear activation function is the worst by all means while training this detection algorithm, it is not flexible as Mish and it has poor quality as shown in Table 4. By statistics, the ReLU activation function is the best but further analysis is needed to explore all possibilities while training the YOLOV4 algorithm. Based on the values shown in Tables 4 and 5, it can be seen that the train/test ratio has slight or no influence on the classification accuracy when compared to two hyperparameters(max batch size and activation functions). Obtained weights from the YOLOV4 model were tested with new input images that previously did not belong to the initial dataset used in this investigation. The testing was conducted using a web camera, where the percentage of reliability varied depending on the object location or angle of the camera visible from Figures 9-12. Detection results for glass packaging are shown on Figure 9. It is visible that the YOLOV4 algorithm perfectly detects and classifies the given object. It is also visible a high coefficient of reliability for every object in the image. Plastic packaging detection results are shown in Figure 10 where it can be seen that the YOLOV4 algorithm perfectly detects and classifies plastic packaging with a high coefficient of reliability on every object on the image. Aluminum packaging detection can be seen on Figure 11. As previous 2 classes, it is again visible that YOLOV4 perfectly detects and classifies the aluminum class of packaging. Figure 11: Results of YOLOV4 detection, for aluminum packaging using web cam. Figure 10: Results of YOLOV4 detection, for plastic packaging using web cam.