| The non-destructive analysis technology based on Near Infrared Spectroscopy(NIRS)has become an extremely important perception of intrinsic information tool in the fields of the chemical industry,agriculture,food,pharmaceuticals,and other fields,which has promoted the high-quality development of the related industries.However,NIRS as an indirect measurement technique,its application relies on analytical models that characterize the relationships between the spectral matrix and the chemical or physical properties.The main challenges facing the existing NIRS modeling are:(1)Spectral differences between similar substances are small,while the classical spectral modeling method has weak signal analysis ability and relies on prior knowledge and a lot of trials to try and error various feature extraction methods.The modeling process is complex and the cycle is long.(2)Spectral modeling relies on wet chemical analysis to provide a large number of labeled samples,the cost of data label acquisition is expensive,and the amount of labeled spectral data is small,leading to easy over-fitting of the model.(3)There are differences between spectroscopic instruments,which can easily lead to difficulties in achieving the same predictive performance when the model established on one instrument is applied to other instruments.Based on the above-mentioned NIRS modeling pain points,this paper introduces deep learning and transfer learning and proposes a variety of effective solutions around spectral modeling and model transfer.The main work and innovations are as follows.(1)A Transformer-based spectral modeling method is proposed to solve the problem that the classical qualitative analysis method has a complex modeling process and the deep learning model depends on the selection of hyperparameters.The model named Spectra Tr uses an attention mechanism instead of convolutional operations to extract spectral features and then uses a multilayer perceptron to establish the mapping relationship between features and labels.In the qualitative analysis experiments of 7 drug spectra and 18 drug spectra provided by the China Institute of Food and Drug Identification,the prediction accuracy of the Spectra Tr model reached 100%and 99.52%,respectively,outperforming PLS_DA,SVM,SAE,and CNN.The results on the publicly available drug spectral dataset show that Spectra Tr has a classification accuracy of 96.97%without the pre-processing algorithm,which is 2.73%~34.85%higher than PLS_DA,SVM,AE,and CNN.The Spectra Tr model has been shown to perform well in spectral analysis,automatically extracting features from spectra,does not depend on pre-processing algorithms,and is insensitive to model hyperparameters.(2)A spectral modeling method based on convolutional neural networks and transfer learning is proposed to solve the problems of weak signal analysis ability of existing quantitative analysis methods and inter-instrument differences.First,a network named MSRCNN was constructed,based on multi-scale fusion and residual structure.On the public spectral data sets of medicines and wheat collected by a single instrument,the RMSE and R~2of MSRCNN reached 2.587,0.981,and 0.309,0.977,respectively,which outperforms PLS,SVM,and CNN.Then four model transfer strategies are designed to transfer the established MSRCNN to other spectroscopic instruments.After fine-tuning by30 samples of other instruments,the strategy of transferring convolutional layers and fully connected layers is the most effective,with RMSE and R~2of 2.289,0.982 and 0.379,and0.965,respectively.Increasing the samples involved in fine-tuning can further improve the predictive performance of the model on different instruments.(3)A semi-supervised spectral modeling method based on DCGAN and transfer learning is proposed to solve the problems of insufficient labeled spectral data,deep learning models that are prone to overfitting and inter-instrument differences.First,the DCGAN network is used to continuously generate and discriminate spectra on the unlabeled spectral data,and learn the general feature representation of the spectra in a game-like manner.With only 50 labeled samples participating in the transfer,the RMSE and R~2of DCGAN-CNN are 0.605 and 0.872,respectively,which outperforms directly modeled CNN,PLS,and SVR.When increasing the normal level of training samples to200,the RMSE and R~2of DCGAN-CNN reached 0.192 and 0.989.When DCGAN-CNN is transferred to the other three instruments,its RMSE is 0.563,0.712,and 0.749,respectively.Experiments show that the proposed method reduces the requirement of the deep learning model for the number of labeled samples,improves the prediction accuracy of the CNN model,and effectively solves the problem of applying the model to different instruments. |