A method for verifying the accuracy of near-infrared spectroscopy classification and identification of plastics
Patent Information
- Application Number
- CN202111553369.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-06-29
- Filing Date
- 2021-12-17
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2041-12-17
AI Technical Summary
The prior art has problems in plastic recognition with high recognition complexity and difficult to quantitatively analyze model recognition accuracy, and there is a lack of fast and lossless method to judge the accuracy of plastic model recognition.
The near-infrared spectral analysis method combined with convolutional neural network (CNN) and support vector machine (SVM) is used to verify the identification accuracy of plastic categories. By collecting near-infrared spectral data of PP and PE recycled and new feeds, performing data preprocessing and model training, selecting the most suitable data preprocessing and model methods, such as MSC-SVM and 1DCNN models, and conducting experimental comparisons to verify recognition accuracy .
It realizes rapid and accurate identification of plastic categories, reduces recognition complexity, improves model recognition accuracy, and provides a lossless plastic recognition method.
Smart Images

Figure CN114202645B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of spectrum detection, and in particular to applying a neural network and a support vector machine to near infrared spectrum analysis of plastics. Background Art
[0002] Since its invention, plastics have provided convenience for human production and life and are widely used. However, since most plastic products are chemically stable and non-degradable, a large amount of plastic waste is generated. Data released by the United Nations Environment Programme in 2018 showed that the annual output of plastic waste in the world is about 300 million tons. my country is one of the top ten producers and consumers of plastic products in the world. The classification, recycling and reuse of plastic waste is very important, otherwise it will not only pollute the environment, but also waste resources.
[0003] Improving the collection and classification of plastic waste is the best way to improve the quality of recycled plastics. Traditional plastic classification methods such as manual classification, optical sorting, and flotation are time-consuming and labor-intensive. In order to save labor costs and accurately and efficiently classify plastics, people have studied algorithms for intelligent plastic classification. For example, laser-induced breakdown spectroscopy (LIBS) technology and principal component analysis (PCA) have been successfully used to identify polyethylene terephthalate (PET), high-density polyethylene (PE), polypropylene (PP), and polystyrene (PS). LIBS technology can also identify plastic / polymer samples with the same polymer matrix but different additives. X-ray absorption spectroscopy (XAS) combined with PCA and back-propagation neural network (BPNN) was used to identify 15 different plastics. Raman spectroscopy and K-nearest neighbor algorithm (KNN), cyclic subspace regression (CSR), and library search have also been used for plastic classification. Attenuated total reflectance Fourier transform infrared spectroscopy combined with principal component analysis and systematic cluster analysis (HCA) was used to classify and identify seven types of waste plastics. The cosine and average distance methods were selected as the distance functions between samples and between classes to cluster the data, and finally a 100% classification accuracy was obtained. The classification and regression model (CART) can find direct and simple classification conditions from near-infrared spectral data.
[0004] Invention patent CN110441254A discloses a method for plastic identification using a combination of neural networks and near-infrared spectroscopy. This method uses a near-infrared optical frequency comb spectrometer; the overlapping interference image signals are convoluted and demodulated to obtain separated interference image signals, and finally Fourier transform is performed to obtain the frequency domain spectrum corresponding to the sample. However, this method uses a polarizer and Fourier transform for signal processing, which increases the complexity of identification. In view of this, there are currently many models involved in the identification of plastics, and a quantitative analysis and judgment method for the recognition accuracy of the model is required. Therefore, it is necessary to provide a method that can quickly and non-destructively judge the model recognition accuracy for plastics, a specific object to be tested. Summary of the invention
[0005] The present invention provides a near infrared spectroscopy plastic recognition method using a convolutional neural network and a support vector machine, and verifies the recognition effects of different preprocessed models.
[0006] One method of the present invention provides a method for verifying the accuracy of plastic category identification using near infrared spectroscopy, comprising the following steps:
[0007] Step 1, respectively collecting near infrared spectra of several PP (polypropylene) recycled materials, PE (polyethylene) recycled materials, PP new materials and PE new materials samples;
[0008] Step 2: For each of the above four types of samples, the random selection method (RS) is used to divide the sample set into a training set and a validation set according to a ratio of approximately 3:1 between the training set and the validation set;
[0009] Step 3, preprocessing the data in step 2 and establishing a support vector machine model; wherein a relaxation coefficient and a penalty factor C are introduced for a linearly inseparable data set; inputting the near infrared spectral data and the corresponding category labels, and randomly selecting a validation set for experiment according to a proportion; the model output includes the predicted label, the training set accuracy, and the validation set accuracy; according to the experimental results, the most suitable data preprocessing and support vector machine model method is selected as MSC-SVM;
[0010] Step 4, build a one-dimensional convolutional neural network model: a 6-layer 1DCNN was built for plastic classification; the total area neural network model includes input layer-convolution layer C1-pooling layer S2-fully connected layer F3-fully connected layer F4-output layer, and the label values "0, 1, 2, 3" representing the plastic category in the training set are converted into one-hot vector inputs, where the input dimension of each sample spectral data is 15011; regularization terms and random inactivation (Dropout) are added to the neural network, and the model complexity is reduced, using only one convolution layer, 8 convolution kernels, a size of 3×1, and a step size of 1;
[0011] Step 5, respectively compare the experimental accuracy of the above near-infrared spectral data using the MSC-SVM and 1DCNN models, so as to verify the recognition accuracy of different models for different types of plastics.
[0012] Preferably, it is verified in step 5 that: PP new material is predicted using the 1DCNN model; PE new material can be correctly classified using both the MSC-SVM model and the 1DCNN model.
[0013] Preferably, in step 3, for a linearly separable data set, the objective function is:
[0014]
[0015] Subject to constraint condition (2):
[0016] y i (ω T x i +b)≥1,i=1,2,...,n (2)
[0017] For linearly inseparable data sets, the relaxation coefficient ξ is introduced i ≥0 and penalty factor C, the objective function and constraints become (3) and (4).
[0018]
[0019] y i (ω T x i +b)≥1-ξ i , i = 1, 2, ..., n (4)
[0020] For formulas (1)-(4), n is the number of samples. ω and b are the hyperplane ω T The weight and bias parameters of x+b=0. i and i A vector representing the i-th input and the i-th dependent variable value.
[0021] Preferably, in step 5, the classification accuracy of the training set and the test set is used as the model evaluation index. The accuracy can be obtained from formula (5), which is the number of samples N that are correctly classified c The total number of samples N r proportion.
[0022]
[0023] Preferably, the data preprocessing methods in step 3 are first-order derivative method, second-order derivative method, centering, standardization, Savitzky-Golay smoothing method, multivariate scattering processing, and standard normal transformation method.
[0024] Another aspect of the present invention is to provide application of the above method in identifying types of plastics using near infrared spectroscopy.
[0025] Another aspect of the present invention is to provide a computer storage medium storing an executable program, wherein the executable program includes a method for executing any of the above-mentioned identification accuracy verification methods.
[0026] The invention of the present invention includes but is not limited to the following points:
[0027] (1) This detection introduces neural network modeling and analysis for plastics. There are technical solutions in the prior art that combine neural networks with spectral technology. However, the identification of plastics is different from the identification of other types of samples. PP or PE are the two types of plastic sources with the largest usage. If the introduced neural network is not optimized as described in the present invention, the accuracy of resolution is not high. Therefore, the present invention introduces the SVM model, and experimentally compares the models after each data preprocessing to obtain the optimized model. By comparing various preprocessing methods and verifying the data after model establishment, it is concluded that selecting different models for different types of plastics can improve prediction accuracy.
[0028] (2) For linearly inseparable data sets in support vector machines, a relaxation coefficient ξ is introduced i ≥0 and penalty factor C, thereby limiting the objective function and constraints. The Lagrange multiplier method is used to solve the extreme value of the constraints. After modeling, a 4-fold cross validation is performed to compare the accuracy of different data preprocessing methods and select the SVM model with the highest accuracy.
[0029] (3) A 6-layer 1DCNN was constructed for plastic classification, including input layer-convolution layer C1-pooling layer S2-fully connected layer F3-fully connected layer F4-output layer. The label value representing the plastic category in the training set was converted into a one-hot vector input. The input dimension of each sample spectral data was 1501×1. In order to avoid overfitting as much as possible, regularization terms and random inactivation (Dropout) were added to the neural network. In addition, the model complexity was reduced by using only one convolution layer, 8 convolution kernels, a size of 3×1, and a step size of 1. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:
[0031] FIG. 1( a ) is a near-infrared original spectrum of a plastic sample according to an embodiment of the present invention;
[0032] FIG1( b ) is a near-infrared spectrum of a plastic sample according to an embodiment of the present invention after outliers are removed;
[0033] Figure 2 Schematic diagram of the structure of each layer of the CNN model according to an embodiment of the present invention. Specific embodiments
[0034] The plastic samples were provided by Ningbo Inspection and Quarantine Bureau, including 100 PP (polypropylene) and PE (polyethylene) plastics, including 32 PE recycled materials (PEr), 36 PE new raw materials (PEn), 15 PP recycled materials (PPr), and 17 PP new raw materials (PPn), with the categories marked as 0, 1, 2, and 3 respectively.
[0035] The near infrared spectrum data of plastics was collected by using the Prismlight Technology S450 near infrared spectrometer. The wavelength range was set to 900-2500nm. At room temperature (25°C), the sample cup containing the plastic sample was placed in the collection window for spectrum collection. Each plastic sample was scanned 3 times and the average spectrum data was taken.
[0036] The spectra of the 100 samples collected are shown in Figure 1(a). Based on the spectra comparison data, the data of two abnormal samples in the PP recycled material are eliminated, and the spectrum is shown in Figure 1(b).
[0037] The final total number of valid samples is 98. The random selection method (RS) is used for each of the four types of plastic samples, and the sample set is divided according to the ratio of training set to validation set of approximately 3:1. There are 72 samples in the training set and 26 samples in the validation set. The specific information is shown in Table 1.
[0038] Table 1 Plastic sample information statistics
[0039] Unit: PCS
[0040]
[0041] Data preprocessing:
[0042] In order to reduce the influence of background noise and sample scattering in the spectrum on the model, the spectral data were preprocessed by the first derivative (1st Der), the second derivative (2nd Der), centralization, standardization, Savitzky-Golay smoothing method (SG), multiplicative scatter correction (MSC), and standard normal variate (SNV) before modeling. After the support vector machine model was established, the most appropriate data preprocessing method was selected according to the experimental results.
[0043] Support Vector Machine Model:
[0044] Support vector machines are generally used to solve binary classification problems, but now they can also handle multi-classification problems. Multi-classification problems can be converted into binary classification problems using one-versus-all (OVA) or one-versus-one (OVO) methods. The basic principle is to find a hyperplane ω T x+b=0, so that the points of different categories in the training set fall on both sides of the hyperplane, and at the same time maximize the blank area on both sides of the hyperplane. Using different kernel functions, samples can be mapped to high-dimensional space to find the hyperplane, thus supporting linear and nonlinear classification.
[0045] For a linearly separable data set, the objective function is:
[0046]
[0047] Subject to constraint condition (2):
[0048] y i (ω T x i +b)≥1,i=1,2,...,n (2)
[0049] For linearly inseparable data sets, the relaxation coefficient ξ is introduced i ≥0 and penalty factor C, the objective function and constraints become (3) and (4).
[0050]
[0051] y i (ω T xi +b)≥1-ξ i , i = 1, 2, ..., n (4)
[0052] For formulas (1)-(4), n is the number of samples. ω and b are the hyperplane ω T The weight and bias parameters of x+b=0. i and i Represents the vector of the ith input and the value of the ith dependent variable. The above extreme values can be solved using the Lagrange multiplier method. After modeling, a 4-fold cross-validation is performed to compare the accuracy of different data preprocessing methods and select the model with the highest accuracy. And select the parameters that make the model work best: use the OVO method, that is, construct a binary SVM model between every two classes; the value of the penalty factor C is set to 256, and the kernel function is a linear kernel function. Input the near-infrared spectral data of the plastic and the corresponding category labels (0, 1, 2, 3), and randomly select 10 validation sets according to the proportions in Table 1 for 10 experiments. The model output includes the predicted label, the training set accuracy, and the validation set accuracy.
[0053] One-dimensional convolutional neural network model:
[0054] As a nonlinear model, convolutional neural network can effectively extract local information in the spectrum and has strong learning ability.
[0055] A typical convolutional neural network model includes an input layer, a convolution layer, a pooling layer, a fully connected layer, and an output layer. For spectral data, it is more efficient to input one-dimensional spectral data into the input layer than a two-dimensional spectral matrix. After inputting the data and labels, the convolution layer uses multiple one-dimensional convolution kernels with set sizes and steps to obtain feature maps after convolution operations. The number of convolution layers can be one, two, or even more, but too many convolution layers and convolution kernels may lead to overfitting. The pooling layer is usually used after the convolution layer to extract local features of the data. There are two pooling methods: maximum pooling and average pooling. The former focuses on extracting feature information. After one or more fully connected layers, the features are mapped to the sample space for classification. In order to establish a nonlinear model, an activation function needs to be added. The ReLU function can avoid the gradient vanishing problem. In the classification problem, the last layer of the neural network usually uses the Softmax function to map the input to between 0 and 1, and obtain the probabilities of different categories for classification.
[0056] When training the model, first initialize the weights, input the near-infrared spectrum data and category labels of the plastic sample training set, and obtain the final output results through each layer of the neural network. Calculate the model loss function value, propagate the loss function value from the last layer to each layer of the network through back propagation, update the weights in the direction of minimizing the loss function value, and continue training.
[0057] This experiment constructed a 6-layer 1DCNN for plastic classification, including input layer-convolution layer C1-pooling layer S2-fully connected layer F3-fully connected layer F4-output layer, such as Figure 2 . The label values "0, 1, 2, 3" representing the plastic category in the training set are converted into one-hot vector inputs, and the input dimension of each sample spectral data is 1501×1. In order to avoid overfitting as much as possible, regularization terms and random dropout (Dropout) are added to the neural network. And to reduce the complexity of the model, only one convolution layer is used, using 8 convolution kernels, the size is 3×1, and the step size is 1. The pooling layer uses the maximum pooling method, the kernel size is 2×1, and the step size is 2. The last fully connected layer of the model uses the Softmax activation function, the optimizer is AdamOptimizer, the learning rate is 0.0001, the number of convolution kernels is 3, the number of neurons in the fully connected layer is 60, and the number of iterations is 5000. Model training is based on the GPU version of the TensorFlow framework.
[0058] The same 10 validation sets as those of the MSC-SVM model were used to conduct experiments and obtain the prediction categories and prediction accuracy.
[0059] Evaluation indicators:
[0060] In this experiment, the classification accuracy of the training set and the test set is used as the model evaluation index. The accuracy P can be obtained from formula (5), which is the number of samples N that are correctly classified. c The total number of samples N r proportion.
[0061]
[0062] When establishing the SVM model, the cross-validation experimental results are shown in Table 2, comparing the modeling without data preprocessing and with different data preprocessing methods.
[0063] Table 2 Accuracy of SVM models with different data preprocessing
[0064]
[0065] It can be seen that the model accuracy after MSC is the highest. The MSC-SVM model with the best classification performance was selected for 10 random experiments. A total of 980 results were obtained for 98 samples, including 720 training sets and 260 validation sets. These 980 results were statistically analyzed, and the classification results of different types of plastics were recorded. The true values and predicted values were reflected in the table to obtain the confusion matrix, as shown in Table 3. Similarly, the confusion matrix of 1DCNN model with 10 random experiments and a total of 980 classification results is shown in Table 4. The validation set of each random experiment is the same as the corresponding validation set used by the MSC-SVM model. The diagonal elements in the confusion matrix represent samples that are correctly classified. If the experimental results of the training set and validation set are distributed diagonally in the table, it means that the model classification accuracy is high.
[0066] Table 3 Confusion matrix of 980 classification results of MSC-SVM model
[0067] Unit:label(s)
[0068]
[0069] Table 4 Confusion matrix of 980 classification results of 1DCNN model
[0070] Unit:label(s)
[0071]
[0072] As shown in Table 3, the training set results of the MSC-SVM model are all distributed on the diagonal, indicating that the classification is completely accurate in this experiment; while the validation set has misclassified results except for PE new materials. The data in Table 4 are not all distributed on the diagonal, indicating that there are a few wrong results in the classification results of the training set and validation set of the 1DCNN model. Overall, the 1DCNN model is more effective in predicting the category of PP new materials, and the MSC-SVM model will more likely misjudge it as PP recycled materials. PE recycled materials are more likely to be misjudged as PE new materials. PE new materials can almost be correctly classified using both models.
[0073] The results of 10 random experiments of MSC-SVM model and 1DCNN model are comprehensively compared, and Table 5 is obtained.
[0074] Table 5 Comparison of accuracy between MSC-SVM model and 1DCNN model
[0075]
[0076] As shown in Table 5, the MSC-SVM model performs very well on the training set with an accuracy of 100%. On the validation set, the 1DCNN model has an accuracy of 91.5%, which is slightly better than the MSC-SVM model. For different types of plastics, the prediction effects of the two models of PE recycled materials and PP recycled materials are similar, and the accuracy of PP recycled materials is not high; the accuracy of PE new materials is 100% on the validation set; the accuracy of PP new materials using the 1DCNN model is 100%. The average program execution time required for a single experimental training of the MSC-SVM model and the 1DCNN model is recorded. The MSC-SVM model is 2.84 seconds, while the average model training time of the 1DCNN model is 24.55 seconds. It can be seen that in the case of a small amount of data in this experiment, the MSC-SVM model is faster than the 1DCNN model. Generally, CNN has significant advantages in the case of large amounts of data, but it is easy to overfit on small data sets. However, this experiment proves that as long as the number of convolution layers is reasonable, a one-dimensional convolution kernel suitable for spectral data is used, the parameters are set appropriately, and some methods to avoid overfitting are used, the accuracy can also achieve good results. Moreover, CNN has low requirements for data preprocessing, and in some cases, no data preprocessing is even required, and there is no need to consider the characteristics of sample data. As a universal method, it has great application potential in near-infrared spectral data analysis. This is one of the inventive points of the present invention, which can meet the detection accuracy requirements of different samples by reasonably selecting parameters such as the number of convolution layers.
[0077] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features therein can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
[0078] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
Claims
1. A method for verifying the accuracy of near-infrared spectroscopy classification and identification of plastics, comprising the following steps: Step 1, respectively collecting near infrared spectra of several PP (polypropylene) recycled materials, PE (polyethylene) recycled materials, PP new materials and PE new materials samples; Step 2: For each of the four categories of samples, the random selection method (RS) is used to divide the sample set into a training set and a validation set according to a ratio of approximately 3:1 between the training set and the validation set; Step 3, performing data preprocessing on the data in the sample set in step 2 and establishing a support vector machine model (SVM); wherein a relaxation coefficient and a penalty factor C are introduced for the linearly inseparable data set in the support vector machine model; inputting the near infrared spectral data and the corresponding category labels, and randomly selecting a validation set for experiment according to the proportion; the model output includes the predicted labels, the training set accuracy and the validation set accuracy; according to the experimental results, selecting the most appropriate data preprocessing and support vector machine model method; Step 4, build a one-dimensional convolutional neural network model: a 6-layer 1DCNN was constructed for plastic classification; the total area neural network model includes input layer-convolution layer C1-pooling layer S2-fully connected layer F3-fully connected layer F4-output layer, and the label values "0, 1, 2, 3" representing the plastic category in the training set are converted into one-hot vector inputs, where the input dimension of each sample spectral data is 15011; regularization terms and random inactivation (Dropout) are added to the neural network, and the model complexity is reduced, using only one convolution layer, 8 convolution kernels, a size of 3×1, and a step size of 1; Step 5, respectively compare the experimental accuracy of the above-mentioned near-infrared spectral data using the most appropriate data preprocessing and support vector machine model method described in step 3 and the 1DCNN model in step 4, so as to verify the recognition accuracy of different models for different types of plastics.
2. The method according to claim 1, wherein the most suitable data preprocessing and support vector machine model method in step 3 is MSC-SVM; It was verified in step 5 that: PP new material was predicted using the 1DCNN model; PE new material was correctly classified using both the MSC-SVM model and the 1DCNN model.
3. According to the method of claim 1, in step 3, for a linearly separable data set, the objective function is: Subject to constraint condition (2): y i (ω T x i +b)≥1,i=1,2,...,n (2) For linearly inseparable data sets, the relaxation coefficient ξ is introduced i ≥0 and penalty factor C, the objective function and constraints become (3) and (4). y i (oh T x i +b)≥1-ξ i ,i=1,2,...,n (4) For formulas (1)-(4), n is the number of samples. ω and b are the hyperplane ω T The weight and bias parameters of x+b=0. i and i A vector representing the i-th input and the i-th dependent variable value.
4. The method according to claim 1, wherein in step 5, the classification accuracy of the training set and the test set is used as the model evaluation index. The accuracy can be obtained from formula (5), which is the number of samples N that are correctly classified. c The total number of samples N r proportion.
5. According to the method of claim 1, the data preprocessing methods in step 3 are first-order derivative method, second-order derivative method, centering, standardization, Savitzky-Golay smoothing method, multivariate scattering processing, and standard normal transformation method.
6. Application of the method according to any one of claims 1 to 5 in near infrared spectroscopy for identifying types of plastics.
7. A computer storage medium storing an executable program, wherein the executable program includes executing the method for verifying the recognition accuracy as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Near infrared optical frequency comb spectrograph for identifying plastic
CN110441254A
Method for discriminating multiple waste plastic kinds by adopting near infrared spectrum characteristic wavelength
CN104502309A
Near infrared spectrum analysis method based on one-dimensional convolutional neural network
CN107478598A