Detection of Carmine in Black Tea Based on UV–Vis Absorption Spectroscopy and Machine Learning
摘要
Carmine is a common synthetic pigment widely used in food processing, pharmaceutical dyeing, and other fields. Black tea is a popular beverage among many people, and its tea pigments have antioxidant, antiviral, anti-inflammatory, and antibacterial effects. However, excessive addition of carmine in black tea can pose a threat to human health. This article applies ultraviolet–visible (UV–vis) absorption spectroscopy technology to detect the carmine component in black tea and constructs a prediction model for the carmine content in black tea based on the Levenberg–Marquardt back propagation (LMBP) neural network and random forest (RF) algorithm. Firstly, 75 different concentrations of black tea-carmine solutions were prepared, and UV–vis absorption spectra were measured. Then, different methods were used to preprocess the spectra in different wavelength ranges, resulting in the optimal characteristic wavelength range of 400–600 nm, with the best preprocessing method being the combination of SG smoothing and normalization. Finally, the LMBP neural network and RF methods were applied to construct content prediction models for the carmine in black tea. The coefficient of determination (R2) of the LMBP model corresponding to the test set was 0.99996, with the root mean square error (RMSE) of 1.0257 × 10−5, while the R2 of the RF model based on the full spectral wavelength was 0.98339, with the RMSE of 1.1686 × 10−4. The R2 value using the traditional Lambert–Beer law of the test set is 0.96673, while the R2 value based on the nonlinear fitting method is 0.98074. This article verifies the superiority of the LMBP method in predicting the content of carmine in black tea through experiments, providing important reference value for tea quality supervision.