Method for identifying content of camellia oil in plant blend oil based on deep learning

Through a deep learning method based on deep learning, combined with Raman spectroscopy technology and attention mechanism design, the problem of complex sample processing and model generalization in vegetable oil identification is solved, and the high accuracy of the content of tea oil in plant blended oil is achieved. Sex identification.

CN119400273APending Publication Date: 2025-02-07SOUTH CHINA NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411468351.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-21
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The prior art has complex sample processing, cumbersome processes, time-consuming, sample residues and the need for professional experimenters in the identification of vegetable oils. Deep learning models may face the problems of feature selection and model generalization when processing complex spectral data. .

Method used

Deep learning models designed using attention mechanisms (such as 1D-CNN, ConvNeXt-ECA, and CNN-GRU-MHA) by collecting and processing Raman spectroscopy data from standard samples using deep learning-based methods combined with Raman spectroscopy technology. Identify the content of camellia oil. The method includes smooth filtering of data, standardization, debaseline, denormalization, averaging and expansion, dimensionality reduction, and feature variable selection.

Benefits of technology

Improve the accuracy, objectivity and reliability of the identification results of the tea oil content in plant blended oil, reduce the complexity of sample processing and the cumbersome process, reduce the dependence on professional experimenters, and improve the model in complexity Feature extraction and discrimination ability in spectral data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119400273A_ABST
    Figure CN119400273A_ABST
Patent Text Reader

Abstract

The invention is applicable to the technical field of food analysis, and provides a method for identifying the content of camellia oil in plant blend oil based on deep learning, which comprises the following steps: collecting or preparing standard samples of pure edible plant oil and mixed oil with different concentration ratios for constructing an identification model; performing Raman spectrum detection to obtain original Raman spectrum data of the standard sample; preprocessing the original Raman spectrum data to obtain expanded Raman spectrum data after preprocessing; carrying out spectrum dimension reduction on the expanded Raman spectrum data so as to visualize the similarity and the difference of the pure oil sample; identifying related spectral variables of the camellia oil by adopting a spectral variable selection method, then constructing an extreme learning machine model by using the selected variables, and identifying the content of the camellia oil in the to-be-detected sample; and finally, introducing a to-be-detected sample into the three deep learning models, sequentially judging, and identifying the content of the camellia oil in the to-be-detected mixed oil sample.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of food analysis, and in particular relates to a method for identifying camellia oil content in plant blended oil based on deep learning. Background Art

[0002] Vegetable blended oil is a kind of vegetable oil mixed by two or more pure vegetable oils in a certain proportion. Compared with single vegetable oil, vegetable blended oil can provide more balanced nutritional value due to the different fatty acid contents of different vegetable oils. Generally speaking, vegetable blended oil is a mixture of a large amount of low-priced pure vegetable oil and a small amount of high-priced pure vegetable oil. Camellia oil is rich in oleic acid, vitamin E, polyphenols and other bioactive substances with health-promoting properties. Long-term consumption of camellia oil can relieve diseases such as hypertension and cardiovascular and cerebrovascular diseases, and is known as the "Oriental Olive Oil".

[0003] In recent years, the commonly used method is to identify vegetable oils by determining the types and proportions of fatty acids through gas chromatography, mass spectrometry, gas chromatography-mass spectrometry, synchronous fluorescence spectroscopy and two-dimensional correlation spectroscopy. However, these methods have some problems, such as complex sample processing, cumbersome procedures, time-consuming, sample residues, and the need for professional experimenters during experimental operations. In contrast, Raman spectroscopy does not consume chemical reagents, does not require any sample preparation, has a simple process, fast detection, and no sample residue. It is a potential detection technology for identifying vegetable oils.

[0004] In the identification of vegetable oils, although traditional machine learning models have achieved certain success, they often rely on manual feature extraction and feature selection when dealing with complex, multivariate spectral data, which not only increases the workload but also easily leads to insufficient or inaccurate feature extraction. In contrast, deep learning models can automatically extract features from spectral data, significantly improving the accuracy and robustness of the model. However, deep learning models may still face problems with feature selection and model generalization when dealing with complex spectral data. To this end, the introduction of the attention mechanism provides an effective solution to this problem. The attention mechanism can dynamically adjust the model's attention to different parts of the input data, thereby improving the model's feature extraction and discrimination capabilities in complex spectral data. Therefore, accurately identifying the content of specific high-value vegetable oils in blended vegetable blended oils based on the attention mechanism combined with deep learning is of great significance to safeguarding consumer rights. Summary of the invention

[0005] In order to solve the problems existing in the prior art, the purpose of the present invention is to provide a method for identifying the camellia oil content in plant blended oil based on deep learning. The deep learning method is applied to the research on the identification of the content of high-value plant oil species in plant blended oil, which can effectively extract valuable information hidden in the sample data; the camellia oil content of the sample is automatically identified by using the trained model, which can improve the accuracy, objectivity and reliability of the results.

[0006] To achieve this object, the present invention adopts the following technical solutions:

[0007] S1. Collect or prepare standard samples of pure edible vegetable oil and mixed oils with different concentration ratios for constructing identification models, and perform Raman spectroscopy detection to obtain original Raman spectral data of the standard samples;

[0008] S2, performing smoothing filtering on the raw Raman spectrum data, and preferably using a Savitzky-Golay filtering method to smooth the Raman spectrum to reduce noise;

[0009] S3, standardizing the Raman spectrum data processed by S2, and preferably using SNV standard normal variable transformation to standardize the Raman spectrum to reduce the spectral intensity variation caused by sample inhomogeneity, the steps are as follows:

[0010] 1. Calculate the average:

[0011]

[0012] 2. Calculate the standard deviation:

[0013]

[0014] 3. Apply SNV changes:

[0015]

[0016] where x i is the i-th data point in the original spectrum data, μ is the mean of the spectrum data, σ is the standard deviation of the spectrum data, and x′ i is the ith data point after SNV normalization.

[0017] S4, removing the baseline of the Raman spectrum data after S3, and preferably using ALS asymmetric least squares smoothing method to remove the baseline of the Raman spectrum data. The steps are as follows:

[0018] 1. Set parameters:

[0019]

[0020] Where p is the asymmetry factor, λ is the smoothing factor, μ is the threshold, and n iter is the number of iterations.

[0021] 2. Calculate the weight matrix:

[0022] For each data point y i , the initial weight matrix W is the identity matrix.

[0023] 3. Iterative calculation and update, for each iteration k:

[0024] (1) Calculate the baseline estimate:

[0025] The baseline estimate z is calculated using the weighted least squares method, which is obtained by minimizing the following objective function:

[0026]

[0027] Among them, w i is the current weight, y i is the original Raman spectrum data, z i is the baseline estimate at the i-th spectral data point, and λ is a regularization parameter used to control the degree of smoothing.

[0028] (2) Update the weight matrix:

[0029] Based on the baseline estimate z, update the weight matrix W:

[0030]

[0031] where w i is the current weight, y i is the original Raman spectrum data, and p is the asymmetry factor.

[0032] (3) Check the convergence conditions:

[0033] If the change of the baseline estimate z between two consecutive iterations is less than the set threshold μ, the iteration is stopped; otherwise, the next iteration is continued.

[0034] 4. Final baseline correction

[0035] After k iterations, the obtained z is the corrected baseline, which is subtracted from the original spectral data y to obtain the spectral data y′ after baseline removal. i :

[0036] y′ i =y i -z i S5, denormalize the Raman spectrum data processed by S4, specifically use the maximum and minimum normalization method to normalize the Raman spectrum data to improve the prediction accuracy. The steps are as follows:

[0037] 1. Calculate the minimum and maximum values:

[0038] min(x)=min{x1,x2,...,x n}

[0039] max(x)=max{x1,x2,...,x n}

[0040] 2. Apply maximum and minimum normalization:

[0041]

[0042] where x i is the i-th data point in the original spectral data, min(x) is the minimum value in the spectral data, max(x) is the maximum value in the spectral data, and x′ i is the normalized ith data point.

[0043] S6, averaging and expanding the Raman spectral data processed in S5, and preferably randomly selecting 5 spectral data of each concentration for averaging, and expanding the data set by preferably adding Poisson noise and frequency domain disturbance to the average spectral data.

[0044] S7. Spectral dimension reduction was performed on the pre-processed pure oil Raman spectral data using principal component analysis (PCA) and unified manifold approximation and projection (UMAP) to visualize the pure oil samples and study the similarities and differences of the pure oil samples.

[0045] S8, using three spectral variable selection methods, namely genetic optimization algorithm GA, non-information variable elimination algorithm UVE and whale optimization algorithm WOA, to identify the relevant spectral variables of camellia oil, and then using the selected variables to build an extreme learning machine model;

[0046] S9. Divide the entire data set, randomly select 20% of the data from the data set as the test set, and the remaining 80% of the data as the training set. The training set is used to train the extreme learning machine model, and the test set is used to test the performance of the final extreme learning machine model;

[0047] S10. Three deep learning models, 1D-CNN, ConvNeXt-ECA and CNN-GRU-MHA, were designed in combination with the attention mechanism. The model randomly selected 60% of the data as the training set, 20% as the validation set, and the remaining 20% ​​as the test set, and the model was evaluated using the 5-fold cross-validation method. The training set is used to determine the model parameters, the validation set is used to adjust the hyperparameters and optimize the network structure, and the test set is used to evaluate the generalization ability of the model.

[0048] Furthermore, the types of pure edible vegetable oils are camellia oil, rapeseed oil and corn oil, the standard samples of the mixed oils with different concentration ratios are camellia oil mixed with rapeseed oil and corn oil with concentration gradients of 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90% and 100%, respectively, and the concentration gradient of the camellia oil in the standard samples of the mixed oils with different concentration ratios is 0%, 5%, 10%, 15%, 20%, 25%, 30% and 35%.

[0049] Furthermore, the dimensionality reduction results of the PCA and UMAP on the three pure oil spectral data sets are displayed through distribution diagrams in two-dimensional space and three-dimensional space, respectively.

[0050] Furthermore, the parameters of the GA genetic optimization algorithm are set as follows: the population size is 100, the crossover probability is 0.7, the mutation probability is 0.05, and the maximum number of iterations is 200; the parameters of the UVE non-information variable elimination algorithm are set as follows: the number of variable repetitions is 500, and the non-information variable threshold is 0.15; the parameters of the WOA whale optimization algorithm are set as follows: the population size is 80, the maximum number of iterations is 200, the shrinkage surround coefficient and the spiral update position coefficient are randomly initialized and dynamically adjusted during the iteration process; the parameters of the extreme learning machine ELM model are set as follows: the number of hidden layer neurons is 100, and the activation function is sigmoid.

[0051] Furthermore, the 1D-CNN deep learning model includes an input layer, four one-dimensional convolutional layers, a batch normalization layer, two pooling layers, a flattening layer, a fully connected layer, a Dropout layer and an output layer; the ConvNeXt-ECA deep learning model adds an ECA module after each convolutional layer, and finally realizes the identification of camellia oil content through global average pooling and flattening operations; the CNN-GRU-MHA deep learning model in S10 is composed of a convolutional layer, a pooling layer and a reshaping layer, performs feature extraction and inputs the data adjusted by the reshaping layer into the GRU layer with 128 output dimensions, and after processing, inputs it into the multi-head attention mechanism, and performs layer normalization operation; the three models in S10 all use the "MSE" loss function and the "Leaky ReLU" activation function, the ConvNeXt-ECA and CNN-GRU-MHA models use the Adam optimizer with a learning rate of 0.0001, and the 1D-CNN model uses the "Nadam" optimizer.

[0052] Furthermore, the performance of the extreme learning machine model and the deep learning model is determined by the coefficient R 2 And root mean square error RMSE to judge.

[0053] Furthermore, the evaluation of the model performance is repeated at least 10 times. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] The present invention is further explained below in conjunction with the accompanying drawings and specific embodiments:

[0055] Figure 1 These are Raman spectra of three pure oils after pretreatment provided by the embodiments of the present invention;

[0056] Figure 2 This is a Raman spectrum diagram when the camellia oil content provided by an embodiment of the present invention increases from 0% to 30%;

[0057] Figure 3 is a Raman spectrum of a binary blend of rapeseed oil and corn oil provided in an embodiment of the present invention;

[0058] Figure 4 The dimensionality reduction results of three pure oil spectral data sets by PCA and UMAP provided in the embodiment of the present invention are as follows: distribution diagram of PCA in two-dimensional space (a), distribution diagram of PCA in three-dimensional space (b), distribution diagram of UMAP in two-dimensional space (c), and distribution diagram of UMAP in three-dimensional space (d);

[0059] Figure 5 The variable selection process of the GA algorithm provided in an embodiment of the present invention (a), the distribution diagram of the variables selected by GA in the spectrum (b), the variable selection process of the UVE algorithm (c), the distribution diagram of the variables selected by UVE in the spectrum (d), the variable selection process of the WOA algorithm (e), and the distribution diagram of the variables selected by WOA in the spectrum (f);

[0060] Figure 6 1. The calibration and prediction result diagram of the ELM model provided in the embodiment of the present invention (a), the calibration and prediction result diagram of the GA-ELM model (b), the calibration and prediction result diagram of the UVE-ELM model (c), and the calibration and prediction result diagram of the WOA-ELM model (d);

[0061] Figure 7 is a structural diagram of three deep learning models provided by embodiments of the present invention;

[0062] Figure 8 1D-CNN model prediction results (a), ConvNeXt-ECA model prediction results (b), CNN-GRU-MHA model prediction results (c) provided by the embodiment of the present invention;

[0063] Fig. 9 4 is a comparison chart of the quantitative performance of various models provided by the embodiments of the present invention. DETAILED DESCRIPTION

[0064] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.

[0065] The embodiment of the present invention provides a method for identifying camellia oil content in plant blended oil based on deep learning, comprising the following steps:

[0066] S1. Collect or prepare standard samples of pure edible vegetable oil and mixed oils with different concentration ratios for constructing identification models, and perform Raman spectroscopy detection to obtain original Raman spectral data of the standard samples;

[0067] Specifically, in the above step S1, the types of pure edible vegetable oils in the embodiment of the present invention are camellia oil, rapeseed oil and corn oil of different origins, brands and batches, and the standard samples of mixed oils with different concentration ratios are rapeseed oil and corn oil with concentration gradients of 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90% and 100% respectively mixed into the camellia oil, and the concentration gradient of the camellia oil in the standard samples of mixed oils with different concentration ratios is 0%, 5%, 10%, 15%, 20%, 25% and 30%. Of course, it should be understood that the standard samples are not limited to the samples listed above, and also include other pure edible vegetable oils and mixed oil samples that appear according to actual needs.

[0068] Specifically, in the above step S1, in the preparation process of the embodiment of the present invention, preferably the three pure oils are pipetted into a beaker with a total volume of 10 mL, preferably washed and dried with deionized water, and preferably stirred evenly with an ultrasonic oscillator (JM-10D-28, Jiemeng Ultrasonic Technology Co., Ltd., China). Before obtaining the Raman spectrum, preferably a pipette (Eppendorf Research plus, Eppendorf AG, Germany) is used to extract 0.1 mL of the well-mixed sample and drop it into a porous plate. Before obtaining the spectrum, each sample is preferably stored in a dark and cold environment.

[0069] Specifically, in the above step S1, the Raman spectrum detection described in the embodiment of the present invention is preferably carried out by a Raman spectrometer (RK785-I, BW&TEK, USA), and the various measurement parameters are preferably as follows: the laser excitation wavelength is 785nm, the objective lens magnification: 10X, the laser power is set to 3×10-3W, the signal-to-noise ratio is 300:1, the spectroscopic grating is an extended grating, the light slit is 30μm, the single spectrum acquisition time is 3s, the accumulation number is 3 times, and a spectrum with a good signal-to-noise ratio is obtained. Under the above preferred laser light source wavelength and measurement parameters, the Raman spectrum displacement range is preferably extracted to be 1000–1800cm-1 The spectral data were used for subsequent data analysis.

[0070] S2. Performing smoothing and filtering processing on the original Raman spectrum data, and preferably using Savitzky-Golay filtering method to smooth the Raman spectrum to reduce noise.

[0071] S3, standardizing the Raman spectrum data processed by S2, and preferably using SNV standard normal variable transformation to standardize the Raman spectrum to reduce the spectral intensity variation caused by sample inhomogeneity, the steps are as follows:

[0072] 1. Calculate the average:

[0073]

[0074] 2. Calculate the standard deviation:

[0075]

[0076] 3. Apply SNV changes:

[0077]

[0078] where x i is the i-th data point in the original spectrum data, μ is the mean of the spectrum data, σ is the standard deviation of the spectrum data, and x′ i is the ith data point after SNV normalization.

[0079] S4, removing the baseline of the Raman spectrum data after S3, and preferably using ALS asymmetric least squares smoothing method to remove the baseline of the Raman spectrum data. The steps are as follows:

[0080] 1. Set parameters:

[0081]

[0082] Where p is the asymmetry factor, λ is the smoothing factor, μ is the threshold, and n iter is the number of iterations.

[0083] 2. Calculate the weight matrix:

[0084] For each data point y i , the initial weight matrix W is the identity matrix.

[0085] 3. Iterative calculation and update, for each iteration k:

[0086] (1) Calculate the baseline estimate:

[0087] The baseline estimate z is calculated using the weighted least squares method, which is obtained by minimizing the following objective function:

[0088]

[0089] Among them, w i is the current weight, y i is the original Raman spectrum data, z i is the baseline estimate at the i-th spectral data point, and λ is a regularization parameter used to control the degree of smoothing.

[0090] (2) Update the weight matrix:

[0091] Based on the baseline estimate z, update the weight matrix W:

[0092]

[0093] where w i is the current weight, y i is the original Raman spectrum data, and p is the asymmetry factor.

[0094] (3) Check the convergence conditions:

[0095] If the change of the baseline estimate z between two consecutive iterations is less than the set threshold μ, the iteration is stopped; otherwise, the next iteration is continued.

[0096] 4. Final baseline correction

[0097] After k iterations, the obtained z is the corrected baseline, which is subtracted from the original spectral data y to obtain the spectral data y′ after baseline removal. i :

[0098] y′ i =y i -z i

[0099] S5, denormalize the Raman spectrum data processed by S4, specifically use the maximum and minimum normalization method to normalize the Raman spectrum data to improve the prediction accuracy. The steps are as follows:

[0100] 1. Calculate the minimum and maximum values:

[0101] min(x)=min{x1,x2,...,x n}

[0102] max(x)=max{x1,x2,...,x n}

[0103] 2. Apply maximum and minimum normalization:

[0104]

[0105] where x i is the i-th data point in the original spectral data, min(x) is the minimum value in the spectral data, max(x) is the maximum value in the spectral data, and x′ i is the normalized ith data point.

[0106] S6, averaging and expanding the Raman spectral data processed in S5, and preferably randomly selecting 5 spectral data of each concentration for averaging, and expanding the data set by preferably adding Poisson noise and frequency domain disturbance to the average spectral data.

[0107] Specifically, after the pretreatment in the embodiment of the present invention through steps S2-S6, the Raman spectra of three pure oils, rapeseed oil, camellia oil and corn oil, are as follows: Figure 1 shown. Figure 1 The medium Raman shift value is 1062cm -1 The characteristic peaks near the center mainly correspond to the CC stretching vibration of fatty acids, and the Raman shift value is 1255 cm -1 The characteristic peaks near the unsaturated olefin bond reflect the bending vibration of the =CH carbon atom, and the Raman shift value is 1288cm -1 The characteristic peak nearby is related to the CH bending vibration of the methylene group, and the Raman shift value is 1427 cm -1 The characteristic peak near it belongs to -CH2 shear vibration, and the Raman shift value is 1641cm -1 The characteristic peak near it belongs to the cis C=C stretching vibration of the olefin RHC=CHR, and the Raman shift value is 1732cm -1 The characteristic peaks nearby belong to the C=O stretching vibration of the carbonyl group of the ester bond;

[0108] Specifically, from Figure 1 It can be seen that the Raman spectra of the three vegetable oils have roughly the same shape and position of the Raman characteristic peaks, the difference lies in the peak intensity of the Raman characteristic peaks. Raman spectra reflect the vibration of the molecular bonds of the material structure, and the molecular bonds exist in the unsaturated fatty acids of the vegetable oils. Therefore, the position of the characteristic peaks in the Raman spectrum and the intensity of the peaks are related to the type and proportion of unsaturated fatty acids in the vegetable oils. It can be judged that the fatty acid composition contained in the three vegetable oils is roughly the same, but the content of some fatty acids is different, which leads to differences in the peak intensity of the same Raman peaks of the three vegetable oils. Figure 2 The Raman spectrum of camellia oil concentration changes. It can be seen from the figure that as the camellia oil content increases from 0% to 30%, the 1288cm -1 and 1641cm -1The intensity of the nearby characteristic peaks also increased, which provided a basis for the identification of camellia oil in the plant oil mixture;

[0109] Specifically, after the pretreatment in the embodiment of the present invention through steps S2-S6, the Raman spectrum of the binary blended oil of rapeseed oil and corn oil is as follows: Figure 3 As shown. Figure 3 It can be seen that 1515cm -1 The intensity of the characteristic peak increases with the increase of rapeseed oil content, 1515cm -1 The characteristic peak at reflects the content of β-carotene. The content of β-carotene in corn oil is lower than that in rapeseed oil, so when the content of rapeseed oil increases, the mixture contains a larger amount of β-carotene, resulting in a stronger characteristic peak at this Raman shift. However, it is impossible to accurately distinguish rapeseed oil and corn oil, as well as mixed oils of three different concentrations of vegetable oils, by relying solely on the spectrum. Therefore, in step S7, the embodiment of the present invention preferably uses the PCA model and the UMAP model to visualize and analyze the three pure oils.

[0110] S7. Spectral dimension reduction was performed on the pre-processed pure oil Raman spectral data using principal component analysis (PCA) and unified manifold approximation and projection (UMAP) to visualize the pure oil samples and study the similarities and differences of the pure oil samples.

[0111] Specifically, in step S7, the dimensionality reduction results of the PCA and UMAP of the embodiment of the present invention on the three pure oil spectrum data sets are preferably displayed through distribution diagrams in two-dimensional space and three-dimensional space;

[0112] Specifically, in step S7, the embodiment of the present invention uses principal component analysis PCA to visualize the three pure oil Raman spectral data sets, and the variance contributions of principal components 1, 2, and 3 are 92.71%, 3.26%, and 0.57%, respectively. The cumulative variance contribution of the first two principal components exceeds 95%, while the cumulative variance contribution of the first three principal components exceeds 96%. This shows that the PCA model effectively captures most of the information in the vegetable oil data. The first three principal components are selected to visualize the spectral data in two-dimensional and three-dimensional space, as shown in FIG. Figure 4 (a) and Figure 4 (b) However, the results show that it is difficult to distinguish the three pure oils. To solve this problem, the more excellent UMAP visualization algorithm was used. The results show that UMAP can effectively distinguish the three pure oils in two-dimensional and three-dimensional space, as shown in Figure 2. Figure 4 (c) and Figure 4(d) As shown. In the visualization diagrams of PCA and UMAP, it can be observed that there are certain differences between the Raman spectral data of the same oil. Although corn oil and rapeseed oil are similar in composition and Raman spectra, in the UMAP analysis, the differences between their species are significantly greater than their internal differences, and the rapeseed oil species have the largest difference. Visualization can intuitively display the similarities and differences between different pure oils, so as to better understand their performance in mixed oils, and then improve the accuracy and reliability of the quantitative model. Therefore, before conducting quantitative analysis on mixed oils, it is necessary to visualize the three pure oils.

[0113] S8, using three spectral variable selection methods, namely genetic optimization algorithm GA, non-information variable elimination algorithm UVE and whale optimization algorithm WOA, to identify the relevant spectral variables of camellia oil, and then using the selected variables to build an extreme learning machine model;

[0114] Specifically, in step S8, the parameters of the GA genetic optimization algorithm of the embodiment of the present invention are preferably set as follows: the population size is 100, the crossover probability is 0.7, the mutation probability is 0.05, and the maximum number of iterations is 200; the parameters of the UVE non-information variable elimination algorithm are preferably set as follows: the number of variable repetitions is 500, and the non-information variable threshold is 0.15; the parameters of the WOA whale optimization algorithm are preferably set as follows: the population size is 80, the maximum number of iterations is 200, the shrinkage surround coefficient and the spiral update parameter are randomly initialized and dynamically adjusted during the iteration process; the parameters of the extreme learning machine ELM model are preferably set as follows: the number of hidden layer neurons is 100, and the activation function is sigmoid.

[0115] S9. Divide the entire data set, randomly select 20% of the data from the data set as the test set, and the remaining 80% of the data as the training set. The training set is used to train the extreme learning machine model, and the test set is used to test the performance of the final extreme learning machine model;

[0116] Specifically, in steps S9 and S10, the performance of the extreme learning machine model and the deep learning model in the embodiment of the present invention is preferably determined by the coefficient R 2 And root mean square error RMSE to judge. RMSE and R 2 The calculation method is as follows:

[0117]

[0118] Where n is the number of samples, y i , and They represent the average of the actual value, predicted value and actual value of camellia oil concentration in the mixture, that is, y i The lower the RMSE value, the higher the R 2The closer it is to 1, the better the prediction effect of the regression model.

[0119] Specifically, in steps S9 and S10, the steps of the embodiment of the present invention are repeated at least 10 times;

[0120] Specifically, in steps S8 and S9, the embodiment of the present invention uses multiple machine learning models such as ELM, GA-ELM, UVE-ELM and WOA-ELM, and combines the Raman spectral data preprocessed in S6 to quantitatively analyze the concentration of camellia oil in plant blended oil. The relevant information is shown in Table 1. Specifically, 4 spectral data are randomly selected from each concentration of blended oil as a training set, and the remaining 2 spectral data are used as a test set. After 200 iterations of GA, 76 spectral variables ( Figure 5 (a)). Figure 5 As shown in (b), the selected variables are mainly distributed between the Raman spectral peaks. Then, these 76 variables are used to build the ELM model, and the R 2 The values ​​of P and RMSEP were 0.9463 and 1.8679, respectively. In addition, UVE selected a total of 49 spectral variables ( Figure 5 (c)). The selected spectral variables are mainly concentrated at the vibration peaks of the Raman spectrum of camellia oil, such as Figure 5 (d) As shown in the figure, the R 2 The values ​​of P and RMSEP were 0.9718 and 1.0592, respectively, and the prediction ability was improved compared with GA-ELM. Figure 5 As shown in (e), the WOA algorithm selects 21 spectral variables ( Figure 5 (f)). Finally, the R 2 The values ​​of P and RMSEP were 0.9572 and 1.8034, respectively;

[0121] Table 1 Prediction performance of different variable selection algorithms combined with ELM model

[0122]

[0123] Specifically, in steps S8 and S9, Figure 6The calibration and prediction results of the four quantitative models of the embodiments of the present invention are shown. The results show that the prediction accuracy of the ELM model after GA feature extraction is improved by 0.0567 compared with the ELM model. The reason is that GA feature extraction effectively reduces the dimension of spectral data, thereby simplifying model construction. The prediction accuracy of the ELM model of camellia oil after UVE variable screening is improved by 0.0255 compared with GA-ELM, because the reduction in the number of variables can eliminate collinearity or irrelevant information, thereby improving the performance of the model, and most of the screened variables are concentrated near the main molecular vibration Raman peak of camellia oil. The prediction accuracy of the ELM model established after WOA variable screening decreased by 0.0146 compared with UVE-ELM, because some variables were removed, resulting in the loss of valuable information, which resulted in the model being unable to achieve higher prediction accuracy. Although the ELM model can predict the concentration of camellia oil, its prediction results are not accurate enough. Therefore, in order to more accurately predict the content of camellia oil in mixed oil, the embodiment of the present invention designs three deep learning models in step S10.

[0124] S10. Three deep learning models, 1D-CNN, ConvNeXt-ECA and CNN-GRU-MHA, were designed in combination with the attention mechanism. The model randomly selected 60% of the data as the training set, 20% as the validation set, and the remaining 20% ​​as the test set, and the model was evaluated using the 5-fold cross-validation method. The training set is used to determine the model parameters, the validation set is used to adjust the hyperparameters and optimize the network structure, and the test set is used to evaluate the generalization ability of the model.

[0125] Specifically, in step S10, the 1D-CNN deep learning model of the embodiment of the present invention includes an input layer, four one-dimensional convolutional layers, a batch normalization layer, two pooling layers, a flattening layer, a fully connected layer, a Dropout layer and an output layer, and its structure is as follows: Figure 7 As shown in (a); the one-dimensional convolution layer is used to extract the features of the input data, the batch normalization layer is used to improve the model stability and accelerate the model convergence, the maximum pooling layer can compress and combine the features extracted by the convolution layer to reduce the dimension of the convolution layer output result, the flattening layer converts the high-dimensional data into one dimension, the fully connected layer connects all the neurons output by the flattening layer to each of its own neurons, and the Dropout layer is used to prevent the model from overfitting;

[0126] Specifically, in step S10, the ConvNeXt-ECA deep learning model of the embodiment of the present invention adds an ECA module after each convolution layer to achieve the purpose of local cross-channel interactive fusion of spectral data. Finally, the identification of camellia oil content is realized through global average pooling and flattening operations. Its structure is as follows: Figure 7 (b)

[0127] Specifically, in step S10, the CNN-GRU-MHA deep learning model of the embodiment of the present invention is composed of a convolution layer, a pooling layer and a reshaping layer, performs feature extraction and inputs the data adjusted by the reshaping layer into the GRU layer with 128 output dimensions, and after processing, inputs it into the multi-head attention mechanism, and performs layer normalization operation. Its structure is as follows: Figure 7 (c) As shown in the figure, the three models in S10 all use the "MSE" loss function and the "Leaky ReLU" activation function. The ConvNeXt-ECA and CNN-GRU-MHA models use the Adam optimizer with a learning rate of 0.0001, and the 1D-CNN model uses the "Nadam optimizer". Table 2 shows the average prediction results of each model run 10 times. Figure 8 The prediction results of three deep learning models are shown.

[0128] Table 21 Prediction results of three deep learning models: D-CNN, improved ConvNeXt and CNN-GRU

[0129]

[0130] Specifically, in step S10, the three models in the embodiment of the present invention all show excellent prediction capabilities, among which the R 2 p is higher than 0.995, R of CNN-GRU-MHA 2 p is higher than 0.998. Although 1D-CNN is not as accurate as the other two models in predicting camellia oil concentration, it is still better than traditional machine learning models such as Fig. 9 As shown. The ConvNeXt-ECA model has been improved on the convolutional neural network architecture. By introducing the ECA attention mechanism, it can better focus on the important features of Raman spectral data, thereby improving the effect of feature extraction. The CNN-GRU-MHA model shows better prediction performance, which may be because the model not only efficiently extracts data features through the convolution layer and pooling layer of CNN, but also makes sequence modeling more accurate through the powerful temporal feature processing capability of GRU. At the same time, the added multi-head attention mechanism MHA can capture the dependencies and complex spatiotemporal correlations in the data. However, both the 1D-CNN model and the ConvNeXt-ECA model are insensitive to sequence data and cannot effectively learn some temporal information in Raman spectral data. Compared with the other two models, CNN-GRU-MHA shows better prediction performance. Therefore, the present invention provides a method for quantitatively analyzing the camellia oil content in blended oil by combining an attention mechanism with a deep learning model, and also proves the application potential of the attention mechanism fused with a deep learning model in vegetable oil identification.

[0131] The above is an embodiment of the present invention. The above embodiments and the specific parameters in the embodiments are only for the purpose of clearly describing the invention verification process, and are not intended to limit the patent protection scope of the present invention. The patent protection scope of the present invention is still subject to its claims. Any equivalent structural changes made by using the contents of the description and drawings of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for identifying camellia oil content in plant blended oil based on deep learning, comprising the following steps: .Collect or prepare standard samples of pure edible vegetable oil and mixed oil with different concentration ratios for building identification models, and perform Raman spectroscopy detection to obtain the original Raman spectral data of standard samples; detect pure oil and mixed oil samples by Raman spectroscopy, and pre-process the data using Savitzky-Golay filtering smoothing, SNV standardization, ALS baseline removal and maximum and minimum normalization methods; randomly select spectral data and expand the data set through Poisson noise; use PCA and UMAP for dimensionality reduction analysis; use GA genetic optimization algorithm, UVE non-information variable elimination algorithm and WOA whale optimization algorithm to select spectral variables and build an extreme learning machine model; finally, combine the attention mechanism, use 1D-CNN, ConvNeXt-ECA and CNN-GRU-MHA deep learning models for training and verification, and evaluate the model performance through cross-validation.

2. A method for identifying camellia oil content in plant blended oil based on deep learning as claimed in claim 1, characterized in that: The types of pure edible vegetable oils are camellia oil, rapeseed oil and corn oil. The standard samples of the mixed oils with different concentration ratios are camellia oil mixed with rapeseed oil and corn oil with concentration gradients of 0%, 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90% and 100%, respectively. The concentration gradient of the camellia oil in the standard samples of the mixed oils with different concentration ratios is 0%, 5%, 10%, 15%, 20%, 25% and 30%.

3. A method for identifying camellia oil content in plant blended oil based on deep learning as claimed in claim 1, characterized in that: The dimensionality reduction results of the PCA and UMAP on the three pure oil spectral data sets are respectively displayed through distribution diagrams in two-dimensional space and three-dimensional space.

4. A method for identifying camellia oil content in plant blended oil based on deep learning as claimed in claim 1, characterized in that: The parameters of the GA genetic optimization algorithm are set as follows: the population size is 100, the crossover probability is 0.7, the mutation probability is 0.05, and the maximum number of iterations is 200; the parameters of the UVE non-information variable elimination algorithm are set as follows: the number of variable repetitions is 500, and the non-information variable threshold is 0.15; the parameters of the WOA whale optimization algorithm are set as follows: the population size is 80, the maximum number of iterations is 200, the shrinkage and encirclement coefficients and the spiral update position coefficients are randomly initialized and dynamically adjusted during the iteration process; the parameters of the extreme learning machine model are set as follows: the number of hidden layer neurons is 100, and the activation function is sigmoid.

5. A method for identifying camellia oil content in plant blended oil based on deep learning as claimed in claim 1, characterized in that: The 1D-CNN deep learning model includes an input layer, four one-dimensional convolutional layers, a batch normalization layer, two pooling layers, a flattening layer, a fully connected layer, a Dropout layer and an output layer; the ConvNeXt-ECA deep learning model adds an ECA module after each convolutional layer, and finally realizes the identification of camellia oil content through global average pooling and flattening operations; the CNN-GRU-MHA deep learning model consists of a convolutional layer, a pooling layer and a reshaping layer, performs feature extraction and inputs the data adjusted by the reshaping layer into the GRU layer with 128 output dimensions, and after processing, inputs it into the multi-head attention mechanism, and performs layer normalization operation; the three models all use the "MSE" loss function and the "Leaky ReLU" activation function, the ConvNeXt-ECA and CNN-GRU-MHA models use the Adam optimizer with a learning rate of 0.0001, and the 1D-CNN model uses the "Nadam" optimizer.

6. A method for identifying camellia oil content in plant blended oil based on deep learning as claimed in claim 1, characterized in that: The performance of the extreme learning machine model and the deep learning model is judged by the determination coefficient R2 and the root mean square error RMSE.

7. A method for identifying camellia oil content in plant blended oil based on deep learning as claimed in claim 1, characterized in that: The evaluation of the model performance was repeated at least 10 times.