Wavelength selection method based on multi-strategy fusion improved zebra optimization algorithm and medium

The zebra optimization algorithm and extreme learning machine model are improved through multi-strategy fusion, which solves the problems of slow wavelength selection calculation speed and low accuracy in the existing technology, achieves efficient and accurate prediction of near-infrared spectrum wavelength selection, and improves model performance.

CN118553331AActive Publication Date: 2024-08-27CHANGCHUN UNIV
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410422335.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-09
Publication Date
2024-08-27
Estimated Expiration
2044-04-09

Smart Images

  • Figure CN118553331A
    Figure CN118553331A
Patent Text Reader

Abstract

The invention discloses a wavelength selection method based on a multi-strategy fusion improved zebra optimization algorithm. The method comprises the following steps: selecting a pioneer zebra through a good point set method, and calculating a target function value; the wavelength combination is updated in the foraging behavior stage; designing a non-linear probability factor selection defense strategy in a predator behavior defense stage, designing a non-linear convergence factor to accelerate algorithm convergence, and updating a wavelength combination; performing variation disturbance on the optimal individual by adopting a self-adaptive Gaussian variation detection mechanism, and selecting a final optimal wavelength combination; establishing an ELM (Extreme Learning Model) prediction model between the selected spectral data and the response to be detected, and judging the prediction capability of the model according to a model evaluation index; mFZOA and ELM models are combined for use, and the improved zebra optimization algorithm is used for solving the waveband selection problem in an ELM regression model, so that the model prediction performance is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of infrared spectrum wavelength selection methods, and in particular to a wavelength selection method and a medium based on a multi-strategy fusion improved zebra optimization algorithm. Background Art

[0002] Near-infrared spectroscopy technology identifies the organic components of the analyzed substance by measuring the amount of near-infrared radiation absorbed and reflected by the substance. It has the advantages of rich spectral information and simple and fast operation, making this technology indispensable in food analysis, agriculture, petroleum and other fields. However, due to the influence of interference information, noise and other factors, adjacent bands of the near-infrared spectrum usually show high collinearity and redundancy. The existence of this pathological relationship will have an adverse effect on the accuracy of the prediction model. Therefore, the selection of characteristic wavelengths has become a crucial link in solving the problem of adjacent band redundancy and improving model accuracy.

[0003] Therefore, the existing technology currently uses band selection methods to screen out the relevant characteristic wavelengths of various substances, so as to improve the performance of the prediction model. Zongbao Sun et al. used the CARS band selection method to select the characteristic wavelengths related to the measurement of salmon umami concentration and established a prediction model. The model established after wavelength selection has more advantages in associating spectral data with the reference value of salmon umami concentration; Yang Chengen et al. used the CARS band selection method to select wavelengths for the measurement of flavonoids and polysaccharides in black fruit glandular ribs, and established a model for prediction, and obtained a good content prediction effect; Puneet Mishra used the VCPA wavelength selection method to screen out the characteristic wavelengths related to potassium and nitrogen in dry bell pepper leaves. The prediction model results showed that the RMSEP of potassium and nitrogen were 0.28 and 0.44 respectively; Takuya Miyano et al. proposed an SFD-NCSC band selection method to optimize the model performance of water and drug content prediction in drug particles. The results showed that this band selection method can effectively improve the model prediction performance and is a very promising method.

[0004] In recent years, optimization algorithms have been continuously used to solve the problem of wavelength selection. Li Jingzhu et al. proposed an improved SSA optimization algorithm MHISSA, and combined this improved method with the prediction model to predict the amount of fertilizer supplied to crop soil. The experimental results show that this method has the smallest prediction error in establishing the model, can effectively select the relevant characteristic wavelengths, and improve the prediction performance of the model; Leqian Hu et al. proposed an improved ant colony optimization algorithm and used it in the wavelength selection in visible light and near-infrared spectral analysis to establish a prediction model. The improved ant colony optimization algorithm has outstanding effects in improving model performance; Pauline Ong et al. combined the flower pollination optimization algorithm with the prediction model to determine the content of theanine in oolong tea. The results showed that the flower pollination optimization algorithm is feasible in improving the predictability of the model and reducing the complexity of the model; Pauline Ong et al. proposed an improved flower pollination optimization algorithm and used the prediction model to predict three sets of public data sets. The results showed that this algorithm can reduce the redundancy of spectral bands and improve the prediction performance of the model. However, this type of optimization algorithm still has problems such as slow optimization speed and low accuracy. Summary of the invention

[0005] The embodiment of the present application provides a wavelength selection method based on a multi-strategy fusion improved zebra optimization algorithm, performs band selection through MFZOA, and establishes an ELM regression prediction model, thereby solving the problems of slow calculation speed and low calculation accuracy of the existing algorithm, and realizing the combined use of MFZOA and ELM models to improve the prediction performance.

[0006] The embodiment of the present application provides a wavelength selection method based on a multi-strategy fusion improved zebra optimization algorithm, characterized in that it includes the following steps:

[0007] Step 1: Initialize the population, select the initial wavelength combination as the pioneer zebra through the best point set method and calculate the objective function value Fit;

[0008] Step 2: position update, update the wavelength combination in the foraging behavior stage; design a nonlinear probability factor to select a defense strategy in the defense against predators behavior stage, design a nonlinear convergence factor to speed up the algorithm convergence, and update the wavelength combination;

[0009] Step 3: Adaptive Gaussian variation detection: Adaptive Gaussian variation detection mechanism is used to perform variation disturbance on the optimal individual, and the Fit after variation is compared with the Fit before variation, and the optimal wavelength combination of this round of iteration is updated. The above operation is repeated, and the Fit values ​​of the optimal wavelength combinations obtained in each round are compared to select the final optimal wavelength combination.

[0010] Step 4: Establish an ELM prediction model between the selected spectral data and the response to be measured, and judge the prediction ability of the model according to the model evaluation index.

[0011] Preferably, the good point set method is specifically:

[0012] Assuming the number of spectral bands is m, let Gs be the unit cube in s-dimensional Euclidean space, if r∈Gs, then the good point set P m (k) is:

[0013] Among them, {r s (m) ·k} represents the decimal part, m represents the number of spectral bands, and r is the optimal point.

[0014] r = {2cos(2πk / p), 1≤k≤s} (p is the smallest prime number satisfying (p-3) / 2)≥s);

[0015] The good point set sequence P m The values ​​in (k) and max(P m (k)) / 2 for comparison, if it is less than max(P m (k)) / 2, the value is 0, otherwise it is 1. That is, the value of the jth position in the good point set sequence is:

[0016]

[0017] The obtained good point set: X = (P m (k1),P m (k2),…,P m (k j ),…,P m (k m )), as the improved initial light wave population.

[0018] Preferably, the nonlinear probability factor Ps is:

[0019] Ps=(2×cos(t / T)-1)

[0020] Among them, t is the current iteration number and T is the maximum iteration number.

[0021] Preferably, when Ps≤0.5, the escape strategy is selected; when Ps>0.5, the attack strategy is selected.

[0022] Preferably, the nonlinear convergence factor a is:

[0023] a=(2×cos(πt / 3T)-1)

[0024] Among them, t is the current iteration number and T is the maximum iteration number.

[0025] Preferably, the adaptive Gaussian variation detection mechanism is specifically:

[0026] x′ ij =x ij ×(1+(1-t / T)×N(0,1))

[0027]

[0028] Among them, x ij is the optimal individual value of the current iteration, x' ij is the optimal individual value after Gaussian mutation, t is the current iteration number, T is the maximum iteration number, N is the Gaussian mutation number, Fit is the objective function before mutation, and Fit' is the objective function after mutation.

[0029] Preferably, the model evaluation indicators are the determination coefficient R2 and the root mean square error RMSE:

[0030]

[0031] Among them, y i represents the true value of the i-th sample, y m represents the mean of y, o(x i ) represents the predicted value of the i-th sample, and n represents the number of samples.

[0032] The present application also proposes a computer-readable storage medium on which a computer program is stored, and the program implements the above method when executed by a processor.

[0033] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:

[0034] 1. This application uses MFZOA in conjunction with the ELM model, and the improved zebra optimization algorithm is used to solve the band selection problem in the ELM regression model, thereby improving the model prediction performance.

[0035] 2. The introduction of the best point set method is used to enrich the initially selected spectral bands, improve the generation method of probability factors and convergence factors, and balance the global and local search capabilities of the algorithm.

[0036] 3. Aiming at the problem that ZOA is prone to fall into local optimality, adaptive Gaussian mutation is introduced to mutate the optimal individuals, thereby improving the optimization performance of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is an algorithm flow chart of MFZOA according to Embodiment 1 of the present application;

[0038] Figure 2 This is a comparison curve diagram of the probability factor before and after improvement in Example 1 of the present application;

[0039] Figure 3 This is a comparison curve of the ZOA and MFZOA convergence factors before and after improvement in Example 1 of the present application;

[0040] Figure 4 This is the ELM model framework diagram in Example 1 of this application;

[0041] Figure 5 This is a graph showing the comparison results of each algorithm on the benchmark test function in Example 2 of the present application;

[0042] Figure 6 The original spectrum of the data set in Example 3 of the present application;

[0043] Figure 7 It is the characteristic wavelength selected by the method in Example 3 of the present application based on the corresponding responses on 4 sets of data sets.

[0044] Figure 8 This is a goodness of fit diagram of the predicted values ​​and actual values ​​of 4 sets of data sets using this method in Example 3 of the present application. DETAILED DESCRIPTION

[0045] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0046] Embodiment 1

[0047] This paper proposes an improved zebra optimization algorithm with multi strategy fusion (MFZOA) to solve the band selection problem in the ELM regression prediction model.

[0048] The Zebra Optimization Algorithm (ZOA) is a population-based heuristic optimization algorithm that updates population members by imitating the foraging behavior and defense against predators of zebras in the wild. The initial position of the zebras in the environment space is random, and each zebra represents a candidate solution to the optimization problem. Therefore, the objective function (Fit) can be evaluated based on the values ​​of the corresponding problem variables. By comparing the values ​​of the objective function, the quality of the corresponding candidate solutions can be effectively analyzed, thereby obtaining the best candidate solution to the problem to be tested.

[0049] The basic process of ZOA mainly includes two stages: initialization and foraging behavior, and defense against predators:

[0050] 1. Initialization: Similar to other optimization algorithms, ZOA randomly initializes the population in the optimization space.

[0051] In ZOA, the initial position of the zebra population has a certain degree of randomness, as shown in formula (1):

[0052]

[0053] Where X represents the initial zebra population, N is the number of zebras in the population, and m is the number of variables in the problem to be solved; i Represents the i-th zebra, whose value is a 01 sequence with 1 row and m columns.

[0054] The zebra with the smallest current fitness value is selected from the initial population as the pioneer zebra PZ, as shown in formula (2):

[0055] PZ=arc(min(Fit)) (2)

[0056] 2. Foraging behavior: In this phase, the population members are updated based on the simulation of the foraging behavior of zebras. The main diet of zebras is grass and sedges, but they will also eat other plants when food is scarce. In ZOA, the best member of the population is considered the pioneer zebra PZ, which guides other members to move to its position.

[0057] PZ guides the population members to the current best position in the search space, as shown in formula (3):

[0058]

[0059] Among them, P1 represents the first stage, which is the foraging behavior stage, x ij P1 is the value of the jth dimension of the i-th zebra in this stage; r is a random number in the interval [0,1], I is a random number in the interval [1,2]; PZ j is the value of the jth dimension of the Pioneer Zebra, x ij Represents the value of the jth dimension of the ith zebra, which can be 0 or 1.

[0060] x ij P1 Then the new value is calculated by formula (4): ij P1 If x is less than 0.5, the new value is 0; ij P1 If it is greater than 0.5, the new value is 1. As shown in formula (4):

[0061]

[0062] PZ leads the population to forage near the best location. If the Fit of the zebra that finds food is better than the current best Fit, the pioneer zebra is updated, otherwise it remains unchanged. As shown in formula (5):

[0063]

[0064] 3. Predator defense behavior: In this stage, the zebra's defense strategy against predator attacks is simulated to update the position of the population members. The main predators of zebras include lions, cheetahs, leopards, wild dogs, hyenas, etc. The zebra's defense strategy varies depending on the predator.

[0065] Zebras encounter two different predators with equal probability. When facing attacks from different predators, zebras will adopt two different defense strategies and update the positions of ZOA population members based on these two strategies.

[0066] A. The predator is a lion, and the zebra chooses the escape strategy. The lion preys on the zebra, and the zebra avoids the lion's attack, as shown in formula (6):

[0067]

[0068] Among them, P2 represents the second stage, which is the stage of defense against predators, and x ij P2 is the value of the jth dimension of the ith zebra in this stage; R is a constant 0.01, r is a random number in the interval [0,1], t is the current number of iterations, T is the maximum number of iterations, and Ps represents a random number in the interval [0,1].

[0069] B. The predator is a small predator, and the zebra chooses an offensive strategy. When a small predator attacks a zebra, other zebras gather around the attacked zebra to scare off the predator, as shown in formula (7):

[0070]

[0071] Among them, P2 represents the second stage, which is the stage of defense against predators, and x ij P2 is the jth dimension value of the i-th zebra in this stage; r is a random number in the interval [0,1], I is a random number in the interval [1,2]; AZ j is the value of the jth dimension of the attacked zebra, x ij Represents the value of the jth dimension of the ith zebra, which can be 0 or 1.

[0072] x ij P2 Then calculate the new value through formula (8): If x ij P2 If x is less than 0.5, the new value is 0; ij P2 If it is greater than 0.5, the new value is 1. As shown in formula (8):

[0073]

[0074] If the Fit of the preyed zebra is better, then the best zebra is updated, otherwise it remains unchanged. As shown in formula (9):

[0075]

[0076] Different initial feature bands will lead to different optimization directions of the algorithm, thus producing different results. Therefore, for the random initialization method in ZOA, it is difficult to ensure the traversability of the initial bands. The multi-strategy fusion improved zebra optimization algorithm (MFZOA) consists of three steps: first, the good point set method is introduced to enrich the initially selected spectral bands; then, a nonlinear convergence factor is designed to update the combination of selected bands; finally, the optimal band combination is mutated and disturbed using adaptive Gaussian mutation to screen out the best band combination.

[0077] like Figure 1 As shown, the present application proposes a MFZOA band selection method based on the ELM model to solve the problems of band information redundancy and low prediction model accuracy in the near-infrared spectrum. First, set the maximum number of iterations T and the initial population of zebras N, use the optimal point set method to select the initial wavelength combination and calculate the objective function value Fit, and select the wavelength combination corresponding to the optimal objective function value as the pioneer zebra PZ; then, enter the foraging behavior stage, and update the wavelength combination according to formulas (3), (4), and (5); then, compare the probability factor PS with 0.5: if PS <= 0.5, select the escape strategy and update the wavelength combination according to formulas (18), (8), and (9); if PS> 0.5, select the attack strategy and update the wavelength combination according to formulas (7), (8), and (9); finally, perform adaptive Gaussian variation detection according to formulas (19) and (20) to update the optimal wavelength combination of this round of iteration. Repeat the above operations for T rounds, compare the Fit values ​​of the optimal wavelength combinations obtained in each round, select the final optimal wavelength combination, and end the MFZOA algorithm. The details are as follows:

[0078] Step 1: Initialize the population. Select the initial wavelength combination as the pioneer zebra through the best point set method and calculate the objective function value Fit.

[0079] This application introduces the optimal point set method to make the characteristic wavelengths selected in the initial stage more evenly distributed, thereby enhancing the diversity of the initial features, improving the performance of the algorithm, and obtaining more effective results. Assuming that the number of spectral bands is m, this method is as follows:

[0080] Let Gs be the unit cube in s-dimensional Euclidean space. If r∈Gs, then the good point set P m (k) is:

[0081]

[0082] Among them, {r s (m) ·k} represents the decimal part, m represents the number of spectral bands, and r is the optimal point.

[0083] r={2cos(2πk / p),1≤k≤s}(p is the smallest prime number satisfying (p-3) / 2)≥s).

[0084] The good point set sequence P m The values ​​in (k) and max(P m (k)) / 2 for comparison, if it is less than max(P m (k)) / 2, the value is 0, otherwise it is 1. That is, the value of the jth position in the good point set sequence is:

[0085]

[0086] Therefore, the final set of good points obtained by this method is:

[0087] X=(P m (k1),P m (k2),…,P m (k j ),…,P m (k m ))(15), which serves as the improved initial population.

[0088] Step 2: position update, update the wavelength combination in the foraging behavior stage; design a nonlinear probability factor to select a defense strategy in the defense against predators behavior stage, design a nonlinear convergence factor to speed up the algorithm convergence, and update the wavelength combination;

[0089] In the second stage of ZOA, one of the two defense strategies is selected based on random probability. This method is too random and is not conducive to the balance between global search and local search. Therefore, this paper designs a nonlinear probability factor to replace the random probability factor in ZOA, which is calculated by formula (16):

[0090] Ps=(2×cos(t / T)-1) (16)

[0091] Among them, t is the current iteration number and T is the maximum iteration number.

[0092] like Figure 2 As shown, the comparison of probability factor before and after improvement.

[0093] When Ps is greater than 0.5, MFZOA selects an offensive strategy, which helps the algorithm to fully search the global situation. Figure 1As shown in the figure, when the iteration cycle is 100, the number of iterations corresponding to the value of Ps is 0.5 is 73, that is, 73% of the cycles are performing global search, which makes it easy to find the best solution in the global range. When Ps is less than 0.5, MFZOA chooses the escape strategy, which is the local development of the algorithm. The algorithm has 27% of the cycles to perform local search at the current best solution, which is conducive to the rapid convergence of the MFZOA algorithm.

[0094] The convergence factor affects the convergence speed of the algorithm, and the linear convergence factor in ZOA is not conducive to the rapid convergence of the algorithm. Therefore, this paper designs a nonlinear convergence factor to replace the linear convergence factor in ZOA to speed up the convergence speed of the algorithm. The nonlinear convergence factor is calculated by formula (17), and the zebra update mechanism is shown in formula (18):

[0095] a=(2×cos(πt / 3T)-1)(17)

[0096]

[0097] Where: x ij P2 is the value of the jth dimension of the ith zebra in the second stage, R is a constant 0.01, a is a number between [0,1], r is a random number in the interval [0,1], t is the current number of iterations, and T is the maximum number of iterations.

[0098] like Figure 3 As shown in Figure 1, the comparison curves of ZOA and MFZOA convergence factors before and after improvement. It can be seen that compared with the convergence factor in ZOA, the improved convergence factor has a larger value and a slower decrease rate in the first half of the iteration cycle, which is conducive to the algorithm to conduct a full global search; while the value decreases rapidly in the second half of the iteration cycle, which is conducive to the rapid local development of the algorithm and enhances the convergence speed of the algorithm.

[0099] Step 3, adaptive Gaussian variation detection, uses the adaptive Gaussian variation detection mechanism to perform variation disturbance on the optimal individual, compares the Fit after variation with the Fit before variation, updates the optimal wavelength combination of this round of iteration, repeats the above operation, compares the Fit values ​​of the optimal wavelength combination obtained in each round, and selects the final optimal wavelength combination.

[0100] At the end of each iteration, ZOA will find the optimal solution in this iteration. To solve the problem that ZOA is prone to fall into the local optimum, this paper introduces adaptive Gaussian mutation to perturb the optimal individual.

[0101] The adaptive Gaussian variation detection mechanism is shown in formulas (19) and (20):

[0102] x′ ij =x ij×(1+(1-t / T)×N(0,1)) (19)

[0103]

[0104] Where: x ij is the optimal individual value of the current iteration, x' ij is the optimal individual value after Gaussian mutation, t is the current number of iterations, T is the maximum number of iterations, N is the number of Gaussian mutations, Fit is the objective function value of the optimal combination before Gaussian mutation, and Fit' is the objective function value of the optimal combination after Gaussian mutation.

[0105] At the beginning of the iteration, the mutation probability is high and the linear adaptive factor takes a large value, which facilitates the algorithm to perform global search; as the number of iterations increases, the mutation probability gradually decreases and the search range narrows. Compare the Fit after mutation with the Fit before mutation, and update the optimal solution.

[0106] Step 4: Establish an ELM prediction model between the selected spectral data and the response to be measured, and judge the prediction ability of the model according to the model evaluation index.

[0107] Extreme Learning Machine (ELM) is an algorithm for solving single hidden layer neural networks. Compared with traditional single hidden layer feedforward neural networks (SLFNs), the biggest feature of this algorithm is that it has a faster learning speed while ensuring learning accuracy. The ELM model framework is as follows Figure 4 shown.

[0108] For a single hidden layer neural network with L hidden nodes, assuming there are n samples (x i ,y i ), each sample has m features, where x i =(x i1 ,x i2 ,…,x im ), y i is the true value of the i-th sample, then this network can be expressed as:

[0109]

[0110] Among them, h(x) is the activation function, w i =(w i1 ,w i2 ,…,w in ) T is the input weight, w i ·x j Indicates w i and x j The inner product of irepresents the bias of the i-th hidden layer unit, β i is the output weight, o j Represents the network output value.

[0111] The goal of single hidden layer neural network learning is to minimize the output error, which can be expressed as:

[0112]

[0113] That is, in theory, there must be β i 、w i and b i , so that

[0114]

[0115] This relationship can be expressed by a matrix: Hβ=y.

[0116] Among them, H is the output matrix of the hidden layer nodes, β represents the output weight matrix, and y represents the expected output matrix.

[0117] In order to train a single hidden layer neural network, it is hoped that there is w i *, b i * and β i *, such that:

[0118] ||H(w i *,b i *)β i *-y||=min||H(w i ,b i )β i -y||,i=1,2,…,L (13)

[0119] In the ELM algorithm, as long as the input weight w i and the hidden layer bias b i is determined randomly, then the output matrix H of the hidden layer will be uniquely determined. The single hidden layer network can be transformed into a linear system with Hβ=y, and the output weight β can be determined:

[0120] β * =H + T (14)

[0121] Among them, H + is the Moore-Penrose generalized inverse matrix of the matrix H, β * The norm of is minimal and unique.

[0122] After step 3, after the relevant characteristic bands are screened out by the band selection method, the ELM prediction model between the selected spectral data and the response to be measured is established. Assuming that there are n samples and the number of bands screened out by the MFZOA method is m, the spectral matrix input to the model is The measured value of each sample is y=(y1, y2,…, yn)T.

[0123] Input (X_in, y), then the model output o(x) can be obtained by formula (21):

[0124]

[0125] The main purpose of wavelength selection is to improve the predictive ability of the model, which is mainly measured by the coefficient of determination (R 2 ) and root mean square error (RMSE) indicators. The range of the coefficient of determination is [0,1], R 2 The closer it is to 1, the higher the degree of explanation of the independent variable for the dependent variable; RMSE is used to measure the deviation between the measured value and the model predicted value. The smaller the RMSE value, the higher the model prediction accuracy. The calculation formulas for the coefficient of determination and the root mean square error are shown in (22) and (23) respectively:

[0126]

[0127]

[0128] Among them, y i represents the true value of the i-th sample, y m represents the mean of y, o(x i ) represents the predicted value of the i-th sample.

[0129] Embodiment 2

[0130] This application selects 12 benchmark test functions to test the performance of the algorithm, and the benchmark test functions are shown in Table 1.

[0131] Table 1 Benchmark functions

[0132]

[0133]

[0134] MFZOA is compared with the zebra optimization algorithm (ZOA), particle swarm optimization algorithm (PSO), differential evolution algorithm (DE), simulated annealing algorithm (SA), genetic algorithm (GA), grey wolf optimization algorithm (GWO), and whale optimization algorithm (WOA). The population number and iteration number of all algorithms are set to 30 and 1000 to ensure the fairness of the experiment. Figure 5As shown in Table 2, all optimization algorithms are run 30 times independently, and the mean (Mean) and standard deviation (Std) of the running results are used as indicators. As shown in Table 2, the comparison results of the benchmark test function of each algorithm are given.

[0135] Table 2 Comparison of the results of the benchmark test functions of each algorithm

[0136]

[0137]

[0138] Embodiment 3

[0139] In order to test the effectiveness of the algorithm proposed in this paper in solving the band selection problem, this paper conducts experiments on four sets of public datasets (corn, almond sugar, soil, and grain datasets):

[0140] The corn dataset contains 80 corn samples, each with a spectral range of 1100-2498nm and 700 bands. The response output variables are the moisture value (Moisture), oil content value (Oil) and starch content value (Starch) of corn; the almond candy dataset contains 32 almond candy samples, each with a spectral range of 850-2048nm and 600 features. The response output variables are the moisture content value (Moisture) and sweetness value (Sugar) of almond candy; the soil dataset contains 108 soil samples, each with a spectral range of 1000-2498nm and 750 features. The response output variable is the soil organic matter content value (Organic Matte) and ergosterol content (Ergosterol); the grain data set contains 80 grain samples, each sample has a spectral range of 1104-2496nm, 117 features, and the response output variables are casein content (Casein), glucose content (Glucose), and lactic acid content (Lactate). Figure 6 As shown, the original spectra of the above data sets are given, where the horizontal axis represents the spectral band range of each data set, and the vertical axis represents the spectral value of each data set.

[0141] like Figure 7 As shown, the characteristic wavelengths selected by the method of the present application and the corresponding responses on 4 sets of data sets are shown. The horizontal axis represents the spectral range, the vertical axis represents the spectral value of the sample, the black curve is the spectral curve of the sample, and the blue bar is the characteristic band selected by the MFZOA band selection method.

[0142] For the corn dataset, Figure 7As shown in (a) to (c) in the figure, the selected bands near 1650-1800nm ​​and 2240-2370nm are related to the first overtone of CH stretching vibration of methyl, methylene and vinyl, and the combination of CH stretching and bending modes. These chemical bonds are related to the composition of oil content; the selected bands near 1900nm and 2108nm are related to the OH combination overtone and the asymmetric stretching and bending combination of water. Starch is mainly composed of OH and CH. The band near 1740-1780nm selected in the prediction is also involved in this paper; for the almond sugar data set, such as Figure 7 As shown in (d) to (e) in the figure, the area near the 1900nm band corresponds to the combination of water absorption and OH bonds; for the soil data set, Figure 7 As shown in (f) to (g) in the figure, the characteristic wavelengths of soil organic matter include 993nm, 1080nm, 1951nm, 2277nm and 2440-2460nm, and the characteristic wavelengths of ergosterol are predicted to be 1682 and 1910nm. Similar results to those in previous studies were also found in this application. For the grain dataset, Figure 7 As shown in (h) to (j), in the prediction of casein content, the band regions near 1760nm and 2180nm are related to the vibration modes of OH and NH, and the bands near 1100nm and 1650nm are related to the CO stretching vibration peak and the aldehyde peak, respectively, which is due to the characteristics of glucose.

[0143] Tables 3, 4, 5, and 6 give the evaluation of the ELM model combined with the MFZOA wavelength selection method in four data sets, and the results are compared with the ELM models of the full spectrum, IRIV, SPA, CARS, SA, and ZOA.

[0144] Table 3 Comparison of models based on different wavelength selection methods based on corn dataset

[0145]

[0146]

[0147] Table 4 Model comparison based on the almond sugar dataset under different wavelength selection methods

[0148]

[0149] Table 5 Comparison of models based on different wavelength selection methods based on soil dataset

[0150]

[0151]

[0152] Table 6 Comparison of models based on grain datasets using different wavelength selection methods

[0153]

[0154] In the comparison table of model performance evaluation of each data set and different wavelength selection methods, Tables 3-6 show the evaluation of several responses corresponding to the four data sets. Among them, No.1 represents the ELM prediction model established using all spectral bands in each response, No.2-No.6 represents the ELM prediction model established after the band selection method, and No.7 represents the band selection method proposed in this paper to select characteristic variables and establish the ELM prediction model. RMSEC and RMSEP represent the root mean square error of the model training set and test set, respectively, and RC2 and RP2 represent the determination coefficient of the model training set and test set, respectively.

[0155] Table 3 shows the effect of using different wavelength selection methods to establish models for each response in the corn data set. It can be seen from Table 3 that: first, the evaluation indicators of the model established by the full spectrum on the three responses are the worst, that is, the prediction performance of the model can be improved by establishing the prediction model through the wavelength selection method; secondly, the number of bands selected by the MFZOA band selection method is above average compared with the band selection methods of NO.2-NO.6, and the evaluation indicators of the model established by the MFZOA method are all the best. For example, in the prediction of oil content, the number of bands selected by the MFZOA method is 338, which is lower than the 361 selected by the SA method, and more than the number of bands selected by other algorithms. In addition, the root mean square errors of the training set and the test set of the model established by the characteristic bands selected by the MFZOA method are 0.0132 and 0.0239, respectively, and the determination coefficients are 0.9948 and 0.9800, respectively, which are the best results among the comparison methods; in the prediction of starch content, the number of bands selected by the MFZOA method is 360, which is lower than the 362 selected by the ZOA method. The root mean square errors of the training set and test set of the model established by the characteristic bands selected by the MFZOA method are 0.0469 and 0.0903, respectively, and the determination coefficients are 0.9972 and 0.9823, respectively, which are also the best results among the comparison methods; in moisture detection, the root mean square errors of the training set and test set of the model established by the MFZOA method are 0.0325 and 0.0393, respectively, and the determination coefficients are 0.9937 and 0.9841, respectively, which are the best results among the comparison methods, which are about 0.02 smaller than the second-ranked ZOA in the root mean square error index and about 0.01 to 0.02 larger in the determination coefficient index. The above is enough to show that the more selected bands are not the better, or the fewer the better, only by selecting the appropriate corresponding bands can the best results be obtained.

[0156] The above conclusions can be drawn from the almond dataset in Table 4, the soil dataset in Table 5, and the grain dataset in Table 6. In addition to the detection of water content in almonds, the root mean square errors of the training set and test set of the MFZOA-ELM model are 0.8254 and 0.5118, respectively, and the determination coefficients are 0.9412 and 0.9842, respectively. Among them, in the evaluation indicators of the training set, MFZOA is second only to IRIV, and the root mean square error and determination coefficient of the training set of the IRIV-ELM model are 0.6744 and 0.9609. In the rating indicators of the test set, the MFZOA method is the best, followed by the IRIV method, and its root mean square error and determination coefficient of the test set are 0.9485 and 0.9673.

[0157] From the analysis of the above model prediction results, it can be seen that the algorithm proposed in this paper can screen out spectral bands suitable for modeling in the above four groups of spectral data sets, and the prediction model established through these characteristic bands can obtain the best performance effect among these comparison methods. Figure 8 The goodness-of-fit diagram of the MFZOA-ELM predicted values ​​and actual values ​​of the responses in each data set is shown. The predicted values ​​of the responses in each data set are in good agreement with the reference values. Although there are deviations, most of the prediction results are relatively ideal, with small errors and large determination coefficients.

[0158] This application improves the zebra optimization algorithm, applies the improved zebra optimization algorithm to the near-infrared spectral band selection and establishes an ELM prediction model. This application conducts experiments on four public near-infrared data sets (corn, almond sugar, soil and grain data sets) to evaluate the effectiveness of the selected band combination. The experimental results show that the combination of MFZOA and the ELM model has better prediction performance. Under the different responses of the corn, almond sugar, soil and grain data sets, the root mean square error of the predicted value is 0.0239~0.0903, 0.5118~2.0253, 0.9596~25.1572 and 1.6270~2.6965, respectively, which fully demonstrates the effectiveness and superiority of the algorithm in this paper in solving the problem of near-infrared spectral band selection. Therefore, the method MFZOA of this application can be used to solve the problem of near-infrared spectral band selection.

[0159] The embodiments of this specific implementation method are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.

[0160] Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0161] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A wavelength selection method based on multi-strategy fusion improved zebra optimization algorithm, characterized in that: The following steps are involved: Step 1: Initialize the population, select the initial wavelength combination as the pioneer zebra through the best point set method and calculate the objective function value Fit; Step 2, position update, updating the wavelength combination during the foraging behavior phase; In the stage of defending against predators, nonlinear probability factors are designed to select defense strategies, nonlinear convergence factors are designed to speed up algorithm convergence, and wavelength combinations are updated; Step 3: Adaptive Gaussian variation detection: Adaptive Gaussian variation detection mechanism is used to perform variation disturbance on the optimal individual, and the Fit after variation is compared with the Fit before variation, and the optimal wavelength combination of this round of iteration is updated. The above operation is repeated, and the Fit values ​​of the optimal wavelength combinations obtained in each round are compared to select the final optimal wavelength combination. Step 4: Establish an ELM prediction model between the selected spectral data and the response to be measured, and judge the prediction ability of the model according to the model evaluation index.

2. The wavelength selection method according to claim 1, characterized in that: The good point set method is specifically as follows: Assuming that the number of spectral bands is m, let Gs be the unit cube in s-dimensional Euclidean space, if r∈Gs, then the good point set P m (k) is: Among them, {r s (m) k} represents the decimal part, m represents the number of spectral bands, r is the optimal point, and is taken as: r = {2cos(2πk / p), 1≤k≤s} (p is the smallest prime number that satisfies (p-3) / 2)≥s); The good point set sequence P m The values ​​in (k) and max(P m (k)) / 2 for comparison, if it is less than max(P m (k)) / 2, the value is 0, otherwise it is 1. That is, the value of the jth position in the good point set sequence is: The obtained good point set: X = (P m (k1),P m (k2),…,P m (k j ),…,P m (k m )), as the improved initial light wave population.

3. The wavelength selection method according to claim 1, characterized in that: The nonlinear probability factor Ps is: Ps=(2×cos(t / T)-1) Among them, t is the current iteration number and T is the maximum iteration number.

4. The wavelength selection method according to claim 3, characterized in that: The nonlinear probability factor Ps, when Ps≤0.5, selects the escape strategy; when Ps>0.5, selects the attack strategy.

5. The wavelength selection method according to claim 1, characterized in that: The nonlinear convergence factor a for: a=(2×cos(πt / 3T)-1) Among them, t is the current iteration number and T is the maximum iteration number.

6. The wavelength selection method according to claim 1, characterized in that: The adaptive Gaussian variation detection mechanism is specifically: x′ ij =x ij ×(1+(1-t / T)×N(0,1)) Among them, x ij is the optimal individual value of the current iteration, x' ij is the optimal individual value after Gaussian mutation, t is the current iteration number, T is the maximum iteration number, N is the Gaussian mutation number, Fit is the objective function before mutation, and Fit' is the objective function after mutation.

7. The wavelength selection method according to claim 1, characterized in that: The model evaluation indicators are the determination coefficient R2 and the root mean square error RMSE: Among them, y i represents the true value of the i-th sample, y m represents the mean of y, o(x i ) represents the predicted value of the i-th sample, and n represents the number of samples.

8. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Cited By

  • Micro-service deployment method for joint request routing in edge environment

    CN119363583A

  • Method and device for detecting fat content of milk powder

    CN120431568A

  • A method and device for detecting the fat content of milk powder

    CN120431568B