Intelligent garbage classification method, system and equipment
By constructing a loss function optimization YOLOV5 model that integrates region perception, multi-dimensional image features and attention-guided loss function, the problem of insufficient accuracy and generalization ability of garbage identification and classification is solved, and more efficient garbage intelligent identification and classification is achieved.
Patent Information
- Application Number
- CN202510217507.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-26
- Publication Date
- 2025-07-18
AI Technical Summary
The existing garbage intelligent identification and classification method based on the YOLOV5 neural network model has problems of insufficient accuracy and generalization capabilities in actual applications, especially ignoring the impact of different target areas and target object sizes on garbage classification and recognition.
The location loss perceived by the fusion region, the classification loss of multi-dimensional image feature fusion, and the loss function based on attention-guided confidence loss is constructed, and the YOLOV5 neural network model is optimized by obtaining target area information, multi-dimensional image features and spatial attention.
The average detection accuracy of garbage identification and classification has been improved, more accurate garbage intelligent identification and positioning has been achieved, and the accuracy and efficiency of garbage classification have been improved.
Smart Images

Figure CN120339672A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of garbage classification, and in particular, to an intelligent garbage classification method, system and device. Background Art
[0002] With the surging global garbage output, the traditional manual classification is inefficient and costly. Therefore, intelligent classification technology has become a key direction to solve environmental protection pain points. As a single-stage object detection algorithm, YOLOv5 can achieve a balance between speed and accuracy through mechanisms such as multi-scale feature fusion and anchor box clustering optimization. Its lightweight characteristics (such as SPP module and FPN structure) make it suitable for embedded devices, providing a technical basis for real-time garbage classification systems.
[0003] After retrieval, some typical prior arts are found. For example, a garbage classification method based on YoloV5 and ResNet50 with the application number CN202211048603.X considers the situation of garbage overlap during image cutting, which is beneficial to improving the accuracy of image cutting and recognition and ensuring the accuracy of garbage classification. Another example is a method and APP for domestic garbage classification based on lightweight YOLOv5 with the application number CN202211028322.8. The lightweight YOLOv5 model is deployed to the domestic garbage classification APP on the mobile terminal, and intelligent classification of various domestic garbage can be realized. Still another example is a garbage classification and positioning method, an unmanned cleaning boat control method and system with the application number CN202310515917.4. An improved yolov5 model trained based on the one-step method is used to identify the water surface image containing floating garbage, and the category and position of the floating garbage can be obtained with one operation.
[0004] Therefore, for the method of realizing intelligent garbage recognition and classification based on the YOLOV5 neural network model, there are still many unsolved technical problems in its actual application. Summary of the Invention
[0005] Based on this, in order to realize intelligent garbage classification and improve the accuracy of garbage recognition and classification, the present invention provides an intelligent garbage classification method, system and device. A loss function is constructed based on the positioning loss of region perception, the classification loss of multi-dimensional image feature fusion, and the confidence loss guided by attention, and a YOLOV5 neural network model is constructed based on the loss function, which integrates region perception, multi-dimensional image features and spatial attention, and can improve the average detection accuracy. The specific technical solutions are as follows:
[0006] An intelligent garbage classification method includes the following steps:
[0007] Collect multiple garbage images and preprocess the multiple garbage images to obtain a garbage image dataset;
[0008] Obtain the localization loss based on region perception, the classification loss of multi-dimensional image feature fusion, and the confidence loss guided by attention, and construct a loss function according to the localization loss, the classification loss, and the confidence loss;
[0009] Construct a YOLOV5 neural network model according to the loss function, and train the YOLOV5 neural network model with the garbage image dataset;
[0010] Identify and locate the garbage to be processed through the trained neural network model, so as to realize the classification of the garbage to be processed.
[0011] The intelligent garbage classification method can improve the average detection accuracy and better realize the intelligent identification, location and classification of garbage by constructing a loss function that integrates the localization loss based on region perception, the classification loss of multi-dimensional image feature fusion, and the confidence loss guided by attention.
[0012] Preferably, the specific method for obtaining the localization loss based on region perception includes the following steps:
[0013] Obtain the target region information, and obtain the region importance coefficient and the target object area coefficient according to the target region information;
[0014] Obtain the area difference penalty term based on the target region information, and obtain the localization loss based on region perception according to the region importance coefficient, the target object area coefficient, and the area difference penalty term.
[0015] Preferably, the specific method for the classification loss of multi-dimensional image feature fusion includes the following steps:
[0016] Obtain the BCE loss of the original class label, the first cross-entropy loss of the material type, and the second cross-entropy loss of the color space;
[0017] Obtain the weight coefficients of the BCE loss, the first cross-entropy loss, and the second cross-entropy loss respectively according to the target region confidence;
[0018] Obtain the classification loss according to the BCE loss, the first cross-entropy loss, the second cross-entropy loss, and the corresponding weight coefficients.
[0019] Preferably, the steps of the specific method for obtaining the confidence loss guided by attention include:
[0020] Construct a spatial attention map, and obtain the confidence loss guided by attention according to the spatial attention map.
[0021] Preferably, the loss function L total = α × L loc + β × L cls + γ × L conf ;
[0022] L loc represents the localization loss, L cls represents the classification loss, L conf represents the confidence loss, and α, β, and γ respectively represent the localization loss weight coefficient, the classification loss weight coefficient, and the confidence loss weight coefficient.
[0023] An intelligent garbage classification system for implementing the intelligent garbage classification method as claimed in the claims, comprising:
[0024] An acquisition module for acquiring multiple garbage images and preprocessing the multiple garbage images to obtain a garbage image dataset;
[0025] A construction module for obtaining a localization loss based on region perception, a classification loss of multi-dimensional image feature fusion, and a confidence loss based on attention guidance, and constructing a loss function according to the localization loss, the classification loss, and the confidence loss;
[0026] A training module for constructing a YOLOV5 neural network model according to the loss function and training the YOLOV5 neural network model through the garbage image dataset;
[0027] An identification module for identifying and locating the garbage to be processed through the trained neural network model to achieve the classification of the garbage to be processed.
[0028] Preferably, the construction module includes:
[0029] A localization loss construction unit for obtaining target region information, obtaining a region importance coefficient and a target object area coefficient according to the target region information, obtaining an area difference penalty term based on the target region information, and obtaining the localization loss based on region perception according to the region importance coefficient, the target object area coefficient, and the area difference penalty term.
[0030] Preferably, the construction module further includes:
[0031] A classification loss construction unit for obtaining the BCE loss of the original class label, the first cross-entropy loss of the material type, and the second cross-entropy loss of the color space, obtaining the weight coefficients of the BCE loss, the first cross-entropy loss, and the second cross-entropy loss respectively according to the target region confidence, and obtaining the classification loss according to the BCE loss, the first cross-entropy loss, the second cross-entropy loss, and the corresponding weight coefficients.
[0032] Preferably, the intelligent waste sorting system further includes:
[0033] A first device, including an XYZ-axis moving mechanism and an internal mechanical claw installed at the end of the Z-axis of the XYZ-axis moving unit, where the XYZ-axis moving mechanism is used to drive the mechanical claw to move along the X, Y, and Z axes;
[0034] A second device, a lifting mechanism, a horizontal telescoping mechanism, a flipping mechanism, and an external mechanical claw. The horizontal telescoping mechanism is installed on the lifting mechanism and the lifting mechanism is used to drive the lifting mechanism to move up and down. The flipping mechanism is fixedly installed on the horizontal telescoping mechanism and the horizontal telescoping mechanism is used to drive the flipping mechanism to telescope horizontally. The external mechanical claw is fixedly installed on the flipping mechanism and the flipping mechanism is used to drive the external mechanical claw to flip.
[0035] An intelligent waste sorting device, which includes:
[0036] A controller;
[0037] A memory, storing executable instructions;
[0038] Wherein, the executable instructions can run on the controller and implement the intelligent waste sorting method described above. Description of the Drawings
[0039] The present invention can be further understood from the following description in conjunction with the drawings. The components in the drawings are not necessarily drawn to scale, but the emphasis is placed on showing the principles of the embodiments. In different views, the same reference numerals designate corresponding parts.
[0040] Figure 1 is the overall process schematic diagram of an intelligent waste sorting method in an embodiment of the present invention;
[0041] Figure 2 is the process schematic diagram of the specific method for obtaining the positioning loss based on area perception in an embodiment of the present invention;
[0042] Figure 3 is the process schematic diagram of the specific method for obtaining the classification loss of multi-dimensional image feature fusion in an embodiment of the present invention;
[0043] Figure 4 is the overall structure schematic diagram of an intelligent waste sorting system in an embodiment of the present invention;
[0044] Figure 5 is the partial structure schematic diagram of an intelligent waste sorting system in an embodiment of the present invention Figure 1 ;
[0045] Figure 6 This is a schematic diagram of part of the structure of an intelligent garbage classification system in an embodiment of the present invention Figure 1 ;
[0046] Figure 7 This is a schematic diagram of part of the structure of an intelligent garbage classification system in an embodiment of the present invention Figure 1 。
[0047] Description of the reference numerals:
[0048] 1. First servo; 2. Internal mechanical claw; 3. Link telescopic structure; 4. Second servo; 5. Claw structure; 6. Infrared sensor; 7. Garbage bin air cylinder; 8. Lifting mechanism; 9. Horizontal telescopic mechanism; 10. Flipping mechanism; 11. External mechanical claw. Detailed implementation manners
[0049] In order to make the objectives, technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below in conjunction with its embodiments. It should be understood that the specific implementation manners described herein are only used to explain the present invention and do not limit the protection scope of the present invention.
[0050] It should be noted that when an element is referred to as being "fixed to" another element, it can be directly on the other element or there can also be an intermediate element. When an element is considered to be "connected" to another element, it can be directly connected to the other element or there may be an intermediate element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are only for the purpose of illustration and do not represent the only implementation manner.
[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the technical field to which the present invention belongs. The terms used in the description of the present invention herein are only for the purpose of describing specific implementation manners and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0052] The "first" and "second" in the present invention do not represent specific quantities and orders, but are only used for name distinction.
[0053] Before elaborating on the embodiments of the present application, a brief description of the YOLOV5 loss function in the prior art will be given first.
[0054] In the YOLOV5 model, the loss function generally includes location loss, confidence loss, and classification loss. The location loss is used to measure the difference between the predicted bounding box and the ground truth bounding box, including the error in the center position and the width and height; the confidence loss is used to measure the difference between the predicted confidence and whether the target is actually included, including the confidence error when the target is included and the confidence error when the target is not included; the classification loss is used to measure the difference between the predicted class probability and the true class. For the existing YOLOV5 loss function, it lacks the fusion of spatial attention maps and target region information, ignores the impact of different target regions and the size of target garbage objects on the accuracy of garbage classification recognition, and there is room for further optimization in its generalization ability and the mean average precision mAP.
[0055] To solve the above problems, as Figure 1 shown, in an embodiment of the present invention, an intelligent garbage classification method is provided, including the following steps:
[0056] S1, collect multiple garbage images and preprocess the multiple garbage images to obtain a garbage image dataset.
[0057] For the preprocessing, it includes but is not limited to:
[0058] 1. Basic processing and enhancement
[0059] 1.1 Grayscale conversion: Convert the color image to a grayscale image to simplify subsequent processing steps. For example, it can be achieved by the weighted average method (such as the RGB to grayscale formula).
[0060] 1.2 Denoising and smoothing: Filter and smooth noises such as salt-and-pepper noise, Gaussian noise, and uniform noise. The filtering methods include mean filtering (suppressing Gaussian noise), median filtering (effectively removing salt-and-pepper noise), Gaussian filtering (smoothing the image while retaining edges), and Wiener filtering (denoising in the frequency domain).
[0061] 1.3 Contrast enhancement: Histogram equalization, adjust the pixel distribution to expand the dynamic range and improve the overall contrast; gamma correction, optimize the details of bright and dark regions through non-linear transformation.
[0062] 2. Geometric transformation and correction
[0063] 2.1 Geometric correction: Eliminate geometric errors caused by sensor distortion, perspective deformation, etc. It is commonly implemented by affine transformation or bilinear transformation.
[0064] 2.2 Rotation and scaling: Adjust the image size or orientation through interpolation algorithms (such as nearest neighbor, bilinear, bicubic interpolation).
[0065] 2.3 Image registration and fusion: Registration is to align multiple images (such as images at different times or from different sensors); Fusion is to combine multi-spectral and high-resolution images to enhance the information content (such as the Pan-sharpening technique).
[0066] 3. Image segmentation and binarization: Threshold segmentation, such as global thresholding method and adaptive thresholding method, edge detection or using operators to extract contour features, such as Sobel, Canny, Laplacian, etc.
[0067] 4. Morphological operations and feature optimization
[0068] 4.1 Morphological processing: Dilation (filling holes) and erosion (removing small noises); Opening operation (erosion first and then dilation) and closing operation (dilation first and then erosion) to optimize the shape.
[0069] 4.2 Interest point detection: Extract stable features such as corners and textures for image matching (such as Harris corner detection).
[0070] 5. Data dimensionality reduction and feature selection: Include principal component analysis (PCA) to reduce the data dimensionality and retain the main features; Linear discriminant analysis (LDA) to enhance the class separability.
[0071] Since preprocessing the garbage images to obtain a high-quality garbage image dataset and then better training the model belong to the conventional technical means in this field, it will not be elaborated here.
[0072] S2. Obtain the localization loss based on region perception, the classification loss of multi-dimensional image feature fusion, and the confidence loss based on attention guidance, and construct a loss function according to the localization loss, the classification loss, and the confidence loss.
[0073] Preferably, as Figure 2 shown, in step S2, the specific method for obtaining the localization loss based on region perception includes the following steps:
[0074] S21. Obtain the target region information, and obtain the region importance coefficient and the target object area coefficient according to the target region information.
[0075] S22. Obtain the area difference penalty term based on the target region information, and obtain the localization loss based on region perception according to the region importance coefficient, the target object area coefficient, and the area difference penalty term.
[0076] For the target region information, it refers to the region information where the garbage to be classified is located, such as the kitchen, the street, the campus, or the hospital. The region importance coefficient can be set by technicians according to experience. Preferably, the region importance coefficient Among them, m1 represents the number of types of special garbage in the target area within a preset time period. Special garbage includes categories such as radioactive garbage, toxic garbage, infectious garbage, explosive garbage, flammable garbage, and corrosive garbage, which can be screened and set by technicians. M i represents the weight of the i-th type of special garbage in the target area within a preset time period, and α 1i represents the weight coefficient of the weight of the i-th type of special garbage in the target area within a preset time period. Thus, through the regional importance coefficient it is possible to obtain the importance of the target area more accurately, avoid the human error that may occur when calibrating the importance coefficient relying on personal experience, and achieve dynamic adjustment of the accuracy requirements for garbage positioning according to the importance of the target area. In addition, obtaining the regional importance coefficient based on the special garbage information in the target area within a preset time period can also increase the weight of certain target areas, thereby specifically improving the accuracy of garbage positioning.
[0077] The target object area coefficient can be understood as the weighted average of the areas of classified garbage images of multiple types that may be detected. Specifically, where m2 represents the types of classified garbage, and S i represents the image area of the i-th type of classified garbage. The image area of the i-th type of classified garbage can be obtained by randomly extracting multiple classified garbage images and calculating the mean of the projected areas of several of their surfaces. a 2i represents the weight coefficient of the image area of the i-th type of classified garbage. Through the target object area coefficient, the positioning loss based on regional perception can be dynamically adjusted, avoiding the model over-focusing on large target garbage objects and ignoring small target garbage objects, as well as enhancing the sensitivity of the model to small target garbage objects, comprehensively measuring the influence of the size of the target object on the attention of the model, and alleviating the problem of uneven positioning ability of traditional loss functions for targets of different scales.
[0078] The area difference penalty term SD = α3' × v; where represents the aspect ratio difference value, α3' represents the aspect ratio difference value weight coefficient, w gt 、h gt represent the width and height of the ground truth box, and w, h represent the width and height of the predicted box. One of the functions of the area difference penalty term is to prevent the model from overfitting and improve its robustness.
[0079] The regional perception-based positioning loss L loc =(1 + λ region × λ object)(1 - CIOU + SD), where CIOU represents the improved Intersection over Union (IoU), that is, Complete IoU. Through the region-aware localization loss, on the basis of the traditional CIOU loss, a region importance coefficient, an object area coefficient, and an area difference penalty term are introduced, which can avoid the human error that may occur when calibrating the importance coefficient relying on personal experience, achieve dynamically adjusting the accuracy requirements of garbage localization according to the importance of the target region, and comprehensively measure the influence of the size of the target object on the attention of the model, alleviating the problem of uneven localization ability of the traditional loss function for targets of different scales.
[0080] Preferably, as Figure 3 shown, in step S2, the specific method for obtaining the classification loss of multi-dimensional image feature fusion includes the following steps:
[0081] S23, obtain the BCE loss L BCE of the original class label, the first cross-entropy loss L material of the material type, and the second cross-entropy loss L color .
[0082] S24, respectively obtain the weight coefficients of the BCE loss, the first cross-entropy loss, and the second cross-entropy loss according to the target region confidence.
[0083] S25, obtain the classification loss L cls = β1L BCE + β2L material + β3L color . Where β1, β2, and β3 respectively represent the weight coefficients of the BCE loss, the first cross-entropy loss, and the second cross-entropy loss, and can all be set by technicians. Preferably, β1, β2, and β3 are 0.7, 0.2, and 0.1 respectively.
[0084] Preferably, the steps of the specific method for obtaining the confidence loss guided by attention include: constructing a spatial attention map, and obtaining the confidence loss L conf guided by attention according to the spatial attention map.
[0085] Here, the spatial attention map is generated through feature interaction and normalization, that is, the spatial attention map where h i , h j represent the position features of the input feature map, W a represents the learnable weight matrix, || represents feature concatenation, and a ij represents the attention weight of position i to j.
[0086] Preferably, spatial attention is used as pixel-level weights to enhance the loss contribution of complex sample regions, that is, the attention-guided confidence loss where N represents the number of complex sample regions, and α i represents the spatial attention weight, y i represents the label, and p i represents the predicted probability.
[0087] The loss function L total = α × L loc + β × L cls + γ × L conf ;
[0088] L loc represents the localization loss, L cls represents the classification loss, and L conf represents the confidence loss. α, β, and γ respectively represent the localization loss weight coefficient, the classification loss weight coefficient, and the confidence loss weight coefficient. Preferably, the initial values of α, β, and γ are set to 0.6, 0.3, and 0.1 respectively and are automatically optimized during the training process.
[0089] S3. Construct a YOLOV5 neural network model according to the loss function, and train the YOLOV5 neural network model with the garbage image dataset.
[0090] S4. Identify and locate the garbage to be processed through the trained neural network model to achieve the classification of the garbage to be processed.
[0091] After identifying and locating the garbage to be processed, the robotic arm can assist the robotic claw to grab the garbage to be processed to achieve the classification and treatment of the garbage to be processed. Since identifying the type of the garbage to be processed, locating it, and then grabbing and classifying and recycling it belong to the conventional technical means in the art, they will not be elaborated here.
[0092] In summary, the intelligent garbage classification method can improve the average detection accuracy and better achieve the intelligent identification, location, and classification of garbage by constructing a loss function that combines the localization loss with regional perception, the classification loss with multi-dimensional image feature fusion, and the attention-guided confidence loss.
[0093] An embodiment of the present invention further provides an intelligent garbage classification system for implementing the intelligent garbage classification method as claimed in the claims, as Figure 4 shown, which includes a collection module, a construction module, a training module, and an identification module.
[0094] The acquisition module is used to acquire multiple garbage images and preprocess the multiple garbage images to obtain a garbage image dataset; the construction module is used to obtain a localization loss based on region perception, a classification loss of multi-dimensional image feature fusion, and a confidence loss based on attention guidance, and construct a loss function according to the localization loss, the classification loss, and the confidence loss;
[0095] The training module is used to construct a YOLOV5 neural network model according to the loss function, and train the YOLOV5 neural network model through the garbage image dataset; the recognition module is used to identify and locate the garbage to be processed through the trained neural network model, so as to realize the classification of the garbage to be processed.
[0096] Specifically, the intelligent garbage classification system acquires garbage images through a camera and performs real-time processing on the images using OpenCV. The system improves the confidence of the model through multiple trainings. The trained YOLOv5 model can identify and locate multiple garbage category targets. The continuous optimization and training of the system contribute to improving the recognition ability and classification accuracy. The garbage information is sent to the lower computer through the ROS (Robot Operating System) system, and the lower computer grabs and classifies the garbage according to the received information, realizing the automated garbage classification process.
[0097] ROS (Robot Operating System) is a set of computer operating system architectures designed specifically for robot software development. It is an open-source meta-level operating system (post-operating system) that provides services similar to an operating system, including hardware abstraction description, underlying driver management, execution of common functions, inter-process message passing, program package management. It also provides some tools and libraries for obtaining, building, writing, and executing multi-machine fusion programs.
[0098] Preferably, the construction module includes a localization loss construction unit and a classification loss construction unit
[0099] The localization loss construction unit is used to obtain target region information, obtain a region importance coefficient and a target object area coefficient according to the target region information, obtain an area difference penalty term based on the target region information, and obtain the localization loss based on region perception according to the region importance coefficient, the target object area coefficient, and the area difference penalty term.
[0100] The classification loss construction unit is used to obtain the BCE loss of the original class label, the first cross-entropy loss of the material type, and the second cross-entropy loss of the color space, obtain the weight coefficients of the BCE loss, the first cross-entropy loss, and the second cross-entropy loss respectively according to the target region confidence, and obtain the classification loss according to the BCE loss, the first cross-entropy loss, the second cross-entropy loss, and the corresponding weight coefficients.
[0101] The construction module further includes a confidence loss construction unit, which is used to construct a spatial attention map and obtain the attention-guided confidence loss according to the spatial attention map.
[0102] The loss function L total = α × L loc + β × L cls + γ × L conf ;
[0103] L loc represents the localization loss, L cls represents the classification loss, L conf represents the confidence loss, and α, β, and γ respectively represent the localization loss weight coefficient, the classification loss weight coefficient, and the confidence loss weight coefficient. Preferably, the initial values of α, β, and γ are set to 0.6, 0.3, and 0.1 respectively and are automatically optimized during the training process.
[0104] As Figure 5 and Figure 6 shown, the intelligent garbage classification system further includes a first device and a second device.
[0105] The first device includes an XYZ-axis moving mechanism and an internal mechanical claw installed at the end of the Z-axis of the XYZ-axis moving unit. The XYZ-axis moving mechanism is used to drive the mechanical claw to move along the X, Y, and Z axes.
[0106] Specifically, the XYZ-axis moving mechanism includes an XY-axis moving unit (not shown in the figure) that uses a stepper motor and a synchronous belt pulley to control the movement of the internal mechanical claw on the XY axis, and a Z-axis moving unit that controls the telescopic structure of the connecting rod of the upper part of the internal mechanical claw through a first servo motor to achieve the movement of the internal mechanical claw on the Z axis, and a driving unit that controls the opening and closing of the claw structure of the lower part of the internal mechanical claw through a second servo motor and a gear structure to achieve the purpose of garbage grasping.
[0107] It automatically classifies and disposes after matching the visual recognition of garbage types, accurately executes the classification actions, replaces manual operations, and improves the efficiency of garbage classification. The system also has an infrared sensor built in to detect whether the trash can is full. When the trash can is full, the trash can pneumatic cylinder automatically pushes out the full trash can, which greatly facilitates manual replacement and sends out a full reminder signal. At the same time, it has the function of real-time detecting the garbage status and can better master the usage of the trash can.
[0108] Since the XYZ-axis moving mechanism belongs to the conventional technical means in this field, it will not be elaborated here.
[0109] The second device includes a lifting mechanism, a horizontal telescopic mechanism, a flipping mechanism, and an external mechanical claw. The horizontal telescopic mechanism is installed on the lifting mechanism, and the lifting mechanism is used to drive the lifting mechanism to move up and down. The flipping mechanism is fixedly installed on the horizontal telescopic mechanism, and the horizontal telescopic mechanism is used to drive the flipping mechanism to horizontally expand and contract. The external mechanical claw is fixedly installed on the flipping mechanism, and the flipping mechanism is used to drive the external mechanical claw to flip.
[0110] Specifically, the lifting mechanism drives the lead screw to lift through a motor and a synchronous belt pulley. The flipping mechanism controls the 180-degree flipping of the external mechanical claw through a motor. The horizontal telescopic mechanism controls the horizontal expansion and contraction of the external mechanical claw through a pneumatic cylinder. The external mechanical claw realizes the horizontal expansion and contraction to grab the garbage container, so as to conduct a large amount of centralized classification of garbage at one time. The lifting structure realizes the automatic input of garbage into the sorting port for internal classification. The second device can classify a large amount of garbage simultaneously, with a large garbage processing volume per single operation, improving the efficiency of garbage classification.
[0111] In summary, by constructing a loss function that integrates the positioning loss of regional perception, the classification loss of multi-dimensional image feature fusion, and the confidence loss based on attention guidance, the system can improve the average detection accuracy and better realize the intelligent recognition, positioning, and classification of garbage.
[0112] An embodiment of the present invention also provides an intelligent garbage classification device, which includes: a controller; a memory storing executable instructions; wherein, the executable instructions can run on the controller and implement the intelligent garbage classification method described above.
[0113] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this specification.
[0114] The above-described embodiments merely represent several implementation manners of the present invention. Their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present invention, several variations and improvements can still be made, and these all fall within the protection scope of the present invention. Therefore, the protection scope of the present invention patent shall be subject to the appended claims.
Claims
1. An intelligent waste sorting method, characterized in that, The intelligent garbage classification method includes the following steps: Collect multiple garbage images and preprocess the multiple garbage images to obtain a garbage image dataset; Obtain a positioning loss based on region perception, a classification loss of multi-dimensional image feature fusion, and a confidence loss based on attention guidance, and construct a loss function according to the positioning loss, the classification loss, and the confidence loss; Construct a YOLOV5 neural network model according to the loss function, and train the YOLOV5 neural network model with the garbage image dataset; Identify and locate the garbage to be processed through the trained neural network model to achieve the classification of the garbage to be processed.
2. The intelligent garbage classification method according to claim 1, wherein The specific method for obtaining the positioning loss based on region perception includes the following steps: Obtain target region information, and obtain a region importance coefficient and a target object area coefficient according to the target region information; Obtain an area difference penalty term based on the target region information, and obtain the positioning loss based on region perception according to the region importance coefficient, the target object area coefficient, and the area difference penalty term.
3. The intelligent garbage classification method according to claim 2, wherein The specific method for the classification loss of multi-dimensional image feature fusion includes the following steps: Obtain the BCE loss of the original class label, the first cross-entropy loss of the material type, and the second cross-entropy loss of the color space; Obtain the weight coefficients of the BCE loss, the first cross-entropy loss, and the second cross-entropy loss respectively according to the target region confidence; Obtain the classification loss according to the BCE loss, the first cross-entropy loss, the second cross-entropy loss, and the corresponding weight coefficients.
4. The intelligent garbage classification method according to claim 3, wherein, The steps of the specific method for obtaining the confidence loss based on attention guidance include: Construct a spatial attention map, and obtain the confidence loss based on attention guidance according to the spatial attention map.
5. The intelligent garbage classification method according to claim 4, characterized in that, The loss function L total = α × L loc + β × L cls + γ × L conf ; L loc represents the localization loss, L cls represents the classification loss, L conf represents the confidence loss, and α, β, and γ respectively represent the localization loss weight coefficient, the classification loss weight coefficient, and the confidence loss weight coefficient.
6. An intelligent garbage classification system for implementing the intelligent garbage classification method according to any one of claims 1-5, characterized in that, The intelligent garbage classification system includes: A collection module for collecting multiple garbage images and preprocessing the multiple garbage images to obtain a garbage image dataset; A construction module for obtaining a positioning loss based on region perception, a classification loss of multi-dimensional image feature fusion, and a confidence loss based on attention guidance, and constructing a loss function according to the positioning loss, the classification loss, and the confidence loss; A training module for constructing a YOLOV5 neural network model according to the loss function and training the YOLOV5 neural network model with the garbage image dataset; An identification module for identifying and locating the garbage to be processed through the trained neural network model to achieve the classification of the garbage to be processed.
7. An intelligent garbage classification system according to claim 6, characterized in that, The construction module includes: A positioning loss construction unit for obtaining target region information, obtaining a region importance coefficient and a target object area coefficient according to the target region information, obtaining an area difference penalty term based on the target region information, and obtaining the positioning loss based on region perception according to the region importance coefficient, the target object area coefficient, and the area difference penalty term.
8. An intelligent garbage classification system according to claim 7, characterized in that, The construction module further includes: A classification loss construction unit is configured to obtain the BCE loss of the original category label, the first cross-entropy loss of the material type, and the second cross-entropy loss of the color space, obtain the weight coefficients of the BCE loss, the first cross-entropy loss, and the second cross-entropy loss respectively according to the confidence of the target region, and obtain the classification loss according to the BCE loss, the first cross-entropy loss, the second cross-entropy loss, and the corresponding weight coefficients.
9. The intelligent garbage classification system according to claim 8, wherein, The intelligent garbage classification system further includes: A first device, including an XYZ-axis moving mechanism and an internal mechanical claw installed at the end of the Z-axis of the XYZ-axis moving unit, where the XYZ-axis moving mechanism is configured to drive the mechanical claw to move along the X, Y, and Z axes; A second device, including a lifting mechanism, a lateral telescopic mechanism, a flipping mechanism, and an external mechanical claw, where the lateral telescopic mechanism is installed on the lifting mechanism and the lifting mechanism is configured to drive the lifting mechanism to move up and down, the flipping mechanism is fixedly installed on the lateral telescopic mechanism and the lateral telescopic mechanism is configured to drive the flipping mechanism to telescopically move laterally, and the external mechanical claw is fixedly installed on the flipping mechanism and the flipping mechanism is configured to drive the external mechanical claw to flip.
10. An intelligent garbage sorting device, characterized in that, The intelligent garbage classification device includes: A controller; A memory storing executable instructions; Wherein, the executable instructions can run on the controller and implement the intelligent garbage classification method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Lightweight YOLOv5-based household garbage classification method and APP
CN115439684A
Garbage classification method based on YoloV5 and ResNet50
CN115471694A
Garbage classification and positioning method and unmanned cleaning boat control method and system
CN116310597A
Cited By
Hydrological digital twinborn model construction and management and control method and device based on AI digital view
CN120744389A