*Article* **Object Detection for Construction Waste Based on an Improved YOLOv5 Model**

**Qinghui Zhou \*, Haoshi Liu, Yuhang Qiu and Wuchao Zheng**

School of Mechanical-Electronic and Vehicle Engineering, Beijing University of Civil Engineering and Architecture, Beijing 100044, China

**\*** Correspondence: zhouqinghui@bucea.edu.cn

**Abstract:** An object detection method based on an improved YOLOv5 model was proposed to enhance the accuracy of sorting construction waste. A construction waste image sample set was established by collecting construction waste images on site. These construction waste images were preprocessed using the random brightness method. A YOLOv5 object detection model was improved in terms of the convolutional block attention module (CBAM), simplified SPPF (SimSPPF) and multiscale detection. Then, the improved YOLOv5 model was trained, validated and tested using the established construction waste image dataset and compared with other conventional models such as Faster-RCNN, YOLOv3, YOLOv4, and YOLOv7. The results show that: based on the improved YOLOv5 model, the mean average precision (mAP) on the test dataset can reach 0.9480. The overall performance of this model is better than that of other conventional models in object detection, which verifies the accuracy and availability of the proposed method.

**Keywords:** construction waste; computer vision; deep learning; YOLOv5; waste sorting

#### **1. Introduction**

The rapid rise in construction activities has produced a large amount of construction waste with the global increase in population and urbanization [1]. According to a literature review and survey, construction waste accounts for more than 25% of the world's waste [2]. In China, the average recovery rate of construction waste is approximately 5%. Additionally, the annual construction waste level is about 1.55 billion tons to 2.4 billion tons [3], accounting for nearly 30–40% of urban waste, causing many environmental issues [4].

Due to the lack of proper recovery schemes and effective disposal technologies, construction waste without any treatment will be transported to the suburban landfill, causing land-use threats [5]. However, some materials are potentially valuable in construction and easily reused/recycled, including concrete, stone masonry, bricks, etc. These sustainable materials should be sorted out and turned into recycled aggregates that can be used in new building projects after crushing and separation, thus reducing the need to mine and process virgin materials. Therefore, reducing, reusing, and recycling construction waste has become an important and essential issue.

Currently, the traditional method of sorting construction waste is mixing, crushing and screening by means of mechanical operation, while preselecting, rejecting and diverting by manual work. However, there are problems of low recycling purity and low efficiency of manual work and especially serious harm to health in dusty and noisy environments. Increasingly, computer vision (CV), robotics, and other-artificial intelligent technologies are being used for construction waste sorting [6]. Usually, a robot for sorting construction waste is used to finely sort a large number of objects before mixing and crushing. Smart technologies can improve the reuse and recycling of construction waste. For example, the company ZenRobotics began to manufacture robots that used artificial intelligence and other recognition technologies to identify and sort household, industrial, and construction and demolition waste in 2007 [7]. Other well-known commercial robots have also been

**Citation:** Zhou, Q.; Liu, H.; Qiu, Y.; Zheng, W. Object Detection for Construction Waste Based on an Improved YOLOv5 Model. *Sustainability* **2023**, *15*, 681. https://doi.org/10.3390/ su15010681

Academic Editors: Carlos Morón Fernández and Daniel Ferrández Vega

Received: 1 December 2022 Revised: 23 December 2022 Accepted: 28 December 2022 Published: 30 December 2022

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

tried for use in the waste management industry, such as Sadako [8], SamurAI [9], and AMP Robotics [10]. The majority of the existing systems capitalize on the agility of robots to rapidly transfer recyclables from a conveyor belt to a bin [11]. However, many factors affect the accuracy and efficiency of sorting construction waste. In a real work environment, the stacking of construction waste on the conveyor belt, the irregular shapes, and the small-sized objects lead to errors in detection. Measures should be taken to improve the accuracy of object detection.

Machine learning can improve the efficiency and accuracy of sorting construction waste. With sufficient data, a CV model can identify different waste materials by machine learning. Previous research has found that CV performed well in construction waste recycling. Several algorithms for CV have been used to identify and classify waste, but inter occlusion and small object detection were not fully considered. Convolutional neural network (CNN) is an algorithm that has become the standard in image classification and object recognition. Therefore, several model developments based on CNN have emerged. For example, Adedeji and Wang (2019) [12] employed such a technique, which extracted features learned by the ResNet-50, and performed waste classification with SVM. Chen et al. (2021) [13] developed a hybrid model that integrated visual features extracted by a DenseNet-169 network and physical features such as weight and depth collected by other sensors. These methods improve the accuracy of sorting waste, but still do not consider the inter occlusion and small object detection. Yang et al. (2021) [14] adopted a "ResNeXt + k-NN" structure. Lau Hiu Hoong et al. (2020) [15] improved the performance of sorting construction waste through the residual network. Chen et al. (2017) [16] employed Fast R-CNN to detect and locate waste objects on conveyor belts, which demonstrated a false negative rate (FNR) of 3% and a false positive rate (FPR) of 9%. Awe et al. (2017) [17], Wang et al. (2019) [18], and Nowakowski and Pamula (2020) [19] applied Faster R-CNN for the detection of residential and municipal waste, construction and demolition waste, and electronic waste, respectively. Ku et al. (2021) [6] proposed a deep learning method for grab detection based on R-CNN. Zhou et al. [20] selected the RepVGG residual network as the basic feature network based on the Faster-RCNN algorithm to retain more information of small-sized objects. Li et al. [21] built an RGB detection platform and used color cameras and laser line scanning sensors to collect RGB images to detect construction waste. Lin et al. [22] proposed a CVGGNet model based on knowledge transfer together with data enhancement and periodic-learningrate technology to classify construction waste. From the above-mentioned studies, the applications of CV in waste sorting had been specifically focused on. The existing object detection algorithms were mainly improved from different perspectives: multi-scale feature fusion, data augmentation, training algorithm, and context-based detection.

In order to enhance the accuracy rate of object detection, the YOLO model has been used to identify and classify waste, such as YOLOv3 [23], YOLOv4 [24] and YOLOv5. The YOLO model uses multiple lower sampling layers, and the target features learned from the network are not exhaustive so the detection effect will be improved [25]. Liu et al. [26] improved the network structure and multi-scale detection based on the YOLOv3 algorithm. The mAP value could reach 91.96%. Chen et al. [27] designed a waste robot with a YOLOv4 model that can identify beverage bottles, cans, wastepaper, and banana peels in an unobstructed environment. Yuan et al. [28] proposed an improved algorithm based on YOLOv5 for underwater waste detection. Gamma transform was added in the preprocessing stage to improve the gray and contrast of underwater images, and the CBAM attention mechanism was embedded in the YOLOv5 detection part to highlight object features and suppress secondary information, thus improving the accuracy of detection. Therefore, YOLO algorithms have also been used for waste sorting. Similarly, YOLO algorithms were also improved from the following different perspectives: CBAM attention mechanism, multi-scale feature learning, data augmentation, and training strategy.

It is well known that small object detection and inter-occlusion are still challenging problems in computer vision. Currently, with the increasing need for recycling onsite construction waste, a higher velocity of the conveyor belt and more stacking of waste will lead to difficulty in finely sorting, which is probably one of the most critical problems in construction waste management. Under the conditions of inter occlusion and small object detection, the accuracy of the CV may decrease [29].

Therefore, there are two problems in sorting construction waste: one is inter-object occlusion, i.e., multiple objects are overlaid on each other, occluding one another. The other problem is small-object detection. Hence, in order to solve these problems and further improve the accuracy of classification and detection of construction waste, an improved YOLOv5 model was proposed by applying the CBAM attention mechanism and SimSPPF module, adding a shallow detection layer to detect small construction waste objects and inter-occlusion and increasing the fourth scale feature fusion to the feature fusion part correspondingly. Additionally, a dataset was established, and a data enhancement method was used to expand the diversity of training samples.
