Abstract:
The detection of pesticide residues in agricultural products is an important step in ensuring the food safety of agricultural products, while traditional detection methods are cumbersome and costly. Using broccoli as a sample, this article used hyperspectral technology combined with machine learning algorithms and deep learning algorithms to provide a simple, fast, low-cost, and non-destructive method for detecting pesticide residues in broccoli. The study collected hyperspectral images in 400~1000 nm of broccoli samples sprayed with different types of pesticides and clean water. Two data preprocessing methods, namely Multivariate Scattering Correction (MSC) and Savitzky Golay Smoothing (SG Smoothing), as well as Principal Component Analysis (PCA), Competitive Adaptive Reweighted Sampling (CARS), and Successive Projection Algorithm (SPA) were used to reduce the dimensionality. A Support Vector Machine (SVM) recognition model was established for pesticide residue discrimination. The SVM-SG-SPA combination has the best discrimination effect, with recognition accuracy of 92.86%, 94.29%, 91.43%, and 92.86% for high-efficiency cypermethrin, chlorpyrifos, imidacloprid, and water, respectively. A one-dimensional convolutional neural network (1D-CNN) model was established using raw spectral data, which achieved recognition accuracy of 94.29%, 95.71%, 94.29%, and 97.14% for high-efficiency cypermethrin, chlorpyrifos, imidacloprid, and water, all of which were higher than the SVM model. The results indicate that the combination of hyperspectral imaging technology and deep learning algorithms as 1D-CNN not only simplifies the recognition process of pesticide residues in broccoli, but also improves recognition efficiency and accuracy.