A Method for Selecting Near-Infrared Spectral Feature Wavelengths of Black Vinegar Solution Based on Combinatorial Algorithm

By combining the differential optimization algorithm and the Cuckoo algorithm, the near-infrared spectral characteristic wavelength of black vinegar solution is selected, which solves the problem of incomplete removal of redundant information in the wavelength selection method in the prior art and realizes high-precision online detection of black vinegar solution concentration.

CN116525018BActive Publication Date: 2025-10-31BEIJING INST OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310249605.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-15
Publication Date
2025-10-31
Estimated Expiration
2043-03-15

AI Technical Summary

Technical Problem

Existing wavelength selection methods for black vinegar solutions are insufficient to effectively remove redundant information, resulting in inadequate accuracy of near-infrared spectroscopy analysis models and an inability to achieve rapid and high-precision online detection.

Method used

By combining differential optimization and the Cuckoo algorithm, and using a feature wavelength selection method to reduce the number of wavelength variables and maximize the removal of redundant information, a near-infrared quantitative analysis model for hexamethylenetetramine concentration in vinegar solution was established.

Benefits of technology

It improves the model's prediction accuracy, reduces its complexity, and enhances the robustness and predictive ability of near-infrared spectroscopy analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116525018B_ABST
    Figure CN116525018B_ABST
Patent Text Reader

Abstract

This invention discloses a method for selecting characteristic wavelengths in the near-infrared spectrum of turmeric vinegar solution based on a combinatorial algorithm, belonging to the fields of chemometrics and online detection of explosives. This invention utilizes a differential algorithm to obtain an initial solution. After initialization, mutation, crossover, and selection operations, a set of characteristic wavelengths for the differential optimization algorithm is obtained, reducing the time spent blindly searching in the initial stage of the Cuckoo Algorithm due to the large amount of information, thus improving the efficiency of selecting characteristic wavelengths in the near-infrared spectrum of turmeric vinegar solution. This invention uses the preprocessed spectrum corresponding to the characteristic wavelength set of the differential optimization algorithm as the initial variable, and uses the Cuckoo Algorithm to select characteristic wavelengths for the initial variable, effectively reducing dimensionality while maximizing the provision of effective information. The near-infrared quantitative analysis model for hexamethylenetetramine concentration in turmeric vinegar solution established by this invention using characteristic wavelengths selected by the combinatorial algorithm can reduce model complexity and improve model prediction accuracy and robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the fields of chemometrics and online detection of explosives, specifically relating to a method for selecting the characteristic wavelengths of near-infrared spectra of black vinegar solution based on a combinatorial algorithm. Background Technology

[0002] Octogen (HMX) is currently the most widely used explosive, and its production is generally carried out using the acetic anhydride method worldwide. In the HMX production process, the concentration of hexamethylenetetramine (HMX) in the hexamethylenetetramine-acetic acid (HMX) solution has a significant impact on product quality, production costs, and the production process. Currently, the detection of hexamethylenetetramine concentration in the HMX solution typically employs chemical analysis methods. However, because this analysis is intermittent or offline, there is a lag in the analytical results. Therefore, a rapid and highly accurate online detection and analysis method is urgently needed.

[0003] The widespread application of near-infrared spectroscopy in agriculture, food, pharmaceuticals, petrochemicals, and other industries has made it possible to use near-infrared spectroscopy for online detection and analysis of raw material concentrations in HMX explosive production. However, with advancements in modern analytical instruments, the thousands of wavelength variables contained in near-infrared spectroscopy contain noise and interference variables, which can mask valuable information, reduce the accuracy of analytical models, and render the results unreliable. Selecting specific wavelength variables can enhance the predictive performance and robustness of the established models.

[0004] Currently, methods for wavelength variable selection mainly include five traditional techniques: non-information variable elimination, continuous projection algorithm, interval partial least squares method, LASSO algorithm, and random forest algorithm, as well as swarm intelligence optimization algorithms such as genetic algorithm, simulated annealing algorithm, and particle swarm optimization algorithm. Different algorithms handle the redundant information contained in the near-infrared spectrum differently, but swarm intelligence optimization algorithms have shown superior performance in wavelength variable selection and have therefore attracted much attention. However, while using swarm intelligence optimization algorithms to select variables reduces the number of variables and thus reduces redundant information, some redundancy remains, making it difficult to achieve optimal model performance. Therefore, it is necessary to use optimization combinatorial algorithms to find the most relevant information in the spectrum. Summary of the Invention

[0005] To address the problem that existing wavelength selection methods for black vinegar solutions are insufficient in removing redundant information, leading to inadequate modeling accuracy, the main objective of this invention is to provide a method for selecting near-infrared spectral characteristic wavelengths of black vinegar solutions based on a combined algorithm. This method maximizes the removal of redundant information, reduces the number of wavelength variables, and establishes a near-infrared quantitative analysis model for the concentration of hexamethylenetetramine in black vinegar solutions. Furthermore, it reduces model complexity and improves model prediction accuracy.

[0006] The objective of this invention is achieved through the following technical solution:

[0007] The present invention discloses a method for selecting near-infrared spectral characteristic wavelengths of black vinegar solution based on a combinatorial algorithm, comprising the following steps:

[0008] Step 1: Collect the raw near-infrared spectra of vinegar solutions with different concentrations of hexamethylenetetramine, and manually test the hexamethylenetetramine concentration data corresponding to the raw near-infrared spectra of the vinegar solutions using chemical analysis methods;

[0009] Step 2: Preprocess the original near-infrared spectrum of the black vinegar solution to eliminate burrs and distortions caused by temperature and noise during data acquisition, and obtain the preprocessed spectrum.

[0010] Step 3: Use the differential optimization algorithm to select characteristic wavelengths from the preprocessed spectrum. After initialization, mutation, crossover and selection operations, the characteristic wavelength set S of the differential optimization algorithm is obtained.

[0011] Step 4: Using the preprocessed spectrum corresponding to the feature wavelength set S of the differential optimization algorithm as the initial variable, the Cuckoo algorithm is used to select the feature wavelength of the initial variable to obtain the combined feature wavelength set SC, that is, the near-infrared spectral feature wavelength selection of black vinegar solution is realized based on the combined algorithm.

[0012] Preferably, the specific steps for selecting the characteristic wavelength using the differential optimization algorithm in step three are as follows:

[0013] (1) Initialization: The initial population X(g) for the number of generations g usually needs to be calculated in conjunction with the upper and lower bounds of the decision space:

[0014]

[0015]

[0016] In the formula, x i,j (g) is the i-th, j-th dimension individual in the initial population X(g) at generation g. Here, represents the lower and upper bounds of the j-th dimension, rand(0,1) represents a random number in the interval [0,1], NP is the population size, and D is the individual dimension;

[0017] (2) Mutation: Three distinct individuals are randomly selected from the initial population X(g) at generation g, and denoted as xi, xj, ... r1 (g), x r2 (g) and x r3 (g), where r1, r2, and r3 are random numbers in the interval [1, NP], and then a mutant individual V is generated according to the mutation formula. i(g+1)=(v i,1 (g+1),v i,2 (g+1),…,v i,D (g+1)):

[0018] v i,j (g+1)=x r1,j (g)+F(x r2,j (g)-x r3,j (g)) (3)

[0019] In the formula, F is the variation parameter;

[0020] (3) Crossover: The mutant individuals v are crossed over. i,j (g+1) and the individual x in the initial population X(g) at generation g. i,j (g) Perform crossover to obtain experimental individuals U i (g+1)=(u i,1 (g+1),u i,2 (g+1),…,u i,D (g+1)):

[0021]

[0022] Where CR is the crossover probability.

[0023] (4) Selection: Select the experimental individuals u according to the greedy criterion. i (g+1) and the individual x in the initial population X(g) at generation g. i (g) Conduct competition if the experimental individual u i (g+1) outperforms x i (g) then the experimental individual u i (g+1) replaces x i (g) Enter the initial population X(g+1) at generation g+1; otherwise, x i (g) The initial population X(g+1) enters at generation g+1:

[0024]

[0025] Where f is the fitness function.

[0026] (5) Set the iteration count g = g + 1, and determine whether g is equal to the maximum iteration count IterMax. If it is equal to IterMax, continue to the next step; otherwise, jump to step (2).

[0027] (6) Output the final initial population X(g+1), which is the set of characteristic wavelengths S of the differential optimization algorithm.

[0028] Preferably, the specific steps of the cuckoo algorithm for selecting characteristic wavelengths in step four are as follows:

[0029] (1) Take the preprocessed spectrum corresponding to the differential optimization algorithm characteristic wavelength set S as the initial variable. According to the dimension constraint, randomly generate NC nests of the t-th generation in the dimension space dim, Y(t) = (y1(t), y2(t), …, yNC(t));

[0030] (2) For the position y k (t) = (y k1 (t), y k2 (t), …, y kdim (t)) of the k-th nest, 1 ≤ k ≤ NC, evaluate the information of the t-th generation nest Y(t) according to the fitness function f, retain the optimal nest information, and obtain the information of the (t + 1)-th generation nest according to the update formula:

[0031]

[0032] In the formula is the nest position of the k-th nest in the t-th generation, is the point-to-point multiplication, α is the step control quantity, used to control the search range of the step, its value follows a normal distribution, and at this time α = 1, L(λ) is the Levy random search path, which belongs to random walk and adopts the Levy flight mechanism. After simplification:

[0033]

[0034] In the formula is the optimal nest information found by the cuckoo at the t-th iteration, u and v follow the standard normal distribution, and β = 1.5.

[0035] (3) Generate a uniformly distributed random number r (r ∈ (0, 1)) and compare it with the maximum discovery probability P. If r < P, discard the nest and replace the old nest through the random walk strategy. After updating, evaluate the nest information and retain the current optimal nest information; if r ≥ P, then remain unchanged:

[0036]

[0037] In the formula represents the positions of two random nests in the t-th generation;

[0038]

[0039] (4) Set the iteration count t = t + 1, and determine whether t is equal to the maximum iteration count N_IterTotal. If it is equal to N_IterMax, continue to the next step; otherwise, jump to step (2).

[0040] (5) Output the optimal bird's nest information The combined characteristic wavelength set SC is obtained.

[0041] Preferably, the fitness function is set as follows: Where y i These are the measured values ​​of the sample components or properties. is the predicted value for the sample, and n is the number of samples.

[0042] Beneficial effects:

[0043] 1) The method for selecting the near-infrared spectral characteristic wavelengths of black vinegar solution based on the combination algorithm disclosed in this invention uses the difference algorithm to obtain the initial solution, which reduces the time of blind search in the initial stage of the cuckoo algorithm due to the large amount of information, and improves the selection efficiency of the near-infrared spectral characteristic wavelengths of black vinegar solution.

[0044] 2) The near-infrared spectral characteristic wavelength selection method for black vinegar solution based on a combination algorithm disclosed in this invention uses the difference and cuckoo algorithm to optimize the near-infrared spectral characteristic wavelength, which can effectively reduce the dimensionality and provide effective information to the maximum extent.

[0045] 3) The near-infrared spectral characteristic wavelength selection method for black vinegar solution based on the combined algorithm disclosed in this invention uses the characteristic wavelength selected by the combined algorithm to establish a near-infrared quantitative analysis model for the concentration of hexamethylenetetramine in black vinegar solution, which has the characteristics of high accuracy and few variables. Attached Figure Description

[0046] Figure 1 This is a selection chart of the near-infrared spectral characteristic wavelengths of the black vinegar solution chosen by the combined algorithm. Detailed Implementation

[0047] The present invention will now be described in further detail with reference to the accompanying drawings:

[0048] Example 1:

[0049] I. Spectral Collection and Preprocessing

[0050] Considering that temperature and noise information may be introduced during near-infrared spectral acquisition, causing spectral distortion and glitches, the correlation between near-infrared spectra and the concentration of hexamethylenetetramine in hexamethylenetetramine-acetic acid solutions is affected, leading to inaccurate models and poor stability. Different masses of hexamethylenetetramine and acetic acid solutions were weighed using an analytical balance to prepare hexamethylenetetramine-acetic acid solutions with varying hexamethylenetetramine concentrations. The hexamethylenetetramine concentration in these solutions was manually analyzed, resulting in 102 samples of hexamethylenetetramine-acetic acid solutions with different concentrations. A Thermo-Nicolet Antaris II Fourier transform near-infrared spectrometer was used, with an empty transmission liquid sample tube as the background, and scanning was performed at room temperature (25°C) in the spectral range of 10000–4000 cm⁻¹. -1 The resolution is 8cm. -1 A total of 1,557 wavelength points were collected.

[0051] The raw near-infrared spectra of 102 black vinegar solution samples were preprocessed using SG smoothing to form a preprocessed spectral set. At the same time, the concentration values ​​represented by the near-infrared spectral curves of different black vinegar solutions were obtained based on manual analysis to form the original concentration set.

[0052] II. Dataset Partitioning

[0053] According to the SPXY algorithm, the preprocessed spectral set and the original concentration set are divided into a calibration set and a prediction set according to a preset ratio of 71:29.

[0054] The SPXY algorithm for dividing the calibration set and the prediction set includes the following steps:

[0055] 1) Take two samples (named p and q) from the preprocessed spectral set and the original concentration set, respectively, and calculate the distances of samples (p and q) to the data x in the preprocessed spectral set and the data y in the original concentration set. The calculation formula is:

[0056]

[0057]

[0058] In the formula, d is the distance between two samples.

[0059] 2) Assign equal importance to the spatial distance between the preprocessed spectral set data x and the original concentration set data y, i.e., perform normalization processing, where the normalized distance d xy for:

[0060]

[0061] 3) When selecting, first select the sample pair (p, q) with the largest normalized distance to enter the calibration set. In each iteration, select the sample with the largest and smallest normalized distance relative to any selected sample to enter the calibration set. Repeat the process until the required number of calibration sets is reached, and the rest enter the prediction set.

[0062] III. Feature Wavelength Optimization Using Differential Optimization Algorithm

[0063] Each wavelength point (a total of 1557 wavelength points) in the near-infrared spectrum of the calibration set is used as a candidate variable for the differential optimization algorithm. After initialization, mutation, crossover and selection operations, the characteristic wavelength set S of the differential optimization algorithm is obtained.

[0064] The differential optimization algorithm for feature wavelength selection includes the following steps:

[0065] (1) Initialization: Let g = 0, then the initial population X(0) calculated by combining the upper and lower bounds of the decision space is:

[0066]

[0067]

[0068] In the formula, x i,j (0) is the i-th and j-th dimension individual in the initial population X(0) when the evolutionary generation is 0. Here, represents the lower and upper bounds of the j-th dimension, rand(0,1) represents a random number in the interval [0,1], NP is the population size, and D is the individual dimension;

[0069] (2) Mutation: Three different individuals are randomly selected from the initial population X(0) and denoted as x. r1 (0), x r2 (0) and x r3 (0), where r1, r2, and r3 are random numbers in the interval [1, NP]. Then, a mutant individual V is generated according to the mutation formula. i (1)=(v i,1 (1),v i,2 (1),…,v i,D (1)):

[0070] v i,j (1) = x r1,j (0)+F(x r2,j (0)-x r3,j (0)) (6)

[0071] In the formula, F is the variation parameter;

[0072] (3) Crossover: The mutant individuals v are crossed over. i,j(1) Individual x in the initial population X(0) i,j (0) Perform crossover to obtain experimental individual U i (1)=(u i,1 (1),u i,2 (1),…,u i,D (1)):

[0073]

[0074] Where CR is the crossover probability.

[0075] (4) Selection: Select the experimental individuals u according to the greedy criterion. i (1) Individual x in the initial population X(0) i (0) Competition occurs if the experimental individual u i (1) performs better than x i (0), then the experimental individual u i (1) Substitute x i (0) Enter the initial population X(1), otherwise x i (0) Enter the initial population X(1):

[0076]

[0077] Where f is the fitness function, calculated as follows:

[0078]

[0079] Where y i These are the measured values ​​of the components or properties of the aforementioned prediction set samples. n is the predicted value of the sample, and n1 is the number of samples in the prediction set.

[0080] (6) Set the iteration count g = g + 1, and determine whether g is equal to the maximum iteration count IterMax. If it is equal to IterMax, continue to the next step; otherwise, jump to step (2).

[0081] (7) Output the final initial population X(g+1), which is the set of characteristic wavelengths S of the differential optimization algorithm.

[0082] In this embodiment, the mutation parameter F is 0.5, the population size NP is 40, the individual dimension D is 1557, the crossover probability CR is 0.7, and the maximum number of iterations IterMax is 400. The feature wavelength set S of the differential optimization algorithm includes 781 feature wavelengths, including 4003.497, 4007.354, 4011.211, 4015.068, 4034.352, 4045.923, 4057.494, 4080.635, 4084.492, 4088.349, 4099.92, 4103.777, 4107.634, 4115.348, 4123.062, 4134.632, and 4142.346.

[0083] IV. Cuckoo Algorithm for Optimizing Feature Wavelengths

[0084] Using the preprocessed spectrum corresponding to the feature wavelength set S of the differential optimization algorithm as the initial variable, the feature wavelength is optimized by the Cuckoo algorithm to obtain the combined feature wavelength set SC.

[0085] The cuckoo algorithm for feature wavelength optimization includes the following steps:

[0086] (1) Using the near-infrared spectra corresponding to 781 characteristic wavelengths in the differential optimization algorithm's characteristic wavelength set S, including 4003.497, 4007.354, 4011.211, 4015.068, 4034.352, 4045.923, 4057.494, 4080.635, 4084.492, 4088.349, 4099.92, 4103.777, 4107.634, 4115.348, 4123.062, 4134.632, and 4142.346, as initial variables, according to the dimensional constraint, randomly generate NC generations (let t = 0) of bird nests in the 781-dimensional space. Y(0) = (y1(0), y2(0), ..., y NC (0));

[0087] (2) The position of the kth bird's nest y k (0)=(y k1 (0),y k2 (0),…,y k781 (0)), 1≤k≤NC, evaluate the information of the bird nests Y(0) of the 0th generation according to the fitness function f, retain the best bird nest information, and obtain the information of the bird nests of the (t+1)th generation according to the update formula:

[0088]

[0089] In the formula Let k be the position of the nest in generation 0. For point-to-point multiplication, α is the step size control quantity, which is used to control the search range of the step size. Its value follows a normal distribution. At this time, α = 1. L(λ) is the Levy random search path, which belongs to random walk and adopts the Levy flight mechanism. After simplification:

[0090]

[0091] In the formula is the optimal nest information found by the cuckoo at the t-th iteration. u and v follow a standard normal distribution, and β = 1.5.

[0092] (3) Generate a uniformly distributed random number r (r ∈ (0, 1)) and compare it with the maximum discovery probability P. If r < P, discard the nest and replace the old nest through the random walk strategy. After updating, evaluate the nest information and retain the current optimal nest information; if r ≥ P, then remain unchanged:

[0093]

[0094] In the formula represents the positions of two random nests in the 0th generation;

[0095]

[0096] (4) Set the iteration number t = t + 1, and judge whether t is equal to the maximum iteration number N_IterTotal. If it is equal to N_IterMax, continue to the next step; otherwise, jump to step (2);

[0097] (7) Output the optimal nest information Obtain the combined characteristic wavelength set S-C.

[0098] In this embodiment, the population size NC is 40, the maximum discovery probability P is 0.25, and the maximum number of iterations N_IterTotal is 500. The combined characteristic wavelength set SC includes 4034.352, 4080.635, 4084.492, 4103.777, 4115.348, 4134.632, 4146.203, 4192.486, 4238.77, 4242.626, 4250.34, 4254.197, 4273.482, 4308.194, 4319.765, 4327.479, 4342.907, 4346.76, 4416.188, 4466.329, 4470.186, 4477.899, 4485.613, 4493.327, and 4504.898. 4578.18, 4582.037, 4585.894, 4601.321, 4605.178, 4609.035, 4616.749, 4620.606, 4659.175, 4666.889, 4670.746, 4678.46, 4682.317, 4686.174, 4697.745, 4751.742, 4782.597, 4794.168, 4813.453, 4821.167, 4828.88, 4832.737, 4836.594, 4840.451, 4844.308, 4852.022, 4867 .45, 4871.307, 4875.164, 4882.877, 4913.733, 4967.73, 4987.015, 4994.729, 5006.299, 5010.156, 5014.013, 5091.152, 5118.15, 5129.721, 5133.578, 5137.435, 5141.292, 5145.149, 5149.006, 5156.72, 5168.291, 5183.718, 5187.575, 5203.003, 5218.431, 5241.572, 5276.285, 5 280.142, 5295.569, 5326.425, 5353.423, 5364.994, 5372.708, 5380.422, 5384.279, 5388.136, 5391.993, 5399.707, 5422.848, 5426.705, 5430.562, 5434.419, 5457.561, 5469.131, 5472.988, 5480.702, 5492.273, 5526.985, 5530.842, 5534.699, 5538.556, 5546.27, 5577.125, 5584.839、5592.553、5604.124、5607.981、5611.838、5623.409、5650.407、5654.264、5677.406、5692.833、5700.547、5704.404、5742.974、5754.544、5777.686、5789.257、5793.114、5796.971、5808.542、5831.683、5835.54、5847.111、5858.682、5862.539、5877.966、5897.251、5912.679、5928.106、5931.963、5935.82、5958.962、5962.819、5966.676、5985.96、5989.817、5997.531、6005.245、6012.959、6016.816、6024.53、6043.814、6090.098、6101.668、6113.239、6147.952、6171.093、6178.807、6182.664、6186.521、6198.092、6205.806、6225.09、6232.804、6236.661、6244.375、6248.232、6263.66、6267.517、6302.229、6306.086、6325.371、6336.941、6344.655、6390.938、6394.795、6402.509、6410.223、6414.08、6417.937、6433.365、6444.936、6498.933、6518.217、6525.931、6529.788、6537.502、6541.359、6552.93、6556.787、6576.071、6583.785、6587.642、6626.211、6630.068、6637.782、6645.496、6660.924、6714.921、6718.778、6722.635、6726.492、6772.775、6784.346、6815.201、6830.629、6842.2、6849.914、6873.055、6892.34、6896.197、6900.054、6907.768、6923.195、6930.909、6938.623、6942.48、6969.479、6977.192、6981.049、6992.62、7004.191、7027.333、7046.617、7050.474、7054.331、7058.188、7077.473、7100.614、7104.471、7119.899、7154.611、7162.325、7166.182、7170.039、7173.896、7177.753、7185.467、7189.324、7200.895、7208.608、7235.607、7251.035、7258.749、7262.605、7266.462、7270.319、7281.89、7308.889、7316.603、7324.316、7335.887、7343.601、7359.029、7374.457、7382.17、7386.027、7401.455、7416.883、7432.311、7443.881、7447.738、7451.595、7459.309、7467.023、7474.737、7494.021、7497.878、7521.02、7555.732、7563.446、7575.017、7586.588、7594.302、7644.442、7648.299、7652.156、7659.87、7667.583、7683.011、7690.725、7694.582、7698.439、7702.296、7713.867、7729.294、7740.865、7756.293、7760.15、7767.864、7775.578、7787.148、7810.29、7821.861、7856.573、7860.43、7868.144、7879.715、7883.572、7887.429、7895.143、7899.0、7906.713、7941.426、7945.283、7960.71、7979.995、7991.566、8003.137、8045.563、8049.42、8057.134、8060.991、8068.705、8087.989、8095.703、8111.131、8118.845、8157.414、8168.985、8180.556、8184.413、8199.84、8215.268、8219.125、8226.839、8230.695、8234.553、8261.551、8265.408、8303.978、8307.834、8330.976、8365.688、8384.973、8396.544, 8408.114, 8442.827, 8462.111, 8469.825, 8477.539, 8512.252, 8519.966, 8531.536, 8535.394, 8539.25, 8550.821, 8577.819, 8581.677, 8593.247, 8600.961, 8604.818, 8631.816, 8635.674, 8651.102, 8662.672, 8701.241, 8705.099, 8712.813, 8755.238, 8786.094, 8816.949, 88 47.805, 8867.09, 8905.659, 8917.229, 8924.943, 8932.657, 8936.515, 8951.942, 8963.513, 9013.653, 9017.51, 9040.651, 9052.223, 9056.079, 9086.935, 9110.076, 9113.934, 9129.361, 9137.075, 9148.646, 9202.643, 9210.356, 9214.214, 9221.928, 9252.783, 9256.64, 9260.497, 9 268.211, 9279.781, 9287.495, 9295.209, 9302.923, 9322.208, 9337.636, 9376.205, 9395.489, 9407.061, 9410.917, 9426.345, 9441.772, 9457.2, 9476.485, 9480.342, 9484.199, 9495.77, 9549.767, 9557.48, 9565.194, 9569.052, 9588.336, 9592.193, 9619.191, 9626.905, 9646.19, 96 435 characteristic wavelengths, including 57.761, 9669.332, 9677.046, 9684.76, 9688.616, 9692.474, 9700.188, 9734.899, 9738.757, 9742.613, 9746.471, 9777.326, 9781.183, 9792.754, 9796.61, 9800.468, 9804.324, 9808.182, 9854.465, 9866.035, 9912.318, 9923.89, 9954.745, 9977.887, 9981.743, and 9989.457.

[0099] V. Result Verification

[0100] Figure 1 The image shows the position of the characteristic wavelengths obtained by the above method in the near-infrared spectrum of the original black vinegar solution. It can be found that the number of characteristic wavelengths has decreased significantly compared with the case without variable selection, indicating that the method of the present invention can significantly reduce wavelength variables and screen out suitable characteristic wavelengths.

[0101] A quantitative analysis model for hexamethylenetetramine concentration in vinifera vinegar solution was constructed using near-infrared spectral data from the calibration set corresponding to 435 characteristic wavelengths in the combined characteristic wavelength set SC, and the correlation coefficient R of the prediction set was used as the basis for the model. p 2 Using root mean square error (RMSEP) as the evaluation metric, the predictive performance of the method of this invention was compared with that of a support vector machine regression model based on full-spectrum modeling and a support vector machine regression model based on the characteristic wavelengths of the difference algorithm. The comparison results show that the method of this invention has the fewest characteristic wavelengths, and its performance on the prediction set is superior to other methods. This demonstrates that the method can reduce the number of wavelength variables, effectively enhance the predictive ability of the model, and improve the robustness and prediction accuracy of near-infrared spectroscopy analysis.

[0102] Table 1 Comparison of different variable optimization methods

[0103]

[0104] The above detailed description further illustrates the purpose, technical solution, and beneficial effects of the invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for selecting characteristic wavelengths of black vinegar solution based on a combined algorithm, comprising the following steps: Step 1: Collect the original near-infrared spectra of black vinegar solutions with different hexamine concentrations, and manually test the hexamine concentration data corresponding to the original near-infrared spectra of the black vinegar solutions using chemical analysis methods; Step 2: Preprocess the original near-infrared spectra of the black vinegar solutions. After eliminating the burrs and deformation phenomena caused by temperature and noise during data collection, obtain the preprocessed spectra; Step 3: Use the differential optimization algorithm to select characteristic wavelengths from the preprocessed spectra. After initialization, mutation, crossover, and selection operations, obtain the differential optimization algorithm characteristic wavelength set S; Step 4: Use the preprocessed spectra corresponding to the differential optimization algorithm characteristic wavelength set S as the initial variables, and use the cuckoo algorithm to select characteristic wavelengths from the initial variables, obtaining the combined characteristic wavelength set S-C, that is, realizing the selection of characteristic wavelengths of black vinegar solution near-infrared spectra based on the combined algorithm; The specific steps for the cuckoo algorithm to select characteristic wavelengths are as follows, (1) Using the preprocessed spectrum corresponding to the feature wavelength set S of the differential optimization algorithm as the initial variable, and according to the dimensional constraint, randomly generate NC number of bird nests of the tth generation in the dimensional space dim, Y(t) = (y1(t), y2(t), ..., y NC (t)); (2) For the position y of the kth bird's nest k (t)=(y k1 (t),y k2 (t),…,y kdim (t)), 1≤k≤NC, evaluate the nest information of generation t based on the fitness function f, retain the optimal nest information, and obtain the nest information of generation t+1 according to the update formula: In the formula Let k be the location of the nest in generation t. This is a point-to-point multiplication, where α is the step size control variable used to control the search range of the step size. Its value follows a normal distribution, so we take α = 1. L(λ) is the Levy random search path, which is a random walk. Using the Levy flight mechanism, after simplification: In the formula is the optimal nest information found by the cuckoo in the t-th iteration, where u and v follow a standard normal distribution and β = 1.5; (3) Generate a uniformly distributed random number r and compare it with the maximum discovery probability P, r ∈ (0, 1); if r < P, discard the nest and replace the old nest through a random walk strategy. After updating, evaluate the nest information and retain the current optimal nest information; If r ≥ P, then constant: In the formula Indicate the positions of two random bird nests in generation t; (4) Set the iteration number t = t + 1, and determine whether t is equal to the maximum iteration number N_IterTotal. If it is equal to N_IterMax, continue to the next step; otherwise, jump to step (2); (5) Output the optimal bird's nest information The combined characteristic wavelength set SC is obtained.

2. The method for selecting near-infrared spectral characteristic wavelengths of black vinegar solution based on a combined algorithm as described in claim 1, characterized in that: The specific steps for the differential optimization algorithm to select characteristic wavelengths in step 3 are as follows, (1) Initialization: The initial population X(g) when the generation number of evolution is g usually needs to be calculated in combination with the upper and lower limits of the decision space: In the formula, x i,j (g) is the i-th, j-th dimension individual in the initial population X(g) at generation g. Here, represents the lower and upper bounds of the j-th dimension, rand(0,1) represents a random number in the interval [0,1], NP is the population size, and D is the individual dimension; (2) Mutation: Three distinct individuals are randomly selected from the initial population X(g) at generation g, and denoted as xi, xj, ... r1 (g), x r2 (g) and x r3 (g), where r1, r2, and r3 are random numbers in the interval [1, NP], and then a mutant individual V is generated according to the mutation formula. i (g+1)=(v i,1 (g+1),v i,2 (g+1),…,v i,D (g+1)): v i,j (g+1)=x r1,j (g)+F(x r2,j (g)-x r3,j (g)) (3) In the formula, F is the mutation parameter; (3) Crossover: The mutant individuals v are crossed over. i,j (g+1) and the individual x in the initial population X(g) at generation g. i,j (g) Perform crossover to obtain experimental individuals U i (g+1)=(u i,1 (g+1),u i,2 (g+1),…,u i,D (g+1)): Where CR is the crossover probability; (4) Selection: Select the experimental individuals u according to the greedy criterion. i (g+1) and the individual x in the initial population X(g) at generation g. i (g) Conduct competition if the experimental individual u i (g+1) outperforms x i (g) then the experimental individual u i (g+1) replaces x i (g) Enter the initial population X(g+1) at generation g+1; otherwise, x i (g) The initial population X(g+1) enters at generation g+1: Where f is the fitness function; (5) Set the iteration number g = g + 1, and determine whether g is equal to the maximum iteration number IterMax. If it is equal to IterMax, continue to the next step; otherwise, jump to step (2); (6) Output the finally obtained initial population X(g + 1), which is the differential optimization algorithm characteristic wavelength set S.

3. The method for selecting near-infrared spectral characteristic wavelengths of black vinegar solution based on a combined algorithm as described in claim 1, characterized in that: The fitness function is set as: In the formula y i These are the measured values ​​of the sample components or properties. is the predicted value for the sample, and n is the number of samples.

Citation Information

Patent Citations

  • Characteristic wavelength selecting method for near infrared spectrum in ant colony optimization algorithm

    CN103344600A

  • Characteristic wavelength selection method and characteristic wavelength selection system of spectrum variable gradient integrated genetic algorithm

    CN110726694A