An improved near-infrared spectral wavelength selection and modeling method for artificial bee colony algorithms.

By improving the artificial bee colony algorithm (I-ABC) to optimize the selection of near-infrared spectral wavelengths, the problems of standard algorithms getting stuck in local optima and slow convergence speed are solved, achieving more efficient and accurate feature wavelength selection and model building, and improving prediction accuracy and robustness.

CN122088237APending Publication Date: 2026-05-26ZHONGKEVOYE JIANGSU BIOLOGICAL CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202512008669.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-29
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

When processing high-dimensional near-infrared spectral data, the standard artificial bee colony algorithm is prone to getting stuck in local optima and has a slow convergence speed in the later stages of iteration, resulting in complex models, large computational load, and poor prediction accuracy and robustness.

Method used

An improved artificial bee colony algorithm (I-ABC) is adopted, which initializes the nectar source population using Logistic chaotic mapping, optimizes the wavelength selection process by combining adaptive perturbation factors and greedy selection strategies, evaluates fitness through partial least squares model, and dynamically adjusts the search strategy to balance global and local searches.

Benefits of technology

It improves the convergence speed and accuracy of the algorithm, enhances the optimization ability in high-dimensional space, establishes a more representative and robust model, and reduces prediction error and computational complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122088237A_ABST
    Figure CN122088237A_ABST
Patent Text Reader

Abstract

This invention discloses an improved near-infrared spectral wavelength selection and modeling method for artificial bee colony algorithms, comprising the following steps: data preparation, chaotic initialization, fitness evaluation, establishing a PLS model based on wavelength subsets, using the regularized fitness function of RMSECV as the fitness Fitnessxi of nectar source xi; searching for foraging bees; searching for observation bees; searching for scout bees; outputting the optimal wavelength subset Sbest and establishing the final PLS model. The beneficial effects of this invention are: the method effectively improves convergence speed and accuracy; chaotic initialization improves the quality of the initial population, avoiding the algorithm from prematurely falling into local extrema; the adaptive perturbation factor balances the algorithm's global search and local exploitation, improving the ability to find the optimal wavelength combination in high-dimensional discrete space, and the selected wavelength subset has stronger representativeness, resulting in a final PLS model with lower RMSEP (root mean square error of prediction) and better robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of spectral data processing technology, specifically relating to an improved near-infrared spectral wavelength selection and modeling method for artificial bee colony algorithms. Background Technology

[0002] Near-infrared spectroscopy is widely used in agriculture, medicine, petrochemicals, and other fields due to its rapid, non-destructive, and low-cost characteristics. However, NIR spectroscopy typically has the following characteristics: 1. High dimensionality: There are many data points, and the number of variables is much greater than the number of samples.

[0003] 2. Collinearity: Adjacent wavelengths are highly correlated.

[0004] 3. Information redundancy and noise: It contains a large amount of background information and random noise that are irrelevant to the attribute being measured.

[0005] Directly using full-spectrum modeling leads to complex models, high computational cost, and poor prediction accuracy and robustness. Therefore, wavelength selection is crucial for improving NIR model performance. Commonly used selection methods such as the Continuous Projection Algorithm (SPA), Genetic Algorithm (GA), and Particle Swarm Optimization (PSO) have limitations. While the standard Artificial Bee Colony Algorithm (ABC) is simple and efficient, it is prone to getting trapped in local optima when dealing with high-dimensional discrete optimization problems, and its convergence speed is slow in the later stages of iteration, failing to fully explore the optimal wavelength combination. Summary of the Invention

[0006] To address the aforementioned shortcomings, this invention aims to utilize an optimization algorithm to screen characteristic wavelengths in high-dimensional near-infrared spectral data and to establish a high-precision quantitative analysis model. Therefore, it provides an improved artificial bee colony algorithm (I-ABC) for efficient and accurate screening of characteristic wavelengths in near-infrared spectra.

[0007] This invention provides the following technical solution: An improved near-infrared spectral wavelength selection and modeling method for artificial bee colony algorithms includes the following steps: Step 1: Data Preparation and Preprocessing The near-infrared spectral matrix Χ and the corresponding physicochemical value vector Y of the sample are acquired, and the calibration set and validation set are divided. Spectral preprocessing is performed on Χ, such as smoothing, baseline removal, standard normal transformation (SNV), or multivariate scattering correction (MSC).

[0008] Step 2: Parameter Setting and Encoding Define the population size NP, maximum number of iterations M, and scout bee limit threshold for I-ABC. Use binary encoding, where 0 indicates that the wavelength is not selected, and 1 indicates that the wavelength is selected.

[0009] Step 3: Chaos Initialization An initial nectar source population P is generated using a Logistic chaotic mapping, where a nectar source is defined as a candidate solution for optimization. The Logistic chaotic mapping replaces traditional random initialization to generate the initial nectar sources. This can increase the ergodicity and uniformity of the initial population.

[0010] Logistic chaotic mapping function: ) in, , The generated chaotic sequence is mapped to a continuous space representing the bee's location.

[0011] Step 4: Fitness Assessment For each honey source Using the Sigmoid function (5) Map consecutive positions to selection probabilities and binarize them to obtain wavelength selection subsets. A partial least squares (PLS) model was built using this subset of data, and the root mean square error of cross-validation (RMSECV) was calculated as the objective function. ; (4) fitness function (3).

[0012] RMSECV is calculated using k-fold cross-validation, where k=5 or k=10.

[0013] Step 5: Bee Collection Stage Foraging bees choose nectar sources from their own location and randomly selected neighboring sources. Generate a new solution The update strategy formula is as follows: (1); (2); Where t is the current iteration number and M is the maximum iteration number. This is an adaptive perturbation factor, whose value is dynamically adjusted according to the current iteration number t, to achieve large-step global search in the early stage and small-step local fine-tuning in the later stage; neighbor honey source This refers to the current honey source A set of candidate solutions near the location, where the selection of neighboring honey sources can be based on distance, random selection or index, and the specific selection method will be optimized according to the algorithm design.

[0014] Step Six: Observing the Bee Stage The bees observe the fitness of the foraging bees and select nectar sources through a roulette wheel mechanism. After selection, they also use an adaptive perturbation strategy to generate new solutions. They generate new solutions based on the adaptive perturbation factor ϕ and update them. The nectar sources are updated through formulas (1) and (2), and a greedy selection strategy is used to update the nectar sources.

[0015] Step Seven: Reconnaissance Bee Phase If the number of nectar source trials If the limit is exceeded, the honey source is discarded and reinitialized using chaotic mapping or random methods to generate a new honey source.

[0016] Step 8: Optimal Solution Output and Modeling Iterate M times, then output the wavelength subset corresponding to the honey source with the highest fitness. The final quantitative analysis model of PLS ​​is then established using this subset.

[0017] The beneficial effects of this invention are: 1. This invention can effectively improve the convergence speed and accuracy: chaotic initialization increases the quality of the initial population and avoids the algorithm from getting trapped in local extrema too early.

[0018] 2. The method of this invention enhances the optimization capability. The adaptive perturbation factor balances the global search and local exploitation of the algorithm, improving the ability to find the optimal wavelength combination in a high-dimensional discrete space.

[0019] 3. The model established by the method of the present invention has high robustness, and the selected wavelength subset has stronger representativeness, resulting in a lower RMSEP (root mean square error of prediction) and better robustness in the final PLS model. Attached Figure Description

[0020] Figure 1 This is a schematic diagram of the overall process of the present invention; Figure 2 This is a schematic diagram of the experimental data results for an example. Detailed Implementation

[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0022] To verify the effectiveness of the improved wavelength selection algorithm for modeling, it will be applied to a set of maize data. This dataset is taken from the open-source maize sample spectral dataset on the eigenvector website, and the spectral data and starch content values ​​obtained by scanning with an m5spec instrument are selected.

[0023] Combination Figure 1 Shown: An improved near-infrared spectral wavelength selection and modeling method for artificial bee colony algorithms includes the following steps: Step 1: Divide the near-infrared spectral matrix X and the corresponding starch content vector Y of the corn samples into a calibration set and a validation set. Perform spectral preprocessing on X, such as smoothing, baseline removal, standard normal transformation (SNV), or multivariate scattering correction (MSC).

[0024] Step 2: Parameter Setting and Encoding Set the population size NP, the maximum number of iterations M, and the scout bee limit threshold Limit for I-ABC.

[0025] Code: Each honey source It is a continuous vector of length m (the number of spectral wavelengths), representing the "preference" for selecting m wavelength points, and is expressed through the Sigmoid transfer function. Calculate the first The probability of a wavelength being selected is encoded in binary, where 0 indicates that the wavelength is not selected and 1 indicates that the wavelength is selected. Then, a threshold (e.g., 0.5) is used to determine whether the wavelength is 0 or 1, forming a binary selection vector. .

[0026] Step 3: Chaos Initialization Implementation To improve the quality of the initial population, a Logistic mapping is chosen: Random selection and ; Generate a chaotic sequence by iterating k times k [100,500].

[0027] Map Z to the initial range [L,U] of the nectar source location. In this embodiment, the initial range is set to [-1,1] to obtain the initial population P.

[0028] Step 4: Fitness Assessment Fitness function: Set the number of latent variables (principal components) A, and apply the fitness function to each honey source. Using the Sigmoid function (5) Map consecutive positions to selection probabilities and binarize them to obtain wavelength selection subsets. Using this subset of data, a partial least squares (PLS) model was built, and the root mean square error of cross-validation (RMSECV) was calculated as the objective function. Using K=5 or K=10 fold cross-validation, calculate RMSECV corresponding to the data subset.

[0029] Step 5: Bee Collection Stage Foraging bees choose nectar sources from their own location and randomly selected neighboring sources. Generate a new solution The update strategy formula is as follows: (1); Where t is the current iteration number and M is the maximum iteration number. This is an adaptive perturbation factor, whose value is dynamically adjusted according to the current iteration number t; Neighbor honey source This refers to the current honey source A set of candidate solutions near the location, where the selection of neighboring honey sources can be based on distance, random selection or index, and the specific selection method will be optimized according to the algorithm design.

[0030] During the bee-collecting and bee-observation stages, the traditional It is a random number between [-1, 1]. This invention introduces an adaptive perturbation factor. The algorithm shrinks as the number of iterations t increases to balance global and local search capabilities. (2) Where rand(-1,1) is a uniformly random number between [-1,1], t is the current iteration number, and M is the maximum iteration number. When t is small (early stage), the factor is close to 1, and the search range is large (global search); when t is close to M (later stage), the factor tends to 0, and the search range is small (local fine search).

[0031] Step Six: Reconnaissance Bee Phase When a certain honey source Number of trials When the set limit is reached, it indicates that the solution has not been updated for a long time and may be a local optimum or a bad solution.

[0032] New interpretation New diversity can be introduced by reapplying the chaotic initialization step, thereby helping the algorithm escape local optima.

[0033] Step 7: Model Building Finally, the globally optimal solution is found. Corresponding wavelength subset .use Corresponding spectral data Based on the physicochemical values ​​y, determine the optimal number of latent variables. (Determined through k-fold cross-validation), the final PLS model is established.

[0034] The experimental results are as follows: A strategy of repeatedly selecting wavelength variables was adopted, with the improved ABC algorithm and other algorithms run 50 times each, and the number of repeatedly selected wavelength variables was counted. The wavelength variable corresponding to the minimum RMSECV value was selected as the preferred feature wavelength to establish a regression correction model, effectively reducing the complexity of the model.

[0035] Depend on Figure 2 It can be seen that the variable bands with selected frequencies above 15 for starch are: 1680 ~ 1700 nm, 1740 ~ 1780 nm and 1980 ~ 2000 nm. These regions are consistent with the second harmonic of CH stretching vibration and the first harmonic of OH stretching vibration in starch.

[0036] To verify the effectiveness of the algorithm, the improved ABC algorithm was compared with the original spectrum and the GA and ABC wavelength selection algorithms. A PLS prediction model for starch components was constructed, and the number of selected wavelength variables, the correlation coefficient (Rc) and root mean square error (RMSEC) of the calibration set, and the correlation coefficient (Rp) and root mean square error (RMSEP) of the prediction set were used as evaluation criteria. The mean of each index was calculated 50 times, and the standard deviation (SD) was the standard deviation of the 50 RMSEP values. The results are shown in Table 2. Among the above evaluation indicators, the number of principal factors selected in PLS modeling for the same component was the same; the fewer wavelengths selected by the algorithm, the lower the complexity of the prediction model; the larger the correlation coefficient of the calibration set and the correlation coefficient of the prediction set, the better the stability of the model; the lower the root mean square error of the calibration set and the root mean square error of the prediction set, the better the prediction accuracy of the model; similarly, the less time the algorithm takes, the higher the modeling efficiency. As can be seen from the table, the stability and accuracy of the prediction model established after the wavelength selection of the improved ABC algorithm were significantly improved. Compared with ABC and GA, the improved ABC algorithm, after wavelength selection, establishes a model with the highest correlation coefficient, the lowest root mean square error, the fewest number of wavelengths selected, the least time spent by the algorithm, and the highest algorithm efficiency.

[0037] Table 2. Performance of different wavelength selection methods on the corn starch index correction and prediction sets. It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered in all respects as exemplary and non-limiting, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.

[0038] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims

1. An improved near-infrared spectral wavelength selection and modeling method for artificial bee colony algorithms, characterized in that, Includes the following steps: S1. Data preparation: Acquire spectral matrix X and physicochemical values ​​Y; S2. Chaotic initialization: Generate the initial honey source population P using Logistic chaotic mapping; S3. Fitness Evaluation: A PLS model is established based on wavelength subsets, using the RMSECV regularized fitness function as the honey source. fitness ; S4. Bee Search: Bees are searched based on adaptive perturbation factors. It dynamically balances global search and local development, generates new solutions, and makes greedy selections. S5. Observer Bee Search: The observer bee selects a nectar source by roulette wheel selection, and also generates and updates a new solution based on the adaptive perturbation factor ϕ. S6. Scout Bee Search: If the number of trials for a certain nectar source reaches the specified limit, it will be reinitialized; S7. Output the optimal wavelength subset And establish the final PLS model.

2. The near-infrared spectral wavelength selection and modeling method for an improved artificial bee colony algorithm according to claim 1, characterized in that: The chaos initialization adopts Mapping Formula Generate a chaotic sequence and linearly map the sequence to the continuous value space of the honey source location.

3. The near-infrared spectral wavelength selection and modeling method for an improved artificial bee colony algorithm according to claim 1, characterized in that: Step S4 involves the foraging bee selecting neighboring nectar sources based on its own location and a randomly chosen neighboring nectar source. Generate a new solution The updated formula is as follows: (1) in, For adaptive perturbation factors, neighboring honey sources This refers to the current honey source A set of candidate solutions near the location; The adaptive perturbation factor The formula is dynamically adjusted with the number of iterations t to balance global search and local exploration. ,(2) Where t is the current iteration number and M is the maximum iteration number.

4. The near-infrared spectral wavelength selection and modeling method for an improved artificial bee colony algorithm according to claim 1, characterized in that... The fitness evaluation function is: (3); RMSECV is calculated using k-fold cross-validation, where k=5 or k=10. (4)。 5. The near-infrared spectral wavelength selection method for an improved artificial bee colony algorithm according to claim 1, characterized in that: The wavelength selection employs binary encoding; consecutive honey source locations are mapped to selection probabilities using a Sigmoid function, and then binarized to either 0 or 1; the Sigmoid function is... (5)。 6. The near-infrared spectral wavelength selection and modeling method for an improved artificial bee colony algorithm according to claim 1, characterized in that: The modeling method used is partial least squares (PLS).