A method for identifying household waste based on partial label feature learning
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-18
- Publication Date
- 2026-08-14
AI Technical Summary
该方法在实际垃圾回收过程中,可以解决垃圾由于数据量大,标签难以获取,从而导致垃圾特征挖掘不充分的问题,实现了高精度垃圾分类,并且降低了学习成本,为垃圾回收分类问题提供了一种有效的方法
[0047] (1) In view of the problem that the lack of data labels makes it difficult for the model to mine data features and thus leads to low classification accuracy, this invention proposes a waste identification method based on partial label feature learning. By using information uncertainty to select samples with rich unknown information for labeling, adaptive learning of features is achieved and the accuracy of waste classification is improved.
Smart Images

Figure CN116721280B_ABST
Abstract
Description
Technical Field
[0001] This invention establishes a waste identification method based on partial label feature learning, using real waste image data. It leverages information uncertainty to select samples with rich unknown information for labeling, achieving adaptive feature learning and reducing learning costs, ultimately leading to accurate waste classification. This method, based on partial label feature learning, solves the problem of insufficient waste feature mining caused by the large volume of data and difficulty in obtaining labels during actual waste recycling, achieving high-precision waste classification and providing technical support for the waste recycling industry. Background Technology
[0002] With the increasing volume of urban waste and the deterioration of environmental conditions, the recycling of waste resources has become a challenging issue. Waste sorting, as a crucial link in the recycling process, has become a focus of public attention. Currently, the commonly used waste sorting method mainly relies on manual sorting, which is tedious, inefficient, and difficult to widely promote. Developing an intelligent and automated method for household waste sorting is key to achieving current environmental resource recycling goals. Deep learning-based waste sorting methods have effectively improved the automation level of waste sorting. However, in actual sorting processes, due to the large amount of waste data and the difficulty in obtaining labels, the limited number of data labels reduces feature mining capabilities, resulting in low accuracy in waste sorting results. In practical applications, accurate sorting of waste with partial labels has significant economic and social benefits. Therefore, the research results of this invention have broad application prospects.
[0003] Traditional classification methods suffer from low accuracy and high cost. With the ever-increasing volume of community waste, these traditional identification methods can no longer meet the daily needs of waste sorting. To address the complexity issue, some recycling identification methods based on sensing technology have been proposed. However, waste has many complex characteristics, and using a single sensor yields data of limited types, thus limiting the types of waste that these methods can identify and their applicability. With the development of machine learning, image-based deep learning methods have been extensively studied. As new products emerge and the types and quantities of waste increase, labels become difficult to obtain, leading to insufficient feature mining. Deep learning requires labeled training, and sufficient data labels ensure feature mining capabilities. Manually labeling large amounts of data is time-consuming, labor-intensive, and challenging. In recent years, data labeling methods based on partial label learning have attracted widespread attention. These methods can automatically label unlabeled data through learning, adapting to the classification needs of deep learning. However, selecting information-rich samples for labeling is difficult, resulting in poor model classification accuracy and high learning costs. Therefore, how to learn data features and achieve rapid and accurate waste classification with partial labeling has become an important research topic in the field of waste recycling and has significant practical implications.
[0004] This invention designs a method for identifying household waste based on partial label feature learning, achieving intelligent waste classification. First, a household waste classification model is established. Then, a waste classification strategy based on partial label feature learning is designed. This strategy utilizes information uncertainty to select samples with rich unknown information for labeling, achieving adaptive feature learning and improving waste classification accuracy. In actual waste recycling processes, this method can solve the problem of insufficient waste feature mining due to the large amount of data and difficulty in obtaining labels, achieving high-precision waste classification and reducing learning costs, thus providing an effective method for waste recycling and classification. Summary of the Invention
[0005] This invention provides a method for identifying household waste based on partial label feature learning. This method utilizes information uncertainty to select samples with abundant unknown information for labeling, achieving adaptive feature learning and improving waste sorting accuracy. In actual waste recycling processes, this method can achieve high-precision waste sorting even when waste lacks labels, while also reducing learning costs.
[0006] The present invention adopts the following technical solution and implementation steps:
[0007] 1. A method for identifying household waste based on partial label feature learning, characterized by comprising the following steps:
[0008] (1) Collection and preprocessing of municipal solid waste data
[0009] Obtain a dataset of images of household waste, comprising 10 categories of household waste images, including: disposable fast food containers, broken flower pots and dishes, vegetable leaves, cigarette butts, plastic toys, plastic hangers, old clothes, aluminum cans, cardboard boxes, and dry cell batteries;
[0010] The pixels of each image in the household waste image dataset are normalized to [0,1].
[0011] The normalized dataset of household waste images is divided into two groups: one group contains P training images, and the other group contains Q test images, generally requiring P > Q. The training images are divided into two groups: one group is the labeled dataset X. L One set of images comprised 70% of the training images; the other set consisted of an unlabeled dataset X. U The number of images is 30% of the training images;
[0012] (2) Constructing a household waste sorting model
[0013] Constructing a sample selection model based on deep networks: The sample selection model includes three feature extractors and three classifiers; the deep network is used as the feature extractor F of the model. (d) s d = 1, 2, 3, where the deep network consists of five parts. The first part, conv1, consists of a convolutional layer with a 7×7 kernel and a stride of 2, a batch normalization layer with 256 output channels, and a ReLU activation function layer. The remaining four parts are conv2_x, conv3_x, conv4_x, and conv5_x, each consisting of three Bottleneck modules. Each Bottleneck module consists of a convolutional layer with a 1×1 kernel, a convolutional layer with a 3×3 kernel, and a convolutional layer with a 1×1 kernel, with a stride of 1. A fully connected layer with 2048 channels is used as the classifier G for the sample selection model. (d) s ;
[0014] Constructing a deep network-based sample labeling model: The sample labeling model includes a feature extractor F. f A label classifier G y A discriminative classifier G g and 10 multi-class discriminant classifiers G (c) m c = 1, 2, ..., 10;
[0015] Construct a classification model based on deep networks, including a feature extractor F. a A classifier G a ;
[0016] The household waste sorting model consists of three parts: a sample selection model, a sample labeling model, and a sorting model.
[0017] (3) Design a waste sorting strategy based on partial label feature learning
[0018] ① Select the samples to be labeled: Sample evaluation criteria, loss function formula L s for:
[0019]
[0020] in, It is classifier G (d) s The parameter matrix is of size 2048×10, Θ (d) s =[θ (d) s,1 ,θ (d) s,2 ,θ (d) s,3 ,θ (d) s,4 ,θ (d) s,5 ] is the feature extractor F (d) s The parameter matrix, θ (d) s,1 This represents the parameter matrix of the conv1 layer, with a size of 64×112×112, θ (d) s,2 This represents the parameter matrix of the conv2_x layer, with a size of 256×56×56, θ (d) s,3 This represents the parameter matrix of the conv3_x layer, with a size of 512×28×28, θ (d) s,4 This represents the parameter matrix of the conv4_x layer, with a size of 1024×14×14, θ (d) s,5 This represents the parameter matrix of the conv5_x layer, with a size of 2048×7×7; x u For the unlabeled dataset X U Image data in, u = 1, 2, ..., N U N U x' is the number of images in the unlabeled dataset. u It is for x u Perturbation data after adding Gaussian noise;
[0021] Based on the trained feature extractor and classifier, calculate the uncertainty O(x) of the unlabeled data. u ):
[0022]
[0023] Select the high-scoring samples for the next step of label learning, choosing 30% of the images in the unlabeled dataset to obtain a new labeled dataset X. UL ;
[0024] ② Learning the labels of unlabeled samples: Label classification loss function L y for:
[0025]
[0026] in, It is classifier G y The parameter matrix is of size 2048×10, Θ f =[θ f,1 ,θ f,2 ,θ f,3 ,θ f,4 ,θ f,5 ] is the feature extractor F f The parameter matrix, θ f,1 This represents the parameter matrix of the conv1 layer, with a size of 64×112×112, θ f,2 This represents the parameter matrix of the conv2_x layer, with a size of 256×56×56, θ f,3 This represents the parameter matrix of the conv3_x layer, with a size of 512×28×28, θ f,4 This represents the parameter matrix of the conv4_x layer, with a size of 1024×14×14, θ f,5 This represents the parameter matrix of the conv5_x layer, with a size of 2048×7×7; N L is the number of images in the labeled dataset; Y represents the image category label matrix, with a size of R×10, R=0.7P; L is the cross-entropy loss function, expressed as:
[0027]
[0028] Where, α(x) (i) j Describe dataset X L Image data x of the i-th image of the j-th class (i) j The actual probability distribution, j = 1, 2, ..., 10, i = 1, 2, ..., N j N j β(x) is the number of images in the j-th class. (i) j Describe the predicted probability distribution of the i-th image data in the j-th class;
[0029] Discriminant loss function L g for:
[0030]
[0031] in, It is classifier G g The parameter matrix is of size 2048×1; X d For labeled dataset X L With the new labeled dataset X UL The set N is the dataset X d The number of images, y g Let X be the identification label vector, with a size of N×1;
[0032] Multi-class discrimination loss function L m for:
[0033]
[0034] in, It is classifier G (c) m The parameter matrix is of size 2048×1; y (c) m For X d The class identification label vector has a size of N×1;
[0035] Integration loss function L label for:
[0036] L label =L y -0.5L g +0.5L m (7)
[0037] Once a trained label learning model is obtained, labels are acquired for the unlabeled data in the new labeled dataset.
[0038] ③Classification task loss function L h The formula is as follows:
[0039]
[0040] in, It is classifier G a The parameter matrix is of size 2048×10, Θ a =[θ a,1 ,θ a,2 ,θ a,3 ,θ a,4 ,θ a,5 ] is the feature extractor F a The parameter matrix, θ a,1 This represents the parameter matrix of the conv1 layer, with a size of 64×112×112, θa,2 The parameter matrix of the conv2_x layer is 256×56×56, and θ is... a,3 This represents the parameter matrix of the conv3_x layer, with a size of 512×28×28, θ a,4 This represents the parameter matrix of the conv4_x layer, with a size of 1024×14×14, θ a,5 This represents the parameter matrix of the conv5_x layer, with a size of 2048×7×7; Y d For dataset X d An image category label matrix of size N×10 is used to train a classification model;
[0041] (4) Household waste identification
[0042] A waste sorting strategy based on partial label feature learning, applied to test set X. B The system learns from 10 types of garbage images to obtain a predicted category label matrix Y for household waste. B ,
[0043]
[0044] Among them, X B Contains Q test images, Y B The size is Q×10;
[0045] Y B To identify household waste and complete the waste identification task.
[0046] The inventiveness of this invention is mainly reflected in:
[0047] (1) In view of the problem that the lack of data labels makes it difficult for the model to mine data features and thus leads to low classification accuracy, this invention proposes a waste identification method based on partial label feature learning. By using information uncertainty to select samples with rich unknown information for labeling, adaptive learning of features is achieved and the accuracy of waste classification is improved.
[0048] (2) The present invention is based on a sample selection method for information uncertainty, which selects some labels for automatic labeling. While ensuring feature mining capabilities, it reduces learning costs, meets actual needs, and provides technical support for the waste recycling industry. Attached Figure Description
[0049] Figure 1 This is a classification effect diagram of the waste partial label feature learning classification method of the present invention. Detailed Implementation
[0050] 1. A method for identifying household waste based on partial label feature learning, characterized by comprising the following steps:
[0051] (1) Collection and preprocessing of municipal solid waste data
[0052] Obtain a dataset of images of household waste, comprising 10 categories of household waste images, including: disposable fast food containers, broken flower pots and dishes, vegetable leaves, cigarette butts, plastic toys, plastic hangers, old clothes, aluminum cans, cardboard boxes, and dry cell batteries;
[0053] The pixels of each image in the household waste image dataset are normalized to [0,1].
[0054] The normalized dataset of household waste images is divided into two groups: one group contains P training images, and the other group contains Q test images, generally requiring P > Q. The training images are divided into two groups: one group is the labeled dataset X. L One set of images comprised 70% of the training images; the other set consisted of an unlabeled dataset X. U The number of images is 30% of the training images;
[0055] (2) Constructing a household waste sorting model
[0056] Constructing a sample selection model based on deep networks: The sample selection model includes three feature extractors and three classifiers; the deep network is used as the feature extractor F of the model. (d) s d = 1, 2, 3, where the deep network consists of five parts. The first part, conv1, consists of a convolutional layer with a 7×7 kernel and a stride of 2, a batch normalization layer with 256 output channels, and a ReLU activation function layer. The remaining four parts are conv2_x, conv3_x, conv4_x, and conv5_x, each consisting of three Bottleneck modules. Each Bottleneck module consists of a convolutional layer with a 1×1 kernel, a convolutional layer with a 3×3 kernel, and a convolutional layer with a 1×1 kernel, with a stride of 1. A fully connected layer with 2048 channels is used as the classifier G for the sample selection model. (d) s ;
[0057] Constructing a deep network-based sample labeling model: The sample labeling model includes a feature extractor F. f A label classifier G y A discriminative classifier G g and 10 multi-class discriminant classifiers G (c) m c = 1, 2, ..., 10;
[0058] Construct a classification model based on deep networks, including a feature extractor F. a A classifier G a ;
[0059] The household waste sorting model consists of three parts: a sample selection model, a sample labeling model, and a sorting model.
[0060] (3) Design a waste sorting strategy based on partial label feature learning
[0061] ① Select the samples to be labeled: Sample evaluation criteria, loss function formula L s for:
[0062]
[0063] in, It is classifier G (d) s The parameter matrix is of size 2048×10, Θ (d) s =[θ (d) s,1 ,θ (d) s,2 ,θ (d) s,3 ,θ (d) s,4 ,θ (d) s,5 ] is the feature extractor F (d) s The parameter matrix, θ (d) s,1 This represents the parameter matrix of the conv1 layer, with a size of 64×112×112, θ (d) s,2 This represents the parameter matrix of the conv2_x layer, with a size of 256×56×56, θ (d) s,3 This represents the parameter matrix of the conv3_x layer, with a size of 512×28×28, θ (d) s,4 This represents the parameter matrix of the conv4_x layer, with a size of 1024×14×14, θ (d) s,5 This represents the parameter matrix of the conv5_x layer, with a size of 2048×7×7; x u For the unlabeled dataset X U Image data in, u = 1, 2, ..., N U N U x' is the number of images in the unlabeled dataset. u It is for x u Perturbation data after adding Gaussian noise;
[0064] Based on the trained feature extractor and classifier, calculate the uncertainty O(x) of the unlabeled data. u ):
[0065]
[0066] Select the high-scoring samples for the next step of label learning, choosing 30% of the images in the unlabeled dataset to obtain a new labeled dataset X. UL ;
[0067] ② Learning the labels of unlabeled samples: Label classification loss function L y for:
[0068]
[0069] in, It is classifier G y The parameter matrix is of size 2048×10, Θ f =[θ f,1 ,θ f,2 ,θ f,3 ,θ f,4 ,θ f,5 ] is the feature extractor F f The parameter matrix, θ f,1 This represents the parameter matrix of the conv1 layer, with a size of 64×112×112, θ f,2 This represents the parameter matrix of the conv2_x layer, with a size of 256×56×56, θ f,3 This represents the parameter matrix of the conv3_x layer, with a size of 512×28×28, θ f,4 This represents the parameter matrix of the conv4_x layer, with a size of 1024×14×14, θ f,5 This represents the parameter matrix of the conv5_x layer, with a size of 2048×7×7; N L is the number of images in the labeled dataset; Y represents the image category label matrix, with a size of R×10, R=0.7P; L is the cross-entropy loss function, expressed as:
[0070]
[0071] Where, α(x) (i) j Describe dataset X L Image data x of the i-th image of the j-th class (i) j The actual probability distribution, j = 1, 2, ..., 10, i = 1, 2, ..., N j N j β(x) is the number of images in the j-th class. (i) j Describe the predicted probability distribution of the i-th image data in the j-th class;
[0072] Discriminant loss function L g for:
[0073]
[0074] in, It is classifier G g The parameter matrix is of size 2048×1; X d For labeled dataset X L With the new labeled dataset X UL The set N is the dataset X d The number of images, y g Let X be the identification label vector, with a size of N×1;
[0075] Multi-class discrimination loss function L m for:
[0076]
[0077] in, It is classifier G (c) m The parameter matrix is of size 2048×1; y (c) m For X d The class identification label vector has a size of N×1;
[0078] Integration loss function L label for:
[0079] L label =L y -0.5L g +0.5L m (7)
[0080] Once a trained label learning model is obtained, labels are acquired for the unlabeled data in the new labeled dataset.
[0081] ③Classification task loss function L h The formula is as follows:
[0082]
[0083] in, It is classifier G a The parameter matrix is of size 2048×10, Θ a =[θ a,1 ,θ a,2 ,θ a,3 ,θ a,4 ,θ a,5 ] is the feature extractor F a The parameter matrix, θ a,1This represents the parameter matrix of the conv1 layer, with a size of 64×112×112, θ a,2 The parameter matrix of the conv2_x layer is 256×56×56, and θ is... a,3 This represents the parameter matrix of the conv3_x layer, with a size of 512×28×28, θ a,4 This represents the parameter matrix of the conv4_x layer, with a size of 1024×14×14, θ a,5 This represents the parameter matrix of the conv5_x layer, with a size of 2048×7×7; Y d For dataset X d An image category label matrix of size N×10 is used to train a classification model;
[0084] (4) Household waste identification
[0085] A waste sorting strategy based on partial label feature learning, applied to test set X. B The system learns from 10 types of garbage images to obtain a predicted category label matrix Y for household waste. B ,
[0086]
[0087] Among them, X B Contains Q test images, Y B The size is Q×10;
[0088] Y B To identify household waste and complete the waste identification task.
Claims
1. A method for identifying household waste based on partial label feature learning, characterized in that, Includes the following steps: (1) Collection and preprocessing of municipal solid waste data Obtain a dataset of images of household waste, comprising 10 categories of household waste images, including: disposable fast food containers, broken flower pots and dishes, vegetable leaves, cigarette butts, plastic toys, plastic hangers, old clothes, aluminum cans, cardboard boxes, and dry cell batteries; The pixels of each image in the household waste image dataset are normalized to [0, 1]. The normalized dataset of household waste images is divided into two groups: one group contains P training images, and the other group contains Q test images, where P > Q. The training images are divided into two groups: one group is the labeled dataset X. L One set of images comprised 70% of the training images; the other set consisted of an unlabeled dataset X. U The number of images is 30% of the number of training images; (2) Construct a household waste sorting model Constructing a sample selection model based on deep networks: The sample selection model includes three feature extractors and three classifiers; the deep network is used as the feature extractor F of the model. (d) s d=1,2,3, where the deep network consists of five parts. The first part, conv1, consists of a convolutional layer with a 7×7 kernel and a stride of 2, a batch normalization layer with 256 output channels, and a ReLU activation function layer. The remaining four parts are conv2_x, conv3_x, conv4_x, and conv5_x, each consisting of three Bottleneck modules. Each Bottleneck module consists of a convolutional layer with a 1×1 kernel, a convolutional layer with a 3×3 kernel, and a convolutional layer with a 1×1 kernel, with a stride of 1. A fully connected layer with 2048 channels is used as the classifier G for the sample selection model. (d) s ; Constructing a deep network-based sample labeling model: The sample labeling model includes a feature extractor F. f A label classifier G y A discriminative classifier G g and 10 multi-class discriminant classifiers G (c) m c = 1, 2, ..., 10; Construct a classification model based on deep networks, including a feature extractor F. a A classifier G a ; The household waste sorting model consists of three parts: a sample selection model, a sample labeling model, and a sorting model. (3) Design a waste sorting strategy based on partial label feature learning ① Select the samples to be labeled: Sample evaluation criteria, loss function formula L s for: (1); Where, φ (d) s It is classifier G (d) s The parameter matrix is of size 2048×10, Θ (d) s =[θ (d) s,1 , θ (d) s,2 ,θ (d) s,3 , θ (d) s,4 , θ (d) s,5 ] is the feature extractor F (d) s The parameter matrix, θ (d) s,1 This represents the parameter matrix of the conv1 layer, with a size of 64×112×112, θ (d) s,2 This represents the parameter matrix of the conv2_x layer, with a size of 256×56×56, θ (d) s,3 This represents the parameter matrix of the conv3_x layer, with a size of 512×28×28, θ (d) s,4 This represents the parameter matrix of the conv4_x layer, with a size of 1024×14×14, θ (d) s,5 This represents the parameter matrix of the conv5_x layer, with a size of 2048×7×7; x u For the unlabeled dataset X U Image data in, u=1,2,…,N U N U x' is the number of images in the unlabeled dataset. u It is for x u Perturbation data after adding Gaussian noise; Based on the trained feature extractor and classifier, calculate the uncertainty O(x) of the unlabeled data. u ): (2); Select the high-scoring samples for the next step of label learning, choosing 30% of the images in the unlabeled dataset to obtain a new labeled dataset X. UL ; ② Learning the labels of unlabeled samples: Label classification loss function L y for: (3); Where, φ y It is classifier G y The parameter matrix is of size 2048×10, Θ f =[θ f,1 , θ f,2 , θ f,3 , θ f,4 , θ f,5 ] is the feature extractor F f The parameter matrix, θ f,1 This represents the parameter matrix of the conv1 layer, with a size of 64×112×112, θ f,2 This represents the parameter matrix of the conv2_x layer, with a size of 256×56×56, θ f,3 This represents the parameter matrix of the conv3_x layer, with a size of 512×28×28, θ f,4 This represents the parameter matrix of the conv4_x layer, with a size of 1024×14×14, θ f,5 This represents the parameter matrix of the conv5_x layer, with a size of 2048×7×7; N L is the number of images in the labeled dataset; Y represents the image category label matrix, with a size of R×10, R=0.7P; L is the cross-entropy loss function, expressed as: (4); Where, α(x) (i) j Describe dataset X L Image data x of the i-th image of the j-th class (i) j The actual probability distribution, j=1,2,…,10, i=1,2,…,N j N j β(x) is the number of images in the j-th class. (i) j Describe the predicted probability distribution of the i-th image data in the j-th class; Discriminant loss function L g for: (5); Where, φ g It is classifier G g The parameter matrix is of size 2048×1; X d For the labeled dataset X L With the new labeled dataset X UL The set N is the dataset X d The number of images, y g For X d The identification tag vector has a size of N×1; Multi-class discrimination loss function L m for: (6); Where, φ (c) m It is classifier G (c) m The parameter matrix is of size 2048×1; y (c) m For X d The class identification label vector has a size of N×1; Integration loss function L label for: (7); Once a trained label learning model is obtained, labels are acquired for the unlabeled data in the new labeled dataset. ③ Classification task loss function L h The formula is as follows: (8); Where, φ a It is classifier G a The parameter matrix is of size 2048×10, Θ a =[θ a,1 , θ a,2 , θ a,3 , θ a,4 , θ a,5 ] is the feature extractor F a The parameter matrix, θ a,1 This represents the parameter matrix of the conv1 layer, with a size of 64×112×112, θ a,2 This represents the parameter matrix of the conv2_x layer, with a size of 256×56×56, θ a,3 This represents the parameter matrix of the conv3_x layer, with a size of 512×28×28, θ a,4 This represents the parameter matrix of the conv4_x layer, with a size of 1024×14×14, θ a,5 This represents the parameter matrix of the conv5_x layer, with a size of 2048×7×7; Y d For dataset X d An image category label matrix of size N×10 is used to train a classification model; (4) Household waste identification A waste sorting strategy based on partial label features was applied to the test set X. B The system learns from 10 types of garbage images to obtain a predicted category label matrix Y for household waste. B , (9); Among them, X B Contains Q test images, Y B The size is Q×10; Y B To identify household waste and complete the waste identification task.