A plastic material classification method based on gaussian multispectral simulation
By using mean-block compression, recursive feature elimination, and Kruskal-Wallis test to select four characteristic wavelengths, a Gaussian multispectral channel was constructed, which solved the problems of hyperspectral data redundancy and large computational load, and achieved high-precision and low-cost classification of plastic materials.
Patent Information
- Application Number
- CN202611685648.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-29
- Publication Date
- 2026-11-24
AI Technical Summary
Existing technologies struggle to achieve high-precision, low-cost, and real-time classification of plastic materials, especially in their insufficient ability to identify different materials of the same color. Furthermore, hyperspectral data processing suffers from high redundancy and computational demands, making it unsuitable for industrial online sorting scenarios.
The mean block compression algorithm, recursive feature elimination algorithm, and Kruskal-Wallis statistical test combined with random forest are used for band screening to construct Gaussian multispectral channels and screen out four characteristic wavelengths to achieve accurate classification of plastic materials.
It achieves high-precision identification of 11 types of plastic materials, reduces data dimensionality and computational load, adapts to real-time industrial detection, reduces hardware and maintenance costs, and minimizes loss of identification accuracy.
Smart Images

Figure CN123160977A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of hyperspectral data processing technology, and in particular to a method for classifying plastic materials based on Gaussian multispectral simulation. Background Technology
[0002] Plastics, with their lightweight, high strength, corrosion resistance, and excellent cost-effectiveness, are widely used in many fields such as industrial manufacturing, food packaging, daily consumer goods, and precision components. Among them, PET, PE, PP, PS, PVC, ABS, PC, PA, PMMA, POM, and PETG are the eleven types of plastics that are currently the most widely used and prevalent materials in both industrial and civilian sectors. Different plastic materials vary greatly in their molecular structure, physicochemical properties, recycling value, and applicable scenarios. Therefore, achieving rapid, accurate, and automated sorting of multiple types of plastics is the core technological foundation for the resource-based recycling of waste plastics, quality control of plastic products, and the implementation of intelligent sorting production lines.
[0003] Currently, the mainstream plastic sorting and testing technologies in the industry are mainly divided into four categories: manual visual sorting, traditional machine vision inspection, single-point near-infrared spectroscopy inspection, and hyperspectral and band screening inspection. All existing technologies have significant shortcomings and are difficult to meet the industrial requirements for high-precision, high-efficiency, and high-stability sorting and testing. The specific technical solutions and their shortcomings are as follows:
[0004] 1. Manual visual sorting: This method relies on human observation of the color, appearance, texture, and other superficial characteristics of plastics to differentiate them. Its core drawbacks are low automation, high labor costs, inability to distinguish between "same color, different material" plastics with highly identical appearances, a high misjudgment rate, and a lack of standardized sorting accuracy.
[0005] 2. Traditional RGB machine vision inspection: This method uses industrial cameras to capture RGB images of plastic surfaces and relies on surface features such as color and texture for classification. Its drawbacks include a single recognition dimension, inability to detect internal molecular structure information, inability to resolve the "same color, different material" problem, and even the possibility of misclassifying "same type, different color" cases. Both recognition stability and accuracy need improvement.
[0006] 3. Single-point near-infrared spectroscopy detection: This method collects the near-infrared spectrum of a single point on the plastic for material identification, which is an improvement over visual inspection. However, its drawbacks include a high reliance on human experience in selecting the detection band, which is highly subjective, lacks a unified standard, and has poor reproducibility. Furthermore, it only extracts features from a single or a small number of bands, resulting in limited spectral information and a weak ability to distinguish between plastics with similar spectra, making it difficult to achieve accurate classification of the eleven categories of plastics.
[0007] 4. Hyperspectral and Band Screening Detection: Hyperspectral detection has the advantage of combining image and spectrum, and can collect hundreds of continuous narrow-band spectral data, theoretically offering the best recognition potential. However, raw hyperspectral data has high redundancy, with single-pixel features reaching hundreds of dimensions, resulting in huge computational demands, poor real-time performance, and susceptibility to overfitting, making it unsuitable for online sorting scenarios. To alleviate these problems, some studies have attempted to compress hyperspectral data into a limited number of feature bands for plastic identification through band screening. However, existing methods typically select only 8-15 bands, limiting hardware cost reduction; furthermore, the distinguishable plastic categories are mostly limited to 5-8 types, resulting in insufficient accuracy for mixed identification scenarios involving engineering plastics such as PA, PC, POM, PMMA, and PETG, as well as specialty plastics.
[0008] For example, Chinese Patent Application Publication No. CN117708719A, published on March 15, 2024, discloses a near-infrared hyperspectral plastic sorting system and method based on band number constraints. By collecting waste plastic samples and corresponding hyperspectral data, a cosine similarity algorithm is used to adaptively label target plastics one by one, constructing a waste plastic sample library. The PLS-DA method is then used for classification. Furthermore, a constraint is set to limit the number of feature variables extracted by the SPAsa algorithm within a specified range. Within this limit, eight feature wavelengths are optimally extracted from 256 wavelengths of near-infrared full-spectrum data of plastics. After applying the established SPAsa-PLS-DA model to plastic sorting, the processing time required to process one frame of data is significantly reduced while maintaining sorting accuracy, thereby further improving the speed of plastic sorting.
[0009] However, the screening process in these technical solutions suffers from "lack of physical meaning" and "overfitting risk" due to the bias of a single algorithm or pure data-driven approach. Existing technologies (such as ReliefF-RFE) rely solely on statistical data for screening, and the selected bands may only be mathematically optimal solutions, but lack clear physical support from molecular vibrational spectra. Furthermore, they are susceptible to noise interference in the training set, which can lead to a collapse in the model's generalization ability. Summary of the Invention
[0010] To address the shortcomings of existing technologies, this invention discloses a plastic material classification method based on Gaussian multispectral simulation, comprising:
[0011] S1: Obtain the hyperspectral reflectance data of the sample;
[0012] S2: Using pre-set sample label data, the hyperspectral reflectance data is cleaned accordingly, and invalid and abnormal samples are removed to obtain the first plastic spectral dataset.
[0013] S3: The first plastic spectral dataset is preprocessed by the mean block compression algorithm to obtain the dimensionality-reduced spectral matrix;
[0014] S4: The reduced spectral matrix is subjected to several rounds of adaptive band filtering using a random forest combined with a recursive feature elimination algorithm to obtain the feature bands;
[0015] S5: Perform a spectral response difference significance check on the characteristic bands to obtain the optimal set of characteristic wavelengths;
[0016] S6: Perform normalized Gaussian multispectral channel simulation on the optimal characteristic wavelength set to obtain the multispectral feature matrix;
[0017] S7: Input the multispectral feature matrix into the pre-trained model to obtain the two-dimensional classification result image.
[0018] This solution employs a three-tiered progressive band selection architecture: "mean block physical dimensionality reduction + recursive feature elimination machine optimization + statistical verification." It abandons the traditional, extensive manual experience-based band selection method and achieves a standardized selection process driven by data and free from subjective intervention. Furthermore, it combines Gaussian multispectral channel simulation to transform highly redundant, high-dimensional spectral data into low-dimensional simulated multispectral features, thus solving the problems of strong subjectivity, poor physical interpretation, and inefficient high-dimensional data computation in traditional methods.
[0019] Optionally, in step S5, the spectral response difference of the characteristic bands is verified, and N optimal characteristic wavelengths are selected to form the set of optimal characteristic wavelengths, N being less than or equal to 5.
[0020] This solution achieves extreme compression of hyperspectral feature dimensions by strictly controlling the number of characteristic wavelengths to five or less, while ensuring that the spectral distinction of various plastic materials is not significantly lost.
[0021] Optionally, in step S5, the spectral response difference of the characteristic bands is verified to obtain four optimal characteristic wavelengths.
[0022] This scheme precisely limits the number of characteristic bands to four, achieving the optimal balance between "information completeness" and "ultimate data compression" after a three-layer progressive selection process. The four characteristic wavelengths are orthogonal and complementary, jointly constructing a complete spectral fingerprint covering the structural differences of eleven types of plastics. Compared to traditional 8-15 band schemes, the 4-channel design minimizes the theoretical upper limit of the data dimension for subsequent Gaussian simulation multispectral data, allowing for seamless integration with the most economical and mature four-channel industrial multispectral cameras on the market. This significantly reduces filter costs, imaging unit costs, and data bandwidth overhead from the hardware perspective.
[0023] Optionally, in step S5, the spectral response difference of the characteristic bands is checked to obtain the optimal characteristic wavelengths as {955nm, 1149nm, 1432nm, 1675nm}.
[0024] Each of the four characteristic wavelengths mentioned above has a clear and irreplaceable physical meaning in molecular vibrational spectroscopy: 955nm is sensitive to differences in hydrogen bonds and end groups in materials such as PET, PP, and PVC; 1149nm accurately responds to differences in the methyl / methylene / methoxyl ratios in the hydrocarbon structures of different plastics; 1432nm enhances the spectral discrimination of oxygen-containing polymers such as POM and PETG containing ester groups and ether bonds; and 1675nm is sensitive to changes in the molecular environment of engineering plastics (such as PVC, ABS, and PC) containing chlorine, nitrogen, and benzene ring heteroatoms. The four wavelengths work together to form a characteristic combination of "orthogonal sensitivity and complementary information across bands," endowing this scheme with a powerful ability to distinguish between different materials of the same color from the underlying principles of molecular spectroscopy.
[0025] Optionally, in step S1, a ground-based acquisition method is used to obtain hyperspectral reflectance data of the sample in the 900–1700 nm near-infrared band.
[0026] This scheme limits the near-infrared band to 900–1700 nm, which covers the first, second, and combination frequency characteristic absorption regions of major organic groups such as CH, OH, and NH in plastic molecules. This allows for the full capture of the differentiated spectral response information at the molecular structure level of eleven types of plastics. The ground-based acquisition method closely matches the actual deployment conditions of industrial production lines, resulting in stable reflectance data with a high signal-to-noise ratio. Furthermore, this band falls within the optimal response range of commonly used InGaAs detectors and is highly compatible with the sensing windows of mainstream industrial-grade near-infrared multispectral / hyperspectral imaging equipment. This lays the hardware foundation for the seamless migration of subsequent laboratory algorithm results to real-time production line detection systems.
[0027] Optionally, in step S2, the pre-set sample label data includes label data for polyethylene terephthalate, polyethylene, polypropylene, polystyrene, polyvinyl chloride, acrylonitrile-butadiene-styrene copolymer, polycarbonate, polyamide / nylon, polymethyl methacrylate, polyoxymethylene, and ethylene glycol-modified polyethylene terephthalate.
[0028] This solution's labeling system comprehensively covers eleven mainstream plastic materials with the largest usage and widest application in current industrial and civilian fields. It includes general-purpose bulk plastics such as PE, PP, and PET, as well as engineering and specialty plastics with complex molecular structures, similar spectral characteristics, and difficulty in differentiation using traditional methods, such as PA, PC, POM, and PETG. This multi-category labeling system ensures the comprehensiveness and representativeness of the constructed dataset, enabling the final trained classification model to have sufficient category coverage in real-world, complex mixed plastic sorting scenarios. It can effectively address the diverse industrial needs in waste plastic recycling, production line quality inspection, and other similar scenarios.
[0029] Optionally, in step S2, the invalid abnormal samples include invalid abnormal samples containing null values and invalid abnormal samples containing infinite values.
[0030] During the acquisition and storage of hyperspectral data, due to sensor anomalies, calibration deviations, or data transmission loss, bad pixels and anomalous pixels containing null values (NaN) or infinite values (Inf) are inevitably introduced. This solution rigorously cleans and removes these invalid and anomalous samples during the dataset construction phase, ensuring the numerical validity and statistical reliability of the spectral dataset from the data source. This effectively avoids the contamination and interference of anomalous samples on subsequent mean block fusion, RFE feature importance ranking, and Kruskal-Wallis statistical test results, significantly improving the robustness of the entire three-layer screening process and the generalization ability of the final classification model.
[0031] Optionally, in step S3, the mean block compression algorithm is specifically as follows:
[0032] Set the block compression step size s, divide the first plastic spectral dataset into blocks of s adjacent bands, and perform mean fusion on the i-th sample and the k-th fusion band. The fusion formula is as follows:
[0033] ;
[0034] This is a reduced-dimensional spectral matrix. Offset within the block .
[0035] This mean-based block compression formula, based on defined mathematical rules, fuses the spectral reflectance of adjacent bands using a sliding mean with a fixed step size. The principle is simple and computationally efficient. By merging redundant adjacent bands with similar spectral response trends into a single fused band, this formula achieves structured physical dimensionality reduction of high-dimensional spectral data while preserving the subtle differences in molecular spectral fingerprints among eleven types of plastic materials to the greatest extent possible. This operation does not rely on any empirical parameters or manual intervention, has a very high degree of standardization, and effectively dilutes high-frequency random noise in the original data. This results in a higher signal-to-noise ratio and more reliable feature importance ranking in the subsequent RFE machine optimization stage, physically suppressing the overfitting risk of high-dimensional modeling.
[0036] Optionally, the compression step size s=2, and the first plastic spectral dataset is divided into blocks according to every 2 adjacent bands.
[0037] Setting the step size 's' precisely to 2 is the optimal compression granularity experimentally verified for densely sampled spectra in the 900–1700 nm band. With a step size of 2, the spectral center wavelength interval between two adjacent fused bands maintains an optimal match with the original instrument sampling interval. This effectively eliminates feature redundancy caused by high correlation between adjacent bands, while avoiding blurring of subtle differential spectral absorption peaks between engineering plastics due to excessive compression. This parameter setting ensures that the fused bands after dimensionality reduction represent local spectral trends while retaining sufficient fine structural information, making it a key parameter configuration for ensuring that the first layer of physical dimensionality reduction does not lose effective classification information.
[0038] Optionally, in step S7, the training set of the pre-trained model includes a training set and a test set. The three-dimensional multispectral feature matrix and the corresponding label vector y are divided into the training set and the test set according to a preset ratio using stratified sampling.
[0039] A stratified sampling strategy was introduced before model training to ensure that the proportion of each type of plastic sample in the training and test sets remained consistent with the proportion of that category in the original dataset. This operation fundamentally avoids the problem of class distribution imbalance caused by random sampling—for example, when the sample size of a certain type of engineering plastic is small, it may all fall into the test set, resulting in a lack of training samples, or all fall into the training set, resulting in a lack of generalization validation. Stratified sampling effectively ensures that the model can obtain sufficient training representation and fair accuracy evaluation for each type of plastic, making the recognition accuracy of the final report reliable and reproducible, and providing a scientific statistical confidence basis for the industrial field deployment of the model.
[0040] Optionally, in step S7, stratified sampling is used to divide the three-dimensional multispectral feature matrix and the corresponding label vector y into the training set and the test set in a 7:3 ratio.
[0041] The 7:3 split ratio represents the optimal balance between sample size and model generalization ability established in this scheme. The 70% training set provides the RBF-SVM model with ample information on the distribution of samples across all categories, enabling the decision boundary to fully learn the complex nonlinear differentiation patterns of the eleven plastic categories in the multispectral feature space. The 30% test set, while retaining sufficient statistical test samples, avoids overfitting and evaluation distortion caused by excessive test samples. This ratio ensures that the statistical confidence levels of accuracy evaluation indicators such as classification OA and Kappa coefficient meet industrial quality inspection standards, while also exhibiting good classification stability and comparability across different batches of data.
[0042] Optionally, in step S7, before generating the training set of the pre-trained model, the sample features of the three-dimensional multispectral feature matrix are standardized:
[0043] ;
[0044] The mean of the features in the training set;
[0045] The standard deviation of the training set features;
[0046] x represents the original eigenvalues of the three-dimensional multispectral feature matrix;
[0047] These are the standardized feature values.
[0048] Since the four Gaussian simulation channels originate from different characteristic wavelength ranges, their reflectance values and amplitude ranges naturally differ. This invention employs a standard score normalization method based on the training set mean and standard deviation to uniformly map all channel features to a numerical distribution space of consistent magnitude. This eliminates the dominant interference of feature dimension differences on the distance metric calculation of the SVM kernel function, enabling the RBF kernel function to equally consider the spectral distinguishing contribution of each channel.
[0049] Meanwhile, standardization based solely on training set statistical parameters aligns with real-world deployment scenarios—when new samples enter the production line, transformation is accomplished solely using offline-saved training set parameters, ensuring the consistency of model inference logic and significantly improving the stability and maintainability of real-time industrial prediction.
[0050] The beneficial effects of this invention are:
[0051] 1. Strong anti-interference ability, capable of accurately identifying similar plastics.
[0052] This invention identifies materials based on the inherent spectral characteristics of plastic molecules in the near-infrared band, overcoming the limitations of traditional visual technologies that rely on color, texture, and morphology. It is completely unaffected by external factors such as plastic dyeing and appearance. It can effectively distinguish between plastics of the same color, transparent plastics, and plastics with similar appearances that are difficult to differentiate with the naked eye, fundamentally solving the problem of misclassification due to "different materials of the same color," and significantly improving the reliability of identification under complex working conditions.
[0053] 2. Extremely high band efficiency; only 4 bands are needed to accurately identify 11 types of plastics.
[0054] This invention employs a three-layer progressive standardized screening mechanism to precisely identify only four core characteristic wavelengths from hundreds of original hyperspectral bands, enabling high-precision differentiation of 11 mainstream plastics, including PET, PE, PP, PS, PVC, ABS, PC, PA, PMMA, POM, and PETG, as well as background regions. Each characteristic band has a clear molecular spectral physical meaning, and the band utilization efficiency far exceeds that of existing technologies.
[0055] 3. Significantly reduced data dimensionality and improved overall detection speed, adapting to real-time industrial scenarios.
[0056] Taking a 542×801 resolution image as an example, the original full-band hyperspectral image requires a storage size of up to 370.97 MB, while the 4-channel Gaussian multispectral image of this invention requires only 6.62 MB, achieving a storage space compression rate of 98.21%, and the data volume is only 1.79% of the original hyperspectral image. This drastic reduction in data volume greatly alleviates the storage pressure on the device and the bandwidth requirements for on-site data transmission, easily adapting to 100 Mbps networks and embedded edge devices, meeting the speed requirements of real-time industrial detection.
[0057] 4. High recognition accuracy: Overall classification accuracy (OA) reaches 98.63% for 11 types of plastics.
[0058] This invention achieves high-precision differentiation between 11 mainstream plastics and background regions by constructing a stratified sampling dataset, standardizing preprocessing, and optimizing the RBF-SVM model. The overall classification accuracy (OA) reaches 98.63%, and the Kappa coefficient reaches 0.9835. Compared with full-band hyperspectral imaging (OA=99.76%), the accuracy loss is only about 1.13% while compressing the feature dimension by 98.21%. This achieves significant engineering benefits with minimal accuracy sacrifice, fully meeting the accuracy standards for industrial sorting and online quality inspection.
[0059] 5. It can directly interface with industrial multispectral hardware, making it highly practical and cost-effective.
[0060] The 4-channel narrowband spectrum obtained by simulation in this invention perfectly matches the imaging mechanism of industrial narrowband multispectral cameras. In the industrial mass production stage, there is no need to collect, transmit, or store massive amounts of hyperspectral data; real-time imaging and detection can be achieved directly using a low-cost four-channel multispectral camera. This significantly reduces equipment costs, computing power costs, and maintenance costs from the hardware source, balancing high precision and cost-effectiveness, and possesses strong industrial application capabilities. Attached Figure Description
[0061] Figure 1 This is a flowchart illustrating one embodiment of the present application;
[0062] Figure 2 The spectral curves of eleven plastics in the embodiments of this application are shown below.
[0063] Figure 3 This is a schematic diagram of the Gaussian multispectral channel response curve in the embodiments of this application;
[0064] Figure 4 This is a schematic diagram showing the comparison of the effects of plastic sample testing before and after in the embodiments of this application;
[0065] Figure 5 This is the classification confusion matrix for plastic samples in the embodiments of this application. Detailed Implementation
[0066] To enable those skilled in the art to better understand the present invention, the technical solutions in the specific embodiments of the present invention will be clearly and completely described below.
[0067] This invention discloses a method for accurate classification of multiple categories of plastic materials based on Gaussian multispectral simulation. Relying on 900–1700nm near-infrared ground-based hyperspectral reflectance data, it accurately covers the identification scenarios of eleven mainstream plastic materials and background areas, including PET (polyethylene terephthalate), PE (polyethylene), PP (polypropylene), PS (polystyrene), PVC (polyvinyl chloride), ABS (acrylonitrile-butadiene-styrene copolymer), PC (polycarbonate), PA (polyamide / nylon), PMMA (polymethyl methacrylate / plexiglass), POM (polyoxymethylene), and PETG (ethylene glycol-modified polyethylene terephthalate).
[0068] like Figures 1 to 5 As shown, it includes:
[0069] S1. Hyperspectral Data Acquisition and Reading
[0070] Ground-based acquisition was used to obtain hyperspectral reflectance data of samples in the 900–1700 nm near-infrared band. The image size was defined as H rows × W columns × B bands, where H is the image height, W is the image width, and B is the total number of original hyperspectral bands. The three-dimensional hyperspectral image cube was flattened into a two-dimensional pixel spectral matrix. The total number of pixels in the image satisfies N=H×W. After acquisition, the hyperspectral three-dimensional data cube is read, and basic parameters such as image height, width, total number of bands, and center wavelength of each band are accurately extracted, providing complete and effective raw data support for subsequent band selection, spectral channel simulation, and feature calculation.
[0071] S2. Sample Extraction and Dataset Construction
[0072] Import pre-labeled sample data, totaling 12 categories, including background regions and eleven mainstream plastic materials: PET (polyethylene terephthalate), PE (polyethylene), PP (polypropylene), PS (polystyrene), PVC (polyvinyl chloride), ABS (acrylonitrile-butadiene-styrene copolymer), PC (polycarbonate), PA (polyamide / nylon), PMMA (polymethyl methacrylate / plexiglass), POM (polyoxymethylene), and PETG (ethylene glycol-modified polyethylene terephthalate). Strictly extract corresponding spectral data according to the labeled regions, simultaneously clean the dataset, removing invalid and outlier samples containing null or infinite values, and count the number of valid samples in each category. Construct a multi-category plastic spectral dataset that is class-balanced, reliable, and contains valid samples, ensuring the accuracy and stability of subsequent model training from the data source.
[0073] S3, Optimal band selection and Gaussian multispectral channel simulation, data synthesis
[0074] This invention abandons the traditional, crude method of manual, subjective band selection and adopts a three-layer progressive standardized band selection mechanism: "mean block physical dimensionality reduction + recursive feature elimination machine optimization + Kruskal-Wallis statistical verification." This mechanism progressively advances through physical compression, machine learning optimization, and statistical testing, driven entirely by data and without human intervention. Ultimately, it precisely identifies four optimal feature bands from hundreds of original hyperspectral bands and constructs standardized Gaussian multispectral simulation channels based on these, transforming highly redundant hyperspectral data into a low-dimensional, highly discriminative four-channel multispectral dataset. The specific steps are as follows:
[0075] Step 1: Mean-based block physical dimensionality reduction.
[0076] To address the issue of dense high-spectral bands in the 900–1700 nm range and the high redundancy of spectral information in adjacent bands, a mean-based block compression algorithm is employed for physical dimensionality reduction preprocessing. Based on the continuous distribution characteristics of plastic molecular spectra, this method merges redundant adjacent bands with similar spectral response trends. While preserving the subtle differences in molecular spectral fingerprints among 11 types of plastic materials to the greatest extent possible, it achieves structured weight reduction of high-dimensional spectral data, effectively reducing subsequent computational load and suppressing the risk of overfitting in high-dimensional modeling.
[0077] Specific operation: Set the block compression step size s=2, and divide the original continuous bands into blocks of 2 adjacent bands. Perform mean fusion on the i-th sample and the k-th fused band, using the following formula:
[0078]
[0079] In the formula, This represents the spectral matrix after dimensionality reduction, and the total number of bands after dimensionality reduction. (Round down) to obtain a dimension-reduced spectral matrix with N rows × B' columns, providing a high-fidelity, low-redundancy, high-quality data foundation for subsequent accurate band selection.
[0080] Step 2: Recursive feature elimination and machine optimization.
[0081] Using all fused bands from the first step of dimensionality reduction as input features, and employing multi-class classification accuracy (11 types of plastics plus background) as the evaluation metric, an adaptive band selection algorithm combining random forest and recursive feature elimination (RFE) is used. After each training round, the feature importance weights of all candidate bands are output to quantitatively characterize the contribution of a single band to the classification of different plastic materials. Subsequently, interfering bands with low material differentiation contribution, large overlap in spectral responses, and easy classification confusion are eliminated round by round. The iterative process of "model training - weight ranking - band removal" is repeated until the number of remaining bands reaches a preset base. Finally, the compressed domain band index obtained from RFE screening is mapped back to the original hyperspectral band index, and a preset fixed reference band is added. After deduplication and sorting, a subset of candidate bands selected by machine learning is obtained.
[0082] This step uses a data-driven approach to enable machine-driven autonomous optimization, automatically selecting a subset of feature bands that are sensitive to mixed recognition scenarios involving multiple categories such as general plastics, engineering plastics, and transparent plastics.
[0083] Step 3: Kruskal-Wallis statistical verification and characteristic wavelength locking.
[0084] To address the issues of insufficient statistical basis and poor reproducibility in machine-selected bands, a Kruskal-Wallis multi-category nonparametric test is introduced to verify the significance of spectral response differences for each candidate band after the initial selection in the second step. This test quantifies the degree of difference in spectral distribution among different plastic materials in each band. By calculating the test statistic H and the corresponding p-value, it determines whether there are statistically significant differences in the spectral responses of each category. The formula for calculating the Kruskal-Wallis test statistic H is as follows:
[0085]
[0086] In the formula, This represents the total number of all plastic spectral samples. Total number of plastic material categories; subscript Representing the Class samples; For the first Number of samples of plastic-like substances; To uniformly sort all sample spectral response values, the first... The cumulative sum of the ranks of the samples in each class. Based on the obtained... The significance of the value can be obtained by comparing it with the chi-square distribution. Value, if If the spectral response is less than the preset significance level, it is considered that the spectral responses of different plastics in this band have significant distinguishing characteristics.
[0087] All candidate bands are sorted in ascending order of p-value, and the four core characteristic wavelengths with the best p-value and the most prominent spectral differences are selected to form the optimal characteristic wavelength set:
[0088]
[0089] Among them, 955nm is located in the OH / CH third harmonic region, and the reflectivity of various plastics in this band is significantly affected by molecular hydrogen bonds and end group content, and is sensitive to material differences of PET, PP and PVC; 1149nm is located in the CH bond second harmonic characteristic absorption region, and different plastics exhibit different absorption intensities due to different hydrocarbon structures (methyl / methylene / methoxyl ratio); 1432nm is located in the CH combination frequency and OH stretching vibration region, and has strong spectral discrimination for POM, PETG and oxygen-containing polymers containing ester / ether bonds; 1675nm is located in the CH first harmonic region, and is sensitive to changes in the molecular environment of engineering plastics such as PVC, ABS, and PC containing heteroatoms (Cl, N, benzene ring).
[0090] After determining the optimal characteristic bands, to simulate the imaging principle of an industrial narrowband multispectral camera and achieve lightweight compression of high-dimensional hyperspectral data, a standardized Gaussian multispectral channel simulation was conducted based on the optimal characteristic wavelength set. The full width at half maximum (FWHM) of the imaging channel was set to 10 nm, and the standard deviation of the Gaussian distribution was calculated.
[0091]
[0092] With each optimal characteristic wavelength Centered on, build a belt The Gaussian weighting function with truncation constraints effectively suppresses spectral noise interference in distant, irrelevant bands. Its function expression is as follows:
[0093]
[0094] In the formula, The center wavelengths of each band in the original hyperspectral image. This represents the normalized weighting coefficient for the corresponding band.
[0095] Single-channel spectral weighted fusion is performed based on Gaussian weighting to obtain simulated multispectral data. The calculation formula is as follows:
[0096]
[0097] Independent simulation channels were generated for each of the four core feature wavelengths. The four sets of one-dimensional simulation features were then stacked horizontally to obtain a lightweight multispectral feature matrix with dimensions of M rows × 4 columns. This enables the compression of hundreds of dimensions of hyperspectral data into four effective features, significantly reducing the computational overhead of subsequent classification models.
[0098] S4. Dataset Partitioning, Preprocessing, and Model Training
[0099] Using stratified sampling, the three-dimensional multispectral feature matrix is... The corresponding label vector y is divided into training and test sets in a 7:3 ratio. Stratified sampling can ensure that the proportion of various plastic samples in the training and test sets is consistent, avoiding model bias caused by sample distribution imbalance.
[0100] To eliminate the interference of differences in feature dimensions on the classification model, the sample features are standardized. The standardization formula is as follows:
[0101]
[0102] In the formula, The mean of the features in the training set. Let x be the standard deviation of the training set features, and x be the original feature values. These are the standardized feature values.
[0103] The RBF kernel support vector machine is selected as the classification model. The expression of the RBF kernel function is as follows:
[0104]
[0105] Model with fixed hyperparameters: penalty coefficient C=100, kernel function coefficients A fixed random seed ensures the reproducibility of model results. The model is fitted using a standardized training set, and then the trained model is used to predict test set samples to obtain the predicted labels for the test set. .
[0106] The model's recognition accuracy is quantified using both overall accuracy (OA) and the Kappa coefficient, calculated as follows:
[0107]
[0108]
[0109] In the formula, This represents the total number of test samples;
[0110] This is an indicator function; it takes a value of 1 if the predicted label matches the true label, and a value of 0 otherwise.
[0111] The expected consistency of categories is used to characterize the random error in classification.
[0112] After the model training is completed, the SVM classification model, feature normalizer, optimal feature wavelength array, and Gaussian distribution parameters are persistently saved. When performing image prediction in the future, there is no need to repeat the band selection and model training process, which greatly improves the detection efficiency.
[0113] S5. Global Pixel Classification and Result Output
[0114] The trained, optimal model is used to perform pixel-by-pixel fine-grained classification of the entire hyperspectral image, reconstructing a two-dimensional classification result image:
[0115]
[0116] It outputs visual classification maps and standard format classification files to achieve fully automatic and high-precision plastic material identification.
[0117] Experimental Results and Quantitative Comparison Analysis
[0118] To verify the effectiveness and engineering advantages of the method of this invention, a comprehensive quantitative comparison was conducted between the Gaussian 4-channel multispectral method of this invention and the original 224-dimensional full-band hyperspectral method under completely identical datasets and hardware environments. The image resolution was 542×801. The comparison results are as follows:
[0119] 1. Accuracy Comparison: The original full-band hyperspectral classification achieved OA=99.76% and Kappa=0.9978; the Gaussian multispectral classification of this invention achieved OA=98.63% and Kappa=0.9835. This invention only loses about 1.13% accuracy, meeting the accuracy requirements for industrial sorting.
[0120] 2. Computing power consumption comparison: The original full-band single-pixel inference floating-point operation volume is about 182,708 times; the four-channel single pixel of this invention only requires 1,074 times, reducing the single-pixel computing power by more than 170 times, and the computing power compression rate is 99.4%.
[0121] 3. Storage volume comparison: The original full-band single image has a storage volume of 370.97 MB; the present invention has a storage volume of only 6.62 MB, a storage space compression rate of 98.21%, and a data storage volume of only 1.79% of that of traditional hyperspectral imaging.
[0122] It should be understood that those skilled in the art can make improvements or modifications based on the above description, and all such improvements and modifications should fall within the protection scope of the appended claims.
Claims
1. A plastic material classification method based on Gaussian multispectral simulation, characterized in that, include: S1: Obtain the hyperspectral reflectance data of the sample; S2: Using pre-set sample label data, the hyperspectral reflectance data is cleaned accordingly, and invalid and abnormal samples are removed to obtain the first plastic spectral dataset. S3: The first plastic spectral dataset is preprocessed by the mean block compression algorithm to obtain the dimensionality-reduced spectral matrix; S4: The reduced spectral matrix is subjected to several rounds of adaptive band filtering using a random forest combined with a recursive feature elimination algorithm to obtain the feature bands; S5: Perform a spectral response difference significance check on the characteristic bands to obtain the optimal set of characteristic wavelengths; S6: Perform normalized Gaussian multispectral channel simulation on the optimal characteristic wavelength set to obtain the multispectral feature matrix; S7: Input the multispectral feature matrix into the pre-trained model to obtain the two-dimensional classification result image.
2. The plastic material classification method based on Gaussian multispectral simulation according to claim 1, characterized in that, In step S5, the spectral response difference of the characteristic bands is verified, and N optimal characteristic wavelengths are selected to form the set of optimal characteristic wavelengths N less than or equal to 5.
3. The method of claim 2, wherein the method further comprises: In step S5, the spectral response difference of the characteristic bands is verified, and four optimal characteristic wavelengths are selected.
4. The method of claim 1, wherein the method is based on Gaussian multispectral simulation. In step S1, ground-based acquisition is used to obtain hyperspectral reflectance data of the sample in the 900–1700 nm near-infrared band.
5. The method for classifying plastic materials based on Gaussian multispectral simulation according to claim 1, characterized in that, In step S2, the pre-set sample label data includes label data for polyethylene terephthalate, polyethylene, polypropylene, polystyrene, polyvinyl chloride, acrylonitrile-butadiene-styrene copolymer, polycarbonate, polyamide / nylon, polymethyl methacrylate, polyoxymethylene, and ethylene glycol-modified polyethylene terephthalate.
6. The method for classifying plastic materials based on Gaussian multispectral simulation according to claim 1, characterized in that, In step S2, the invalid abnormal samples include invalid abnormal samples containing null values and invalid abnormal samples containing infinite values.
7. The method for classifying plastic materials based on Gaussian multispectral simulation according to claim 1, characterized in that, In step S3, the mean block compression algorithm is specifically as follows: Set the block compression step size s, divide the first plastic spectral dataset into blocks of s adjacent bands, and perform mean fusion on the i-th sample and the k-th fusion band. The fusion formula is as follows: ; For a reduced-dimensional spectral matrix, This represents the offset within the block.
8. The method for classifying plastic materials based on Gaussian multispectral simulation according to claim 7, characterized in that, The compression step size s=2, the first plastic spectral dataset is divided into blocks according to every 2 adjacent bands.
9. The method for classifying plastic materials based on Gaussian multispectral simulation according to claim 1, characterized in that, In step S7, the training set of the pre-trained model includes a training set and a test set. The three-dimensional multispectral feature matrix and the corresponding label vector y are divided into the training set and the test set according to a preset ratio using stratified sampling. In step S7, stratified sampling is used to divide the three-dimensional multispectral feature matrix and the corresponding label vector y into the training set and the test set in a 7:3 ratio.
10. The method for classifying plastic materials based on Gaussian multispectral simulation according to claim 9, characterized in that, In step S7, before generating the training set of the pre-trained model, the sample features of the three-dimensional multispectral feature matrix are standardized: ; The mean of the features in the training set; The standard deviation of the training set features; x represents the original eigenvalues of the three-dimensional multispectral feature matrix; These are the standardized feature values.
Citation Information
Patent Citations
Near-infrared hyperspectral plastic sorting system and method based on band number constraint
CN117708719A
