Abstract:Objective To establish a rapid and accurate detection and analysis method for mycotoxins.Methods Based on near-infrared spectroscopy, qualitative models for the contents of zearalenone (ZEN) and deoxynivalenol (DON) in maize were established. 144 naturally contaminated maize samples were used, and near-infrared spectra were collected from two sample preparations, namely maize powder and toxin extract. Five pretreatment methods were applied to process the original spectra, and two characteristic wavelength screening methods were selected to further extract effective information from the spectra. Pollution classification models for ZEN and DON were established using three machine learning algorithms, namely k-nearest neighbor classification algorithm, least squares support vector machine, and random forest, as well as the long short-term memory (LSTM) network algorithm of deep learning.Results The LSTM algorithm outperforms other algorithms on the spectral data of maize powder. For ZEN, the classification accuracy of the test set of the optimal qualitative model reaches as high as 97%, while that of the optimal qualitative model for DON is 83%.Conclusion The LSTM algorithm can effectively alleviate the overfitting problem and significantly improve the classification performance of the model.