# A Real-Time Garbage Truck Supervision and Data Statistics Method Based on Object Detection

Authors: Xuanyu Zhang; Yining Gao; Guangyi Xiao; Bo Feng; Wenshu Chen
Journal: Wireless Communications and Mobile Computing
 (2020)

---

## Abstract

Garbage classification is difficult to supervise in the stage of collection and transportation. This paper proposes a computer vision-based method for intelligent supervision and workload statistics of garbage trucks. In terms of hardware, this paper deploys a camera and an image processing unit with NPU based on the original on-board computing and communication equipment. In terms of software, this paper uses the YOLOv3-tiny algorithm on the image processing unit to perform real-time target detection on garbage truck work, collects statistics on the color, specifications, and quantity of garbage bins cleaned by the garbage truck, and uploads the results to the server for recording and display. The proposed method has low deployment and maintenance costs while maintaining excellent accuracy and real-time performance, which makes it have good commercial application value.


---

## Body

## 1. Introduction

At present, garbage classification has received great attention. Garbage classification can not only play the role of environmental protection but also can recycle and reuse some resources, which has high social benefits. Garbage is divided into four categories and placed in four-colored trash cans, including recyclables (blue), kitchen waste (green), hazardous waste (red), and other garbage (black) [1]. Four types of trash cans are shown in Figure 1.Figure 1
Trash bin for holding different sorts of trash.The work of garbage can collection and transportation is to collect and transport the garbage distributed in garbage cans all over the city. According to the regulations, each garbage truck can only collect and transport garbage of a single category. However, due to the lack of effective regulatory means, there is a phenomenon that on-board staffs do not follow the regulations and pour other types of garbage into their trucks.Meanwhile, due to the lack of effective statistical data means, the problem of vehicle scheduling without reliable data basis often leads to great differences in the workload of each garbage truck. With the development of computer technology, mobile devices have the conditions to deploy artificial intelligence-related technologies. The development of neural network processing unit (NPU) has greatly reduced the difficulty and cost of deployment of the popular deep learning technology. Computer vision is an important branch of artificial intelligence. Through the deep learning method based on convolutional neural network, the computer can obtain the environment perception ability similar to human vision by analyzing the pictures captured by the camera. This paper attempts to use computer vision technology to supervise and count the workloads of the garbage trucks. The collection data mainly includes the amounts, colors, and specifications of garbage cans collected by garbage trucks. The main contributions of this paper are as follows.(i)
A hardware deployment scheme based on the image processing unit with NPU is proposed(ii)
Based on the analysis of the image characteristics of the garbage can, a dataset for garbage can recognition is established by using the garbage can color as the classification basis(iii)
An intelligent supervision and workload statistics algorithm for garbage trucks is proposed based on the trained YOLOv3-tiny modelThe structure of the paper is as follows. Section2 is the related work of the paper, including the current supervision methods for garbage trucks, the types of garbage trucks, and the deployment and application of various target detection algorithms on mobile devices. Section 3 describes the method of this paper in detail from the perspective of hardware deployment scheme and object detection algorithm. Section 4 is the experiment, which gives the test results of this paper in the real environment. Section 5 is summary and prospect.


## 2. Related Works

At present, there is a monitoring and statistical method for garbage trucks in Zhonglian Environment, which is achieved by installing RFID tags with specific information on the bottom of each garbage can. However, the working environment of trash cans is often harsh, and RFID tags are prone to damage or fall off. In addition, not all garbage cans on the market are produced by the same company. When there is a difference in the data format of the RFID tag and the receiver, or when dealing with garbage cans without RFID, this method will completely lose the ability to work. Most of the garbage can collection and transportation vehicles in China adopt self-loading and unloading design. According to the different loading position of the trash can, they can be divided into two types: side feeding (garbage dumped from side) and rear feeding type (garbage dumped from back), as shown in Figure2.Figure 2
Side feeding and rear feeding garbage trucks.
(a)
Side feeding garbage truck(b)
Rear feeding garbage truckThe side feeding design can clean only one trash can at a time, while the rear feeding type can clean up two trash cans at the same time. According to the data of Zhonglian Environment, its company produces more than 8000 rear feeding garbage trucks each year but only about 4000 side feeding garbage trucks. Because the rear feeding garbage truck has greater possession and identification difficulty, this paper takes it as an example to carry out research and experiment, but this method can also be extended to the side feeding garbage truck for deployment.Object detection technology is the cornerstone of many computers vision research, which is used to locate, track, and analyze all potential objects in images [2]. The traditional object detection is mostly realized according to the steps of region selection and feature classification. There are a variety of feature extraction operators and classifiers, for example, the features like SIFT [3], HOG [4], and LBP [5] and the classifiers like SVM [6], Adaboost [7], and so on. However, due to the characteristics of human design, the generalization ability of traditional target detection methods is very weak, and it is easy to be affected by external environmental factors. With the development of deep learning, object detection has gradually shifted to the implementation based on convolution neural network, such as the famous R-CNN [8] and SSD [9]. The object detection based on deep learning breaks through the limitation of artificially setting the target image features, and the accuracy and robustness of object detection are greatly improved by automatically learning the possible features of the target through convolution neural network. However, most of the object detection methods based on convolution neural network have high requirements for computing power, which makes it face real-time challenges and is not conducive to the deployment of mobile devices. In the past few years, more and more scholars have begun to pay attention to the real-time performance of object detection, and some excellent real-time performance object detection algorithms such as Faster R-CNN [10] and YOLO [11–13] have emerged. Target detection in vehicle environment has also been widely concerned by the academic community, but most of them focus on the auxiliary driving of family cars, such as pedestrian detection, traffic sign detection, and so on. In [14], YOLOv2 was used for traffic sign recognition, which can effectively detect three types of traffic signs in real time. In [15], the real-time pedestrian detection was realized on a newly developed embedded device through HOG + SVM. In [16], truck drivers’ potentially dangerous driving behaviors were analyzed based on 11-month digital tachograph data and multilevel modeling approach. In [17], an allocation model was used to understand individualization driving states. Although the recognition of the movement process of the trash can is actually related to action recognition, compared to human gesture recognition, the task is obviously more regular and simple. We do get some inspiration from gesture recognition. Linear discriminant analysis (LDA) and extreme learning machine (ELM) are very common in gesture recognition [18–20]. Machine learning is also applied in many gesture recognition [21–24]. There is also work to recognize gestures by combining some functions in Internet of Things (IoT) [25]. In addition to the vehicle environment, CNN also has a wide range of applications in other fields, such as Smart City [26–28], health care [29, 30], and transportation [31].What is more, network routing protocols are constantly being improved [32–34], and the progress of sensor networks [35–37] has greatly improved the reliability of IoT [38–40].


## 3. Methods

This paper creatively applies the object detection algorithm to the garbage truck for monitoring and data statistics. The following will elaborate on the method of this paper from the perspective of hardware deployment and software design.


### 3.1. Hardware Deployment

Due to the special environment of garbage truck, the hardware deployment scheme will be affected by such factors as power consumption, computing power, volume of devices, and so on. The angle of the camera, the transmission mode of the data, and the computing power of the image processing unit will all have an impact on the design of the software level of this paper. The overall hardware deployment scenario for this paper is shown in Figure3.Figure 3
Hardware deployment.Most garbage trucks have their own on-board computers with mobile network communication functions to record the vehicle’s location and remaining fuel. Using the original data communication method can effectively reduce the deployment cost and difficulty. Only a waterproof camera and an image processing unit are installed on the truck in the design of this paper. The supervision and data statistics of the garbage truck work are realized through the software level. Because the garbage can is large and the computing power of the image processing unit is weak, the camera resolution selected in this paper is640×480. With the front of the car as the front, the camera is arranged on the slant of the working position of the garbage can. Take the horizontal direction as 0 degree, the camera angle is about 10 degrees. When the trash can is at the highest position, it is necessary to ensure that the vertical direction of the trash can at the two positions is completely photographed, as shown in Figure 4. The sample photo taken during the process of turning the barrel once is shown in Figure 5.Figure 4
Camera installation location.Figure 5
Some frames during the process of turning the trash.The image processing unit has a neural network processing unit NPU, and the NPU calculation force is 3Tops. The CPU adopts ARM architecture. Compared with the traditional structure of x86 CPU plus GPU, the structure of ARM CPU plus NPU has lower power consumption and smaller volume, which is more suitable for deployment in the vehicle environment. The image processing unit communicates with the on-board computer through the serial port, transmits the detection results to the on-board computer with a specific format of data message, and then uploads the data to the server through the mobile network for recording and subsequent display.


### 3.2. Software Design

In this section, the dataset established in this paper is described, and then, the object detection algorithm is described.


#### 3.2.1. Dataset

The training of object detection model is a kind of supervised learning, which needs to build a dataset with labels. Firstly, this paper analyzes the image characteristics of trash can. According to the different types of garbage, the garbage cans cleaned by the garbage collection and transportation trucks can be divided into four categories according to the color. The blue garbage cans contain recyclable garbage; the green garbage cans contain wet garbage; the red garbage cans contain harmful garbage, and the black garbage cans contain dry garbage.At the same time, there are many different cubage of these bins; the most common are 120L and 240L. Because of the limitation of two-dimensional image, there is no essential difference in two-dimensional image between trash cans of different cubage, while the color information is a good feature in three channel images. Therefore, in this paper, the garbage cans are divided into four types according to the color characteristics.In addition, because the turning operation of garbage truck is purely mechanical control, the detection program cannot obtain the signal of the beginning and end of turning through the electrical signal, so it is necessary to continuously perform object detection on the camera shot frames. This means that the garbage cans which are not in the turning state should not be the target of object detection. As shown in Figure6, the part marked in the green box are the garbage cans in the process of turning, which should be labeled during data tagging, while the garbage cans marked in the red box are not in the process of turning, which should be regarded as the background (negative sample) and not be labeled during tagging.Figure 6
Schematic diagram of sample annotation.Generally, when building a dataset, it should be taken into account that the object of identification of the model trained on it is “all kinds of trash cans in the process of bins turning,” rather than simply “trash cans.”In this paper, the dataset is collected in the real environment by setting up the camera on the trucks, and it is obtained by recording screen and clipping. It contains a total of 3266 sample pictures, some of which are shown in Figure7.Figure 7
Some training samples.


#### 3.2.2. YOLOv3-Tiny Algorithm

The object detection algorithm used in this paper is YOLOv3-tiny. YOLOv3-tiny is a simplified version of YOLOv3. Compared with the complete version of YOLOv3, YOLOv3-tiny simplifies its backbone and only forecasts the bounding box in two fields of vision. The advantages of simple network and small amount of computation make it very suitable for deployment in this work scenario. Its backbone network uses a 7-layer convolutional layer plus a maximum pooling layer network structure, as shown in Table1.Table 1
Backbone of YOLOv3-tiny.
TypeFilterSizeOutputConv163×3/1416×416×16Max2×2/2208×208×16Conv323×3/1208×208×32Max2×2/2104×104×32Conv643×3/1104×104×64Max2×2/252×52×64Conv1283×3/152×52×128Max2×2/226×26×128Conv2563×3/126×26×256Max2×2/213×13×256Conv5123×3/113×13×512Max2×2/113×13×512Conv10243×3/113×13×1024The loss function of the YOLO series algorithm needs to be measured in three aspects, namely, the coordinates of the object, the confidence score, and the category. The coordinates are calculated by the sum of squares of the offset function, and the confidence and classification are calculated by the cross-entropy loss function. The overall loss function is expressed as shown in Formula (1).(1)lossobject=λcoord∑i=0K×K∑j=0MIijobjxi−x^i2+yi−y^i2+∑i=0K×K∑j=0MIijobjC^ilogCi+1−C^ilog1−Ci−λnoobj∑i=0K×K∑j=0MIijobjC^ilogCi+1−C^ilog1−Ci−∑i=0K×KIijobj∑c∈classesp^iclogpic+1−p^iclog1−pic.In which,λcoord represents the penalty coefficient of coordinate prediction, λnoobj indicates that it does not contain the target penalty coefficient, K represents the number of grid divisions in the prediction, and M represents the number of boundary boxes predicted by a single grid. Iijobj and Iijnoobj indicate that the object is detected and not detected in the i grid and the j boundary box. x, y, w, and h represent the upper-left coordinate and width-height of the object, C represents the confidence level, and pic represents the probability that the target in the i-th grid belongs to a certain category. Superscript ^ represents the true value.


#### 3.2.3. Data Statistics

The process of turning the trash can is determined by whether there is a trash can in the frame, and the statistical process of the data is shown in Figure8.Figure 8
Flow chart of data statistics algorithm.When the object detection algorithm detects the garbage can in a frame, the program is regarded as the process of turning the garbage can has begun. Afterwards, when the object detection program cannot detect the garbage can in the screen, it shows that the process of turning the bucket is over. Meanwhile, the number of trash bin targets in a frame is the number of trash bins. Since the rear-feeding garbage truck may operate two garbage bins at the same time during operation, it is necessary to distinguish between the left and right garbage bins. The experiment found that the change of thex-coordinate of the trash bin target during the entire barrel turning process was small. In this paper, according to the x-axis coordinates of the target, whether a trash can is located in the left position or the right position is calibrated. The judgment of the trash can cubage is special. Because the size of the trash can is constantly changing in the whole turning process, the size of the object bounding box cannot be directly used to determine the cubage of the trash can. Therefore, in the process of turning over the bin, the size of the object bounding box in each frame is superimposed, and the final sum is used to judge the cubage of the bin.At the end of the turning, the image processing unit sends the data of the garbage cans to the on-board computer through the RS232 serial port. The on-board computer will detect whether there is any substandard operation according to the data received. At the same time, the data is uploaded to the server through the mobile network for recording and display. The effect of data recording and display is shown in Figure9.Figure 9
Server data display page.


## 3.1. Hardware Deployment

Due to the special environment of garbage truck, the hardware deployment scheme will be affected by such factors as power consumption, computing power, volume of devices, and so on. The angle of the camera, the transmission mode of the data, and the computing power of the image processing unit will all have an impact on the design of the software level of this paper. The overall hardware deployment scenario for this paper is shown in Figure3.Figure 3
Hardware deployment.Most garbage trucks have their own on-board computers with mobile network communication functions to record the vehicle’s location and remaining fuel. Using the original data communication method can effectively reduce the deployment cost and difficulty. Only a waterproof camera and an image processing unit are installed on the truck in the design of this paper. The supervision and data statistics of the garbage truck work are realized through the software level. Because the garbage can is large and the computing power of the image processing unit is weak, the camera resolution selected in this paper is640×480. With the front of the car as the front, the camera is arranged on the slant of the working position of the garbage can. Take the horizontal direction as 0 degree, the camera angle is about 10 degrees. When the trash can is at the highest position, it is necessary to ensure that the vertical direction of the trash can at the two positions is completely photographed, as shown in Figure 4. The sample photo taken during the process of turning the barrel once is shown in Figure 5.Figure 4
Camera installation location.Figure 5
Some frames during the process of turning the trash.The image processing unit has a neural network processing unit NPU, and the NPU calculation force is 3Tops. The CPU adopts ARM architecture. Compared with the traditional structure of x86 CPU plus GPU, the structure of ARM CPU plus NPU has lower power consumption and smaller volume, which is more suitable for deployment in the vehicle environment. The image processing unit communicates with the on-board computer through the serial port, transmits the detection results to the on-board computer with a specific format of data message, and then uploads the data to the server through the mobile network for recording and subsequent display.


## 3.2. Software Design

In this section, the dataset established in this paper is described, and then, the object detection algorithm is described.


### 3.2.1. Dataset

The training of object detection model is a kind of supervised learning, which needs to build a dataset with labels. Firstly, this paper analyzes the image characteristics of trash can. According to the different types of garbage, the garbage cans cleaned by the garbage collection and transportation trucks can be divided into four categories according to the color. The blue garbage cans contain recyclable garbage; the green garbage cans contain wet garbage; the red garbage cans contain harmful garbage, and the black garbage cans contain dry garbage.At the same time, there are many different cubage of these bins; the most common are 120L and 240L. Because of the limitation of two-dimensional image, there is no essential difference in two-dimensional image between trash cans of different cubage, while the color information is a good feature in three channel images. Therefore, in this paper, the garbage cans are divided into four types according to the color characteristics.In addition, because the turning operation of garbage truck is purely mechanical control, the detection program cannot obtain the signal of the beginning and end of turning through the electrical signal, so it is necessary to continuously perform object detection on the camera shot frames. This means that the garbage cans which are not in the turning state should not be the target of object detection. As shown in Figure6, the part marked in the green box are the garbage cans in the process of turning, which should be labeled during data tagging, while the garbage cans marked in the red box are not in the process of turning, which should be regarded as the background (negative sample) and not be labeled during tagging.Figure 6
Schematic diagram of sample annotation.Generally, when building a dataset, it should be taken into account that the object of identification of the model trained on it is “all kinds of trash cans in the process of bins turning,” rather than simply “trash cans.”In this paper, the dataset is collected in the real environment by setting up the camera on the trucks, and it is obtained by recording screen and clipping. It contains a total of 3266 sample pictures, some of which are shown in Figure7.Figure 7
Some training samples.


### 3.2.2. YOLOv3-Tiny Algorithm

The object detection algorithm used in this paper is YOLOv3-tiny. YOLOv3-tiny is a simplified version of YOLOv3. Compared with the complete version of YOLOv3, YOLOv3-tiny simplifies its backbone and only forecasts the bounding box in two fields of vision. The advantages of simple network and small amount of computation make it very suitable for deployment in this work scenario. Its backbone network uses a 7-layer convolutional layer plus a maximum pooling layer network structure, as shown in Table1.Table 1
Backbone of YOLOv3-tiny.
TypeFilterSizeOutputConv163×3/1416×416×16Max2×2/2208×208×16Conv323×3/1208×208×32Max2×2/2104×104×32Conv643×3/1104×104×64Max2×2/252×52×64Conv1283×3/152×52×128Max2×2/226×26×128Conv2563×3/126×26×256Max2×2/213×13×256Conv5123×3/113×13×512Max2×2/113×13×512Conv10243×3/113×13×1024The loss function of the YOLO series algorithm needs to be measured in three aspects, namely, the coordinates of the object, the confidence score, and the category. The coordinates are calculated by the sum of squares of the offset function, and the confidence and classification are calculated by the cross-entropy loss function. The overall loss function is expressed as shown in Formula (1).(1)lossobject=λcoord∑i=0K×K∑j=0MIijobjxi−x^i2+yi−y^i2+∑i=0K×K∑j=0MIijobjC^ilogCi+1−C^ilog1−Ci−λnoobj∑i=0K×K∑j=0MIijobjC^ilogCi+1−C^ilog1−Ci−∑i=0K×KIijobj∑c∈classesp^iclogpic+1−p^iclog1−pic.In which,λcoord represents the penalty coefficient of coordinate prediction, λnoobj indicates that it does not contain the target penalty coefficient, K represents the number of grid divisions in the prediction, and M represents the number of boundary boxes predicted by a single grid. Iijobj and Iijnoobj indicate that the object is detected and not detected in the i grid and the j boundary box. x, y, w, and h represent the upper-left coordinate and width-height of the object, C represents the confidence level, and pic represents the probability that the target in the i-th grid belongs to a certain category. Superscript ^ represents the true value.


### 3.2.3. Data Statistics

The process of turning the trash can is determined by whether there is a trash can in the frame, and the statistical process of the data is shown in Figure8.Figure 8
Flow chart of data statistics algorithm.When the object detection algorithm detects the garbage can in a frame, the program is regarded as the process of turning the garbage can has begun. Afterwards, when the object detection program cannot detect the garbage can in the screen, it shows that the process of turning the bucket is over. Meanwhile, the number of trash bin targets in a frame is the number of trash bins. Since the rear-feeding garbage truck may operate two garbage bins at the same time during operation, it is necessary to distinguish between the left and right garbage bins. The experiment found that the change of thex-coordinate of the trash bin target during the entire barrel turning process was small. In this paper, according to the x-axis coordinates of the target, whether a trash can is located in the left position or the right position is calibrated. The judgment of the trash can cubage is special. Because the size of the trash can is constantly changing in the whole turning process, the size of the object bounding box cannot be directly used to determine the cubage of the trash can. Therefore, in the process of turning over the bin, the size of the object bounding box in each frame is superimposed, and the final sum is used to judge the cubage of the bin.At the end of the turning, the image processing unit sends the data of the garbage cans to the on-board computer through the RS232 serial port. The on-board computer will detect whether there is any substandard operation according to the data received. At the same time, the data is uploaded to the server through the mobile network for recording and display. The effect of data recording and display is shown in Figure9.Figure 9
Server data display page.


## 3.2.1. Dataset

The training of object detection model is a kind of supervised learning, which needs to build a dataset with labels. Firstly, this paper analyzes the image characteristics of trash can. According to the different types of garbage, the garbage cans cleaned by the garbage collection and transportation trucks can be divided into four categories according to the color. The blue garbage cans contain recyclable garbage; the green garbage cans contain wet garbage; the red garbage cans contain harmful garbage, and the black garbage cans contain dry garbage.At the same time, there are many different cubage of these bins; the most common are 120L and 240L. Because of the limitation of two-dimensional image, there is no essential difference in two-dimensional image between trash cans of different cubage, while the color information is a good feature in three channel images. Therefore, in this paper, the garbage cans are divided into four types according to the color characteristics.In addition, because the turning operation of garbage truck is purely mechanical control, the detection program cannot obtain the signal of the beginning and end of turning through the electrical signal, so it is necessary to continuously perform object detection on the camera shot frames. This means that the garbage cans which are not in the turning state should not be the target of object detection. As shown in Figure6, the part marked in the green box are the garbage cans in the process of turning, which should be labeled during data tagging, while the garbage cans marked in the red box are not in the process of turning, which should be regarded as the background (negative sample) and not be labeled during tagging.Figure 6
Schematic diagram of sample annotation.Generally, when building a dataset, it should be taken into account that the object of identification of the model trained on it is “all kinds of trash cans in the process of bins turning,” rather than simply “trash cans.”In this paper, the dataset is collected in the real environment by setting up the camera on the trucks, and it is obtained by recording screen and clipping. It contains a total of 3266 sample pictures, some of which are shown in Figure7.Figure 7
Some training samples.


## 3.2.2. YOLOv3-Tiny Algorithm

The object detection algorithm used in this paper is YOLOv3-tiny. YOLOv3-tiny is a simplified version of YOLOv3. Compared with the complete version of YOLOv3, YOLOv3-tiny simplifies its backbone and only forecasts the bounding box in two fields of vision. The advantages of simple network and small amount of computation make it very suitable for deployment in this work scenario. Its backbone network uses a 7-layer convolutional layer plus a maximum pooling layer network structure, as shown in Table1.Table 1
Backbone of YOLOv3-tiny.
TypeFilterSizeOutputConv163×3/1416×416×16Max2×2/2208×208×16Conv323×3/1208×208×32Max2×2/2104×104×32Conv643×3/1104×104×64Max2×2/252×52×64Conv1283×3/152×52×128Max2×2/226×26×128Conv2563×3/126×26×256Max2×2/213×13×256Conv5123×3/113×13×512Max2×2/113×13×512Conv10243×3/113×13×1024The loss function of the YOLO series algorithm needs to be measured in three aspects, namely, the coordinates of the object, the confidence score, and the category. The coordinates are calculated by the sum of squares of the offset function, and the confidence and classification are calculated by the cross-entropy loss function. The overall loss function is expressed as shown in Formula (1).(1)lossobject=λcoord∑i=0K×K∑j=0MIijobjxi−x^i2+yi−y^i2+∑i=0K×K∑j=0MIijobjC^ilogCi+1−C^ilog1−Ci−λnoobj∑i=0K×K∑j=0MIijobjC^ilogCi+1−C^ilog1−Ci−∑i=0K×KIijobj∑c∈classesp^iclogpic+1−p^iclog1−pic.In which,λcoord represents the penalty coefficient of coordinate prediction, λnoobj indicates that it does not contain the target penalty coefficient, K represents the number of grid divisions in the prediction, and M represents the number of boundary boxes predicted by a single grid. Iijobj and Iijnoobj indicate that the object is detected and not detected in the i grid and the j boundary box. x, y, w, and h represent the upper-left coordinate and width-height of the object, C represents the confidence level, and pic represents the probability that the target in the i-th grid belongs to a certain category. Superscript ^ represents the true value.


## 3.2.3. Data Statistics

The process of turning the trash can is determined by whether there is a trash can in the frame, and the statistical process of the data is shown in Figure8.Figure 8
Flow chart of data statistics algorithm.When the object detection algorithm detects the garbage can in a frame, the program is regarded as the process of turning the garbage can has begun. Afterwards, when the object detection program cannot detect the garbage can in the screen, it shows that the process of turning the bucket is over. Meanwhile, the number of trash bin targets in a frame is the number of trash bins. Since the rear-feeding garbage truck may operate two garbage bins at the same time during operation, it is necessary to distinguish between the left and right garbage bins. The experiment found that the change of thex-coordinate of the trash bin target during the entire barrel turning process was small. In this paper, according to the x-axis coordinates of the target, whether a trash can is located in the left position or the right position is calibrated. The judgment of the trash can cubage is special. Because the size of the trash can is constantly changing in the whole turning process, the size of the object bounding box cannot be directly used to determine the cubage of the trash can. Therefore, in the process of turning over the bin, the size of the object bounding box in each frame is superimposed, and the final sum is used to judge the cubage of the bin.At the end of the turning, the image processing unit sends the data of the garbage cans to the on-board computer through the RS232 serial port. The on-board computer will detect whether there is any substandard operation according to the data received. At the same time, the data is uploaded to the server through the mobile network for recording and display. The effect of data recording and display is shown in Figure9.Figure 9
Server data display page.


## 4. Experiment

### 4.1. Experimental Setup

The training environment and deployment environment are independent of each other. The operating system for the model training environment is Ubuntu 16.04 with 1080ti, 8 GB.The image processing unit in the deployment environment has 8 GB DDR3 memory, and the SoC adopts the RK3399pro. The CPU of the SoC adopts double Cortex- A72 four Cortex-A53 kernel structure; the highest frequency is 1.8 G Hz, NPU supports 8Bit/16Bit operation, and the calculation force is 3.0Tops. The camera has a resolution of640×480, a focal length of 2 mm, and a horizontal angle of view of 95 degrees. It is connected to the graphics processing unit through USB2.0. The graphics processing unit communicates with the vehicle computer through the RS232 serial port, and the vehicle computer communicates with the server through the LTE network. In addition, the operating system of the image processing unit is Fedora28. The object detect model is deployed using RKNN-toolkit. Python 3.6 is adopted as the programming language.In the experiment, the image processing unit is deployed in the carriage, as shown in Figure10. The deployment of camera on the garbage truck is shown in Figure 11.Figure 10
Deployment of image processing unit in experiment.Figure 11
Deployment of camera in the experiment.


### 4.2. Model Training

The training parameters of the YOLOv3-tiny model are as follows: batch is 64, subdivision is 8, momentum is 0.9, decay is 0.0005, and the number of iterations is 76000. The learning rate used step-by-step strategy, the initial value is 0.001 and changed at 66000 and 71000 times, and the ratio is 0.1.The loss curve during training is shown in Figure12. The final loss value of the training on the verification machine is 0.071556.Figure 12
Loss curve for YOLOv3-tiny model training.The detection example of the YOLOv3-tiny object detection model trained in this paper in the process of trash can overturning is shown in Figure13.Figure 13
Example of object detection effect.


### 4.3. Actual Scene Test

This paper tests the proposed method many times on the actual working garbage trucks. The working time of these garbage trucks is 6:30-9:00, and the test weathers are cloudy, rainy, and sunny. The test results are shown in Table2.Table 2
Test results in actual work scenarios.
DateWeathersLight conditionNumber of test samplesAmount accuracyCubage accuracyColor accuracyOperation after experiment19.12.12SunnySufficient12291.80%77.86%95.08%Adjust threshold; increase sample amount19.12.16SunnySufficient12895.31%100%100%—19.12.17CloudyPoor13887.79%100%100%—20.01.04RainyVery poor8146.91%94.74%97.22%Increase sample amount20.01.05RainyVery poor6347.05%100%100%Increase sample amount20.02.15RainyPoor48100%100%100%—20.02.16CloudyPoor61100%98.36%100%—20.02.17SunnySufficient66100%100%100%—It can be seen from Table2 that under the good light conditions, the accuracy of the proposed method is very high. After continuous iteration, the accuracy of this method has approached 100%. However, due to the lack of light compensation in this experiment, the light condition in Changsha city in January is very poor under rainy conditions. Under this villainous light condition, the recognition effect of this method is greatly reduced. By patching the light, the problem could be easily solved. Experiments show the excellent real-time performance of the proposed method. On the image processing unit with NPU, the frame rate of our method is greater than 25FPS.


## 4.1. Experimental Setup

The training environment and deployment environment are independent of each other. The operating system for the model training environment is Ubuntu 16.04 with 1080ti, 8 GB.The image processing unit in the deployment environment has 8 GB DDR3 memory, and the SoC adopts the RK3399pro. The CPU of the SoC adopts double Cortex- A72 four Cortex-A53 kernel structure; the highest frequency is 1.8 G Hz, NPU supports 8Bit/16Bit operation, and the calculation force is 3.0Tops. The camera has a resolution of640×480, a focal length of 2 mm, and a horizontal angle of view of 95 degrees. It is connected to the graphics processing unit through USB2.0. The graphics processing unit communicates with the vehicle computer through the RS232 serial port, and the vehicle computer communicates with the server through the LTE network. In addition, the operating system of the image processing unit is Fedora28. The object detect model is deployed using RKNN-toolkit. Python 3.6 is adopted as the programming language.In the experiment, the image processing unit is deployed in the carriage, as shown in Figure10. The deployment of camera on the garbage truck is shown in Figure 11.Figure 10
Deployment of image processing unit in experiment.Figure 11
Deployment of camera in the experiment.


## 4.2. Model Training

The training parameters of the YOLOv3-tiny model are as follows: batch is 64, subdivision is 8, momentum is 0.9, decay is 0.0005, and the number of iterations is 76000. The learning rate used step-by-step strategy, the initial value is 0.001 and changed at 66000 and 71000 times, and the ratio is 0.1.The loss curve during training is shown in Figure12. The final loss value of the training on the verification machine is 0.071556.Figure 12
Loss curve for YOLOv3-tiny model training.The detection example of the YOLOv3-tiny object detection model trained in this paper in the process of trash can overturning is shown in Figure13.Figure 13
Example of object detection effect.


## 4.3. Actual Scene Test

This paper tests the proposed method many times on the actual working garbage trucks. The working time of these garbage trucks is 6:30-9:00, and the test weathers are cloudy, rainy, and sunny. The test results are shown in Table2.Table 2
Test results in actual work scenarios.
DateWeathersLight conditionNumber of test samplesAmount accuracyCubage accuracyColor accuracyOperation after experiment19.12.12SunnySufficient12291.80%77.86%95.08%Adjust threshold; increase sample amount19.12.16SunnySufficient12895.31%100%100%—19.12.17CloudyPoor13887.79%100%100%—20.01.04RainyVery poor8146.91%94.74%97.22%Increase sample amount20.01.05RainyVery poor6347.05%100%100%Increase sample amount20.02.15RainyPoor48100%100%100%—20.02.16CloudyPoor61100%98.36%100%—20.02.17SunnySufficient66100%100%100%—It can be seen from Table2 that under the good light conditions, the accuracy of the proposed method is very high. After continuous iteration, the accuracy of this method has approached 100%. However, due to the lack of light compensation in this experiment, the light condition in Changsha city in January is very poor under rainy conditions. Under this villainous light condition, the recognition effect of this method is greatly reduced. By patching the light, the problem could be easily solved. Experiments show the excellent real-time performance of the proposed method. On the image processing unit with NPU, the frame rate of our method is greater than 25FPS.


## 5. Conclusion

In this paper, a method of intelligent supervision and workload statistics of garbage trucks based on computer vision is proposed. On the basis of using the original on-board computing and communication equipment, a camera and an image processing unit are installed to build the hardware environment. A dataset is established based on the picture caught by the camera, and the YOLOv3-tiny model is trained on it to perform the real-time detection, and data statistics of the can flip process of the garbage truck. Compared with the traditional RFID-based supervision and data statistics methods, the proposed method has lower deployment and maintenance costs. The experimental results show that the method proposed in this paper has an accuracy rate close to 100% and a frame rate greater than 25FPS under good light conditions. However, the performance of the method will be greatly affected when the light condition becomes worse.Network routing protocols are constantly being improved, especially in the field of sensor networks. In the future, edge computing and cloud computing may be better balanced. In the following work, cloud computing may be involved so that the proposed method can have a better computing environment. The accuracy and robustness of the proposed method will be further optimized. For example, the dataset will be expanded and optimized, and the fill light equipment will be installed to make the proposed method adapt to more weather conditions.



---

*Source: 8827310-2020-10-12.xml*