Garbage overflow rapid detection processing method and system facing inspection robot
Lightweight YOLOv8 network built through lightweight convolution and multi-scale attention mechanism solves the problem of inefficiency in traditional garbage management methods, and realizes efficient garbage can overflow detection on low-computing equipment, which is suitable for inspection robots Real-time garbage overflow detection.
Patent Information
- Application Number
- CN202411277366.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-09-12
AI Technical Summary
The traditional garbage management method is inefficient and cannot achieve 24-hour uninterrupted monitoring. The YOLO model has a large amount of calculations and is not suitable for inspection robots, which limits the development of garbage overflow detection.
Lightweight convolution and multi-scale attention mechanism are used to build a lightweight YOLOv8 network, and the GhostConv module and C2f_EMA module are used to reduce the parameter amount and calculation amount, and combined with the Wise-IoU loss function, the adaptability and accuracy of the detection model are improved.
It realizes efficient garbage can overflow detection on low-computing equipment, significantly reduces computing costs, improves the accuracy and robustness of detection, and is suitable for real-time garbage overflow detection of patrol robots.
Smart Images

Figure CN119169560A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of inspection robot image processing and target detection and recognition, and relates to a garbage overflow rapid detection and processing method and system for an inspection robot. Background Art
[0002] In the process of modern urbanization, garbage management has become an important part of urban management. With the increase in population and consumption level, the amount of urban garbage is increasing. Traditional manual inspection and regular cleaning methods can no longer meet the needs of efficient and timely garbage disposal. Regular cleaning not only consumes a lot of human resources, but also often leads to overflowing garbage bins due to the uneven generation of garbage, which seriously affects the city's environmental sanitation and the quality of life of residents.
[0003] Traditional garbage management methods have obvious shortcomings. Inefficiency: In the regular cleaning mode, people need to be sent to check whether the garbage bin is full or not, resulting in a waste of resources. Delayed response: Once the garbage bin overflows, the cleaning work often cannot be followed up immediately, resulting in garbage scattering and polluting the environment. High cost: Frequent manual inspections increase labor costs and it is difficult to achieve 24-hour uninterrupted monitoring.
[0004] To solve the above problems, the intelligent trash can overflow detection system came into being. This system integrates advanced computer vision and deep learning algorithms to automatically identify the status of trash in the trash can and transmit data to the central management system in real time. When the trash can is close to full, the system will automatically send an alarm to the cleaning staff or the dispatch center, thereby achieving accurate garbage removal scheduling.
[0005] By combining patrol robots with IoT technology, more intelligent urban waste management can be achieved. IoT technology enables various devices to be interconnected and share data, thus forming an efficient waste management system. Managers can monitor the garbage collection situation in various areas in real time through the central control platform, arrange garbage removal plans scientifically and reasonably, reduce resource waste, and improve urban management efficiency.
[0006] Among the current overflow detection technologies, the YOLO series of models are widely used in target detection tasks due to their excellent speed and accuracy. However, the YOLO model is usually large and computationally intensive, and is not suitable for running on resource-constrained devices. That is, the YOLO model combined with the inspection robot to perform garbage overflow detection is limited by its huge computational workload, which hinders its development. In this context, it is particularly important to study the lightweight YOLO model. Summary of the invention
[0007] In view of this, the purpose of the present invention is to provide a method and system for rapid detection and processing of garbage overflow for inspection robots. It provides an efficient solution for garbage bin overflow detection through lightweight convolution and multi-scale attention mechanism. Lightweight convolution significantly reduces the computational cost of the model by reducing the number of parameters and calculations, and is suitable for low-computing power environments such as embedded devices. The multi-scale attention mechanism improves the model's ability to handle targets of different shapes and sizes by capturing feature information at different scales, thereby enhancing the accuracy and robustness of detection. Combining these two technologies, an efficient, accurate and low-computing power device-suitable garbage bin overflow detection model can be constructed.
[0008] In order to achieve the above object, the present invention provides the following technical solutions:
[0009] A rapid detection and processing method for garbage overflow for an inspection robot comprises the following steps:
[0010] S1. Collect image data of road trash cans through inspection robots and pre-process the data;
[0011] S2. Build a lightweight YOLOv8 network, which includes at least a ghost convolution GhostConv module and several C2f_EMA modules;
[0012] S3, using the improved loss function Wise-IoU as the loss function of the constructed lightweight YOLOv8 network;
[0013] S4, using the preprocessed image data to train the constructed lightweight YOLOv8 network model to obtain a garbage overflow rapid detection model;
[0014] S5. The garbage overflow rapid detection model is mounted on the inspection robot, and garbage overflow detection is performed on the images collected by the inspection robot in real time.
[0015] Further, in step S1, the preprocessing process of the original trash can image data at least includes data labeling, wherein the original trash can image data is labeled using the LabelImg method, and the labeling categories include: full trash can, not full trash can, and overflowing trash;
[0016] After the labeling is completed, the labeled trash can image data is divided into a training set and a test set.
[0017] Further, in step S2, the structure of the constructed lightweight YOLOv8-garbage_bin model includes at least a backbone network and a head network, wherein the backbone network includes at least several GhostConv modules, C2f modules, C2f_EMA modules, and at least one SPPF module, and in the backbone network, multi-scale feature extraction is performed by combining several groups of GhostConv modules, C2f modules, and C2f_EMA modules, wherein the GhostConv module performs lightweight convolution operations, and the C2f and C2f_EMA modules perform abstract processing on feature information; the extracted highest scale features are input into the SPPF module to extract key information;
[0018] The head network includes at least several Upsample modules, Concat modules, C2f modules, C2f_EMA modules and Detect modules. It first performs Upsample and Concat to concatenate feature maps of different resolutions. It then uses C2f and C2f_EMA to further process features. Finally, the Detect layer detects objects of different scales.
[0019] Furthermore, the data processing process of GhostConv is:
[0020] First, use ordinary convolution, batch normalization and an activation function Relu to compress the number of channels of the input image and generate several feature maps with inherent feature maps;
[0021] The feature map with the inherent feature map is subjected to multiple unit mappings and linear transformations in parallel with the linear operation φ k Expand the feature map; among them, the cheap operation φ k Includes depth-separable convolutional unit, batch normalization unit and an activation function Relu;
[0022] Then the cheap operations φ1, φ2, …, φ k The different feature maps obtained are combined with the feature map after the initial feature mapping through the concat operation to obtain the final output feature map.
[0023] Furthermore, the structure of the C2f_EMA module is:
[0024] The input data is first processed by a convolutional layer Conv. After processing, the input feature weights are dynamically allocated through the efficient multi-scale attention EMA. The processed data is then split into multiple parts by the segmentation unit Split. Each part is then input into the corresponding bottleneck module Bottleneck for feature extraction. The data processed by all bottleneck modules is then input into the splicing module Contact for splicing. After splicing, the data is processed and output by the convolutional layer Conv.
[0025] Furthermore, the processing flow of the efficient multi-scale attention mechanism EMA of the C2f_EMA module is as follows:
[0026] The size of the input feature map is C×H×W, where C represents the number of channels, H represents the height, and W represents the width; the input feature map is divided into G groups through the grouping operation, and the number of channels in each group is C / G;
[0027] Each set of feature maps generates two 1-dimensional feature vectors through average pooling in the X direction and average pooling in the Y direction. The two 1-dimensional feature vectors are processed through point-by-point convolution and activation function to generate two attention weight vectors. The two attention weight vectors are multiplied by matrix to generate an H×W attention matrix.
[0028] Each set of feature maps is also processed by global average pooling to generate a 1-dimensional feature vector; the 1-dimensional feature vector is processed by point-by-point convolution and activation function to generate an attention weight vector; the attention weight vector is processed by matrix multiplication to generate a C / G×1 attention matrix;
[0029] The spatial attention matrix and the channel attention matrix are fused through matrix multiplication operations to generate an H×W×C / G attention matrix; the attention matrix is processed through point-by-point convolution and activation function to generate the final attention weight matrix; the final attention weight matrix is element-wise multiplied with the input feature map to generate the feature map after reallocation of weights; the feature map after reallocation of weights is processed through point-by-point convolution and activation function to generate the final output feature map.
[0030] Further, in step S3, an improved loss function Wise-IoU is established for the constructed lightweight model, which is expressed as:
[0031]
[0032] in, Denotes the loss function Wise-IoU v1 with two-layer attention mechanism, which is expressed as:
[0033]
[0034] In the formula, represents the penalty for reducing low-quality anchor boxes, represents the penalty for enlarging the normal quality anchor box, and:
[0035]
[0036] In the formula, x, y and x gt y gt Represent the coordinates of the center of the anchor box and the center of the target box respectively; W g ,H g is the size of the smallest enclosing box, (·) * W g ,H g Separation operation;
[0037] r is a non-monotonic focusing coefficient, which is expressed as:
[0038]
[0039] In the formula, β is the outlier degree of the anchor box, δ represents the parameter of the distance metric, which represents the distance between the prediction box and the target box, and α represents the hyperparameter, which controls the adjustment of the loss weight.
[0040]
[0041] and Represent the IoU loss and quality box loss values respectively.
[0042] The present invention also proposes a rapid detection and processing system for garbage overflow for an inspection robot, which is used to execute the aforementioned rapid detection and processing method for garbage overflow for an inspection robot.
[0043] The garbage overflow rapid detection and processing system for the inspection robot of the present invention comprises at least a robot body, a shell, front wheels, a support frame, a mobile control component and various sensors;
[0044] The robot body is protected by a shell, the front wheels are used for movement, the support frame is used to support the body, the mobile control component and the support frame are respectively fastened to the shell, and the sensors installed on the robot body include at least a laser radar and a camera; the robot body includes automatic cruising and manual operation modes;
[0045] The system uses a NUC host as a computing processor and runs the ROS system as a robot operating system;
[0046] The system realizes real-time communication and data processing between sensor data and the host through the ROS communication framework.
[0047] The beneficial effects of the present invention are:
[0048] The present invention has multiple advantages. First, the lightweight YOLOv8-garbage_bin model of the present invention adopts the ghost convolution GhostConv module to realize the lightweight design of the model, while maintaining high detection accuracy, significantly reducing the number of parameters and computational costs. Secondly, the C2f_EMA module in the lightweight YOLOv8-garbage_bin model of the present invention can significantly improve the feature expression ability and generalization performance of the model while increasing a small amount of computational overhead. Finally, the present invention uses the Wise-IoU loss function to train the lightweight YOLOv8-garbage_bin model, which effectively reduces the competition of high-quality anchor frames and the harmful gradients brought by low-quality samples, thereby improving the overall performance of the detector and further improving the detection accuracy of the model.
[0049] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:
[0051] Figure 1 It is a schematic diagram of the structure of the Conv module and the GhostConv module, where: Figure 1 (a) is a schematic diagram of the structure of the Conv module. Figure 1 (b) is a schematic diagram of the structure of the GhostConv module;
[0052] Figure 2 Schematic diagram of the processing flow of the efficient multi-scale attention module;
[0053] Figure 3 It is a schematic diagram of the structure of the conventional C2f module and the improved C2f_EMA module, where: Figure 3 (a) is a schematic diagram of the structure of a conventional C2f module. Figure 3 (b) is a schematic diagram of the structure of the improved C2f_EMA;
[0054] Figure 4 This is a schematic diagram of the structure of the improved lightweight YOLOv8-garbage_bin model;
[0055] Figure 5This is a comparison example of garbage overflow recognition between the improved lightweight model YOLOv8-garbage_bin and the existing YOLOv8 model, where: Figure 5 (a) is a detection example of the existing YOLOv8 model. Figure 5 (b) is a detection example of the improved lightweight model YOLOv8-garbage_bin. DETAILED DESCRIPTION
[0056] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0057] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.
[0058] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0059] See also Figure 1 to Figure 5 , which is a method and system for rapid detection and processing of garbage overflow for inspection robots.
[0060] Example 1
[0061] This embodiment proposes a rapid detection and processing method for garbage overflow for a patrol robot, which includes the following steps:
[0062] S1. Collect image data of road trash cans through inspection robots and pre-process the data;
[0063] S2. Build a lightweight YOLOv8 network, which includes at least a ghost convolution GhostConv module and several C2f_EMA modules;
[0064] S3, using the improved loss function Wise-IoU as the loss function of the constructed lightweight YOLOv8 network;
[0065] S4, using the preprocessed image data to train the constructed lightweight YOLOv8 network model to obtain a garbage overflow rapid detection model;
[0066] S5. The garbage overflow rapid detection model is mounted on the inspection robot, and garbage overflow detection is performed on the images collected by the inspection robot in real time.
[0067] In step S1 of this embodiment, a large number of original trash can images are obtained in the early stage through inspection robots or other means, and the trash can images are labeled using LabelImg. A total of three categories are labeled: full trash can, not full trash can, and overflowing garbage, and all labeled images are divided into training sets and test sets.
[0068] In step S2 of this embodiment, the latest YOLOv8 model is improved, such as Figure 1 The structural diagram of the Conv module and the GhostConv module shown in FIG. Figure 1 (a) is a schematic diagram of the structure of the Conv module. Figure 1 (b) is a schematic diagram of the structure of the GhostConv module. Referring to Figure (b), the GhostConv module includes conventional convolution, Ghost generation, and feature map concatenation; the conventional convolution operation of the Conv module is used to convolve the input feature map to obtain the output. In the GhostConv module, it can reduce the number of parameters and computational complexity required for the convolution operation. The specific process is:
[0069] The GhostConv module first uses ordinary convolution (1*1*M), batch normalization and an activation function Relu to compress the number of channels of the input image and generate some inherent feature maps;
[0070] The feature map is then subjected to a series of simple linear operations (unit mapping in parallel with linear transformation to preserve the intrinsic feature map) φ k Get more feature maps and increase features; the cheap operation φ k It is composed of a depthwise convolution unit, a batch normalization unit and an activation function Relu;
[0071] Then the cheap operations φ1, φ2, …, φ k The different feature maps obtained are combined with the feature map after the initial feature mapping through the concat operation to obtain the final output feature map.
[0072] Assume that the input data tensor is c*h*w, where c, h, and w are the input channel dimensions and the height and width of the input feature map, respectively. After one convolution, the output data tensor is n*h′*w′, where n, h′, and w′ are the output channel dimensions and the height and width of the output feature map, respectively. The conventional convolution kernel size is k, and the linear convolution kernel size is d. After s transformations, the ratio between the amount of computation of the ordinary convolution operation and the amount of computation of the GhostConv module is:
[0073]
[0074] Among them, (n / s) is the number of output channels in the first transformation, and (s-1) is because the identity mapping does not require transformation, but it is also part of the second transformation, so the Ghost module can save computational effort.
[0075] The ratio of the parameters of the convolution kernel is calculated as:
[0076]
[0077] In the C2f_EMA module, EMA is a new type of efficient multi-scale attention (EMA) module. Compared with the previous attention mechanism, the biggest improvement is to keep the size of the tensor unchanged while dividing the channel into multiple sub-channels, that is, to reconstruct some channels into batch dimensions. For example, the original tensor dimension is [B, C, H, W], where B is the batch size, C is the number of channels, H is the height, and W is the width. After reconstruction, it becomes [B*G, C / / G, H, W], and the tensor size is B*C*H*W, thereby reducing information loss. Figure 2 The processing flow diagram of the efficient multi-scale attention module shown in Figure 1 is as follows:
[0078] The size of the input feature map (Input) is C×H×W, where C represents the number of channels, H represents the height, and W represents the width. The input feature map is divided into G groups through the grouping operation (Groups), and the number of channels in each group is C / G. Each group of feature maps is subjected to the average pooling operation in the X direction (X Avg Pool) and the average pooling operation in the Y direction (Y Avg Pool) to generate two 1-dimensional feature vectors.
[0079] Two 1D feature vectors are processed by point-wise convolution (Conv(1×1)) and activation function (Sigmoid) to generate two attention weight vectors. The two attention weight vectors are processed by matrix multiplication (Matmul) to generate an H×W attention matrix. Each set of feature maps is processed by global average pooling (Avg Pool) to generate a 1D feature vector. This 1D feature vector is processed by point-wise convolution (Conv(1×1)) and activation function (Softmax) to generate an attention weight vector. This attention weight vector is processed by matrix multiplication (Matmul) to generate a C / G×1 attention matrix. The spatial attention matrix and the channel attention matrix are fused by matrix multiplication (Matmul) to generate an H×W×C / G attention matrix. The attention matrix is processed by point-wise convolution (Conv(1×1)) and activation function (Sigmoid) to generate the final attention weight matrix. The final attention weight matrix is element-wise multiplied with the input feature map to generate the weighted feature map. The weighted feature map is processed by point-by-point convolution (Conv(1×1)) and activation function (Sigmoid) to generate the final output feature map.
[0080] Figure 3 The schematic diagram of the structure of the conventional C2f module and the improved C2f_EMA module is shown, wherein: Figure 3 (a) is a schematic diagram of the structure of a conventional C2f module. Figure 3 (b) is a schematic diagram of the improved C2f_EMA structure. Figure 3 As shown in (a), in a conventional C2f module, the input data is first processed by a convolutional layer (Conv), and then split into multiple parts by the segmentation unit Split. Each part is then input into the corresponding bottleneck module (Bottleneck) for feature extraction. The data processed by all bottleneck modules are then input into the splicing module (Contact) for splicing. After splicing, the data is processed and output by the convolutional layer (Conv).
[0081] like Figure 3 As shown in (b), the improved C2f_EMA module adds the EMA attention mechanism to the first convolutional layer in the C2f module, dynamically allocates the input feature weights, determines the focus according to the actual content of the input, and improves the accuracy and generalization of the model with a small amount of computational overhead.
[0082] The improved lightweight YOLOv8-garbage_bin model is obtained, and its structure is as follows Figure 4As shown in the figure. Backbone is used to extract multi-scale features from the input image. It is mainly composed of convolutional layers, GhostConv, C2f modules and C2f_EMA modules. These modules cooperate with each other through different functions. GhostConv is a lightweight convolution operation that improves efficiency by reducing redundant calculations. It provides efficient feature representation, especially in the initial feature extraction stage. The C2f module further abstracts feature information and reduces the complexity of the network; compared with the standard convolution operation, C2f has fewer repetitions, making the model calculation more efficient. In addition, the C2f_EMA module combines the multi-scale attention mechanism (EMA), which can dynamically allocate the weights of input features. It is particularly suitable for processing objects of different scales, thereby effectively enhancing the perception ability of the model. Finally, the SPPF module at the tail of the backbone further extracts key information by processing large-scale feature maps to provide support for subsequent target detection.
[0083] The Head network is responsible for integrating these features and performing multi-scale target detection. First, the resolution of the low-resolution feature map is increased by Upsample so that it can be spliced with the high-resolution features. Next, the Concat module fuses feature maps from different resolutions and enhances the detection capability of the model by integrating multi-scale information. After that, the C2f and C2f_EMA modules in the network are used again to further abstract information to ensure the accuracy of target detection. Finally, the Detect layer uses multi-scale feature maps to detect small, medium, and large targets respectively, ensuring that the model can effectively handle objects of different sizes and ensure the comprehensiveness and accuracy of detection.
[0084] In step S3 of this implementation, since the training data inevitably contains low-quality examples, geometric factors such as distance and aspect ratio will aggravate the penalty for low-quality examples, thereby reducing the generalization performance of the model. Therefore, distance attention is constructed and Wise-IoU v1 with a two-layer attention mechanism is obtained:
[0085] represents the penalty for enlarging anchor boxes of normal quality.
[0086] It means reducing the penalty for low-quality anchor boxes, and when the anchor box detection box coincides well with the target box, it pays more attention to the distance between the center points.
[0087]
[0088] In the formula, x, y and x gt y gt Represent the coordinates of the center of the anchor box and the center of the target box respectively; W g ,Hg is the size of the smallest enclosing box, (·) * W g ,H g Separation operation. To prevent The gradients that hinder convergence, Wg, Hg are separated from the computational graph (superscript * indicates this operation). Because it effectively eliminates the factors that hinder convergence, no new metric dynamic non-monotonic FM is introduced.
[0089] The outlier degree of the anchor box is and The ratio is expressed as:
[0090]
[0091] A small outlier means that the anchor box is of high quality. Assign a small gradient gain to it so that ==BBR(Bounding Box Regression)== is focused on anchor boxes of normal quality. In addition, assigning a smaller gradient gain to anchor boxes with large outliers will effectively prevent low-quality examples from generating large harmful gradients. This embodiment uses β to construct a non-monotonic focusing coefficient and applies it to WIoU v1 to obtain Wise-IoU. Weakening the penalty of geometric factors when the anchor box overlaps well with the target box, and less training intervention will enable the model to obtain better generalization ability.
[0092]
[0093] In the formula, β is the outlier degree of the anchor box, δ represents the parameter of the distance metric, which represents the distance between the prediction box and the target box, and α represents the hyperparameter, which controls the adjustment of the loss weight.
[0094] After the above steps, the improved model YOLOv8-garbage_bin is obtained.
[0095] In step S4 of this embodiment, the lightweight model YOLOv8-garbage_bin constructed in step S2 is trained according to the data set labeled in step S1 and the loss function established in step S3. In this embodiment, the training environment is Python-3.9.19torch-2.3.1CUDA:0 (NVIDIA GeForce RTX 4060Laptop GPU, 8188MiB), the number of training rounds is set to 100, and the batch_size is set to 8, and finally the trained model is obtained. After the training of YOLOv8-garbage_bin is completed, compared with YOLOv8 in the same training environment and parameter settings, the parameters are reduced by about 50%, GFLOPs are reduced by 11.8, and the average detection accuracy mAP_0.5 is increased by 1.5%.
[0096] In step S5 of this embodiment, the road garbage image data collected in step S1 is detected by the TX2 computing processor on the inspection robot using the trained lightweight model YOLOv8-garbage_bin, and the detected image is output. Figure 5 This is a comparison example of garbage overflow recognition between the improved lightweight model YOLOv8-garbage_bin of the present invention and the existing YOLOv8 model, wherein: Figure 5 (a) is a detection example of the existing YOLOv8 model. Figure 5 (b) is a detection example of the improved lightweight model YOLOv8-garbage_bin. Compared with the two, YOLOv8-garbage_bin has better detection effect after training. In addition, the lightweight indicators of YOLOv8-garbage_bin and YOLOv8 are compared as shown in Table 1:
[0097] Table 1
[0098]
[0099] As can be seen from Table 1, YOLOv8-garbage_bin has better lightweight performance and higher accuracy.
[0100] Example 2
[0101] This embodiment proposes a garbage overflow rapid detection and processing system for carrying the aforementioned garbage overflow rapid detection and processing method, which at least includes a robot body, a shell, a front wheel, a support frame, a mobile control component and various sensors. The robot body is protected by the shell, the front wheel is used for movement, the support frame is used to support the body, and the mobile control component and the support frame are respectively fastened to the shell. The core of the platform uses the NUC host as a computing processor and runs the ROS system as the robot operating system. In order to achieve the perception and monitoring of the environment, the platform is equipped with sensors such as laser radar and Intel RealSense D435i camera. Through the ROS communication framework, real-time communication and data processing are achieved between the sensor data and the host. When the computer receives the control signal, the robot can choose automatic cruising or manual operation mode. The control signal is transmitted to the DC motor via the walking control drive module to achieve flexible control of multiple speeds and turning radius. During the cruising process, the camera collects the overflowing image data of the garbage can in real time, and performs image processing and analysis through the NUC processor. The detection results will be displayed on the display screen, thereby completing the automatic detection task of the inspection robot for garbage overflow.
[0102] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A rapid detection and processing method for garbage overflow for inspection robots, characterized in that: It includes the following steps: S1. Collect image data of road trash cans through inspection robots and pre-process the data; S2. Build a lightweight YOLOv8 network, which includes at least a ghost convolution GhostConv module and several C2f_EMA modules; S3, using the improved loss function Wise-IoU as the loss function of the constructed lightweight YOLOv8 network; S4, using the preprocessed image data to train the constructed lightweight YOLOv8 network model to obtain a garbage overflow rapid detection model; S5. The garbage overflow rapid detection model is mounted on the inspection robot, and garbage overflow detection is performed on the images collected by the inspection robot in real time.
2. The method for rapid detection and processing of garbage overflow for inspection robots according to claim 1, characterized in that: In step S1, the preprocessing process of the original trash can image data at least includes data labeling, wherein the original trash can image data is labeled using the LabelImg method, and the labeling categories include: full trash can, not full trash can, and overflowing trash; After the labeling is completed, the labeled trash can image data is divided into a training set and a test set.
3. The method for rapid detection and processing of garbage overflow for inspection robots according to claim 1, characterized in that: In step S2, the structure of the constructed lightweight YOLOv8-garbage_bin model includes at least a backbone network and a head network, wherein the backbone network includes at least several GhostConv modules, C2f modules, C2f_EMA modules, and at least one SPPF module. In the backbone network, multi-scale feature extraction is performed by combining several groups of GhostConv modules, C2f modules, and C2f_EMA modules, wherein the GhostConv module performs lightweight convolution operations, and the C2f and C2f_EMA modules perform abstract processing on feature information; the extracted highest scale features are input into the SPPF module to extract key information; The head network includes at least several Upsample modules, Concat modules, C2f modules, C2f_EMA modules and Detect modules. It first performs Upsample and Concat to concatenate feature maps of different resolutions. It then uses C2f and C2f_EMA to further process features. Finally, the Detect layer detects objects of different scales.
4. The method for rapid detection and processing of garbage overflow for inspection robots according to claim 3, characterized in that: The data processing process of GhostConv is: First, use ordinary convolution, batch normalization and an activation function Relu to compress the number of channels of the input image and generate several feature maps with inherent feature maps; The feature map with the inherent feature map is subjected to multiple unit mappings and linear transformations in parallel with the linear operation φ k Expand the feature map; among them, the cheap operation φ k Includes depth-separable convolutional unit, batch normalization unit and an activation function Relu; Then the cheap operations φ1, φ2, …, φ k The different feature maps obtained are combined with the feature map after the initial feature mapping through the concat operation to obtain the final output feature map.
5. The method for rapid detection and processing of garbage overflow for inspection robots according to claim 3, characterized in that: The structure of the C2f_EMA module is: The input data is first processed by a convolutional layer Conv. After processing, the input feature weights are dynamically allocated through the efficient multi-scale attention EMA. The processed data is then split into multiple parts by the segmentation unit Split. Each part is then input into the corresponding bottleneck module Bottleneck for feature extraction. The data processed by all bottleneck modules is then input into the splicing module Contact for splicing. After splicing, the data is processed and output by the convolutional layer Conv.
6. The method for rapid detection and processing of garbage overflow for inspection robots according to claim 5, characterized in that: The processing flow of the efficient multi-scale attention mechanism EMA of the C2f_EMA module is as follows: The size of the input feature map is C×H×W, where C represents the number of channels, H represents the height, and W represents the width; the input feature map is divided into G groups through the grouping operation, and the number of channels in each group is C / G; Each set of feature maps generates two 1-dimensional feature vectors through average pooling in the X direction and average pooling in the Y direction. The two 1-dimensional feature vectors are processed through point-by-point convolution and activation function to generate two attention weight vectors. The two attention weight vectors are multiplied by matrix to generate an H×W attention matrix. Each set of feature maps is also processed by global average pooling to generate a 1-dimensional feature vector; the 1-dimensional feature vector is processed by point-by-point convolution and activation function to generate an attention weight vector; the attention weight vector is processed by matrix multiplication to generate a C / G×1 attention matrix; The spatial attention matrix and the channel attention matrix are fused through matrix multiplication operations to generate an H×W×C / G attention matrix; The attention matrix is processed by point-by-point convolution and activation function to generate the final attention weight matrix; the final attention weight matrix is element-wise multiplied with the input feature map to generate the feature map after reallocating the weights; the feature map after reallocating the weights is processed by point-by-point convolution and activation function to generate the final output feature map.
7. The method for rapid detection and processing of garbage overflow for inspection robots according to claim 1, characterized in that: In step S3, an improved loss function Wise-IoU is established for the constructed lightweight model, which is expressed as: in, Denotes the loss function Wise-IoU v1 with two-layer attention mechanism, which is expressed as: In the formula, represents the penalty for reducing low-quality anchor boxes, represents the penalty for enlarging the normal quality anchor box, and: In the formula, x, y and x gt y gt Represent the coordinates of the center of the anchor box and the center of the target box respectively; W g ,H g is the size of the smallest enclosing box, (·) * W g ,H g Separation operation; r is a non-monotonic focusing coefficient, which is expressed as: In the formula, β is the outlier degree of the anchor box, δ represents the parameter of the distance metric, which represents the distance between the prediction box and the target box, and α represents the hyperparameter, which controls the adjustment of the loss weight. and Represent the IoU loss and quality box loss values respectively.
8. A garbage overflow rapid detection and processing system for inspection robots, characterized by: It is used to execute the garbage overflow rapid detection and processing method for a patrol robot as described in any one of the aforementioned claims 1-7.
9. The garbage overflow rapid detection and processing system for patrol robots according to claim 8, characterized in that: It at least includes a robot body, a shell, front wheels, a support frame, a mobile control component and various sensors; The robot body is protected by a shell, the front wheels are used for movement, the support frame is used to support the body, the mobile control component and the support frame are respectively fastened to the shell, and the sensors installed on the robot body include at least a laser radar and a camera; the robot body includes automatic cruising and manual operation modes; The system uses a NUC host as a computing processor and runs the ROS system as a robot operating system; The system realizes real-time communication and data processing between sensor data and the host through the ROS communication framework.
Citation Information
Patent Citations
Improved YOLOv5 lightweight community scene pedestrian detection method
CN115862066A
Traffic scene target detection method and system based on improved YOLOv5s
CN118314320A
Cited By
Digital government management platform and method
CN120654917A
