A solid waste identification method, system, device and storage medium

By inserting a convolutional block attention network into the ResNet-38 network, accurately pseudo-labels are generated and fully supervised semantic segmentation neural network is trained, and the problem of low recognition accuracy of solid-state waste in weak-supervised semantic segmentation technology is solved, and higher recognition accuracy is achieved.

CN116721274BActive Publication Date: 2025-08-15NANHU LAB
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310034929.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-10
Publication Date
2025-08-15
Estimated Expiration
2043-01-10

AI Technical Summary

Technical Problem

The existing weak supervision semantic segmentation technology has problems of misjudgment and misjudgment when identifying sparse target objects, especially solid waste, which leads to low recognition accuracy, and it is especially difficult to distinguish objects such as white plastic garbage and stones.

Method used

ResNet-38 network and convolutional block attention network are used to refine the labels by calculating activation maps and conditional random field, accurately pseudo-labels are generated, and fully supervised semantic segmentation neural network is trained to improve recognition accuracy.

Benefits of technology

The recognition accuracy of solid-state waste is significantly improved, and by generating more accurate pseudo-labels, the recognition ability of semantic segmentation models for complex boundaries is improved, and the recognition effect is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116721274B_ABST
    Figure CN116721274B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, device and storage medium for identifying solid waste, and relates to the field of semantic segmentation technology. The method comprises: inputting a target image into a first classification model to obtain a first class activation map and a second class activation map; calculating a first target class activation map of a background based on the first class activation map; calculating a second target class activation map of the background based on the first class activation map and the second class activation map; determining a target affinity label based on the first target class activation map, the first class activation map, the second class activation map and the second target class activation map; inputting the target image and the target affinity label into a solid waste pseudo-label generation model to obtain a solid waste pseudo-label, thereby training a fully supervised semantic segmentation neural network, obtaining a target solid waste recognition model, identifying solid waste in the target image, and improving the recognition accuracy of solid waste.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of semantic segmentation technology, and in particular to a method, system, device and storage medium for identifying solid waste. Background Art

[0002] Semantic segmentation is one of the key issues in computer vision today, enabling a complete understanding of a scene. With the continuous advancement of autonomous driving technology, medical technology, and other fields, the demand for semantic segmentation datasets for various scenarios has increased significantly. However, constructing semantic segmentation datasets requires pixel-level annotation of each image in the dataset. Pixel-level annotation is a labor-intensive task, requiring significant investment in both manpower and time.

[0003] Weakly supervised semantic segmentation technology generates pseudo labels based on a dataset of image-level annotation information such as points, graffiti, rectangular boxes, or class labels, thereby forming a semantic segmentation dataset with pixel-level annotations. Point, graffiti, rectangular boxes, or class label annotations are easier to obtain than pixel-level annotations, which can save a lot of time and human resource expenses.

[0004] However, the current weakly supervised semantic segmentation technology still has certain limitations. Existing weakly supervised semantic segmentation models often perform relatively well in the segmentation of salient target objects, but the segmentation performance of sparse target objects is often unsatisfactory. In addition, some target objects (such as target solid waste) are extremely difficult to distinguish from the target background, and sometimes it is even difficult to define the category of the target object, for example: the distinction between white plastic garbage and stones; the category determination of debris piled around the house. This will also cause the weakly supervised semantic segmentation model to misjudge or miss the target object, and the accuracy of boundary definition will decrease, resulting in low recognition accuracy for solid waste. Summary of the Invention

[0005] The purpose of the present invention is to provide a solid waste identification method, system, device and storage medium, which improve the solid waste identification accuracy.

[0006] To achieve the above object, the present invention provides the following solutions:

[0007] A method for identifying solid waste, the method comprising:

[0008] Acquire a target image; the target image is a two-dimensional color image acquired by a sampling device;

[0009] Inputting the target image into a first classification model to obtain a first class activation map and a second class activation map; the first classification model is determined based on a ResNet-38 network; the first class activation map is a class activation map of solid waste in the target image; the second class activation map is a class activation map of an entity in the target image; the entity is the area in the target image excluding the solid waste and the background;

[0010] Calculating a first target class activation map for the background in the target image based on the first class activation map;

[0011] Calculating a second target class activation map for the background in the target image based on the first class activation map and the second class activation map;

[0012] concatenating the first target class activation map, the first class activation map, and the second class activation map to obtain a target multi-class label, and refining the target multi-class label using a conditional random field to obtain a target refined multi-class label;

[0013] concatenating the second target class activation map and the first class activation map to obtain a target single class label, and refining the target single class label using a conditional random field to obtain a target refined single class label;

[0014] determining a target affinity label according to the target refined multi-category label and the target refined single-category label;

[0015] Inputting the target image and the target affinity label into a solid waste pseudo-label generation model to obtain a pseudo-label of the solid waste in the target image; the solid waste pseudo-label generation model is determined based on a ResNet-38 network and a convolutional block attention network;

[0016] Training a fully supervised semantic segmentation neural network based on the pseudo labels of the solid waste in the target image to obtain a target solid waste recognition model;

[0017] The target image is input into the target solid waste recognition model to recognize the solid waste in the target image.

[0018] Optionally, the process of determining the first classification model includes:

[0019] Acquire a training sample; the training sample includes: a training image and a training label; the training image includes: training solid waste, a training background, and a training entity; the training entity is the area of the training image excluding the training solid waste and the training background, and the training label is the label of the training solid waste;

[0020] Using the training image as input and the recognition result of the training solid waste as output, the ResNet-38 network is trained for a preset number of training times to obtain a trained ResNet-38 network;

[0021] Delete the global mean pooling layer in the trained ResNet-38 network to obtain the first classification model.

[0022] Optionally, the process of determining the solid waste pseudo-label generation model includes:

[0023] Inputting the training images into the first classification model to obtain a class activation map of the training solid waste and a class activation map of the training entity;

[0024] Calculating a first training class activation map of the training background based on the class activation map of the training solid waste;

[0025] Calculating a second training class activation map of the training background based on the class activation map of the training solid waste and the class activation map of the training entity;

[0026] concatenating the first training class activation map, the class activation map of the training solid waste, and the class activation map of the training entity to obtain a training multi-class label, and refining the training multi-class label using a conditional random field to obtain a training refined multi-class label;

[0027] concatenating the second training class activation map and the class activation map of the training solid waste to obtain a training single class label, and refining the training single class label using a conditional random field to obtain a training refined single class label;

[0028] Determining a training affinity label based on the training refined multi-category label and the training refined single-category label;

[0029] Determine paired labels for the training affinity labels; the paired labels include: positive correlation paired labels, negative correlation paired labels, and background paired labels;

[0030] Determining a cross-loss function based on the paired labels;

[0031] Insert one convolutional block attention network into the last three ResBlock modules of the ResNet-38 network to obtain an attention affinity network;

[0032] The attention affinity network is trained with the training samples and the training affinity labels as input and the cross loss function as a constraint to obtain the solid waste pseudo-label generation model.

[0033] A solid waste identification system, comprising:

[0034] A target image acquisition module is used to acquire a target image; the target image is a two-dimensional color image acquired by a sampling device;

[0035] a first classification module, configured to input the target image into a first classification model to obtain a first class activation map and a second class activation map; the first classification model is determined based on a ResNet-38 network; the first class activation map is a class activation map of solid waste in the target image; the second class activation map is a class activation map of entities in the target image; the entities are regions in the target image excluding solid waste and background;

[0036] a first target class activation map determining module, configured to calculate a first target class activation map of the background in the target image based on the first class activation map;

[0037] a second target class activation map determining module, configured to calculate a second target class activation map of the background in the target image based on the first class activation map and the second class activation map;

[0038] a target refined multi-category label determination module, configured to concatenate the first target class activation map, the first class activation map, and the second class activation map to obtain a target multi-category label, and refine the target multi-category label using a conditional random field to obtain a target refined multi-category label;

[0039] a target refined single category label determination module, configured to concatenate the second target class activation map and the first class activation map to obtain a target single category label, and refine the target single category label using a conditional random field to obtain a target refined single category label;

[0040] a target affinity tag determination module, configured to determine a target affinity tag according to the target refined multi-category tag and the target refined single-category tag;

[0041] a pseudo-label generation module, configured to input the target image and the target affinity label into a solid waste pseudo-label generation model to obtain a pseudo-label for the solid waste in the target image; the solid waste pseudo-label generation model is determined based on a ResNet-38 network and a convolutional block attention network;

[0042] a recognition model training module, configured to train a fully supervised semantic segmentation neural network based on pseudo labels of solid waste in the target image to obtain a target solid waste recognition model;

[0043] The recognition module is used to input the target image into the target solid waste recognition model to recognize the solid waste in the target image.

[0044] Optionally, the first classification module includes: a first classification model determination submodule, and the first classification model determination submodule includes:

[0045] A training sample acquisition unit is configured to acquire a training sample; the training sample includes a training image and a training label; the training image includes training solid waste, a training background, and a training entity; the training entity is the area of the training image excluding the training solid waste and the training background; and the training label is a label of the training solid waste;

[0046] A first training unit is configured to train a ResNet-38 network using the training image as input and the recognition result of the training solid waste as output, for a preset number of training times, to obtain a trained ResNet-38 network;

[0047] The first classification model determination unit is used to delete the global mean pooling layer in the trained ResNet-38 network to obtain the first classification model.

[0048] Optionally, the pseudo label generation module includes: a pseudo label generation model determination submodule, and the pseudo label generation model determination submodule includes:

[0049] a class activation map determining unit, configured to input the training image data into the first classification model to obtain a class activation map of the training solid waste and a class activation map of the training entity;

[0050] a first training class activation map determining unit, configured to calculate a first training class activation map of the training background based on the class activation map of the training solid waste;

[0051] a second training class activation map determining unit, configured to calculate a second training class activation map of the training background based on the class activation map of the training solid waste and the class activation map of the training entity;

[0052] a training refined multi-class label determination unit, configured to concatenate the first training class activation map, the class activation map of the training solid waste, and the class activation map of the training entity to obtain a training multi-class label, and refine the training multi-class label using a conditional random field to obtain a training refined multi-class label;

[0053] a training refined single class label determination unit, configured to concatenate the second training class activation map and the class activation map of the training solid waste to obtain a training single class label, and refine the training single class label using a conditional random field to obtain a training refined single class label;

[0054] a training affinity label determination unit, configured to determine a training affinity label based on the training refined multi-category label and the training refined single-category label;

[0055] A paired label determination unit, configured to determine paired labels for the training affinity labels; the paired labels include: positive correlation paired labels, negative correlation paired labels, and background paired labels;

[0056] a cross loss function determining unit, configured to determine a cross loss function according to the paired labels;

[0057] An insertion unit is used to insert a convolutional block attention network into each of the last three ResBlock modules of the ResNet-38 network to obtain an attention affinity network;

[0058] The pseudo-label generation model determination unit is used to train the attention affinity network with the training samples and the training affinity labels as input and the cross loss function as a constraint to obtain the solid waste pseudo-label generation model.

[0059] A device comprising:

[0060] one or more processors;

[0061] a storage device having one or more programs stored thereon;

[0062] When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the above-described method.

[0063] A storage medium stores a computer program thereon, wherein the computer program implements the method described above when executed by a processor.

[0064] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0065] The present invention discloses a method, system, device and storage medium for identifying solid waste. In the process of generating pseudo-labels for solid waste in a target image, refined multi-category labels and refined single labels are combined to obtain affinity labels. Compared with the affinity labels generated in the original AffinityNet, the affinity labels are more accurate and can significantly improve the accuracy of the final semantic segmentation pseudo-labels. Inserting a convolutional block attention network into the ResNet-38 network helps to refine the complex boundary lines of solid waste and improve the accuracy of the pseudo-labels. The generated pseudo-labels with higher accuracy are used to train a fully supervised semantic segmentation neural network to obtain a target solid waste identification model, thereby improving the recognition accuracy of solid waste. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0067] Figure 1 A schematic flow chart of a solid waste identification method according to Example 1 of the present invention;

[0068] Figure 2 Schematic diagram of the attention affinity network structure;

[0069] Figure 3 This is a schematic diagram of the structure of the solid waste identification system provided in Example 2 of the present invention. DETAILED DESCRIPTION

[0070] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0071] The purpose of the present invention is to provide a solid waste identification method, system, device and storage medium, aiming to improve the solid waste identification accuracy.

[0072] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.

[0073] Example 1

[0074] Figure 1 This is a flow chart of the solid waste identification method provided in Example 1 of the present invention. Figure 1 As shown, the solid waste identification method in this embodiment includes:

[0075] Step 101: Acquire a target image. The target image is a two-dimensional color image acquired by a sampling device.

[0076] Step 102: Input the target image into a first classification model to obtain a first-class activation map and a second-class activation map. The first classification model is based on a ResNet-38 network; the first-class activation map is the class activation map of the solid waste in the target image; the second-class activation map is the class activation map of the entity in the target image; the entity is the area in the target image excluding the solid waste and background.

[0077] Specifically, the determination formulas for the first type activation map and the second type activation map are both: Among them, M c (x,y) is the class activation map (CAM), w c are weights of different categories, f cam It represents the CAM feature vector at (x, y) before global average pooling (GAP), where (x, y) is the coordinate of a point on the image; c represents different categories, i.e., class, including solid waste and entities.

[0078] When the target image is an image of a certain area in the city, research has found that in the dataset, the frequency of buildings is greater than 42%, the frequency of vegetation is greater than 86%, the frequency of roads is greater than 81%, and the frequency of cars and electric vehicles is less than 5%. However, cars and electric vehicles are easily confused with solid waste. Therefore, during training, the five categories of buildings, vegetation, cars, roads and electric vehicles can be used as entities.

[0079] Step 103: Calculate a first target class activation map of the background in the target image according to the first class activation map.

[0080] Specifically, the calculation formula is: M bg1 (x,y)=[1-M0(x,y)] α Among them, M bg1(x, y) is the activation map of the first target class, M0(x, y) is the CAM of solid waste, α is the hyperparameter for adjusting the activation map of the first target class, α ≥ 1.

[0081] Step 104: Calculate a second target class activation map for the background in the target image based on the first class activation map and the second class activation map.

[0082] Specifically, the calculation formula is: Among them, M bg2 (x,y) is the activation map of the second target class, w q is the weight of different categories of objects when calculating background CAM, M q (x, y) represents the CAM of objects of different categories, including the CAM of entities (when the target image is an image of a certain area in a city, it refers to the CAM of five categories: buildings, vegetation, cars, roads, and electric vehicles) and the CAM of solid waste. q refers to solid waste or entity (q = 0 represents solid waste). β is a hyperparameter that adjusts the activation map of the second target class, and β ≤ 1.

[0083] Step 105: concatenate the first target class activation map, the first class activation map, and the second class activation map to obtain a target multi-class label, and refine the target multi-class label using a conditional random field to obtain a target refined multi-class label.

[0084] Step 106: Concatenate the second target class activation map and the first class activation map to obtain a target single class label, and use the conditional random field to refine the target single class label to obtain a target refined single class label.

[0085] Step 107: Determine a target affinity label based on the target refined multi-category label and the target refined single-category label.

[0086] Specifically, when the Euclidean distance between the target refined multi-category label and the target refined single-category label is less than a preset hyperparameter, the semantic affinity between two features i and j in any label can be calculated according to the following formula:

[0087] Among them, (x i ,y i ) refers to the convolution feature map f aff The coordinates of the i-th feature, (x j ,y j ) refers to the convolution feature map f aff The coordinates of the j-th feature.

[0088] Apply the above formula to the two sets of labels generated in step 105 and step 106, and at the same time pass P = {(i, j) | d ((x i ,y i ),(x j ,y j ))<λ,i≠j} to generate paired labels. Among them, λ is a preset hyperparameter that can be determined according to actual conditions. Then the following formula is used to determine the pixel-level positive correlation paired labels (P + ), negatively correlated pairwise labels (P - ) and background paired labels

[0089]

[0090]

[0091]

[0092] Among them, d((x i ,y i ),(x j ,y j )) is the Euclidean distance between feature i and feature j, is the affinity between i and j.

[0093] Step 108: Input the target image and the target affinity label into the solid waste pseudo-label generation model to obtain the pseudo-label of the solid waste in the target image; the solid waste pseudo-label generation model is determined based on the ResNet-38 network and the convolutional block attention network.

[0094] Specifically, such as Figure 2 As shown in the figure, the classification network (ResNet-38 network) is improved, and the convolutional block attention network module (CBAM) is connected to the last three ResBlock modules to obtain the attention affinity network (AAN). The outputs of these three ResBlock modules are spliced and calculated to obtain the attention affinity matrix (AAM).

[0095] Step 109: Train the fully supervised semantic segmentation neural network based on the pseudo labels of the solid waste in the target image to obtain a target solid waste recognition model.

[0096] Step 110: Input the target image into the target solid waste recognition model to identify the solid waste in the target image.

[0097] As an optional implementation, the process of determining the first classification model includes:

[0098] Obtain training samples; the training samples include: training images and training labels; the training images include: training solid waste, training background, and training entities; the training entities are areas in the training images excluding the training solid waste and the training background, and the training labels are labels of the training solid waste.

[0099] The ResNet-38 network is trained with the training image as input and the recognition result of the training solid waste as output, with a preset number of training times, to obtain a trained ResNet-38 network.

[0100] Delete the global mean pooling layer in the trained ResNet-38 network to obtain the first classification model.

[0101] As an optional implementation, the process of determining the solid waste pseudo-label generation model includes:

[0102] The training images are input into the first classification model to obtain a class activation map of the training solid waste and a class activation map of the training entity.

[0103] A first training class activation map of the training background is calculated based on the class activation map of the training solid waste.

[0104] A second training class activation map of the training context is calculated based on the class activation map of the training solid waste and the class activation map of the training entity.

[0105] The first training class activation map, the class activation map of the training solid waste, and the class activation map of the training entity are spliced to obtain a training multi-category label, and the training multi-category label is refined using a conditional random field to obtain a training refined multi-category label.

[0106] The second training class activation map and the class activation map of the training solid waste are spliced to obtain a training single class label, and the training single class label is refined using a conditional random field to obtain a training refined single class label.

[0107] The training affinity labels are determined based on the training refined multi-category labels and the training refined single-category labels.

[0108] Determine paired labels for training affinity labels; paired labels include: positive correlation paired labels, negative correlation paired labels, and background paired labels.

[0109] Determine the cross-loss function based on the pairwise labels.

[0110] A convolutional block attention network is inserted into the last three ResBlock modules of the ResNet-38 network to obtain an attention affinity network.

[0111] Taking training samples and training affinity labels as input and the cross loss function as constraint, the attention affinity network is trained to obtain the solid waste pseudo-label generation model.

[0112] Specifically, the training image is input into AAN and the paired labels and AAM obtained above are used to calculate the loss function. The cross loss entropy of the positive and negative correlation paired labels and the background paired labels is calculated by the following formula:

[0113]

[0114]

[0115] Among them, L + refers to the difference (i.e., loss) between positively correlated pairwise labels and semantic affinity, L - It refers to the difference (i.e., loss) between negatively correlated pairwise labels and semantic affinity.

[0116] The cross loss entropy finally used for AAN training is implemented by the following formula:

[0117]

[0118] in, is the loss value of the relevant prospect (here solid waste). It refers to the loss value of the positively correlated background, and γ and δ are hyperparameters used to adjust the confidence of the cross-loss entropy of foreground and background target objects.

[0119] The training images are fed into the AAN network, along with the affinity labels generated from the single refined labels and the multi-category refined labels as supervisory information. The AAN network is optimized using the aforementioned loss function, resulting in a trained AAN network that generates the expected AAMs, thereby obtaining the final pseudo-labels for the solid waste. These pseudo-labels can be used to train any fully supervised semantic segmentation neural network model.

[0120] Example 2

[0121] Figure 3 This is a schematic diagram of the solid waste identification system provided in Example 2 of the present invention. Figure 3 As shown, the solid waste identification system in this embodiment includes:

[0122] The target image acquisition module 201 is used to acquire a target image; the target image is a two-dimensional color image collected by a sampling device.

[0123] The first classification module 202 is used to input the target image into the first classification model to obtain a first class activation map and a second class activation map; the first classification model is determined based on the ResNet-38 network; the first class activation map is the class activation map of the solid waste in the target image; the second class activation map is the class activation map of the entity in the target image; the entity is the area in the target image excluding the solid waste and the background.

[0124] The first object class activation map determining module 203 is configured to calculate a first object class activation map of the background in the target image according to the first class activation map.

[0125] The second target class activation map determining module 204 is configured to calculate a second target class activation map of the background in the target image according to the first class activation map and the second class activation map.

[0126] The target refined multi-category label determination module 205 is used to splice the first target class activation map, the first class activation map and the second class activation map to obtain a target multi-category label, and use the conditional random field to refine the target multi-category label to obtain a target refined multi-category label.

[0127] The target refined single category label determination module 206 is configured to concatenate the second target class activation map and the first class activation map to obtain a target single category label, and refine the target single category label using a conditional random field to obtain a target refined single category label.

[0128] The target affinity label determination module 207 is configured to determine the target affinity label according to the target refined multi-category label and the target refined single-category label.

[0129] The pseudo-label generation module 208 is used to input the target image and the target affinity label into the solid waste pseudo-label generation model to obtain the pseudo-label of the solid waste in the target image; the solid waste pseudo-label generation model is determined based on the ResNet-38 network and the convolutional block attention network.

[0130] The recognition model training module 209 is used to train a fully supervised semantic segmentation neural network based on the pseudo labels of the solid waste in the target image to obtain a target solid waste recognition model.

[0131] The recognition module 210 is configured to input the target image into a target solid waste recognition model to recognize the solid waste in the target image.

[0132] As an optional implementation, the first classification module 202 includes: a first classification model determination submodule, the first classification model determination submodule includes:

[0133] The training sample acquisition unit is used to acquire training samples; the training samples include: training images and training labels; the training images include: training solid waste, training background and training entities; the training entities are the areas in the training images other than the training solid waste and training background, and the training labels are the labels of the training solid waste.

[0134] The first training unit is used to train the ResNet-38 network with a training image as input and a recognition result of the training solid waste as output, for a preset number of training times, to obtain a trained ResNet-38 network.

[0135] The first classification model determination unit is used to delete the global mean pooling layer in the trained ResNet-38 network to obtain the first classification model.

[0136] As an optional implementation, the pseudo-label generation module 208 includes: a pseudo-label generation model determination submodule, which includes:

[0137] The class activation map determining unit is used to input the training image data into the first classification model to obtain the class activation map of the training solid waste and the class activation map of the training entity.

[0138] The first training class activation map determining unit is configured to calculate a first training class activation map of a training background according to the class activation map of the training solid waste.

[0139] The second training class activation map determining unit is configured to calculate a second training class activation map of the training background according to the class activation map of the training solid waste and the class activation map of the training entity.

[0140] The training refined multi-category label determination unit is used to splice the first training class activation map, the class activation map of the training solid waste, and the class activation map of the training entity to obtain the training multi-category label, and use the conditional random field to refine the training multi-category label to obtain the training refined multi-category label.

[0141] The training refined single category label determination unit is used to splice the second training class activation map and the class activation map of the training solid waste to obtain a training single category label, and use the conditional random field to refine the training single category label to obtain a training refined single category label.

[0142] The training affinity label determination unit is used to determine the training affinity label according to the training refined multi-category label and the training refined single-category label.

[0143] The paired label determination unit is used to determine the paired labels for training affinity labels; the paired labels include: positive correlation paired labels, negative correlation paired labels and background paired labels.

[0144] The cross loss function determination unit is used to determine the cross loss function according to the paired labels.

[0145] The insertion unit is used to insert a convolutional block attention network into the last three ResBlock modules of the ResNet-38 network to obtain an attention affinity network.

[0146] The pseudo-label generation model determination unit is used to train the attention affinity network with training samples and training affinity labels as input and a cross loss function as a constraint to obtain a solid waste pseudo-label generation model.

[0147] Example 3

[0148] A device comprising:

[0149] One or more processors.

[0150] A storage device having one or more programs stored thereon.

[0151] When one or more programs are executed by one or more processors, the one or more processors are caused to implement the method in Embodiment 1.

[0152] Example 4

[0153] A storage medium stores a computer program thereon, wherein the computer program implements the method in embodiment 1 when executed by a processor.

[0154] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.

[0155] This document uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only intended to help understand the method and core concept of the present invention. At the same time, those skilled in the art will find that the specific implementation methods and application scopes may vary based on the concept of the present invention. In summary, the contents of this specification should not be construed as limiting the present invention.

Claims

1. A method for identifying solid waste, characterized in that: The method comprises: Acquire a target image; the target image is a two-dimensional color image acquired by a sampling device; Inputting the target image into a first classification model to obtain a first class activation map and a second class activation map; the first classification model is determined based on a ResNet-38 network; the first class activation map is a class activation map of solid waste in the target image; the second class activation map is a class activation map of an entity in the target image; the entity is the area in the target image excluding the solid waste and the background; Calculating a first target class activation map for the background in the target image based on the first class activation map; Calculating a second target class activation map for the background in the target image based on the first class activation map and the second class activation map; concatenating the first target class activation map, the first class activation map, and the second class activation map to obtain a target multi-class label, and refining the target multi-class label using a conditional random field to obtain a target refined multi-class label; concatenating the second target class activation map and the first class activation map to obtain a target single class label, and refining the target single class label using a conditional random field to obtain a target refined single class label; determining a target affinity label according to the target refined multi-category label and the target refined single-category label; Inputting the target image and the target affinity label into a solid waste pseudo-label generation model to obtain a pseudo-label of the solid waste in the target image; the solid waste pseudo-label generation model is determined based on a ResNet-38 network and a convolutional block attention network; Training a fully supervised semantic segmentation neural network based on the pseudo labels of the solid waste in the target image to obtain a target solid waste recognition model; The target image is input into the target solid waste recognition model to recognize the solid waste in the target image.

2. The solid waste identification method according to claim 1, characterized in that: The process of determining the first classification model includes: Acquire a training sample; the training sample includes: a training image and a training label; the training image includes: training solid waste, a training background, and a training entity; the training entity is the area of the training image excluding the training solid waste and the training background, and the training label is the label of the training solid waste; Using the training image as input and the recognition result of the training solid waste as output, the ResNet-38 network is trained for a preset number of training times to obtain a trained ResNet-38 network; Delete the global mean pooling layer in the trained ResNet-38 network to obtain the first classification model.

3. The solid waste identification method according to claim 2, characterized in that: The process of determining the solid waste pseudo-label generation model includes: Inputting the training images into the first classification model to obtain a class activation map of the training solid waste and a class activation map of the training entity; Calculating a first training class activation map of the training background based on the class activation map of the training solid waste; Calculating a second training class activation map of the training background based on the class activation map of the training solid waste and the class activation map of the training entity; concatenating the first training class activation map, the class activation map of the training solid waste, and the class activation map of the training entity to obtain a training multi-class label, and refining the training multi-class label using a conditional random field to obtain a training refined multi-class label; concatenating the second training class activation map and the class activation map of the training solid waste to obtain a training single class label, and refining the training single class label using a conditional random field to obtain a training refined single class label; Determining a training affinity label based on the training refined multi-category label and the training refined single-category label; Determine paired labels for the training affinity labels; the paired labels include: positive correlation paired labels, negative correlation paired labels, and background paired labels; Determining a cross-loss function based on the paired labels; Insert one convolutional block attention network into the last three ResBlock modules of the ResNet-38 network to obtain an attention affinity network; The attention affinity network is trained with the training samples and the training affinity labels as input and the cross loss function as a constraint to obtain the solid waste pseudo-label generation model.

4. A solid waste identification system, characterized in that: The system comprises: A target image acquisition module is used to acquire a target image; the target image is a two-dimensional color image acquired by a sampling device; a first classification module, configured to input the target image into a first classification model to obtain a first class activation map and a second class activation map; the first classification model is determined based on a ResNet-38 network; the first class activation map is a class activation map of solid waste in the target image; the second class activation map is a class activation map of entities in the target image; the entities are regions in the target image excluding solid waste and background; a first target class activation map determining module, configured to calculate a first target class activation map of the background in the target image based on the first class activation map; a second target class activation map determining module, configured to calculate a second target class activation map of the background in the target image based on the first class activation map and the second class activation map; a target refined multi-category label determination module, configured to concatenate the first target class activation map, the first class activation map, and the second class activation map to obtain a target multi-category label, and refine the target multi-category label using a conditional random field to obtain a target refined multi-category label; a target refined single category label determination module, configured to concatenate the second target class activation map and the first class activation map to obtain a target single category label, and refine the target single category label using a conditional random field to obtain a target refined single category label; a target affinity tag determination module, configured to determine a target affinity tag according to the target refined multi-category tag and the target refined single-category tag; a pseudo-label generation module, configured to input the target image and the target affinity label into a solid waste pseudo-label generation model to obtain a pseudo-label for the solid waste in the target image; the solid waste pseudo-label generation model is determined based on a ResNet-38 network and a convolutional block attention network; a recognition model training module, configured to train a fully supervised semantic segmentation neural network based on pseudo labels of solid waste in the target image to obtain a target solid waste recognition model; The recognition module is used to input the target image into the target solid waste recognition model to recognize the solid waste in the target image.

5. The solid waste identification system according to claim 4, characterized in that: The first classification module includes: a first classification model determination submodule, and the first classification model determination submodule includes: A training sample acquisition unit is configured to acquire a training sample; the training sample includes a training image and a training label; the training image includes training solid waste, a training background, and a training entity; the training entity is the area of the training image excluding the training solid waste and the training background; and the training label is a label of the training solid waste; A first training unit is configured to train a ResNet-38 network using the training image as input and the recognition result of the training solid waste as output, for a preset number of training times, to obtain a trained ResNet-38 network; The first classification model determination unit is used to delete the global mean pooling layer in the trained ResNet-38 network to obtain the first classification model.

6. The solid waste identification system according to claim 5, characterized in that: The pseudo label generation module includes: a pseudo label generation model determination submodule, and the pseudo label generation model determination submodule includes: a class activation map determining unit, configured to input the training image data into the first classification model to obtain a class activation map of the training solid waste and a class activation map of the training entity; a first training class activation map determining unit, configured to calculate a first training class activation map of the training background based on the class activation map of the training solid waste; a second training class activation map determining unit, configured to calculate a second training class activation map of the training background based on the class activation map of the training solid waste and the class activation map of the training entity; a training refined multi-class label determination unit, configured to concatenate the first training class activation map, the class activation map of the training solid waste, and the class activation map of the training entity to obtain a training multi-class label, and refine the training multi-class label using a conditional random field to obtain a training refined multi-class label; a training refined single class label determination unit, configured to concatenate the second training class activation map and the class activation map of the training solid waste to obtain a training single class label, and refine the training single class label using a conditional random field to obtain a training refined single class label; a training affinity label determination unit, configured to determine a training affinity label based on the training refined multi-category label and the training refined single-category label; A paired label determination unit, configured to determine paired labels for the training affinity labels; the paired labels include: positive correlation paired labels, negative correlation paired labels, and background paired labels; a cross loss function determining unit, configured to determine a cross loss function according to the paired labels; An insertion unit is used to insert a convolutional block attention network into each of the last three ResBlock modules of the ResNet-38 network to obtain an attention affinity network; The pseudo-label generation model determination unit is used to train the attention affinity network with the training samples and the training affinity labels as input and the cross loss function as a constraint to obtain the solid waste pseudo-label generation model.

7. A device, characterized in that include: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method according to any one of claims 1 to 3.

8. A storage medium, characterized in that: A computer program is stored thereon, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Weak supervision semantic segmentation method based on adaptive affinity and category allocation

    CN112668579A

  • Solid waste identification data set construction system based on convolutional neural network

    CN113486937A