An improved grey wolf optimization-based near-infrared spectroscopy antioxidant activity detection method

By improving the Grey Wolf Optimization (EGWO) algorithm and using multi-model weighted fusion, the problems of high-dimensional spectral data redundancy and multicollinearity in near-infrared spectroscopy detection were solved, achieving high-precision and rapid detection of antioxidant activity.

CN122903854BActive Publication Date: 2026-11-27SHANDONG ACAD OF CHINESE MEDICINE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202611383257.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-09-08
Publication Date
2026-11-27
Estimated Expiration
2046-09-08

AI Technical Summary

Technical Problem

Existing near-infrared spectroscopy methods for detecting antioxidant activity suffer from high-dimensional spectral data redundancy and multicollinearity, resulting in limited prediction accuracy. Furthermore, a single model cannot fully utilize spectral information and cannot meet the needs for rapid detection.

Method used

The improved Grey Wolf Optimization (EGWO) algorithm is used for feature wavelength selection. It combines multiple model weighted fusion, including partial least squares regression, ridge regression and lightweight gradient booster. Through mechanisms such as correlation constraint redundancy removal and chaotic initialization, the feature wavelength selection is optimized, and multiple models are built in parallel for integrated prediction.

Benefits of technology

It improves the prediction accuracy and stability of near-infrared spectroscopy for detecting antioxidant activity, reduces the redundancy of characteristic wavelengths, fully explores spectral information, and achieves rapid and accurate detection of antioxidant activity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122903854B_ABST
    Figure CN122903854B_ABST
Patent Text Reader

Abstract

The application discloses an improved grey wolf optimization-based near-infrared spectrum antioxidant activity detection method and relates to the field of near-infrared spectrum analysis. Standard normal variable transformation and SG first derivative pretreatment are performed on collected near-infrared diffuse transmission spectra; initialization of target index correlation and a candidate wavelength subset dynamic correlation de-redundancy mechanism are embedded into a grey wolf optimization search process, so that wavelength screening simultaneously considers target correlation, variable redundancy and prediction performance; in combination with quantum heuristic probability binary, interval opposite learning, nonlinear convergence factor and population diversity chaos reset mechanisms, an adaptive screening low-redundancy feature wavelength subset is selected based on data correlation; a multi-model weighted integration framework is constructed, a verification set is adaptively optimized, and a prediction result is output. The application is fast, nondestructive, reduces redundant wavelength selection and improves model prediction stability, and is suitable for batch rapid detection of antioxidant activity in the fields of food, medicine and natural products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of near-infrared spectroscopy analysis and machine learning technology, and in particular to a near-infrared spectroscopy antioxidant activity detection method based on an improved gray wolf optimization. Background Technology

[0002] Antioxidant activity is a core indicator for evaluating the quality of food, pharmaceuticals, and natural products. Currently, the mainstream detection methods rely on chemical analysis techniques such as DPPH and ABTS. Although the results are reliable, the operation process is complex, the detection cycle is long, and the reagent consumption is high, which cannot meet the needs of rapid detection of large-scale samples.

[0003] Near-infrared spectroscopy, as a rapid and non-destructive green analysis technology, has been widely used in the quantitative detection of components in many fields. However, it has obvious limitations when used for the detection of antioxidant activity: near-infrared spectral data has high dimensionality and a large number of wavelength points, and there are serious problems of multicollinearity and low signal-to-noise ratio. Direct modeling of the full spectrum is prone to overfitting, resulting in limited prediction accuracy.

[0004] In recent years, swarm intelligence algorithms such as the Grey Wolf Optimization algorithm have been used for spectral wavelength selection. However, the standard Grey Wolf Optimization algorithm is prone to premature convergence in high-dimensional spectral spaces, and the traditional Sigmoid binarization method has poor adaptability to wavelength selection, failing to accurately screen effective information bands. At the same time, existing near-infrared antioxidant modeling mostly uses a single regression model, and different models have different learning focuses on spectral information. A single model is difficult to fully explore the linear and nonlinear correlation information in the spectrum.

[0005] Furthermore, there is a high degree of collinearity between adjacent wavelengths in the near-infrared spectrum. Although existing methods have attempted to use correlation information for feature selection, further improvements are needed in the synergy between the utilization of target-related information and the control of candidate wavelength redundancy during the iterative search process in the quantitative analysis of near-infrared antioxidant activity.

[0006] Therefore, there is an urgent need for a near-infrared antioxidant activity detection method that can optimize characteristic wavelengths for different target antioxidant activity indicators and perform integrated prediction. Summary of the Invention

[0007] To address the aforementioned issues, this application proposes a near-infrared spectroscopy method for detecting antioxidant activity based on an improved gray wolf optimization. This method aims to resolve the problems in existing chemical detection methods for antioxidant activity, where the screening of high-dimensional spectral variables and the model prediction process are independent, leading to the selection of effective wavelengths being susceptible to interference from redundant variables, and where a single model struggles to fully utilize different types of spectral information. The specific details are as follows: S1. Samples collected at a depth of 10000~4000 cm⁻¹ -1Near-infrared diffuse transmittance spectra in the wavenumber range were scanned multiple times and averaged to construct the original spectral matrix. Simultaneously, the reference true values ​​of at least one target antioxidant activity index for each sample were determined using standard methods. The target antioxidant activity index is selected from at least one of ABTS scavenging rate, DPPH scavenging rate and hydroxyl radical scavenging rate. When there are two or more target antioxidant activity indices, subsequent characteristic wavelength screening, regression modeling and prediction are performed for each target antioxidant activity index. S2. Perform standard normal variable transformation (SNV) and Savitzky-Golay first derivative preprocessing on the original spectral matrix to obtain the preprocessed spectrum. S3. For each target antioxidant activity index, an improved Grey Wolf Optimization Algorithm (EGWO) is used, which includes target correlation bias initialization and a dynamic correlation redundancy removal update mechanism for candidate wavelength subsets. This algorithm adaptively optimizes the wavelength subsets of the preprocessed spectrum to obtain the target characteristic wavelengths corresponding to the target antioxidant activity index. The correlation constraint redundancy removal update mechanism dynamically reduces highly correlated redundant wavelengths during the wavelength search process, which is a key improvement distinguishing it from traditional Grey Wolf optimization methods. The EGWO integrates chaotic initialization, correlation bias initialization, quantum heuristic probability binarization, interval opposition learning, nonlinear convergence factor, and population diversity chaotic reset mechanism, and performs correlation constraint redundancy removal update: In the population initialization stage, the initial selection probability of candidate wavelengths is set according to the absolute value of the correlation coefficient between each wavelength and the target antioxidant activity index; in each iteration, the candidate wavelength subset updated after the current gray wolf individual is taken as the object, the absolute value of the pairwise correlation coefficient of wavelengths in the candidate subset is calculated, and high correlation wavelengths with a correlation coefficient absolute value greater than a preset threshold are removed with a preset probability, and the removed wavelength subset directly participates in fitness calculation; a composite function that integrates RMSECV, wavelength proportion, and model complexity is used as the fitness function, so that the wavelength selection process simultaneously considers prediction error, feature dimension, and model complexity; S4. Based on the target characteristic wavelength corresponding to each target antioxidant activity index, three complementary regression models, namely Partial Least Squares Regression (PLS), Ridge Regression (Ridge), and Lightweight Gradient Boosting Machine (LightGBM), are constructed in parallel. S5. The validation set adaptive weight search strategy is used to weight and fuse the prediction results of the three types of models to output the predicted value of the corresponding target antioxidant activity index. S6. Collect the near-infrared spectrum of the unknown sample, and after the same preprocessing as above, input it into the trained ensemble model to output the predicted value of the corresponding target antioxidant activity index. Preferably, the sample S1 consists of 15 batches of Codonopsis pilosula oral liquid samples collected through various means, totaling 143 samples. The antioxidant activity indicators include ABTS scavenging rate, DPPH scavenging rate and hydroxyl radical scavenging rate. Different target antioxidant activity indicators are used to establish spectrum-indicator paired datasets and perform subsequent modeling independently.

[0008] Preferably, the standard normal variable transformation SNV calculation formula for S2 is: ; in, The absorbance of the spectrum after preprocessing. This represents the original spectral absorbance. Let be the average absorbance of the i-th spectrum. Let be the standard deviation of the absorbance of the i-th spectrum; The Savitzky-Golay first derivative preprocessing window has a width of 5 to 25 wavelength points, and the polynomial order is 2 to 3.

[0009] Preferably, the formula for wavelength selection probability in quantum heuristic probabilistic binarization is: ; in, Let x be the probability that the wavelength point is selected, x be the normalized position of the individual gray wolf at that wavelength point, and π be pi.

[0010] Preferably, the formula for calculating the nonlinear convergence factor is: .

[0011] Where a is the convergence factor, t is the current iteration number, and T is the maximum iteration number.

[0012] Preferably, the composite fitness function expression is: ; ; ; Where w1 is the weight coefficient of the RMSECV term, w2 is the weight coefficient of the wavelength quantity term, and w3 is the weight coefficient of the model complexity term. The root mean square error of cross-validation obtained by building a PLS model based on a subset of candidate wavelengths. The total number of wavelengths, To select the number of wavelengths, For model complexity, This represents the number of latent variables actually used in the PLS model. Pre-determine the number of latent variables for the PLS model. 20 represents the current number of modeling samples used for PLS fitness evaluation, and 20 is the normalized upper bound for the number of latent variables. When EGWO calculates fitness for each candidate wavelength subset, Adaptive determination, It varies with the subset of candidate wavelengths.

[0013] EGWO uses PLS as the fitness evaluation model for each candidate wavelength subset. The root mean square error of cross-validation obtained by building the PLS model based on the candidate wavelength subset is denoted as RMSECV. For each outer fold, RMSECV is calculated using only the data from the training part of that outer layer and using 3-fold cross-validation (shuffling the order and fixing the random seed). The outer folds are not included in the fitness calculation.

[0014] Preferably, in the EGWO, the correlation constraint redundancy removal update, interval opposition learning, and Tent chaotic reset are performed in the following manner: Taking the candidate wavelength subset updated in each iteration of the current gray wolf individual as the object, calculate the pairwise correlation coefficient of the wavelengths; when the absolute value of the correlation coefficient of the two wavelengths |r| is greater than 0.95, one of them is randomly removed with a 30% probability, and the removed wavelength subset is directly used as the candidate solution for the individual to participate in the fitness calculation. Every 5 iterations, a population-opposing solution is generated with a 30% probability, and the best solution is retained; When the population diversity is below the threshold, Tent chaos is used to reset the bottom-level individuals to avoid premature convergence.

[0015] Preferably, the hyperparameter ranges of the three types of models in S4 are limited: PLS latent variable count: 5~20; Ridge regression regularization parameter α = 10.0; LightGBM weak learners: 300, learning rate: 0.05, maximum tree depth: 3, leaf nodes per tree: 12.

[0016] Preferably, the weighted fusion formula for the model in S5 is: ; in , , These are the prediction weights for the partial least squares regression, ridge regression, and lightweight gradient booster models, respectively. All weights are non-negative and satisfy the following conditions: + + =1; The weight combinations are iterated in the interval [0,1] with a step size of 0.1. The optimal weights are determined by the minimum mean square error of the validation data divided into 80% and 20% within the training set. 80% of the data is used to train the three basic models PLS, Ridge and LightGBM, and 20% of the data is only used to generate predictions and search for fusion weights, and does not participate in the parameter fitting of the three basic models.

[0017] Preferably, the correlation bias initialization uses the normalized result of the absolute value of the correlation coefficient between each wavelength and the target antioxidant activity index as the initial selection probability, wherein 70% of the gray wolf individuals are selected as an initial candidate wavelength subset based on the initial selection probability, with approximately 15% of the wavelengths being extracted.

[0018] Preferably, the population diversity is represented by the average Euclidean distance from each individual gray wolf to the population average. When the population diversity is less than 0.05 × 10⁻⁶, the population diversity is considered to be lower than 0.05 × 10⁻⁶. At that time, the gray wolf individuals in the bottom 20% of fitness ranking were reinitialized using the Tent chaotic sequence.

[0019] Preferably, a near-infrared antioxidant activity rapid detection device can also be configured, including near-infrared spectral acquisition hardware, memory, processor, and result display unit; The memory stores a computer-executable program, and the processor runs the program to implement a rapid detection method for near-infrared spectroscopy antioxidant activity.

[0020] Preferably, the device is any one of a desktop offline device, a production line rapid testing device, or a handheld portable miniature testing instrument; It is also equipped with a data storage module and a data interaction module, which are used to store spectrum, wavelength, model, and prediction data, as well as to realize data uploading and pre-trained model download.

[0021] Preferably, a near-infrared spectroscopy rapid detection system for antioxidant activity can also be configured; The system includes a spectral acquisition module, a spectral preprocessing module, an EGWO target feature wavelength optimization module, a multi-model parallel training module, an adaptive weighted fusion module, and an error evaluation module. Each module performs preprocessing defined by the method, EGWO wavelength optimization for each target antioxidant activity index, integrated modeling, weighted fusion, and error evaluation logic.

[0022] In summary, the near-infrared spectroscopy method for detecting antioxidant activity based on improved gray wolf has the following advantages compared to traditional techniques: 1. This application adopts an overall technical solution to avoid the defects of large fluctuations in traditional models, thereby improving prediction accuracy and stability; 2. This application employs a weighted fusion of multiple models, including PLS, Ridge, and LightGBM, to fully exploit both linear and nonlinear spectral information, resulting in more efficient utilization of spectral information. 3. This application introduces target correlation bias initialization and dynamic correlation redundancy removal within the candidate wavelength subset during the EGWO search process, and combines chaotic initialization, quantum heuristic probability binarization, interval opposition learning, nonlinear convergence and population diversity reset mechanism to improve the stability and redundancy control of high-dimensional near-infrared characteristic wavelength search.

[0023] 4. This application embeds correlation constraints into the EGWO search process, reducing the number of selected wavelengths and lowering the average absolute correlation coefficient between selected wavelengths, thereby improving the screening effect of near-infrared characteristic wavelengths.

[0024] 5. This application relies on near-infrared spectroscopy technology, requires no chemical reagents, has a fast detection speed, and has the potential for application in laboratory batch testing, rapid screening of industrial processes, and portable on-site testing.

[0025] The technical method of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0026] Figure 1 The flowchart shows the technical process of a rapid detection method for near-infrared spectroscopy antioxidant activity based on an improved gray wolf optimization algorithm and ensemble learning. Figure 2 This is the original near-infrared spectrum curve; Figure 3 EGWO wavelength selection results; Figure 4 Scatter plot of ABTS clearance rate prediction results for the optimal weighted ensemble model; Figure 5 Comparison of 5-fold cross-validation performance for different models. Detailed Implementation

[0027] The technical method of the present invention will be further described below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps described in these embodiments do not limit the scope of this application.

[0028] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the scope of this application and its application or use.

[0029] Techniques, systems, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, they should be considered part of the instruction manual.

[0030] In all the examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.

[0031] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning as understood by one of ordinary skill in the art to which this invention pertains.

[0032] Example 1 This embodiment predicts the ABTS clearance rate, such as Figure 1 The specific steps are as follows: 1. Data acquisition and preprocessing.

[0033] Taking 143 samples of Codonopsis pilosula oral liquid as an example, near-infrared spectroscopy was used to collect samples from 10,000 to 4,000 cm⁻¹. -1 Diffuse transmission spectrum within the range, with a spectral resolution of 8 cm⁻¹ -1 A total of 778 wavelength points were obtained.

[0034] The ABTS free radical scavenging rate measured by chemical method was used as the true value. The sample true value range was 0.4867~0.7519, with a mean of 0.6278 and a standard deviation of 0.0717, which belongs to the wide-variable antioxidant index.

[0035] 2. Spectral preprocessing.

[0036] Using SNV combined with Savitzky-Golay first derivative (window width 15 points, polynomial order 2); SNV calculation formula: ; The sample scattering and baseline drift interference are eliminated to obtain the preprocessed spectrum.

[0037] Raw near-infrared spectrum such as Figure 2 As shown in the figure, all samples are within the range of 10,000–4,000 cm. -1 The spectral response curves of the samples within the range showed a generally consistent trend, but significant differences were observed in certain wavenumber regions. These differences stemmed from variations in the chemical composition and concentration of the samples, providing a spectral information basis for subsequent quantitative analysis of antioxidant activity.

[0038] 3. EGWO wavelength filtering parameter settings.

[0039] In this embodiment, the Tent chaotic mapping is based on x. k+1 =x k / 0.7(x k <0.7) or x k+1 =10 / 3×(1-x k )(x k≥0.7) Generate a [0,1] sequence; the correlation bias initialization uses the normalized absolute value of the correlation coefficient between each wavelength and the target index as the initial selection probability. In the correlation bias initialization, the initial selection probability of each wavelength point is calculated as follows: first, take the absolute value of the correlation coefficient between each wavelength and the target antioxidant activity index, then divide it by the sum of the absolute values ​​of the correlation coefficients of all wavelengths to obtain the normalized probability; to keep the probability non-zero, the probability less than 1e-6 is truncated to 1e-6 and then normalized again. 70% of individuals select about 15% of the wavelengths as initial candidates according to this probability; quantum heuristic probability binarization is performed according to P(bit=1)=sin 2 (πx) generates 0 / 1 states; the complementary solution is generated by x′=1-x, evaluated with a 30% probability, and replaced only when better; the population diversity index is the average Euclidean distance from each individual to the average individual in the population, and when this index is less than 0.05× At that time, the gray wolf individuals in the bottom 20% of fitness ranking were reinitialized using the Tent sequence.

[0040] EGWO fully implements six improvement mechanisms: (1) Tent chaotic mapping combined with wavelength correlation bias initialization population. In the correlation bias initialization, the initial selection probability of each wavelength point is calculated by dividing the absolute value of the correlation coefficient between each wavelength and the target antioxidant activity index by the sum of the absolute values ​​of the correlation coefficients of all wavelengths, and the probability less than 1e-6 is truncated to 1e-6 and then normalized. (2) Quantum heuristic probability binarization, selection probability ; (3) Nonlinear convergence factor ; (4) The absolute value of the wavelength correlation coefficient |r| threshold is 0.95. When it exceeds the standard, there is a 30% probability that the correlation constraint will be executed to remove redundant wavelengths by updating and eliminating redundant wavelengths. (5) Perform complementary learning every 5 iterations, generating complementary solutions with a 30% probability; (6) When population diversity is insufficient, Tent chaotically resets the bottom-level individuals; In this embodiment, w1, w2, and w3 are preset weight coefficients in the composite fitness function, and w1, w2, and w3 are set to 0.7, 0.2, and 0.1, respectively. The EGWO wavelength selection result is as follows: Figure 3As shown, the horizontal axis represents the wavenumber, and the vertical axis represents the spectral values ​​after preprocessing with the first derivative of SNV+SG. The black curve represents the average preprocessed spectrum of 143 samples, and the gray scatter plot marks the union of 183 wavelength points obtained from the EGWO screening of the five outer folds. Each outer fold performs the same EGWO screening process within its respective training part. EGWO adaptively selects a subset of characteristic wavelengths within the training part of each outer fold. Combined with the ablation results of Example 2, the correlation constraint can reduce the number of selected wavelengths and lower the average absolute correlation coefficient between the selected wavelengths.

[0041] EGWO uses PLS as the fitness evaluation model for each candidate wavelength subset. The root mean square error of cross-validation obtained by building the PLS model based on the candidate wavelength subset is denoted as RMSECV. For each outer fold, RMSECV is calculated using only the data from the training part of that outer layer and using 3-fold cross-validation (shuffling the order and fixing the random seed). The outer folds are not included in the fitness calculation.

[0042] 4. Multi-model training parameters.

[0043] The final PLS model has 17 latent variables. During EGWO fitness evaluation, the actual number of latent variables in PLS is adaptively determined based on a subset of candidate wavelengths, with an upper limit of 20. The Ridge regularization parameter α = 10.0. The LightGBM weak learner has 300 nodes, a learning rate of 0.05, a maximum tree depth of 3, and 12 leaf nodes. These model hyperparameters are pre-fixed before outer-layer cross-validation, and the outer-layer leave-throughs are not involved in determining these parameters.

[0044] 5. Adaptive weighted fusion.

[0045] The weighted fusion formula is: ; In each fold cross-validation, the optimal weight combination {w_PLS, w_Ridge, w_LGBM} is searched on the validation data divided into 80% and 20% portions within the outer training part with a step size of 0.1. 80% of the data is used to train the three base models PLS, Ridge, and LightGBM, while 20% of the data is only used to generate predictions and search for fusion weights, without participating in parameter fitting of the three base models. The optimal weights are determined with the goal of minimizing the mean squared error of the validation set.

[0046] Specifically, the weight combinations are iterated in the interval [0,1] with a step size of 0.1, and the optimal weights are determined by the minimum mean square error of the validation data divided into 80% / 20% within the outer training part.

[0047] 6. Comparison of 5-fold cross-validation results.

[0048] The performance of the outer 5-fold cross-validation method is evaluated. For each outer fold, only the training portion of that fold is used to calculate the correlation between wavelength and target metric, perform EGWO feature wavelength selection, and train PLS, Ridge, and LightGBM models. The fusion weights of the three models are determined only using the validation data within the outer training portion, divided into 80% and 20% portions. 80% of the data is used to train the three base models (PLS, Ridge, and LightGBM), while the remaining 20% ​​is used only to generate predictions and search for fusion weights, without participating in parameter fitting for the three base models. The outer folds are not involved in correlation calculation, feature wavelength selection, model parameter determination, or fusion weight optimization; they are only used to obtain out-of-fold prediction results. The prediction results from the five outer folds are summarized to calculate R0. 2 The error indicators are shown in Table 1: Table 1 Performance results of the 5-fold cross-validation method

[0049] Experimental results show that the full-spectrum PLS baseline R 2 The differences are significant (negative values ​​appear at fold 4). However, after EGWO wavelength selection and optimal weight integration, the method of this invention performs best among the methods compared in this embodiment, and stable positive R values ​​are obtained for each fold in cross-validation. 2 The prediction results of the optimal weighted ensemble model are as follows: Figure 4 As shown in the figure, each data point represents the out-of-fold prediction result obtained from 5-fold cross-validation, and the red dashed line represents the ideal prediction line. The data points are concentrated near the diagonal, indicating a good agreement between the predicted and measured values. The coefficient of determination R0 of this method's 5-fold cross-validation is... 2 =0.829 and standard deviation is 0.076, indicating that the integrated model of the present invention has good predictive performance and interleaving stability in this embodiment.

[0050] 7. Algorithm comparison experiment.

[0051] Table 2. Algorithm Comparison Experiment Results

[0052] The results of the algorithm comparison experiment are shown in Table 2. The comparison shows that the standard GWO wavelength selection (PLS+SGWO) achieves R... 2 Approximately 0.78, while the improved GWO (PLS+EGWO) of this invention increases to R. 2 =0.811, verifying the effectiveness of the overall EGWO improvement mechanism, which includes redundant removal of correlation constraints. The optimal weight ensemble method further improves R... 2 The increase to 0.829 indicates that multi-model weighted fusion further improved the average R-value in this embodiment. 2 .

[0053] Performance comparison of each model Figure 5 As shown, the horizontal axis represents the full-spectrum PLS baseline, PLS (EGWO wavelength-selected), Ridge (EGWO wavelength-selected), LightGBM (EGWO wavelength-selected), and the optimal weighted ensemble model (the method of this invention), respectively, and the vertical axis represents the coefficient of determination R. 2 The error bars represent the standard deviation of the 5-fold cross-validation. As can be seen from the figure, the full-spectrum PLS baseline R... 2 The average R-value of PLS ​​after 5-fold cross-validation is lower and has a larger standard deviation, while after wavelength selection by EGWO, the average R-value of PLS ​​is lower. 2 The R-value increased from 0.679 to 0.811. After further weighted fusion of the three models, the average R-value increased. 2 It reached 0.829.

[0054] Example 2 This embodiment conducts ablation experiments on each improved mechanism in the EGWO wavelength screening strategy. The experiments used the same 143 samples of Codonopsis pilosula oral liquid as in Example 1, with SNV+SG first-order derivative preprocessing, 5-fold cross-validation partitioning, and model training configuration. While keeping the other mechanisms and training configuration unchanged, only one mechanism was removed each time. The specific comparison scheme is as follows: (1) Full EGWO: Enable all improvement mechanisms; (2) Decorrelation constraint: Remove the initialization of correlation bias and the elimination of |r|>0.95 probability; (3) Remove correlation bias initialization: Only remove correlation bias initialization, retain those with a probability of |r|>0.95 to be eliminated; (4) Decorrelation removal: Only remove those with a probability of |r|>0.95, and retain the correlation bias initialization; (5) Remove Tent chaos: Replace Tent chaos mapping with random initialization and random reset; (6) De-quantum heuristic probability binarization: Replace quantum heuristic probability binarization with linear threshold binarization; (7) Eliminate the oppositional learning: Eliminate the spaced oppositional learning; (8) Nonlinear convergence removal: Replace the nonlinear convergence factor with a linear convergence factor; (9) Remove diversity reset: Remove chaotic reset of population diversity; (10) Standard GWO: All improvement mechanisms are turned off.

[0055] Table 3. Results of complete ablation experiments using the wavelength selection strategy.

[0056] The RMSECV in Table 3 is calculated based on the out-of-fold prediction results of the five outer folds; the number of wavelength unions and the average |r| are calculated based on the union of wavelengths screened from the five outer folds. Table 3 shows that in the ablation experiments where each improved mechanism was removed one by one, correlation constraints contributed the most to suppressing wavelength redundancy: the union of the five screened wavelengths of the complete EGWO was 183, corresponding to R... 2 =0.811±0.078, the average |r| of the union of wavelengths selected by 5-fold screening is 0.645; after removing the correlation constraint, the number of wavelengths increases to 237, and the average |r| of the union of wavelengths selected by 5-fold screening rises to 0.689, R 2 The performance dropped to 0.783±0.081. Removing the remaining mechanisms individually resulted in a slight decrease in performance; the standard GWO, as the baseline for full shutdown, was significantly inferior to the full EGWO in terms of wavelength count and wavelength redundancy.

[0057] Finally, it should be noted that the above embodiments are only used to illustrate the technical methods of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical methods of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical methods to deviate from the spirit and scope of the technical methods of the present invention.

Claims

1. A near-infrared spectroscopy method for detecting antioxidant activity based on an improved gray wolf spectroscopy, characterized in that, Includes the following steps: S1. Samples collected at a depth of 10000~4000 cm⁻¹ -1 Near-infrared diffuse transmittance spectra in the wavenumber range were scanned multiple times and averaged to construct the original spectral matrix. Simultaneously, the reference true values ​​of at least one target antioxidant activity index for each sample were determined using standard methods. The target antioxidant activity index is selected from at least one of ABTS scavenging rate, DPPH scavenging rate and hydroxyl radical scavenging rate. When there are two or more target antioxidant activity indices, subsequent characteristic wavelength screening and regression modeling are performed for each target antioxidant activity index. S2. Perform standard normal variable transformation (SNV) and Savitzky-Golay first derivative preprocessing on the original spectral matrix to obtain the preprocessed spectrum. S3. For each target antioxidant activity index, the improved Grey Wolf Optimization Algorithm (EGWO), which includes target correlation bias initialization and candidate wavelength subset dynamic correlation redundancy removal update mechanism, is used to perform wavelength subset adaptive optimization on the preprocessed spectrum to obtain the target characteristic wavelength corresponding to the target antioxidant activity index. The EGWO integrates chaotic initialization, correlation bias initialization, quantum heuristic probability binarization, interval opposition learning, nonlinear convergence factor, and population diversity chaotic reset mechanism, and performs correlation constraint redundancy removal update: During the population initialization phase, the initial selection probability of candidate wavelengths is set based on the absolute value of the correlation coefficient between each wavelength and the target antioxidant activity index. In each iteration, the candidate wavelength subset updated for the current gray wolf individual is used as the object. The absolute value of the pairwise correlation coefficient of the wavelengths in the candidate subset is calculated. Highly correlated wavelengths with an absolute value of correlation coefficient greater than a preset threshold are removed with a preset probability. The removed wavelength subset directly participates in the fitness calculation. The fitness function is a composite function that integrates the root mean square error of cross-validation (RMSECV), wavelength proportion, and model complexity obtained by building a PLS model based on a subset of candidate wavelengths, so that the wavelength selection process considers prediction error, feature dimension, and model complexity simultaneously. S4. Based on the target characteristic wavelength corresponding to each target antioxidant activity index, three complementary regression models, namely Partial Least Squares Regression (PLS), Ridge Regression (Ridge), and Lightweight Gradient Boosting Machine (LightGBM), are constructed in parallel. S5. The validation set adaptive weight search strategy is used to weight and fuse the prediction results of the three types of models to output the predicted value of the corresponding target antioxidant activity index. S6. Collect the near-infrared spectrum of the unknown sample, and after the same preprocessing as above, input it into the trained ensemble model to output the predicted value of the corresponding target antioxidant activity index. The formula for wavelength selection probability in quantum heuristic probability binarization is: ; in, Let be the probability of a wavelength being selected from the candidate wavelength subset, x be the normalized position of the gray wolf individual at that wavelength, and π be pi.

2. The method for detecting antioxidant activity based on improved gray wolf near-infrared spectroscopy according to claim 1, characterized in that, The formula for calculating the standard normal variable transformation SNV of S2 is: ; in, The absorbance of the spectrum after preprocessing. This represents the original spectral absorbance. Let be the average absorbance of the i-th spectrum. Let be the standard deviation of the absorbance of the i-th spectrum; The Savitzky-Golay first derivative preprocessing window has a width of 5 to 25 wavelength points, and the polynomial order is 2 to 3.

3. The method for detecting antioxidant activity based on improved gray wolf near-infrared spectroscopy according to claim 1, characterized in that, The formula for calculating the nonlinear convergence factor is: ; Where a is the convergence factor, t is the current iteration number, and T is the maximum iteration number.

4. The method for detecting antioxidant activity based on improved gray wolf near-infrared spectroscopy according to claim 1, characterized in that, The composite fitness function is expressed as follows: ; ; ; Where w1 is The weight coefficients for the term w1, w2 are the weight coefficients for the wavelength quantity term, and w3 are the weight coefficients for the model complexity term. CV represents the root mean square error of cross-validation obtained from the PLS model built based on a subset of candidate wavelengths. The total number of wavelengths, To select the number of wavelengths, For model complexity, This represents the number of latent variables actually used in the PLS model. Pre-determine the number of latent variables for the PLS model. 20 represents the current number of modeling samples used for PLS fitness evaluation, and 20 is the normalized upper limit for the number of latent variables. When EGWO calculates fitness for each subset of candidate wavelengths, Adaptive determination, It varies with the subset of candidate wavelengths.

5. The method for detecting antioxidant activity based on improved gray wolf near-infrared spectroscopy according to claim 1, characterized in that, In the EGWO, correlation-constrained redundancy removal and update, interval-adjoint learning, and Tent chaotic reset are performed as follows: When the absolute value of the correlation coefficient between two wavelengths, |r|, is greater than 0.95, one of them is randomly removed with a 30% probability. Every 5 iterations, a population-opposing solution is generated with a 30% probability, and the best solution is retained; When the population diversity is below the threshold, Tent chaos is used to reset the bottom-level individuals to avoid premature convergence.

6. The method for detecting antioxidant activity based on improved gray wolf near-infrared spectroscopy according to claim 1, characterized in that, The hyperparameter range is limited for three types of models in S4: PLS latent variable count: 5~20; Ridge regression regularization parameter α = 10.0; LightGBM has 300 weak learners, a learning rate of 0.05, a maximum tree depth of 3, and 12 leaf nodes per tree.

7. The method for detecting antioxidant activity based on improved gray wolf near-infrared spectroscopy according to claim 1, characterized in that, The weighted fusion formula for the model in S5 is: ; in , , These are the prediction weights for the partial least squares regression, ridge regression, and lightweight gradient booster models, respectively. All weights are non-negative and satisfy the following conditions: + + =1; The weight combinations are iterated in the interval [0,1] with a step size of 0.

1. The training set is divided into training data and validation data of the basic model according to 80% / 20%. 80% of the data is used to train the three basic models PLS, Ridge and LightGBM, and 20% of the data is only used to generate predictions and search for fusion weights. It does not participate in the parameter fitting of the three basic models. The optimal weight is determined by the minimum mean square error of the 20% of validation data.

8. The method for detecting antioxidant activity based on improved gray wolf near-infrared spectroscopy according to claim 1, characterized in that, The correlation bias initialization uses the normalized result of the absolute value of the correlation coefficient between each wavelength and the target antioxidant activity index as the initial selection probability, wherein 70% of the gray wolf individuals are selected as the initial candidate wavelength subset according to the initial selection probability.

9. The method for detecting antioxidant activity based on improved gray wolf near-infrared spectroscopy according to claim 1, characterized in that, The population diversity is represented by the average Euclidean distance from each individual gray wolf to the population average. When the population diversity is below 0.05× At that time, the gray wolf individuals in the bottom 20% of fitness ranking are reinitialized using a Tent chaotic sequence, where, It is the arithmetic square root of the total number of wavelengths.

Citation Information

Patent Citations

  • Hyperspectral seed vigor nondestructive testing method based on deep learning

    CN117351285A

  • Method for rapidly detecting quality of yeast for making hard liquor by combining near infrared spectrum with physicochemical indexes

    CN117783045A