# A Vision Detection Scheme Based on Deep Learning in a Waste Plastics Sorting System
###### Abstract  
The preliminary sorting of plastic products is a necessary step to improve the utilization of waste resources. To improve the quality and efficiency of sorting, a plastic detection scheme based on deep learning is proposed in this paper for a waste plastics sorting system based on vision detection. In this scheme, the YOLOX (You Only Look Once) object detection model and the DeepSORT (Deep Simple Online and Realtime Tracking) multiple object tracking algorithm are improved and combined to make them more suitable for plastic sorting. For plastic detection, multiple data augmentations are combined to improve the detection effect, while BN (Batch Normalization) layer fusion and mixed precision inference are adopted to accelerate the model. For plastic tracking, the improved YOLOX is used as a detector, and the tracking effect is further improved by optimizing the deep cosine metric learning and the metric in the matching stage. Based on this, virtual detection lines are set up to filter and extract information to determine the sorted objects. The experimental results show that the scheme proposed in this paper makes full use of vision information to achieve dynamic and real-time detection of plastics. The system is effective and versatile for sorting complex objects. plastic sorting; vision detection; deep learning; object detection; multiple object tracking 2023202 with traditional methods, vision detection methods based on industrial cameras have advantages such as high efficiency and non-contact characteristics. Therefore, industrial cameras are currently one of the most widely used sensors and an essential component in image-processing systems [9]. Vision-based automated sorting provides an effective method for the recycling of waste plastics. The main research in this paper focuses on how to make full use of the visual information provided by the industrial camera to realize dynamic sorting when facing complex operational objects with different categories, locations, shapes, and heights. To improve the accuracy and efficiency of plastic detection so as to provide accurate information for subsequent sorting, scholars have carried out a considerable amount of research in designing vision detection methods. The existing research is mainly divided into two types: the first is the traditional machine learning method, and the second is the method based on deep learning. The first type usually contains three main parts: data processing, feature extraction, and selecting machine learning algorithms as classifiers [10][PERSON] [PERSON] et al. binarized the acquired RGB images and then used Hu moment to extract a set of numerical attributes from the region of interest, and fed them into the k-NN classifier to realize the classification of plastic cutlery, plastic bottles, and aluminum cans [11]. [PERSON] et al. studied the classification of three plastics: PET, HPDE, and PP. Plastic regions were first extracted and [PERSON] manipulations were performed. Then, the majority voting scheme combined with Principal Component Analysis (PCA), Kernel PCA (KPCA), Fisher's Linear Discriminant Analysis (FLDA), Singular Value Decomposition (SVD), and Laplacian Eigenmaps (LEMAP) was used to extract features. Finally, the Support Vector Machine (SVM) was used for classification. The proposed method outperforms the single classifier [12]. [PERSON] et al. proposed a robotic-arm sorting method based on a thermal imaging camera and proximity sensor. They adopted a SURF feature extractor to extract key points and fed them into clustering model for feature mapping. Finally, aluminum cans, plastic bottles, and Tetra Paks were sorted using the SVM classifier [13]. [PERSON] et al. first used distance transformation, threshold segmentation, and other methods to process images. Then, the ReliefF algorithm was applied to select the color features of plastic bottles. Finally, the SVM was used for color classification [14]. [PERSON] et al. first segmented the effective area of the plastic bottle.