# Automated Detection and Classification of Returnable Packaging Based on YOLOV4 Algorithm
###### Abstract
[PERSON] and [PERSON] [19] reported the development of a smart trash bin that separates and collects trash recyclables using a webcam and YOLO algorithm where the classification accuracy of recyclables using YOLO was 91% in an optimal computing environment and 75% when implemented on Raspberry Pi. [PERSON] [20] used the YOLO-Green object detection algorithm for detecting trash in real time. In this paper, the original dataset was developed from real-world trash divided into seven types of solid waste (batteries, clothes, electronic waste, glass, metal, paper, and plastic). The YOLO-Green achieved a classification accuracy of 78.04%. The YOLO-based neural network model with variational autoencoder was employed for automatic detection and classification of recycling waste [21]. The highest classification accuracy was 69.7%. The superiority of the YOLO algorithm compared to other detection algorithms can be demonstrated by additional research and applications in practice. For example, [PERSON] et al. [22] trained YOLOV4, Single Shot MultiBox Detector (SSD), and Faster-Region Based Convolutional Neural Networks (Faster-RCNN) for the detection and classification of vehicle models. The obtained results showed that the YOLOV4 algorithm has had the best performance (mAP in the amount of 98.19% and FPS in the amount of 82.1). SSD proved to be the fastest (FPS in the amount of 105.14), but the problem comes from the simplified light model (Mobilnet- lightweight model) which frequently failed to detect a vehicle. Faster-RCNN turned out to be the slowest model (FPS in the amount of 36.32), although it was slightly less accurate (mAP valued at 93.40%) than YOLOV4, due to its detection speed it was unable to perform the given task. According to [21], YOLO can be applied as an algorithm for an automatic waste recycling system. The authors trained the modified YOLO (YOLO with variational Autoencoder) and Fast R-CNN model on a custom-made dataset consisting of cans, batteries, and plastic bottles. The obtained results prove that the modified YOLO model with a prediction accuracy rate of 69.70% and a localization rate of 22.10% again outperforms the competitive Fast R-CNN with an accuracy rate of 71.60% and a localization rate of 8.60%. In the paper, ref. [23] AI-controlled Outdoor Autonomous Trash-Collecting Robot was used for underwater garbage collection. Several object detection algorithms (Mask-RCNN, YOLOV4, and YOLOV4-tiny) were compared and tested for the outdoor waste detection and classification task. The obtained results were evaluated with the best map and the detection time where YOLOV4 and YOLOV4-tiny outperformed the Mask-RCNN in the detection and localization of outdoor trash. YOLOV4 and YOLOV4-tiny achieved the best mAP of 99.32% and 95.25% with a detection speed of 32.76 and 5.21 ms, while the Mask-RCNN barely achieved the best mAP of 89.10% and had a very slow detection time in the amount of 3973.29 ms. One of the important factors when choosing the optimal algorithm for implementation in an automatic system is the memory of the model itself. [PERSON] et al. [24] trained Faster R-CNN, 4S-YOLOV4, YOLOv4, YOLOv3, SSD, and 4 SP-YOLOv4, on a dataset consisting of 6600 images of underwater garbage. The obtained results show that 4 SP YOLO requires significantly less memory for obtaining weight factors than Faster R-CNN or SSD. In this particular case, 4 SP YOLO requires \(10^{2}\) less memory than SSD and up to \(10^{6}\) times less memory than Faster R-CNN. This fact gives the possibility of implementing the YOLO detection algorithm to a printed circuit board-based microcontrollers such as Raspberry Pi, CaffeLatte, etc. The goal of this paper is to examine the YOLOV4 algorithm and achieve the optimal performance by varying activation function and max batch size hyperparameters on a custom-made, three-class (plastic, glass, and aluminum) dataset that contains 3788 images (2838 original images and 950 downloaded from [PERSON] [25]).