Blueberry fruit anthocyanin lossless rapid prediction method based on auto-encoder
By using a dual-branch parallel network architecture based on an autoencoder, combined with an autoencoder and a deep convolutional channel attention module, non-destructive and rapid in-situ prediction of anthocyanins in blueberries was achieved. This solves the accuracy and speed problems of anthocyanin detection in existing technologies and is suitable for non-destructive detection of active ingredients in agricultural products and food quality control.
Patent Information
- Application Number
- CN202511034824.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-25
- Publication Date
- 2025-11-11
AI Technical Summary
Existing technologies cannot achieve non-destructive, rapid, in-situ prediction of anthocyanins in blueberries, and deep learning methods cannot ensure the matching of features extracted by Raman spectroscopy with traditional chemical detection methods, resulting in insufficient prediction accuracy.
A dual-branch parallel network architecture (DBREN) based on an autoencoder is adopted, which combines an autoencoder feature distillation submodule and a deep convolutional channel attention submodule to achieve high-precision and non-destructive prediction of anthocyanin concentration through spectral acquisition, data preprocessing and concentration prediction.
It enables high-precision, non-destructive, in-situ prediction of anthocyanins in blueberries, reduces detection errors, improves detection efficiency, meets the rapid and accurate requirements for agricultural product quality testing, and is suitable for non-destructive testing of active ingredients in agricultural products and food quality control.
Smart Images

Figure CN120927591A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of non-destructive testing technology for plant active ingredients, and in particular to a non-destructive and rapid prediction method for anthocyanins in blueberry fruits based on an autoencoder. Background Technology
[0002] Blueberry anthocyanins, as natural antioxidants, possess the ability to scavenge free radicals and play an important physiological role in the prevention of metabolic and neurodegenerative diseases. However, traditional detection methods rely on destructive pretreatment steps, making it difficult to achieve in-situ analysis of anthocyanins in whole fruits.
[0003] In recent years, visible-near-infrared spectroscopy (Vis-NIRS) and mid-infrared spectroscopy (MIRS) methods have been increasingly applied to the analysis and detection of fruit and vegetable components due to their non-destructive and rapid detection advantages. However, the strong water absorption peaks in the near-infrared region are easily affected by the sample's water content and the humidity of the testing environment, often requiring freeze-drying to eliminate the influence of moisture, which limits its application in in-situ real-time detection. Compared to infrared spectroscopy, Raman spectroscopy, as a rapid, non-destructive, and highly sensitive molecular spectroscopy technique, has a very weak response to water molecules and can directly analyze water-containing tissues or liquid samples, avoiding the damage to the natural matrix caused by freeze-drying. Combining Raman spectroscopy with microscopy can also image specific plant regions, providing molecular information at the single-cell level, making it suitable for in-situ detection of multi-biological samples.
[0004] In existing technologies, researchers have used confocal Raman spectroscopy to study the stability of blueberry anthocyanin extracts in aqueous solutions in situ. However, Raman spectroscopy cannot directly provide (or predict) the content of blueberry anthocyanin extracts. Furthermore, researchers have combined Raman spectroscopy with deep learning architectures (especially convolutional neural networks, CNNs) to achieve rapid, non-destructive chemical analysis by efficiently processing high-dimensional spectral data and capturing nonlinear relationships, significantly outperforming traditional chemometric methods. For example, Raman spectroscopy combined with deep learning models has been used for the rapid determination of total phenolic content (TPC) and antioxidant capacity (DPPH, ORAC, FRAP) in maple syrup, providing strong support for the application of machine learning and deep learning in the non-destructive, high-precision analysis and prediction of anthocyanins.
[0005] However, no research has yet applied deep learning methods to the Raman spectral prediction of anthocyanins in blueberries. This makes it impossible to ensure that the features extracted by Raman spectroscopy are highly consistent with the anthocyanin content data of the same blueberry measured by traditional chemical detection methods, thus failing to improve the accuracy of machine learning prediction models. Summary of the Invention
[0006] The purpose of this invention is to provide a non-destructive and rapid prediction method for anthocyanins in blueberries based on an autoencoder, achieving high-precision non-destructive in-situ prediction.
[0007] To achieve the above objectives, this invention provides a non-destructive and rapid prediction method for anthocyanins in blueberry fruits based on an autoencoder, comprising the following steps:
[0008] S1. Spectral Acquisition: A uniform area on the blueberry skin was selected as the detection site, and spectral data was acquired multiple times for each sample.
[0009] S2. Data Preprocessing: Adaptive iterative reweighted penalized least squares method was used to preprocess the anthocyanin characteristic peaks from 400 to 1700 cm⁻¹. -1 The spectrum within the range is subjected to baseline subtraction, and then the Savitzky-Golay smoothing algorithm is used to process high-frequency noise to obtain preprocessed spectral data;
[0010] S3. Concentration Prediction: Input the preprocessed spectral data into the DBREN model. The dual-branch parallel network extracts spatial local features and global correlation features respectively. The output features of the two branches are concatenated to output the anthocyanin concentration prediction value.
[0011] Preferably, in S1, at least 6 spectral acquisitions are performed on each sample, with a single exposure time of 5s, a laser power of 20mW, and an integration time of 5s.
[0012] Preferably, in S1, the wavelength range used for spectral acquisition is 400-1800 cm⁻¹. -1 Non-contact measurements were performed using a Raman spectrometer. All spectral acquisitions were calibrated using silicon samples and conducted under constant temperature conditions of 24-26℃ and relative humidity controlled at 45-55%.
[0013] Preferably, in S2, the window width of the Savitzky-Golay smoothing algorithm is 11 and the polynomial order is 3, which effectively reduces high-frequency noise interference.
[0014] Preferably, in S3, the DBREN model includes an autoencoder feature distillation submodule and a deep convolutional channel attention submodule. The autoencoder feature distillation submodule is used to extract global correlation features, and the deep convolutional channel attention submodule is used to extract spatial local features.
[0015] Preferably, the self-encoder feature distillation submodule includes:
[0016] a. Three residual convolutional blocks, each containing a 5×1 convolutional kernel, batch normalization, and skip connections;
[0017] b. Adaptive pooling utilizes a cascaded structure of [one-dimensional convolutional layer → residual module → max pooling layer] with residual skip connections to compress the original spectral dimension from 512 to 32.
[0018] To solve the gradient vanishing problem, this method achieves low-dimensional embedding of high-dimensional data while preserving the global spectral morphological features. It analyzes the noise distribution across the entire spectrum through an autoencoder and dynamically suppresses skin interference signals using a self-attention mechanism.
[0019] Preferably, the deep convolutional channel attention submodule includes:
[0020] c. Depth-separable convolutional layers, using 3×1 convolutional kernels to extract local feature peaks;
[0021] d. Channel attention gating unit, which generates channel weights through global average pooling and Sigmoid activation, dynamically enhancing the 520-540cm channel weights. -1 Band response;
[0022] Dynamic calibration of local features is achieved through convolutional modules that embed channel attention mechanisms. Each layer of the network follows the paradigm of [one-dimensional convolutional layer → batch normalization → ReLU → channel attention layer → max pooling layer]. The channel attention in the structure recalibrates the weights of the feature channels through the SENet architecture, thereby strengthening the response signal to the feature peaks.
[0023] Preferably, S3 is as follows:
[0024] S31. A deep autoencoder is constructed by stacking residual blocks to perform nonlinear feature compression of Raman spectra under label-free constraints. The identity mapping preserves the original spectral features during the hierarchical feature extraction process, avoiding the information loss problem of weak absorption peaks and effectively capturing the global morphological features of anthocyanin characteristic peaks.
[0025] S32. The residual block in the autoencoder introduces skip connections, additively fusing the original input residual term x with the transformed feature y, allowing the input signal to be directly transmitted to deeper layers, thus solving the gradient vanishing problem in deep neural networks. The mathematical expression is:
[0026] y=σ(BN(W2·σ(BN(W1·x))))+x);
[0027] Where W1 and W2 represent convolutional filters, BN represents batch normalization, and σ represents the ReLU activation function.
[0028] The channel attention mechanism in DCACN achieves adaptive enhancement of key spectral responses through a dynamic recalibration strategy for feature channels. This module uses global average pooling to compress spectral features along the spatial dimension and generates channel attention weights through a bottleneck structure constructed by fully connected layers. This design, targeting the high-dimensionality of spectral data, prioritizes amplifying response regions related to the target chemical composition in the features through the dynamic generation of channel attention weights, effectively suppressing instrument noise and background interference.
[0029] The dual-branch output features are concatenated and then input into a fully connected regression layer, thereby achieving complementary fusion of global and local features. This new architecture, suitable for spectral prediction, enables residual learning and attention mechanisms to work together to optimize both steady-state spectral features and dynamic discriminative information, effectively overcoming the feature representation bias of a single model.
[0030] Preferably, in S3, the DBREN model is trained through the following steps:
[0031] T1. Construct a training dataset, including the Raman spectrum of blueberry skin and its corresponding anthocyanin concentration reference values;
[0032] T2. Raman spectroscopy of blueberry anthocyanin enrichment extract was used for preliminary experiments to verify the ability of the DBREN model to resolve the anthocyanin characteristics in the spectrum.
[0033] Preferably, in T1, the anthocyanin concentration reference value is determined by pH difference method.
[0034] This invention also provides an application of a non-destructive and rapid prediction method for anthocyanins in blueberries based on an autoencoder in the rapid detection of active ingredients in berries, the active ingredients including flavonoids.
[0035] Therefore, the present invention employs the above-mentioned non-destructive and rapid prediction method for anthocyanins in blueberry fruits based on an autoencoder, and the beneficial effects are as follows:
[0036] (1) Non-destructive testing technology for agricultural products: Current methods for detecting anthocyanin concentration in whole blueberries require data collection using whole blueberry samples, inevitably damaging the fruit. This invention provides in-situ analysis of functional components (such as anthocyanins) in agricultural products like blueberries. It only requires collecting and using Raman spectra from a local area of the blueberry skin to predict the anthocyanin concentration of the entire blueberry fruit. This overcomes the technical bottlenecks of traditional chemical testing, such as destructive sampling, complex operation, and long detection time. It can be extended to the non-destructive in-situ rapid analysis of other plant secondary metabolites, providing a theoretical basis for the non-destructive testing of active ingredients in agricultural products and promoting standardized applications in precision agriculture and food quality control.
[0037] (2) Deep Learning and Spectral Data Fusion: Existing algorithm models predict the anthocyanin concentration of blueberries based on the blueberry skin spectrum. Traditional machine learning models based on feature peak extraction suffer from prediction errors due to neglecting spectral background information. Machine learning models with full-spectrum data input struggle to effectively analyze features, exhibiting poor performance. This invention employs a dual-branch feature fusion architecture (DBREN model) for Raman spectroscopy. Based on the high sensitivity and non-destructive characteristics of Raman spectroscopy, it solves the problem of feature extraction of low-concentration metabolites in complex biological samples through the collaborative optimization of a deep convolutional channel attention network (DCACN) and an autoencoder. This achieves spectral noise suppression and accurate analysis of feature peaks, enabling rapid and non-destructive prediction with good fitting and accuracy. It establishes a new paradigm for on-site analysis of anthocyanin content in agricultural food systems, providing an innovative technical path for precision agriculture and industrial quality control.
[0038] (3) Improved detection accuracy, enhanced sensitivity, high detection efficiency, and low cost: Compared with traditional chemical detection methods (such as pH difference method), the root mean square error (RMSE) of the DBREN model of this invention is reduced to 0.145 mg, which is 12%-15% lower than the traditional machine learning model (XGBoost / RF), and the mean absolute error (MAE) is 0.101 mg, which is 11% lower than the traditional method; Through the collaborative training of autoencoder and depthwise separable convolution, the model of this invention can effectively resolve anthocyanin concentrations as low as 0.05 mg / g (the detection limit of the traditional method is 0.2 mg / g), meeting the requirements of post-harvest quality grading; The detection time of a single sample of this invention is shortened to 5s (traditional HPLC requires 4-6h), and no sample pretreatment (such as grinding and centrifugation) is required; This invention does not require chemical reagent consumption or fruit sample damage.
[0039] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0040] Figure 1 This is a deep learning architecture diagram of an embodiment of a non-destructive and rapid prediction method for anthocyanins in blueberries based on an autoencoder, wherein (a) is a measurement principle diagram: by focusing the excitation laser source to the size of the diffraction-limited plate, the Raman signal of the blueberry skin can be obtained. (b) is the original Raman spectrum, (c) is the preprocessed Raman spectrum, (d) is the autoencoder feature distillation submodule, and (e) is the deep convolution channel attention submodule;
[0041] Figure 2 This is a Raman spectrum of blueberry skin and blueberry anthocyanin extract solution (BAES) according to an embodiment of the present invention, which is a non-destructive and rapid prediction method for blueberry fruit anthocyanins based on an autoencoder.
[0042] Figure 3 This is a gradient concentration Raman spectrum of a blueberry anthocyanin extract solution (BAES) from an embodiment of a non-destructive rapid prediction method for blueberry fruit anthocyanins based on an autoencoder according to the present invention.
[0043] Figure 4 This invention presents a method for non-destructive and rapid prediction of anthocyanins in blueberry fruit based on an autoencoder, demonstrating a significant correlation between the intensity of Raman characteristic peaks in blueberry skin and anthocyanin concentration.
[0044] Figure 5 This is a fitting curve showing the relationship between the concentration of anthocyanin solution and the peak intensity of Raman characteristic peaks in an embodiment of the present invention, which is a non-destructive and rapid prediction method for anthocyanins in blueberries based on an autoencoder.
[0045] Figure 6 This invention relates to a method for non-destructive and rapid prediction of anthocyanins in blueberries based on an autoencoder. The correlation between characteristic peaks of blueberry anthocyanins is shown in the histogram, which represents the Raman peak intensity distribution characteristics of each characteristic peak, and the contour map shows the correlation strength and distribution density between characteristic peaks.
[0046] Figure 7 This is blueberry prediction data from an embodiment of the non-destructive and rapid prediction method for blueberry anthocyanins based on an autoencoder of the present invention, wherein (a) is the distribution of training data in the XGBoost model, (b) is the distribution of training data in the RF model, (c) is the distribution of training data in the DBREN model, and (d) is the distribution of blueberry anthocyanin solution prediction data and training data in the DBREN model. Detailed Implementation
[0047] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0048] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning as understood by one of ordinary skill in the art to which this invention pertains.
[0049] Example 1
[0050] A non-destructive and rapid method for predicting anthocyanins in blueberries based on an autoencoder is implemented using a detection system. This system includes a sample positioning module, a Raman spectrometer, and a terminal device. The sample positioning module comprises a blueberry clamping platform with a pressure sensor, precisely controlling the contact force within the range of 0.3±0.1N to avoid damage to the fruit peel. The Raman spectrometer integrates a 532nm laser (power adjustable range 5-100mW) and a grating spectrometer, with a spot diameter ≤200μm, for spectral acquisition of blueberry skin. The terminal device incorporates a spectral preprocessing module and a DBREN model inference module for data preprocessing and concentration prediction of the acquired spectral data. The terminal device communicates with the Raman spectrometer in real time via USB 3.0 or Bluetooth.
[0051] like Figure 1 As shown, the prediction method includes the following steps:
[0052] S1, Spectral Acquisition
[0053] The blueberry skin was cleaned of impurities and sugar alcohol residue using a lint-free cloth. A uniform area of 0.5cm × 1cm was selected as the detection site. Each blueberry sample underwent six spectral acquisitions, with a single exposure time of 5 seconds, a laser power of 20mW, and an integration time of 5 seconds. The obtained spectral data were used for subsequent analysis. To ensure data reliability, all measurements were calibrated using silicon samples and performed under constant temperature conditions of 25±1℃ and relative humidity controlled at 50±5%.
[0054] S2, Data Preprocessing
[0055] The adaptive iteratively reweighted penalized least squares (airPLS) method was used to analyze the anthocyanin characteristic peaks from 400 to 1700 cm⁻¹. -1 Baseline subtraction is performed on the spectrum within the range, and then the SG smoothing algorithm is used to reduce high-frequency noise interference to obtain preprocessed spectral data.
[0056] S3, Concentration Prediction
[0057] The preprocessed spectrum is input into the DBREN model. A dual-branch parallel network extracts spatial local features and global correlation features respectively. The output features of the two branches are then concatenated by channel concatenation.
[0058] (1) Spatial Local Feature Extraction: The spatial feature branch (DCACN branch) adopts a hierarchical convolutional structure, including three groups of convolutional modules (kernel size 5×1, padding 2). Each group sequentially performs standard one-dimensional convolution → one-dimensional batch normalization → ReLU → channel attention weighting → one-dimensional max pooling. Among them, the channel attention gating unit generates channel weights (Sigmoid activation) through global average pooling to dynamically enhance the anthocyanin response frequency band. After performing one-dimensional adaptive average pooling, the last group sequentially performs → flattening layer → fully connected layer → Dropout.
[0059] (2) Global correlation feature extraction: The residual block introduces skip connections, and the original input residual term is additively fused with the transformed feature. The mathematical expression is:
[0060] y=σ(BN(W2·σ(BN(W1·x))))+x);
[0061] Where W1 and W2 represent convolutional filters, BN represents batch normalization, and σ represents the ReLU activation function.
[0062] The global correlation branch (autoencoder branch) achieves spectral feature compression through an encoder structure: the input signal is sequentially processed through a 5×1 convolution → residual module (including skip connections) → one-dimensional max pooling, and finally, global average pooling is used to compress the 512-dimensional spectrum into a 128-dimensional latent representation, capturing the overall spectral distribution characteristics. The residual block employs a double convolution structure, using ReLU activation and skip connections to mitigate gradient vanishing.
[0063] (3) Feature channel splicing: The output features of the two branches (64-dimensional DCACN branch + 128-dimensional autoencoder branch) are spliced together → Dropout → Fully connected layer to achieve complementary fusion of global and local features and output the anthocyanin concentration prediction value.
[0064] Comparative Example 1
[0065] The difference from Example 1 is that, in S3, concentration prediction:
[0066] The preprocessed spectrum is input into the classic XGBoost machine learning model, whose objective function is expressed as:
[0067]
[0068] in, The overall objective function guides the optimization of parameter θ during model training. Let y be the loss function. i This represents the true anthocyanin content of the i-th sample. Let Ω(f) be the model's predicted value for the i-th sample. k) represents the regularization term, controlling the complexity of a single tree, f k For the k-th decision tree, the leaf weights are constrained by controlling the number of leaf nodes, which effectively prevents overfitting of spectral data.
[0069] Comparative Example 2
[0070] The difference from Example 1 is that, in S3, concentration prediction:
[0071] The preprocessed spectrum is input into the random forest (RF) model, and expressed as follows:
[0072]
[0073] The random forest consists of B independently trained decision trees, T b (x) represents the probability distribution of each tree, and the prediction result of the b-th decision tree for the input sample x.
[0074] Comparative Example 3
[0075] Test
[0076] In this invention, all blueberry samples were first subjected to Raman spectroscopy, then ground, and the anthocyanin content was determined using the pH difference method to verify the excellent analytical ability of the trained DBREN model for anthocyanin characteristics in the spectrum. Furthermore, the performance and reliability of the prediction model were analyzed by comparing it with traditional machine learning methods in Examples 1 and 2, using root mean square error (RMSE) and coefficient of determination (R²). 2 The evaluation is based on three core indicators: mean absolute error (MAE).
[0077] pH differential method: Anthocyanins in blueberries were extracted using acidic ethanol (containing 1% hydrochloric acid) at a material-to-liquid ratio of 1:15 (w / v) and an ethanol volume fraction of 70%. Extraction was performed at 200 W and 30 °C for 20 min. The extract was centrifuged at 5000 × g for 10 min, and the supernatant was collected. The extraction was repeated, and the extracts were combined and filtered to obtain the final extract. A suitable amount of the extract was diluted 5-fold with pH 1.0 (HCl) and pH 4.5 (KCl) buffers, respectively. After equilibration in a water bath for 30 min, a blueberry anthocyanin extract solution (BAES) was obtained. The absorbance values at 520 nm (characteristic absorption wavelength) and 700 nm (baseline correction wavelength) were measured using a UV-Vis spectrophotometer. The anthocyanin content was calculated using the following formula:
[0078]
[0079] Where ΔA is defined as the absorbance change between pH 1.0 and pH 4.5; WM blueberry anthocyanin molecular weight is 449.2 g / mol; DF represents the dilution factor, which is set to 5 in this specific reaction system; V represents the total volume of the extraction solution; 10 3 ε represents the conversion factor from g to mg; ε represents the molar absorption coefficient of anthocyanins, with a value of 2.69 × 10⁻⁶. 4 L / (mol·cm); L represents the optical path length of the cuvette, which is measured precisely as 1 cm.
[0080] The anthocyanin content of a single blueberry was measured to range from 1.78 to 4.18 mg (mean 2.99 mg). The test results are as follows: Figures 2-6 As shown.
[0081] Depend on Figure 2 It is known that only substances with Raman activity can be detected in Raman spectroscopy, specifically at wavelengths of 540, 631, 730, 876, 1138, 1200, 1240, 1337, 1471, 1530, 1598, and 1645 cm⁻¹. -1 Characteristic Raman peaks were observed at all locations, confirming that blueberry anthocyanins have significant Raman activity characteristics.
[0082] Depend on Figure 4 This confirms that Raman spectroscopy can achieve high-precision prediction of anthocyanin content in complex biological matrices.
[0083] Depend on Figure 3 and Figure 5 It can be seen that the intensity of the characteristic peak is strongly correlated with the anthocyanin content, and it exhibits excellent linear response in the low concentration range (>1000 μg / mL). This system verifies that Raman spectroscopy can accurately predict anthocyanin content and achieve a lower detection limit, providing experimental basis for developing an anthocyanin content prediction model based on Raman spectroscopy.
[0084] Depend on Figure 6 It can be seen that there are different correlations among the Raman characteristic peaks of the input variable blueberry anthocyanins, with the Pearson correlation coefficient R ranging from 0.43 to 0.97, revealing the difference in coupling degree between different vibrational modes and proving the feasibility of predicting the anthocyanin content of whole fruit using blueberry Raman spectroscopy.
[0085] The mathematical expressions for the evaluation are as follows:
[0086]
[0087] in, y is the average of the true values. i For the true value, Let n be the predicted value, and n be the sample size. R 2The denominator in the expression is the total sum of squares (SST), and the numerator is the residual sum of squares (SSE).
[0088] The statistical evaluation results of the blueberry anthocyanin content prediction model are shown in Table 1, and the distribution is as follows: Figure 7 As shown.
[0089] Table 1 Statistical evaluation of the blueberry anthocyanin content prediction model
[0090]
[0091] From Table 1 and Figure 1 It can be seen that the DBREN model (R) 2 =0.96) significantly outperforms XGBoost(R 2 =0.88) and RF(R 2 =0.87), maintaining excellent performance on the test set (R = 0.87). 2 =0.97, RMSE=0.072, MAE=0.059), its deep convolutional attention mechanism can effectively extract local spectral features of complex biological matrices, and enhance the characteristic peaks and substituent-sensitive peaks (1200 cm⁻¹) through cross-channel correlation. -1 The weight allocation of ) overcomes the interference of tissue heterogeneity. In contrast, XGBoost relies on manual feature engineering and is susceptible to spectral background noise, and the RF model has limited ability to represent nonlinear relationships, indicating that machine learning models are insufficient in responding to the heterogeneity of complex biological tissues such as blueberry epidermal cell walls. DAREN was trained on gradient concentration solution spectral data, and experimental data (R 2 =0.96, RMSE=0.062, MAE=0.055) indicates that the model has grasped the quantitative relationship between the vibrational mode and concentration of anthocyanin molecules, and verifies the DBREN model's ability to resolve anthocyanin characteristics in the spectrum and the chemical specificity of the spectral feature extraction module.
[0092] In summary, DAREN offers groundbreaking advantages in the analysis of complex biological samples. Its multimodal feature collaborative optimization framework maximizes the utilization of spectral information, and its architecture provides an innovative methodology for the in-situ detection of plant active ingredients. This method combines the advantages of portable Raman spectrometers with the powerful predictive capabilities of deep learning models, enabling rapid, in-situ, and non-destructive assessment of blueberry anthocyanin content.
[0093] Therefore, the present invention adopts the above-mentioned non-destructive and rapid prediction method of anthocyanins in blueberry fruit based on autoencoder, which solves the problems of sample destruction, accuracy and speed of traditional methods for anthocyanin content detection, and achieves high-precision non-destructive in-situ prediction.
[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A non-destructive and rapid prediction method for anthocyanins in blueberry fruits based on an autoencoder, characterized in that, Includes the following steps: S1. Spectral Acquisition: A uniform area on the blueberry skin was selected as the detection site, and spectral data was acquired multiple times for each sample. S2. Data Preprocessing: Adaptive iterative reweighted penalized least squares method was used to preprocess the anthocyanin characteristic peaks from 400 to 1700 cm⁻¹. -1 The spectrum within the range is subjected to baseline subtraction, and then the Savitzky-Golay smoothing algorithm is used to process high-frequency noise to obtain preprocessed spectral data; S3. Concentration Prediction: Input the preprocessed spectral data into the DBREN model. The dual-branch parallel network extracts spatial local features and global correlation features respectively. The output features of the two branches are concatenated to output the anthocyanin concentration prediction value.
2. The method for non-destructive and rapid prediction of anthocyanins in blueberry fruit based on an autoencoder according to claim 1, characterized in that, In S1, at least 6 spectral acquisitions are performed on each sample. The single exposure time of the spectral acquisition is 5s, the laser power is 20mW, and the integration time is 5s.
3. The method for non-destructive and rapid prediction of anthocyanins in blueberry fruit based on an autoencoder according to claim 1, characterized in that, In S1, the wavelength range used for spectral acquisition is 400-1800 cm⁻¹. -1 Non-contact measurements were performed using a Raman spectrometer. All spectral acquisitions were calibrated using silicon samples and conducted under constant temperature conditions of 24-26℃ and relative humidity controlled at 45-55%.
4. The method for non-destructive and rapid prediction of anthocyanins in blueberry fruit based on an autoencoder according to claim 1, characterized in that, In S2, the Savitzky-Golay smoothing algorithm has a window width of 11 and a polynomial order of 3.
5. The method for non-destructive and rapid prediction of anthocyanins in blueberry fruit based on an autoencoder according to claim 1, characterized in that, In S3, the DBREN model includes an autoencoder feature distillation submodule and a deep convolutional channel attention submodule.
6. The method for non-destructive and rapid prediction of anthocyanins in blueberry fruit based on an autoencoder according to claim 5, characterized in that, The autoencoder feature distillation submodule includes: a. Three residual convolutional blocks, each containing a 5×1 convolutional kernel, batch normalization, and skip connections; b. Adaptive pooling utilizes a cascaded structure of [one-dimensional convolutional layer → residual module → max pooling layer] with residual skip connections to compress the original spectral dimension from 512 to 32.
7. The method for non-destructive and rapid prediction of anthocyanins in blueberry fruit based on an autoencoder according to claim 5, characterized in that, The deep convolutional channel attention submodule includes: c. Depth-separable convolutional layers, using 3×1 convolutional kernels to extract local feature peaks; d. Channel attention gating unit, which generates channel weights through global average pooling and Sigmoid activation, dynamically enhancing the 520-540cm channel weights. -1 Band response.
8. The method for non-destructive and rapid prediction of anthocyanins in blueberry fruit based on an autoencoder according to claim 7, characterized in that, S3 specifically refers to: S31. A deep autoencoder is constructed by stacking residual blocks to perform nonlinear feature compression of Raman spectra under label-free constraints. The identity mapping preserves the original spectral features during the hierarchical feature extraction process. S32. The residual block in the autoencoder introduces skip connections, and the original input residual term x is additively fused with the transformed feature y. The mathematical expression is: y=σ(BN(W2·σ(BN(W1·x))))+x); Where W1 and W2 represent convolutional filters, BN represents batch normalization, and σ represents the ReLU activation function.
9. A non-destructive and rapid prediction method for anthocyanins in blueberry fruit based on an autoencoder, as described in claim 1, is characterized in that... In S3, the DBREN model is trained through the following steps: T1. Construct a training dataset, including the Raman spectrum of blueberry skin and its corresponding anthocyanin concentration reference values; T2. Raman spectroscopy of blueberry anthocyanin enrichment extract was used for preliminary experiments to verify the ability of the DBREN model to resolve the anthocyanin characteristics in the spectrum.
10. A non-destructive and rapid prediction method for anthocyanins in blueberry fruit based on an autoencoder, as described in claim 9, is characterized in that, In T1, the reference value of anthocyanin concentration is determined by pH difference method.