A method for generating domestic waste dataset based on data enhancement

Through the Copy-Paste data enhancement method and automatic annotation by the RGB-D acquisition system, the problem of insufficient domestic waste identification data in deep learning is solved, an efficient and realistic data set is generated, and the model performance and recognition accuracy are improved.

CN114429573BActive Publication Date: 2024-09-06HUAQIAO UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210022048.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-10
Publication Date
2024-09-06
Estimated Expiration
2042-01-10

AI Technical Summary

Technical Problem

In deep learning, the field of household waste identification faces the problem of insufficient data samples and imbalanced data sample categories, which results in data annotation being time-consuming and poor generalization ability. Existing synthetic rendering methods rely on a large amount of workload and have poor model generalization ability. .

Method used

Using a data enhancement method based on Copy-Paste, the domestic waste images are automatically annotated through the RGB-D acquisition system to generate a data set in real images, and a deep learning model is used for self-training and data enhancement to reduce dependence on graphics rendering and generate Information-rich datasets.

Benefits of technology

Quickly and efficiently expand annotated domestic waste data sets, save manpower and costs, improve the detection performance of deep learning models and the accuracy of domestic waste identification, reduce dependence on graphics rendering, and generate more realistic data sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114429573B
    Figure CN114429573B
Patent Text Reader

Abstract

A method for generating a domestic waste data set based on data enhancement includes: dividing domestic waste into several batches, and placing the domestic waste sparsely on a conveyor belt in batches; collecting images of color images and height images; automatically annotating the color images using the contour information and height information of the objects in the height images; using a pure conveyor belt background without domestic waste as a picture template, randomly pasting N objects onto the image template to generate the first batch of domestic waste data sets A1; using A1 to train a model; using the trained model to predict an unlabeled domestic waste data set D; using a data set with a pseudo-label as an image template, performing data enhancement on A1 to generate a second batch of domestic waste data sets A2; and merging A1 and A2 to form a merged domestic waste data set B1. The present invention can generate a large number of domestic waste data sets, quickly and efficiently expand the domestic waste data sets, help train the model, and improve the accuracy of domestic waste recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of deep learning and domestic waste identification, and in particular to a method for generating a domestic waste data set based on Copy-Paste data enhancement. Background Art

[0002] In the field of computer image recognition, image target detection based on deep learning has become an important research direction. In recent years, deep learning technology has been widely used in the classification and identification of domestic waste. However, insufficient data sample size and unbalanced data sample categories have become important factors restricting deep learning in domestic waste target recognition. When constructing a large number of labeled data sets for classification, a professional is required to annotate each image, which will lead to the problem that labeling data is time-consuming and expensive.

[0003] In addition, it is unlikely to find a large labeled dataset containing examples in a specific scene. Once the scene changes, the original model cannot accurately detect objects, so each new environment with new instances requires data collection and annotation. What is needed in engineering applications is a standardized system that can efficiently and quickly obtain a large amount of valid data sets for model training.

[0004] Previously, a relatively successful research direction to solve this type of problem was to use synthetically rendered scenes and objects as datasets for training. However, this method requires a lot of work to make the scenes and objects as realistic as possible and ensure high-quality global and local consistency. In addition, the generalization ability of the model trained with this synthetic dataset is very poor.

[0005] Therefore, the prior art requires a method for generating a domestic waste dataset based on Copy-Paste data augmentation, which pastes masks of real objects in real images, thereby reducing dependence on graphics rendering. Summary of the invention

[0006] In order to solve the above-mentioned problems existing in the prior art, the present invention proposes a method for generating a domestic waste dataset based on Copy-Paste data enhancement, which can quickly and efficiently expand the labeled domestic waste dataset, replace manual labeling, save manpower and cost, and improve the performance of deep learning model detection, thereby further improving the accuracy of domestic waste identification.

[0007] The present invention adopts the following technical solution:

[0008] A method for generating a household garbage dataset based on Copy-Paste data enhancement, the specific steps of the method are as follows:

[0009] Divide the domestic waste into several batches, each batch is of the same category, and place the domestic waste sparsely on the conveyor belt in batches;

[0010] Use the RGB-D acquisition system to acquire color images and height images of the object;

[0011] Use the contour information and height information of the objects in the height map to automatically annotate the color map;

[0012] Use Copy-Paste to randomly paste N objects onto the image template, where N is an integer, to generate the first batch of household waste data set A1;

[0013] Use the first batch of household waste dataset A1 to train the deep learning model;

[0014] Use the trained deep learning model to make predictions on the unlabeled domestic waste dataset D;

[0015] Using the dataset with pseudo labels as the image template, the first batch of domestic waste dataset A1 is enhanced by Copy-Paste to generate the second batch of domestic waste dataset A2;

[0016] The first batch of domestic waste data sets A1 and the second batch of domestic waste data sets A2 are merged to form a merged domestic waste data set B1.

[0017] Specifically, an RGB-D acquisition system is used to acquire color images and height images of an object; the RGB-D acquisition system is divided into a color imaging module and a height imaging module, the color imaging module is composed of a Linea ColorCamera and a coaxial light source, and is used to acquire the color image of the object; the height imaging module is a Laser Line-Scanning Sensor, which contains a laser transmitter and two monochrome cameras, and is used to acquire the depth map of the object; the image acquisition is that the RGB-D system uses an encoder to convert the displacement of the conveyor belt into a pulse signal at a fixed ratio, and then simultaneously triggers the color imaging module and the height imaging module to acquire data;

[0018] Specifically, the method of automatically labeling a color image by using the contour information and height information of an object in the height image comprises the following steps:

[0019] Read the domestic waste image that needs to be automatically labeled, and obtain the contour information and height information of the object in the collected height map;

[0020] Use the height information of the height map to remove interference on the conveyor belt;

[0021] The mask image of the object is generated through the height map to obtain the contour label of the object.

[0022] Specifically, the object contour label is obtained by using the findContours function of OpenCV to obtain the object contour label for the mask image generated by the height map.

[0023] Automatically label the categories of objects in the same batch and save the label information in a json file.

[0024] Specifically, the deep learning model includes but is not limited to an instance segmentation model and a target detection model.

[0025] Specifically, the Copy-Paste data enhancement of the domestic waste dataset includes the following steps:

[0026] Read the labels of the domestic waste dataset that needs to be enhanced with Copy-Paste data, and separate each object and its label information in the domestic waste dataset;

[0027] Select the image template to be pasted and generate distribution points, randomly paste N objects onto the selected image template, and store the label information of the N objects into the label file corresponding to the template, where N is an integer;

[0028] Finally, the fully occluded objects in the image template are removed, and the masks and rectangles of the partially occluded objects are updated.

[0029] Specifically, the label information includes contour information of the object and category information of the object.

[0030] Specifically, the steps of separating each object and the label information of the object from the domestic waste data set are as follows:

[0031] Read the label file of the image, the label file is in json format;

[0032] Generate a rectangular box, x-coordinate, y-coordinate, w-width and h-height surrounding each object according to the contour point set of the object;

[0033] Subtract the x-coordinate and y-coordinate from the object's contour point set to obtain the separated object contour label;

[0034] The object in the image is cropped according to the x-coordinate, y-coordinate, w-width, h-height and the object's contour point set.

[0035] Specifically, the image template is selected to contain a background of a household garbage conveyor belt with pseudo labels.

[0036] Specifically, the use of the deep learning model to train the first batch of domestic waste data sets A1 includes the following steps:

[0037] Perform online data enhancement on the household waste dataset that needs to be trained, including but not limited to: cropping, horizontal flipping, vertical flipping, rotation, changing image brightness and contrast, and setting some pixels to zero;

[0038] The SGD optimizer is used for training, and the learning rate strategy used is cosine annealing with preheating.

[0039] It can be seen from the above description of the present invention that, compared with the prior art, the present invention has the following beneficial effects:

[0040] (1) The present invention proposes a method for generating a domestic waste dataset based on Copy-Paste data enhancement. First, the domestic waste is divided into several batches, each batch is of the same category, and the domestic waste is sparsely placed on a conveyor belt in batches; an RGB-D acquisition system is used to collect color images and height images of objects; the color image is automatically labeled using the contour information and height information of the object in the height image; N objects are randomly pasted onto the image template by Copy-Paste, where N is an integer, to generate the first batch of domestic waste dataset A1; a deep learning model is used to train the first batch of domestic waste dataset A1; and the trained The deep learning model predicts the unlabeled domestic waste data set D; using the data set with pseudo labels as the image template, the first batch of domestic waste data set A1 is enhanced by Copy-Paste to generate the second batch of domestic waste data set A2; the first batch of domestic waste data set A1 and the second batch of domestic waste data set A2 are merged to form a merged domestic waste data set B1; the present invention collects images through the RGB-D acquisition system and automatically annotates the label information of objects. The Copy-Paste data enhancement is combined with self-training to automatically generate a large number of domestic waste data sets with rich information to meet the needs of deep learning model training.

[0041] (2) The present invention pastes the mask of the real object in the real image, removes the object that is completely occluded in the image template, and updates the mask and rectangular frame of the partially occluded object, thereby reducing the dependence on graphics rendering, making the data set more realistic, and improving the detection effect of the training model.

[0042] (3) The embodiment of the present invention first classifies the domestic waste, and then collects the color image and height image through the RGB-D acquisition system and automatically labels them, replacing the manual labeling of the prior art, which is accurate and time-saving. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1It is an RGB-D acquisition system according to an embodiment of the present invention;

[0044] Figure 2 This is an example of a color image of the same category of domestic waste in an embodiment of the present invention;

[0045] Figure 3 This is an example of a height map image of the same category of domestic waste in an embodiment of the present invention;

[0046] Figure 4 A flow chart of a method for generating a household garbage dataset based on Copy-Paste data enhancement provided by an embodiment of the present invention;

[0047] Figure 5 An example of an automatically annotated labeled image provided by an embodiment of the present invention;

[0048] Figure 6 A flow chart of a method for automatically labeling a color image using a height map provided by an embodiment of the present invention;

[0049] Figure 7 A flow chart of a method for Copy-Paste data enhancement provided by an embodiment of the present invention;

[0050] Figure 8 A flow chart of a method for separating image objects in a household garbage data set provided by an embodiment of the present invention;

[0051] Fig. 9 An example of an image containing a conveyor belt of domestic waste with pseudo labels as a background provided by an embodiment of the present invention;

[0052] Fig.10 An image example of a domestic waste dataset after Copy-Paste data enhancement provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0053] The present invention is further described below through specific implementation modes.

[0054] A method for generating a domestic waste dataset based on Copy-Paste data enhancement. Specifically, the image acquisition of the domestic waste dataset is as follows: the background is a fixed conveyor belt. The image set is obtained by taking pictures from top to bottom by a dual camera of an RGB-D acquisition system fixed above the conveyor belt. The RGB-D acquisition system is as follows: Figure 1 shown.

[0055] A method for generating a household garbage dataset based on Copy-Paste data enhancement. For specific steps, see Figure 2 As shown:

[0056] S101: Divide the domestic waste into several batches, each batch is of the same category, and sparsely place the domestic waste on a conveyor belt in batches;

[0057] S102: Use the RGB-D acquisition system to acquire color images and height images of the object, where the color images and height images of the domestic waste category Bottle_PET are as follows: Figure 3 and Figure 4 As shown;

[0058] An RGB-D acquisition system is used to acquire color images and height images of objects; the RGB-D acquisition system is divided into a color imaging module and a height imaging module, the color imaging module is composed of a Linea Color Camera and a coaxial light source, and is used to acquire color images of objects; the height imaging module is a Laser Line-Scanning Sensor, which contains a laser transmitter and two monochrome cameras, and is used to acquire depth images of objects; the image acquisition is an RGB-D system that uses an encoder to convert the displacement of the conveyor belt into a pulse signal at a fixed ratio, and then simultaneously triggers the color imaging module and the height imaging module to acquire data.

[0059] S103: Automatically label the color image using the contour information and height information of the object in the height image. The labels obtained by automatically labeling the image are as follows: Figure 5 As shown;

[0060] Using the contour information and height information of the object in the height map, the color map is automatically annotated. The specific steps are as follows: Figure 6 As shown:

[0061] S201: Read the household garbage image that needs to be automatically labeled, and obtain the contour information and height information of the object in the collected height map;

[0062] S202: removing interferences on the conveyor belt using height information of the height map;

[0063] S203: Generate a mask image of the object through the height map to obtain a contour label of the object;

[0064] S204: Automatically label the categories of objects in the same batch and save the label information in a json file.

[0065] Read the domestic waste image that needs to be automatically labeled, and obtain the contour information and height information of the object in the collected height map;

[0066] Use the height information of the height map to remove interference on the conveyor belt;

[0067] Generate a mask image of the object through the height map to obtain the contour label of the object;

[0068] Automatically label the categories of objects in the same batch and save the label information in a json file.

[0069] Specifically, the mask image generated by the height map uses the findContours function of OpenCV to obtain the contour label of the object and mark the category.

[0070] S104: randomly paste N objects onto the image template by Copy-Paste to generate the first batch of domestic waste data set A1;

[0071] S105: Use the first batch of domestic waste data set A1 to train the deep learning model;

[0072] The deep learning model is used to train the first batch of household waste data set A1, including the following steps:

[0073] (1) Perform online data enhancement on the domestic waste dataset that needs to be trained, including: cropping, horizontal flipping, vertical flipping, rotation, changing image brightness and contrast, and setting some pixels to zero.

[0074] (2) The model is optimized using the SGD optimizer with momentum. The formula of the optimizer L is shown in (1), and the learning rate strategy used is cosine annealing with preheating.

[0075]

[0076] where v t represents the accumulated acceleration at time t, α represents the magnitude of the power, and W t represents the parameters of the model at time t, η t is the learning rate, X (is) is the i-th s samples, Y (is) For the i s The true value of the sample, f(X) is the predicted value of the model, and ΔJ is the gradient of the model.

[0077] S106: Use the trained deep learning model to predict the unlabeled domestic waste dataset D;

[0078] S107: Using the dataset with pseudo labels as an image template, the first batch of domestic waste datasets are enhanced by Copy-Psate to generate the second batch of domestic waste datasets A2;

[0079] The first batch of domestic waste data A1 is subjected to copy-paste data enhancement to produce the second batch of domestic waste data set A2. The specific steps are as follows: Figure 7 As shown:

[0080] S301: Read the label of the domestic waste data set that needs to be enhanced by Copy-Paste data;

[0081] S302: Separate each object and label information of the object in the domestic waste data set;

[0082] The method for separating objects from a household garbage dataset comprises the following specific steps: Figure 8 As shown:

[0083] S401: Read the label file of the image, where the label file is in json format;

[0084] S402: Generate a rectangular frame, an x ​​coordinate, a y coordinate, a w width, and a h height that surround each object according to the contour point set of the object;

[0085] S403: Subtract the x-coordinate and y-coordinate from the object's contour point set to obtain a separated object contour label;

[0086] S404: Cut out the object in the image according to the x-coordinate, the y-coordinate, the w-width, the h-height and the contour point set of the object.

[0087] S303: Randomly paste N objects onto the selected image template to obtain a generated domestic waste data set, where N is an integer;

[0088] S304: remove the completely blocked objects in the image template, and update the mask and rectangular frame of the partially blocked objects.

[0089] S108: Merge the first batch of domestic waste data sets A1 and the second batch of domestic waste data sets A2 to form a merged domestic waste data set B1.

[0090] like Fig. 9 An example of an image containing a conveyor belt of domestic waste with pseudo labels provided in an embodiment of the present invention; Fig.10 An image example of a domestic waste dataset after Copy-Paste data enhancement provided in an embodiment of the present invention.

[0091] (1) The present invention proposes a method for generating a domestic waste dataset based on Copy-Paste data enhancement. First, the domestic waste is divided into several batches, each batch is of the same category, and the domestic waste is sparsely placed on a conveyor belt in batches; an RGB-D acquisition system is used to collect color images and height images of objects; the color image is automatically labeled using the contour information and height information of the object in the height image; N objects are randomly pasted onto the image template by Copy-Paste, where N is an integer, to generate the first batch of domestic waste dataset A1; a deep learning model is used to train the first batch of domestic waste dataset A1; and the trained The deep learning model predicts the unlabeled domestic waste data set D; using the data set with pseudo labels as the image template, the first batch of domestic waste data set A1 is enhanced by Copy-Paste to generate the second batch of domestic waste data set A2; the first batch of domestic waste data set A1 and the second batch of domestic waste data set A2 are merged to form a merged domestic waste data set B1; the present invention collects images through the RGB-D acquisition system and automatically annotates the label information of objects. The Copy-Paste data enhancement is combined with self-training to automatically generate a large number of domestic waste data sets with rich information to meet the needs of deep learning model training.

[0092] (2) The present invention pastes the mask of the real object in the real image, removes the object that is completely occluded in the image template, and updates the mask and rectangular frame of the partially occluded object, thereby reducing the dependence on graphics rendering, making the data set more realistic, and improving the detection effect of the training model.

[0093] The above is only a specific implementation of the present invention, but the design concept of the present invention is not limited thereto. Any non-substantial changes to the present invention using this concept shall be deemed as an infringement of the protection scope of the present invention.

Claims

1. A method for generating a domestic waste dataset based on data enhancement, characterized in that: The specific steps of the method are as follows: Divide the domestic waste into several batches, each batch is of the same category, and place the domestic waste sparsely on the conveyor belt in batches; An RGB-D acquisition system is used to acquire color images and height images of an object; the RGB-D acquisition system is divided into a color imaging module and a height imaging module, the color imaging module is composed of a Linea Color Camera and a coaxial light source, and is used to acquire a color image of an object; the height imaging module is a Laser Line-Scanning Sensor, which contains a laser transmitter and two monochrome cameras, and is used to acquire a depth image of an object; the image acquisition is an RGB-D system that uses an encoder to convert the displacement of the conveyor belt into a pulse signal at a fixed ratio, and then simultaneously triggers the color imaging module and the height imaging module to acquire data; Use the contour information and height information of the objects in the height map to automatically annotate the color map; Use Copy-Paste to randomly paste N objects onto the image template, where N is an integer, to generate the first batch of household waste data set A1; Use the first batch of household waste dataset A1 to train the deep learning model; Use the trained deep learning model to make predictions on the unlabeled domestic waste dataset D; Using the dataset with pseudo labels as the image template, the first batch of domestic waste dataset A1 is enhanced by Copy-Paste to generate the second batch of domestic waste dataset A2; Merge the first batch of domestic waste data sets A1 and the second batch of domestic waste data sets A2 to form a merged domestic waste data set B1; The method of automatically labeling the color image by using the contour information and height information of the object in the height image comprises the following steps: Read the domestic waste image that needs to be automatically labeled, and obtain the contour information and height information of the object in the collected height map; Use the height information of the height map to remove interference on the conveyor belt; Generate a mask image of the object through the height map to obtain the contour label of the object; Automatically label the categories of objects in the same batch and save the label information in a json file.

2. The method for generating a domestic waste dataset based on data enhancement according to claim 1, characterized in that: Use OpenCV's findContours function to obtain the object's contour label and mark the category for the mask image generated by the height map.

3. The method for generating a domestic waste data set based on data enhancement according to claim 1, characterized in that: The image templates are selected from pure conveyor belt backgrounds with different pollution levels and no domestic garbage.

4. The method for generating a domestic waste data set based on data enhancement according to claim 1, characterized in that: The deep learning model includes but is not limited to an instance segmentation model and a target detection model.

5. The method for generating a domestic waste data set based on data enhancement according to claim 1, characterized in that: The Copy-paste data enhancement of the domestic waste dataset includes the following steps: Read the labels of the domestic waste dataset that needs to be enhanced with Copy-Paste data, and separate each object and its label information in the domestic waste dataset; Select the image template to be pasted and generate distribution points, randomly paste N enhanced objects onto the selected image template, and store the label information of the N objects into the label file corresponding to the template, where N is an integer; Finally, the fully occluded objects in the image template are removed, and the masks and rectangles of the partially occluded objects are updated.

6. The method for generating a domestic waste data set based on data enhancement according to claim 5, characterized in that: The label information includes contour information of the object and category information of the object.

7. The method for generating a domestic waste dataset based on data enhancement according to claim 5, characterized in that: The steps of separating each object and the label information of the object in the domestic waste data set are as follows: Read the label file of the image, the label file is in json format; Generate a rectangular box, x-coordinate, y-coordinate, w-width and h-height surrounding each object according to the contour point set of the object; Subtract the x-coordinate and y-coordinate from the object's contour point set to obtain the separated object contour label; The object in the image is cut out according to the x-coordinate, y-coordinate, w-width, h-height and the object's contour point set.

8. The method for generating a domestic waste data set based on data enhancement according to claim 5, characterized in that: The image template is selected to contain a household garbage conveyor belt background with pseudo labels.

9. The method for generating a domestic waste data set based on data enhancement according to claim 1, characterized in that: The deep learning model is trained using the first batch of domestic waste data set A1, including the following steps: Perform online data enhancement on the household waste dataset that needs to be trained, including but not limited to: cropping, horizontal flipping, vertical flipping, rotation, changing image brightness and contrast, and setting some pixels to zero; The SGD optimizer is used for training, and the learning rate strategy used is cosine annealing with preheating.