Rosmarinic acid (RA) and Carnosic acid (CA) are key compounds in Salvia rosmarinus Spenn. In order to perform rapid detection of RA and CA, a method based on hyperspectral imaging technology (HSI) and machine learning was proposed. Preprocessing involved the denoising and smoothing via Savitzky-Golay (SG) smoothing, Multiplicative Scatter Correction (MSC) and Standard Normal Variate (SNV). Then by comparing the results of Continuous Projection Algorithm (SPA), Competitive Adaptive Reweighted Sampling (CARS) and Interval Random Frog Leap (IRF). 57 and 47 most suitable characteristic wavelengths for RA and CA were selected by CARS, respectively, further the interpretability of the characteristic wavelength to the RA and CA was investigated. Prediction models of RA and CA were constructed based on characteristic wavelength using Random Forest (RF), Back Propagation Neural Network (BPNN), Partial Least Squares Regression (PLSR) and Long Short-Term Memory Network (LSTM). For RA, the SNV-CARS-PLSR model performed the best, the model’s correlation coefficients were 0.97 (R²c) and 0.96 (R²p), the Root Mean Square Error (RMSE) were 0.09 and 0.10 for training set and testing set. For CA, the SNV-CARS-LSTM model performed the best, the model’s correlation coefficients were 0.96 (R²c) and 0.92 (R²p), the Root Mean Square Error (RMSE) were 0.02 and 0.02 for training set and testing set. The result proved that the proposed method can accurately detect the content of RA and CA in Salvia rosmarinus Spenn. The research provides valuable insights for the development of HSI applying in real-time and online quality detection of Salvia rosmarinus Spenn.
Yang et al. (Mon,) studied this question.