Recyclable plastic classification method and system

Through principal component analysis and cluster analysis technology, the characteristic wavelengths in hyperspectral plastic classification are screened out, which solves the problems of high computational complexity and low classification efficiency in the existing technology, and achieves efficient and accurate plastic classification.

CN120047830AInactive Publication Date: 2025-05-27DONGGUAN LUHANG ENVIRONMENTAL PROTECTION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510167498.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-16
Publication Date
2025-05-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Due to the high data redundancy and large calculation volume, existing hyperspectral plastic classification technology is difficult to efficiently select representative feature wavelengths, resulting in high computational complexity and low classification efficiency.

Method used

By collecting the hyperspectral curve of plastic samples, principal component analysis is performed to calculate the eigenvalues ​​and eigenvectors, candidate wavelengths and their accumulated sums are determined, and feature wavelengths are screened out by intra-class dispersion and inter-class dispersion, reducing the calculation complexity.

Benefits of technology

It effectively reduces the amount of calculation in hyperspectral plastic classification, improves classification efficiency, and ensures classification accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120047830A_ABST
    Figure CN120047830A_ABST
Patent Text Reader

Abstract

The invention relates to a recyclable plastic classification method and system, and the method comprises the steps: collecting a hyperspectral curve of a preset type of plastic sample, carrying out the sampling of the hyperspectral curve, obtaining a hyperspectral vector of the plastic sample, enabling each element in the hyperspectral vector to correspond to a wavelength, and enabling the plastic type to serve as the label of the hyperspectral curve; calculating by adopting principal component analysis to obtain a feature value and a feature vector, and obtaining candidate wavelengths and an accumulated sum corresponding to the candidate wavelengths according to the feature value and the feature vector; gathering the reflectivity corresponding to each candidate wavelength into a preset number of types to obtain intra-class dispersivity and inter-class dispersivity of each candidate wavelength, and determining a characteristic wavelength from the candidate wavelengths according to the intra-class dispersivity, the inter-class dispersivity and the cumulative sum; acquiring a hyperspectral image of the recyclable plastic according to the characteristic wavelength; and inputting the hyperspectral image into the target identification model to obtain the type of the recyclable plastic, and classifying the recyclable plastic according to the type.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of resource recovery, and specifically to a method and system for classifying recyclable plastics. Background Art

[0002] Recycling recyclable plastics can not only reduce the environmental pollution caused by plastics, but also enable resource reuse and realize the repeated use of plastics. Different types of plastics have different chemical compositions, melting points, and physical properties. Mixed treatment may lead to a decline in material properties and affect the quality of recycled plastics. Precise classification can ensure that plastics of the same type enter the corresponding recycling process, improve the purity of recycled plastics, thereby enhancing processing efficiency, reducing production costs, and promoting the development of the circular economy.

[0003] Traditional plastic recycling relies on manual identification or physical sorting methods based on density, optical properties, etc. However, these methods often have problems such as low accuracy, low efficiency, and difficulty in distinguishing plastics with similar chemical compositions. Due to the differences in chemical composition and molecular structure, different types of plastics have different reflectivities at specific wavelengths. Therefore, automated classification of plastics can be achieved through hyperspectral data. However, hyperspectral data usually contains hundreds or even thousands of bands, resulting in high data redundancy and large computational amounts, and is limited by computational resources and classification efficiency in practical applications. How to efficiently select representative characteristic wavelengths to reduce computational complexity while ensuring classification accuracy is the key problem faced by current hyperspectral plastic classification technology. Summary of the Invention

[0004] In order to reduce the computational amount in hyperspectral identification for classifying recyclable plastics and prevent interference from non-characteristic wavelengths, in the first aspect of the present invention, a method for classifying recyclable plastics is provided. The method includes: Collect the hyperspectral curves of plastic samples of preset types, sample the hyperspectral curves to obtain the hyperspectral vectors of the plastic samples. Each element in the hyperspectral vector corresponds to a wavelength, and the plastic type is used as the annotation of the hyperspectral curve; Use principal component analysis to calculate the eigenvalues and eigenvectors, and obtain the candidate wavelengths and the cumulative sums corresponding to the candidate wavelengths according to the eigenvalues and eigenvectors; Cluster the reflectivities corresponding to each candidate wavelength into the number of preset types to obtain the within-class scatter and between-class scatter of each candidate wavelength. Determine the characteristic wavelengths from the candidate wavelengths according to the within-class scatter, between-class scatter, and the cumulative sums; Collect the hyperspectral images of recyclable plastics according to the characteristic wavelengths; input the hyperspectral images into the target recognition model to obtain the types of recyclable plastics, and classify the recyclable plastics according to the types.

[0005] Preferably, obtaining the candidate wavelengths and the cumulative sum corresponding to the candidate wavelengths according to the eigenvalues and eigenvectors is specifically as follows: Calculate the average value of each eigenvector, add the sequence numbers of the elements in the eigenvector that are greater than the average value to the set, calculate the intersection of the set of the first preset number of eigenvalues, calculate the cumulative sum of the products of the values of each element in the intersection in the eigenvectors corresponding to the first preset number of eigenvalues and the eigenvalues, and use the wavelengths in the hyperspectral vector that have the same sequence numbers as those in the intersection as the candidate wavelengths.

[0006] Preferably, before calculating the intersection of the set of the first preset number of eigenvalues, it further includes: Sort the eigenvalues in descending order according to the eigenvalues.

[0007] Preferably, clustering the reflectivities corresponding to each candidate wavelength into a preset number of categories to obtain the within-class scatter and between-class scatter of each candidate wavelength is specifically as follows: Obtain the number of each plastic sample and the central value of the reflectivity of the candidate wavelength, and establish the corresponding relationship between the central value, the plastic type, and the number of samples; For each central value, calculate the distance from the reflectivity of each plastic sample at the candidate wavelength to the central value, sort the plastic samples in ascending order according to the distance, and divide the first-mentioned number of plastic samples into one cluster; If a plastic sample belongs to only one cluster, the probability that the plastic sample belongs to the cluster is 1. Otherwise, calculate the distances from the plastic sample to each cluster it belongs to, and determine the probability that the plastic sample belongs to the cluster according to the distances; After the clustering is completed, calculate the within-class scatter and between-class scatter.

[0008] Preferably, calculating the within-class scatter and between-class scatter is specifically as follows: For each cluster, calculate the square of the distance from the reflectivity of each plastic sample to the central value, multiply the square of the distance by the probability that the plastic sample belongs to the cluster corresponding to the central value to obtain the contribution value of the plastic sample in the cluster it belongs to; add up all the contribution values of all clusters to obtain the within-class scatter; For each cluster, calculate the square of the distance from the central value corresponding to the cluster to the global average, multiply the square of the distance by the probability weighting value of the plastic samples in the cluster belonging to the cluster to obtain the contribution degree of the cluster; add up the contribution degrees of all clusters to obtain the between-class scatter.

[0009] Preferably, the specific calculation method of the probability weighting value is: adding up the probabilities of all plastic samples belonging to the cluster.

[0010] Preferably, determining the characteristic wavelengths from the candidate wavelengths according to the within-class scatter, between-class scatter, and the cumulative sum is specifically as follows: Normalize the within-class scatter and the between-class scatter of all candidate wavelengths, and normalize the cumulative sum of all candidate wavelengths; Calculate the weighted sum of the between-class scatter and the cumulative sum, and subtract the result of the weighted sum from the within-class scatter to obtain the eigenvalue of the candidate wavelength; Sort the candidate wavelengths in ascending order of eigenvalues, and select the top k candidate wavelengths as the characteristic wavelengths, where k is a positive integer.

[0011] In a second aspect of the present invention, a recyclable plastic classification system is provided, and the system includes: A sample collection module, configured to collect the hyperspectral curve of a plastic sample of a preset type, sample the hyperspectral curve to obtain the hyperspectral vector of the plastic sample, each element in the hyperspectral vector corresponds to a wavelength, and use the plastic type as the annotation of the hyperspectral curve; A candidate wavelength determination module, configured to calculate eigenvalues and eigenvectors by using principal component analysis, and obtain candidate wavelengths and the cumulative sum corresponding to the candidate wavelengths according to the eigenvalues and eigenvectors; A characteristic wavelength determination module, configured to cluster the reflectance corresponding to each candidate wavelength into a preset number of types to obtain the within-class scatter and the between-class scatter of each candidate wavelength, and determine the characteristic wavelength from the candidate wavelengths according to the within-class scatter, the between-class scatter, and the cumulative sum; A classification module, configured to collect the hyperspectral image of the recyclable plastic according to the characteristic wavelength; input the hyperspectral image into a target recognition model to obtain the type of the recyclable plastic, and classify the recyclable plastic according to the type.

[0012] Preferably, the obtaining of the candidate wavelengths and the cumulative sum corresponding to the candidate wavelengths according to the eigenvalues and eigenvectors is specifically: Calculate the average value of each eigenvector, add the serial numbers of the elements in the eigenvector that are greater than the average value to a set, calculate the intersection of the set of the first preset number of eigenvalues, calculate the cumulative sum of the products of the values of the elements in the intersection and the eigenvalues in the eigenvectors corresponding to the first preset number of eigenvalues, and use the wavelengths with the same serial numbers as those in the intersection in the hyperspectral vector as the candidate wavelengths.

[0013] Preferably, before calculating the intersection of the set of the first preset number of eigenvalues, it further includes: Sort the eigenvalues in descending order of eigenvalues.

[0014] Preferably, the clustering of the reflectance corresponding to each candidate wavelength into a preset number of types to obtain the within-class scatter and the between-class scatter of each candidate wavelength is specifically: Obtain the number of each plastic sample and the central value of the reflectance at the candidate wavelengths, and establish the corresponding relationship between the central value, the type of plastic, and the number of samples. For each central value, calculate the distance from the reflectance of each plastic sample at the candidate wavelength to the central value, sort the plastic samples in ascending order of the distance, and divide the plastic samples with the aforementioned number of samples into one cluster. If a plastic sample belongs to only one cluster, the probability that the plastic sample belongs to the cluster is 1. Otherwise, calculate the distance from the plastic sample to each cluster it belongs to, and determine the probability that the plastic sample belongs to the cluster according to the distance. After clustering is completed, calculate the within-class scatter and the between-class scatter.

[0015] Preferably, the calculation of the within-class scatter and the between-class scatter is specifically as follows: For each cluster, calculate the square of the distance from the reflectance of each plastic sample to the central value, multiply the square of the distance by the probability that the plastic sample belongs to the cluster corresponding to the central value to obtain the contribution value of the plastic sample in the cluster to which it belongs; add up all the contribution values of all clusters to obtain the within-class scatter. For each cluster, calculate the square of the distance from the central value corresponding to the cluster to the global average, multiply the square of the distance by the probability weighting value of the plastic samples in the cluster belonging to the cluster to obtain the contribution degree of the cluster; add up the contribution degrees of all clusters to obtain the between-class scatter.

[0016] Preferably, the specific calculation method of the probability weighting value is: add up the probabilities of all plastic samples belonging to the cluster.

[0017] Preferably, the determination of the characteristic wavelengths from the candidate wavelengths according to the within-class scatter, the between-class scatter, and the cumulative sum is specifically as follows: Normalize the within-class scatter and the between-class scatter of all candidate wavelengths, and normalize the cumulative sum of all candidate wavelengths. Calculate the weighted sum of the between-class scatter and the cumulative sum, and subtract the result of the weighted sum from the within-class scatter to obtain the characteristic value of the candidate wavelength. Sort the candidate wavelengths in ascending order of the characteristic value, and select the top k candidate wavelengths as the characteristic wavelengths, where k is a positive integer.

[0018] Hyperspectral data usually contains hundreds of wavelengths, and direct processing has a large computational amount. The present invention obtains candidate wavelengths based on the characteristic values and eigenvectors, as well as the importance (cumulative sum) of the candidate wavelengths; then, determines the characteristic wavelengths from the candidate wavelengths according to the within-class scatter, the between-class scatter, and the cumulative sum, and further selects the optimal wavelengths to reduce the computational amount. Description of the Drawings

[0019] Figure 1It is the flowchart of the first embodiment; Figure 2 They are hyperspectral images of different samples; Figure 3 It is a schematic diagram for obtaining the hyperspectral vector corresponding to the hyperspectral curve; Figure 4 It is a schematic diagram of the reflectance of candidate wavelengths in different hyperspectral curves; Figure 5 It is a schematic diagram of the eigenvector corresponding to the hyperspectral vector and the eigenvalue; Figure 6 They are the effect diagrams of identifying different plastics. Specific implementation manners

[0020] In this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising one..." does not exclude the existence of additional identical elements in the process, method, article or device comprising the element.

[0021] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

[0022] Figure 1 It is the flowchart of the first embodiment of the present invention. As Figure 1 shown, the recyclable plastic classification method specifically includes: S1, collecting the hyperspectral curves of plastic samples of preset types, sampling the hyperspectral curves to obtain the hyperspectral vectors of the plastic samples, each element in the hyperspectral vector corresponds to a wavelength, and using the plastic type as the annotation of the hyperspectral curve; Hyperspectral imaging can capture the spectral information of an object within multiple wavelength ranges. Different from traditional cameras that can only capture images within the visible light range, hyperspectral imaging can capture a wider spectral range, preferably including visible light, near-infrared, and even mid-infrared, etc. For a specific plastic sample, a hyperspectral imager will record the reflection or absorption intensity at different wavelengths, and these intensity values can be plotted into a curve, namely the hyperspectral curve. Figure 2 The hyperspectral curves of 8 samples are shown. Due to the differences in their chemical compositions and physical structures, the hyperspectral curves of each type of plastic will also vary, which can be used to identify different substances just like fingerprints. Before collecting the hyperspectral curves, determine the types of plastics, such as PET, PP, PVC, etc.

[0023] The hyperspectral curve contains a large amount of spectral information. For the convenience of subsequent data processing and analysis, sample the hyperspectral curve, that is, select some discrete points on the curve to represent the whole curve. Each point obtained after sampling corresponds to a wavelength and a reflectance or absorption intensity value. Arrange the reflectance or intensity values of these points in the order of wavelength, and a vector is formed, namely the hyperspectral vector. In another alternative embodiment, the reflectances corresponding to all wavelengths collected by the hyperspectral imager form the hyperspectral vector.

[0024] Each element in the hyperspectral vector represents the reflectance or intensity value of the original hyperspectral curve at a specific wavelength. Figure 3 Each solid dot in it represents a sampling point, and the values corresponding to the sampling points in each hyperspectral curve constitute the hyperspectral vector of the hyperspectral curve of this sample. In order to let the computer know which type of plastic each hyperspectral vector represents, label the hyperspectral curve, that is, indicate the type of plastic corresponding to this curve. For example, if a hyperspectral curve is of PET plastic, label the hyperspectral vector corresponding to this hyperspectral curve as PET. Suppose we want to identify two types of plastics, PET and PP. First, we need to collect the hyperspectral curves of PET and PP plastic samples, and then sample these curves to obtain hyperspectral vectors. For the PET sample, label the hyperspectral vector corresponding to its hyperspectral curve as "PET", and for the PP sample, label the hyperspectral vector corresponding to its hyperspectral curve as "PP". In one embodiment, there may be some noise or interference that causes the hyperspectral curve to be uneven, affecting subsequent sampling and vector generation. Some preprocessing techniques, such as smoothing filtering, denoising, etc., are used to improve the quality of the hyperspectral curve.

[0025] S2. Calculate the eigenvalues and eigenvectors using principal component analysis, and obtain the candidate wavelengths and the cumulative sums corresponding to the candidate wavelengths according to the eigenvalues and eigenvectors. Principal Component Analysis (PCA) is a commonly used dimensionality reduction technique that transforms the original data onto a new set of orthogonal coordinate systems through linear transformation, maximizing the variance of the data on the new coordinate systems. The larger the variance, the more information the data contains in that direction. In PCA, the eigenvalue represents the variance magnitude of the principal component represented by the corresponding eigenvector, and the eigenvector represents the direction of the principal component. The values in the eigenvector represent the weight of that wavelength in the corresponding principal component. The larger the absolute value, the higher the importance of that wavelength in that principal component. Calculate the eigenvalues and eigenvectors of all hyperspectral vectors using principal component analysis. All hyperspectral vectors form a hyperspectral matrix, and each row in the hyperspectral matrix is the hyperspectral vector of a sample.

[0026] In a specific embodiment, obtaining the candidate wavelengths and the cumulative sum corresponding to the candidate wavelengths according to the eigenvalues and eigenvectors is specifically as follows: Calculate the average value of each eigenvector, add the serial numbers of the elements in the eigenvector that are greater than the average value to a set, calculate the intersection of the sets of the first preset number of eigenvalues, calculate the cumulative sum of the products of the values of each element in the intersection in the eigenvectors corresponding to the first preset number of eigenvalues and the eigenvalues, and use the wavelengths in the hyperspectral vector with the same serial numbers as those in the intersection as the candidate wavelengths.

[0027] Calculate the average value of all elements in each eigenvector. Each element in the eigenvector corresponds to a wavelength in the original hyperspectral vector, and the serial number of the element is the position of that wavelength in the hyperspectral vector. For each eigenvector, add the wavelength serial numbers corresponding to the elements greater than the average value to a set. This set can be regarded as the wavelengths concerned by that eigenvector. Obtain a preset value, such as the first 5, the first 10, etc. After sorting the eigenvalues in descending order of eigenvalues, calculate the intersection of the sets corresponding to the first preset number of eigenvalues, that is, find the elements (wavelength serial numbers) that exist in common in these sets. They have relatively high weights in multiple principal components, and these common wavelength serial numbers are relatively important. For each wavelength serial number in the intersection, multiply its value in the first preset number of eigenvectors by the corresponding eigenvalue, and then add up these products. The cumulative sum is the importance score of that wavelength. The higher the score, the more important the wavelength. According to the above calculations, a set of important wavelength serial numbers is obtained, and the wavelengths corresponding to these serial numbers are the selected candidate wavelengths.

[0028] Suppose there are 10 plastic samples, and 100 - wavelength hyperspectral vectors are collected for each sample. First, perform PCA analysis on the 100 - wavelength hyperspectral vectors of the 10 samples to calculate 100 eigenvalues and their corresponding eigenvectors. The eigenvalues are arranged in descending order of magnitude, indicating the importance of the corresponding principal components. Each element of the eigenvector corresponds to a wavelength, and the element value represents the weight of that wavelength in the corresponding principal component. For each eigenvector, add the wavelength numbers corresponding to the elements greater than the average value to a set. For example, if the average value of the first eigenvector is 0.05, and the wavelength numbers corresponding to the elements greater than 0.05 are [10, 20, 30, 40, 50], then these numbers are added to the first set. Suppose it is preset to select the first 5 eigenvalues, calculate the intersection of the sets corresponding to the first 5 eigenvalues, that is, find the elements (wavelength numbers) that exist in all 5 sets; for example, the intersection of the first 5 sets is [20, 40, 60].

[0029] For each wavelength number in the intersection, calculate the cumulative sum of the product of its values in the first 5 eigenvectors and the corresponding eigenvalues. For example, for wavelength number 20, its values in the eigenvectors corresponding to the first 5 eigenvalues [0.8, 0.7, 0.6, 0.5, 0.4] are [0.1, 0.2, 0.3, 0.4, 0.5] respectively, then its cumulative sum is 0.5. Perform this calculation for each wavelength number in the intersection to obtain the importance score of each wavelength. Take the wavelengths in the hyperspectral vector with the same numbers as those in the intersection as candidate wavelengths. For example, if the intersection is [20, 40, 60], then the 20th, 40th, and 60th wavelengths in the hyperspectral vector are used as candidate wavelengths. Figure 5 The corresponding relationship between the values and wavelengths in the hyperspectral vector, and the corresponding relationship between the eigenvalues λ and eigenvectors are shown. Among them, the 5th element in the eigenvector corresponding to the first eigenvalue is the weighted value for wavelength 5. The larger the value in the eigenvector, the greater the contribution of this wavelength to the features after dimensionality reduction.

[0030] S3. Cluster the reflectances corresponding to each candidate wavelength into a preset number of categories to obtain the within - class scatter and between - class scatter of each candidate wavelength. Determine the characteristic wavelengths from the candidate wavelengths according to the within - class scatter, between - class scatter, and the cumulative sum; Cluster analysis is an unsupervised learning method that can divide data points into different groups, such that the data points within the same group have a high degree of similarity, and the data points between different groups have a low degree of similarity. For each candidate wavelength, take the reflectances of all samples at this wavelength as data points, Figure 4 The values of the candidate wavelengths in different samples are shown. Perform cluster analysis, and each wavelength will obtain a preset number of clustering clusters, and each cluster represents a type of plastic; where the preset number of categories is the number of plastic types in the S1 samples.

[0031] For each candidate wavelength, the within-class scatter and between-class scatter after clustering are calculated. The within-class scatter refers to the degree of dispersion among data points within the same cluster. The smaller the within-class scatter, the closer the reflectance of samples within the same cluster at this wavelength. The between-class scatter refers to the degree of dispersion among data points between different clusters. The larger the between-class scatter, the greater the difference in reflectance of samples in different clusters at this wavelength.

[0032] In one embodiment, the within-class scatter is calculated using the within-class scatter function, and the between-class scatter is calculated using the between-class scatter function. In another embodiment, the within-class scatter is calculated using the within-class scatter matrix, and the between-class scatter is calculated using the between-class scatter matrix. Since the value of each candidate wavelength in different samples is one-dimensional, that is, a reflectance or intensity, the value calculated by the within-class scatter matrix is a specific value, and this specific value is the within-class scatter; similarly, the value calculated by the between-class scatter matrix is also a specific value, and this specific value is the between-class scatter.

[0033] A small within-class scatter indicates that this wavelength has a good discrimination ability for the same type of plastic, a large between-class scatter indicates that this wavelength has a good discrimination ability for different types of plastic, and a high cumulative sum indicates that this wavelength is relatively important in multiple main components. The importance score of each candidate wavelength calculated by PCA in S2, the larger the cumulative sum, the higher the weight of this wavelength in multiple main components. Select candidate wavelengths with a small within-class scatter, a large between-class scatter, and a high cumulative sum as the final characteristic wavelengths.

[0034] For example, there are 10 plastic samples, including 3 types of plastics: PET, PP, and PVC, and each sample has a hyperspectral vector of 100 wavelengths. Through PCA, 10 candidate wavelengths are obtained. For each candidate wavelength, the reflectances of the 10 samples at this wavelength are clustered, and the number of clusters is set to 3. Calculate the within-class scatter and between-class scatter of each candidate wavelength after clustering. If the within-class scatters of wavelengths 20 and 40 are the smallest, the between-class scatters are the largest, and the cumulative sums are also relatively high, then select wavelengths 20 and 40 as the characteristic wavelengths.

[0035] In an alternative embodiment of S3, the candidate wavelengths are sorted in descending order of their cumulative sums, and the first preset number of candidate wavelengths are used as the characteristic wavelengths. For example, if 5 characteristic wavelengths need to be selected, then according to the magnitude of the cumulative sums, the 5 wavelengths with the highest cumulative sums can be selected as the final characteristic wavelengths.

[0036] S4, collect the hyperspectral image of the recyclable plastic according to the characteristic wavelengths; input the hyperspectral image into the target recognition model to obtain the type of the recyclable plastic, and classify the recyclable plastic according to the type.

[0037] Using a hyperspectral camera, only the image information of recyclable plastics at characteristic wavelengths is collected, which can reduce the data volume and improve the processing efficiency. Using a pre-trained machine learning or deep learning model, it can identify the objects in the image and judge the category of the objects. It can also use semantic segmentation and other methods to identify different plastics. The recognition effects of different plastics are as Figure 6 shown. The hyperspectral image of the recyclable plastics collected is input into the target recognition model, and the target recognition model will output the recognition result, indicating the type of the plastic. According to the plastic type output by the target recognition model, the recyclable plastics are classified manually or automatically. For example, PET plastics are put into the PET recycling bin, and PP plastics are put into the PP recycling bin.

[0038] In yet another embodiment, the reflectance corresponding to each candidate wavelength is clustered into a preset number of categories to obtain the within-class scatter and between-class scatter of each candidate wavelength, specifically: Obtain the number of samples of each type of plastic and the central value of the reflectance of the candidate wavelength, and establish the corresponding relationship between the central value, the plastic type, and the number of samples; For each central value, calculate the distance from the reflectance of each plastic sample at the candidate wavelength to the central value, sort the plastic samples in ascending order of the distance, and divide the plastic samples with the number of the aforementioned samples into one cluster; If a plastic sample belongs to only one cluster, the probability that the plastic sample belongs to the cluster is 1. Otherwise, calculate the distance from the plastic sample to each cluster it belongs to, and determine the probability that the plastic sample belongs to the cluster according to the distance; After the clustering is completed, calculate the within-class scatter and between-class scatter.

[0039] In S1, the number of samples of each type of plastic is known. For example, there are 10 PP-type plastics in the samples. Calculate the average value or median of the reflectance of each type of plastic sample at a candidate wavelength, and use the average value or median as the central value of this type of plastic at the candidate wavelength. For each central value, calculate the Euclidean distance or Manhattan distance from the reflectance of each plastic sample at the candidate wavelength to the central value, sort the plastic samples in ascending order of the distance, and divide the several plastic samples with the closest distance into one cluster. The number of clusters is the same as the number of plastic types, and the number of elements in each cluster is the same as the number of samples belonging to this cluster in the samples. Since a plastic sample may be assigned to multiple clusters, calculate the probability that it belongs to each cluster. The probability can be calculated according to the reciprocal of the distance, the Gaussian function, etc. The closer the distance, the higher the probability. After the clustering is completed, calculate the within-class scatter and between-class scatter.

[0040] Among them, the calculation of the within-class scatter and between-class scatter is specifically: For each cluster, calculate the square of the distance from the reflectance of each plastic sample to the central value, and multiply the square of the distance by the probability that the plastic sample belongs to the cluster corresponding to the central value to obtain the contribution value of the plastic sample in the cluster to which it belongs; sum up all the contribution values of all clusters to obtain the within-class scatter. For each cluster, calculate the square of the distance from the central value corresponding to the cluster to the global average, and multiply the square of the distance by the probability weighting value of the plastic samples belonging to the cluster in the cluster to obtain the contribution degree of the cluster; sum up the contribution degrees of all clusters to obtain the between-class scatter.

[0041] Among them, the specific calculation method of the probability weighting value is: add up the probabilities of all plastic samples belonging to the cluster.

[0042] The within-class scatter reflects the degree of dispersion of sample points within the same clustering cluster. The smaller the within-class scatter, the more similar the reflectances of plastic samples of the same category are at this wavelength, and the better the clustering effect. For each cluster, calculate the within-class scatter of each clustering cluster separately. Specifically, for each plastic sample within a cluster, calculate the square of the distance between its reflectance at the candidate wavelength and the central value of the cluster, and multiply the square of the distance of each sample by the probability that the sample belongs to the cluster, and the probability is the one calculated in the previous clustering analysis. Then, sum up all the weighted contribution values of all clusters to obtain the total within-class scatter.

[0043] The between-class scatter reflects the degree of dispersion between different clustering clusters. The larger the between-class scatter, the greater the difference in reflectances of plastic samples of different categories at this wavelength, and the better the clustering effect. Specifically, for a cluster, calculate the square of the distance from the central value of the cluster to the global average of the reflectances of all samples at this wavelength, where the global average refers to the average of the reflectances of all plastic samples at this wavelength, and multiply the square of the distance by the probability weighting value of the cluster, and the probability weighting value refers to the sum of the probabilities of all plastic samples belonging to the cluster. For example, if a cluster has 3 samples, and their probabilities of belonging to the cluster are 0.8, 0.9, and 0.7 respectively, then the probability weighting value of the cluster is 2.4. Sum up the weighted contribution degrees of all clusters to obtain the total between-class scatter.

[0044] After obtaining the within-class scatter and the between-class scatter, further determine the characteristic wavelength. In one embodiment, determining the characteristic wavelength from the candidate wavelengths according to the within-class scatter, the between-class scatter, and the cumulative sum is specifically as follows: Normalize the within-class scatter and the between-class scatter of all candidate wavelengths, and normalize the cumulative sum of all candidate wavelengths; Calculate the weighted sum of the between-class scatter and the cumulative sum, and subtract the result of the weighted sum from the within-class scatter to obtain the characteristic value of the candidate wavelength; Sort the candidate wavelengths in ascending order of the eigenvalue, and select the top k candidate wavelengths with the smallest eigenvalues as the characteristic wavelengths, where k is a positive integer.

[0045] In one embodiment, the within-class scatter, between-class scatter, and cumulative sum of all candidate wavelengths are normalized separately, or the within-class scatter and between-class scatter of all candidate wavelengths are normalized as a whole, and the cumulative sum is normalized as a whole. The normalized between-class scatter and cumulative sum are weighted and added together, and a weight needs to be preset in advance to balance the importance of the between-class scatter and the cumulative sum. Then, subtract the result of the above weighted addition from the normalized within-class scatter to obtain the eigenvalue of the candidate wavelength; in another alternative embodiment, the eigenvalue of the candidate wavelength is: a1 * between-class scatter - a2 * within-class scatter - a3 * cumulative sum, where a1, a2, and a3 are weights. After calculating the eigenvalues of all candidate wavelengths, sort the candidate wavelengths in ascending order of the eigenvalue. The smaller the eigenvalue, the more important the wavelength. Select the top k candidate wavelengths as the final characteristic wavelengths. k is a positive integer representing the number of characteristic wavelengths, and the specific value of k can be set according to actual needs.

[0046] In the second embodiment of the present invention, a recyclable plastic classification system is provided, and the system includes: A sample collection module, configured to collect the hyperspectral curves of plastic samples of a preset type, sample the hyperspectral curves to obtain the hyperspectral vectors of the plastic samples, each element in the hyperspectral vector corresponds to a wavelength, and use the plastic type as the annotation of the hyperspectral curve; A candidate wavelength determination module, configured to calculate eigenvalues and eigenvectors by using principal component analysis, and obtain candidate wavelengths and the cumulative sum corresponding to the candidate wavelengths according to the eigenvalues and eigenvectors; A characteristic wavelength determination module, configured to cluster the reflectance corresponding to each candidate wavelength into a preset number of types to obtain the within-class scatter and between-class scatter of each candidate wavelength, and determine the characteristic wavelength from the candidate wavelengths according to the within-class scatter, between-class scatter, and the cumulative sum; A classification module, configured to collect the hyperspectral image of the recyclable plastic according to the characteristic wavelength; input the hyperspectral image into a target recognition model to obtain the type of the recyclable plastic, and classify the recyclable plastic according to the type.

[0047] Preferably, the obtaining of the candidate wavelengths and the cumulative sum corresponding to the candidate wavelengths according to the eigenvalues and eigenvectors is specifically: Calculate the average value of each eigenvector, add the indices of the elements in the eigenvector that are greater than the average value to a set, calculate the intersection of the sets of the first preset number of eigenvalues, calculate the sum of the products of the values of each element in the intersection in the eigenvectors corresponding to the first preset number of eigenvalues and the eigenvalues, and use the wavelengths in the hyperspectral vector that have the same indices as those in the intersection as candidate wavelengths.

[0048] Preferably, before calculating the intersection of the sets of the first preset number of eigenvalues, it further includes: Sort the eigenvalues in descending order of the eigenvalue magnitude.

[0049] Preferably, clustering the reflectivities corresponding to each candidate wavelength into a preset number of categories to obtain the within-class scatter and between-class scatter of each candidate wavelength, specifically: Obtain the number of each type of plastic sample and the central value of the reflectivity of the candidate wavelength, and establish the corresponding relationship between the central value, the type of plastic, and the number of samples; For each central value, calculate the distance from the reflectivity of each plastic sample at the candidate wavelength to the central value, sort the plastic samples in ascending order of the distance, and divide the first-mentioned number of plastic samples into one cluster; If a plastic sample belongs to only one cluster, the probability that the plastic sample belongs to the cluster is 1, otherwise, calculate the distances from the plastic sample to each cluster it belongs to, and determine the probability that the plastic sample belongs to the cluster according to the distances; After the clustering is completed, calculate the within-class scatter and between-class scatter.

[0050] Preferably, calculating the within-class scatter and between-class scatter, specifically: For each cluster, calculate the square of the distance from the reflectivity of each plastic sample to the central value, multiply the square of the distance by the probability that the plastic sample belongs to the cluster corresponding to the central value to obtain the contribution value of the plastic sample in the cluster it belongs to; add up all the contribution values of all clusters to obtain the within-class scatter; For each cluster, calculate the square of the distance from the central value corresponding to the cluster to the global average, multiply the square of the distance by the probability weighting value of the plastic samples in the cluster belonging to the cluster to obtain the contribution degree of the cluster; add up the contribution degrees of all clusters to obtain the between-class scatter.

[0051] Preferably, the specific calculation method of the probability weighting value is: adding up the probabilities of all plastic samples belonging to the cluster.

[0052] Preferably, determining the characteristic wavelength from the candidate wavelengths according to the within-class scatter, the between-class scatter, and the sum, specifically: Normalize the within-class scatter and the between-class scatter of all candidate wavelengths, and normalize the sum of all candidate wavelengths; Calculate the between-class scatter and add it to the cumulative sum weighted, and subtract the result of the weighted addition from the within-class scatter to obtain the eigenvalue of the candidate wavelength; Sort the candidate wavelengths in ascending order of eigenvalues, and select the top k candidate wavelengths as the characteristic wavelengths, where k is a positive integer.

[0053] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of adding a necessary general hardware platform, and of course, it can also be implemented by a combination of hardware and software. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a computer product. The present invention can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.

[0054] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than limiting it, and other embodiments can also be adopted; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for classifying recyclable plastics, characterized in that: The method comprises: Collecting hyperspectral curves of preset types of plastic samples, sampling the hyperspectral curves to obtain hyperspectral vectors of the plastic samples, each element in the hyperspectral vector corresponds to a wavelength, and the type of plastic is used as a label of the hyperspectral curve; The principal component analysis is used to calculate the eigenvalues ​​and eigenvectors, and the candidate wavelengths and the cumulative sums corresponding to the candidate wavelengths are obtained according to the eigenvalues ​​and eigenvectors; Clustering the reflectivity corresponding to each candidate wavelength into a preset number of categories to obtain an intra-class dispersion and an inter-class dispersion of each candidate wavelength, and determining a characteristic wavelength from the candidate wavelengths according to the intra-class dispersion and the inter-class dispersion and the cumulative sum; A hyperspectral image of recyclable plastics is collected according to characteristic wavelengths; the hyperspectral image is input into a target recognition model to obtain the type of recyclable plastics, and the recyclable plastics are classified according to the type.

2. The method according to claim 1, characterized in that The candidate wavelengths and the cumulative sums corresponding to the candidate wavelengths are obtained according to the eigenvalues ​​and eigenvectors, specifically: Calculate the average value of each eigenvector, and add the sequence numbers of the elements in the eigenvector that are greater than the average value to the set, calculate the intersection of the sets of the preset eigenvalues, calculate the cumulative sum of the value in the eigenvector corresponding to the preset eigenvalues ​​of each element in the intersection and the product of the eigenvalue, and take the wavelengths with the same sequence numbers in the hyperspectral vector and the intersection as candidate wavelengths.

3. The method according to claim 2, characterized in that Before the intersection of the set of the preset feature values ​​before the calculation, the method further includes: Sort the eigenvalues ​​in descending order.

4. The method according to claim 1, characterized in that The reflectivity corresponding to each candidate wavelength is clustered into a preset number of categories to obtain the intra-category dispersion and inter-category dispersion of each candidate wavelength, specifically: Obtain the number of each plastic sample and the central value of the reflectivity of the candidate wavelength, and establish a corresponding relationship between the central value and the type of plastic and the number of samples; For each center value, calculate the distance from the reflectivity of each plastic sample at the candidate wavelength to the center value, sort the plastic samples in ascending order of distance, and divide the plastic samples with the aforementioned number of samples into one cluster; If a plastic sample belongs to only one cluster, the probability that the plastic sample belongs to the cluster is 1; otherwise, the distance from the plastic sample to each cluster to which it belongs is calculated, and the probability that the plastic sample belongs to the cluster is determined based on the distance; After clustering is completed, the within-class spread and between-class spread are calculated.

5. The method according to claim 4, characterized in that The calculation of the intra-class scatter and the inter-class scatter is specifically as follows: For each cluster, the square of the distance from the reflectivity of each plastic sample to the central value is calculated, and the square of the distance is multiplied by the probability that the plastic sample belongs to the cluster corresponding to the central value to obtain the contribution value of the plastic sample in the cluster to which it belongs; all contribution values ​​of all clusters are added together to obtain the intra-class dispersion; For each cluster, the square of the distance from the center value corresponding to the cluster to the global average is calculated, and the square of the distance is multiplied by the probability weighted value of the plastic sample in the cluster belonging to the cluster to obtain the cluster contribution; the contribution of all clusters is added together to obtain the inter-class dispersion.

6. The method according to claim 5, characterized in that The specific calculation method of the probability weighted value is: add the probabilities of all plastic samples belonging to the cluster.

7. The method according to claim 1, characterized in that The determining of the characteristic wavelength from the candidate wavelengths according to the intra-class scatter and the inter-class scatter and the cumulative sum is specifically: Normalizing the intra-class scatter and the inter-class scatter of all candidate wavelengths, and summing and normalizing all candidate wavelengths; Calculate the inter-class scatter and the accumulated sum and perform weighted addition, and obtain the characteristic value of the candidate wavelength by subtracting the result of the weighted addition from the intra-class scatter; The candidate wavelengths are sorted in ascending order of characteristic values, and the top k candidate wavelengths are selected as characteristic wavelengths, where k is a positive integer.

8. A recyclable plastic sorting system, characterized in that: The system comprises: A sample collection module is used to collect hyperspectral curves of preset types of plastic samples, sample the hyperspectral curves to obtain hyperspectral vectors of the plastic samples, each element in the hyperspectral vector corresponds to a wavelength, and use the type of plastic as a label for the hyperspectral curve; A candidate wavelength determination module is used to obtain eigenvalues ​​and eigenvectors by principal component analysis, and obtain candidate wavelengths and cumulative sums corresponding to the candidate wavelengths according to the eigenvalues ​​and eigenvectors; A characteristic wavelength determination module, used for clustering the reflectivity corresponding to each candidate wavelength into a preset number of categories to obtain the intra-class dispersion and inter-class dispersion of each candidate wavelength, and determining the characteristic wavelength from the candidate wavelengths according to the intra-class dispersion and inter-class dispersion and the cumulative sum; The classification module is used to collect hyperspectral images of recyclable plastics according to characteristic wavelengths; the hyperspectral images are input into the target recognition model to obtain the types of recyclable plastics, and the recyclable plastics are classified according to the types.

9. The system according to claim 8, characterized in that The candidate wavelengths and the cumulative sums corresponding to the candidate wavelengths are obtained according to the eigenvalues ​​and eigenvectors, specifically: Calculate the average value of each eigenvector, and add the sequence numbers of the elements in the eigenvector that are greater than the average value to the set, calculate the intersection of the sets of the preset eigenvalues, calculate the cumulative sum of the value in the eigenvector corresponding to the preset eigenvalues ​​of each element in the intersection and the product of the eigenvalue, and take the wavelengths with the same sequence numbers in the hyperspectral vector and the intersection as candidate wavelengths.

10. The system according to claim 8, characterized in that The reflectivity corresponding to each candidate wavelength is clustered into a preset number of categories to obtain the intra-category dispersion and inter-category dispersion of each candidate wavelength, specifically: Obtain the number of each plastic sample and the central value of the reflectivity of the candidate wavelength, and establish a corresponding relationship between the central value and the type of plastic and the number of samples; For each center value, calculate the distance from the reflectivity of each plastic sample at the candidate wavelength to the center value, sort the plastic samples in ascending order of distance, and divide the plastic samples with the aforementioned number of samples into one cluster; If a plastic sample belongs to only one cluster, the probability that the plastic sample belongs to the cluster is 1; otherwise, the distance from the plastic sample to each cluster to which it belongs is calculated, and the probability that the plastic sample belongs to the cluster is determined based on the distance; After clustering is completed, the within-class spread and between-class spread are calculated.