# Automated Detection and Classification of Returnable Packaging Based on YOLOV4 Algorithm
###### Abstract  
This article describes the implementation of the You Only Look Once (YOLO) detection algorithm for the detection of returnable packaging. The method of creating an original dataset and creating an augmented dataset is shown. The model was evaluated using mean Average Precision (mAP), F1 score, Precision, Recall, Average Intersection over Union (Average IoU) score, and Average Loss. The training was conducted in four cycles, i.e., 6000, 8000, 10,000, and 20,000 max batches with three different activation functions Mish, ReLU, and Linear (used in 6000 and 8000 max batches). The influence train/test dataset ratio was also investigated. The conducted investigation showed that variation of hyperparameters (activation function and max batch sizes) have a significant influence on detection and classification accuracy with the best results obtained in the case of YOLO version 4 (YOLOV4) with the Mish activation function and max batch size of 20,000 that achieved the highest mAP of 99.96% and lowest average error of 0.3643.  
artificial intelligence algorithms; automated system; convolutional neural network; computer vision; YOLOV4 20222121131 20222121131 20222121131 202221131 202221131 202221131 2022221131 2022221131 2022221131 20222131 202222131 20222131 20222131 2022213  
dataset which consists of 2527 images in six categories of waste (glass, paper, cardboard, plastic, metal, and trash). From the obtained results, it was seen that the optimized DenseNet121 achieved the highest accuracy of 99.6%. [PERSON] and [PERSON] [12] proposed the intelligent waste material classification, which is based on ResNet-50 and support vector machines (SVM) applied to TrashNet dataset [11]. ResNet-50 was used as a feature extractor while the SVM was used to classify the waste into the specified groups, the obtained model achieved an accuracy score of 87%. [PERSON] and [PERSON] [13] performed the plastic waste classification using CNN on the following classes: polyethylene terephthalate, high-density polyethylene, polypropylene, and polystyrene. Authors in the research created a unique dataset, they also investigated the different configurations of CNN (15 and 23-layer network), diverse image resolutions (120 \(\times\) 120, and 227 \(\times\) 227 pixels), and the influence of different train/test dataset ratios (60:40 up to 90:10). The highest classification accuracy was achieved in case of 23-layer CNN with the image resolution of 227 \(\times\) 227 pixels of 99.23% at train/test ratio 90:10. [PERSON] et al. [14] proposed the multi-layer hybrid CNN (similar to VggNet with fewer parameters and higher classification accuracy) and tested on TrashNet [11] dataset, for intelligent waste classification to overcome the low classification accuracy and long running times of the majority of CNN-s. In this investigation, the highest classification accuracy achieved was 92.6%. The SVM along with Histogram of Oriented Gradient (HOG) features CNN, and ResNet50 CNN [15] were applied to publicly available waste dataset from [PERSON] [16]. The goal was to identify a single object in images and classify it into one of the given categories (cardboard, glass, metal, paper, plastic, and trash). The highest accuracy score was 95.35% and it was achieved using ResNet50 architecture. On the original dataset [PERSON] et al. [17] applied the four and five-layer deep CNN for classifying the paper, glass, plastic, and organic waste. The investigation showed that the highest classification accuracy of 83% and 76.7% was achieved in the case of organic waste with four and five-layered deep CNN, respectively. In the last few years, the YOLO algorithm has been increasingly used in the detection and classification of non-biodegradable waste. [PERSON] et al. [18] applied the YOLO algorithm to detect non-biodegradable waste from the bins. Classification accuracy was faulty and imprecise with the results of 75% for metal, 65% for plastic, and 60% for glass.