| With its fast,non-destructive,green and non-polluting advantages,near-infrared spectroscopy has gradually replaced traditional chemical analysis methods in recent years and has been used in the detection of many products such as fruits,grains,petroleum,and pharmaceuticals.However,the collected spectral data generally contain a lot of noise,irrelevant variables and even interference variables.These noises will seriously interfere with the accuracy of near-infrared analysis.Hot spots for infrared analysis.The wavelength variable selection method can not only propose irrelevant noise in the spectral data,but also improve the prediction ability of the model,reduce the complexity of the model,enhance the interpretability of the model,and increase the prediction speed of the model.As a wavelength selection method,the intelligent algorithm shows good performance that many other methods do not have,and it plays an irreplaceable role in the popularization and development of nearinfrared analysis technology.The research content of this paper is mainly as follows:(1)Aiming at the efficiency of the near-infrared spectrum wavelength selection method based on the intelligent algorithm,an improved whale optimization algorithm(Improved whale optimization algorithm,i WOA)is proposed.First,in order to improve the efficiency of the algorithm,follow the genetic algorithm to divide the wavelength variable into several bands.These bands correspond to the location gene information of the whale.The position gene adopts binary code,’1’ means to select this band,and ’0’ means not to choose;then Three improvement schemes are proposed for the whale optimization algorithm—chaotic strategy initialization population,nonlinear time-varying Sigmoid transfer function,and the introduction of greedy algorithm ideas.After the near-infrared spectral data of corn fat,protein,starch and water were selected by the i WOA algorithm wavelength,the PLS prediction model established was compared with the full spectrum and several other algorithms.The experimental results show that the performance of the model established by the i WOA algorithm is better than other wavelength selection algorithms.The number of variables selected by the algorithm is less,the screening process takes less time,the operation efficiency is higher,and the prediction accuracy of the established model is also higher.(2)The advantage of the i WOA algorithm is its high efficiency,but its prediction stability and accuracy still have room for improvement.In view of this,an improved butterfly optimization algorithm(Improved butterfly optimization algorithm,i BOA)is proposed.First,an adaptive weight coefficient position update strategy is given,the purpose is to reasonably allocate the algorithm to perform local search and global search at the appropriate stage;secondly,in order to further improve the exploration ability of the algorithm,the simulated annealing algorithm is introduced into the butterfly position update Finally,local optimization is carried out;finally,in order to make the algorithm show better performance in solving the wavelength selection problem,an improved fitness function is given.After the i BOA algorithm performs wavelength selection on the four-component data set of corn,the PLS prediction model established is compared with i BOA and other algorithms.The experimental results show that compared with the i WOA algorithm,the i BOA algorithm not only greatly reduces the volatility of the predicted value,but also slightly improves the prediction accuracy of the algorithm,and the number of wavelengths to be screened is also greatly reduced.Therefore,a simpler,more robust and more accurate forecasting model is established through the i BOA algorithm.(3)In order to verify the screening effects of the proposed two algorithms i WOA and i BOA on other data sets,a near-infrared spectrum quantitative analysis and prediction system was designed to measure the near-infrared spectrum data of two types of red grapes with nuclei and non-nuclei and to select wavelength variables.The results show that both algorithms show excellent results in the prediction of sugar content in red grapes. |