Fruit surface pesticide residue detection method based on Gaussian mixture model and Raman spectrum
Through Raman spectroscopy technology and Gaussian hybrid model, the problem of traditional detection methods destroying fruit integrity and inaccurate detection is solved, and fast, low-cost and high-reliability detection of pesticide residues on the surface of fruits is achieved.
Patent Information
- Application Number
- CN202510333811.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-07-04
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional pesticide residue detection methods on the surface of fruits need to destroy fruit integrity, are complex and expensive to operate, difficult to meet fast, low-cost and comprehensive testing needs, and ignore the impact of temperature on Raman spectral data, resulting in inaccurate detection results.
Raman spectroscopy technology combined with Gaussian mixed model is used to collect Raman spectroscopy data on the surface of fruits through multi-point acquisition, baseline correction and feature peak extraction, and a classification model of Gaussian mixed pesticide residue concentration is constructed using principal component analysis and expectation maximization algorithm to generate a detection report.
It realizes fast and low-cost large-scale fruit surface pesticide residue detection, improves the reliability and accuracy of the detection, and can fully reflect the pesticide residue status on the fruit surface.
Smart Images

Figure CN120253801A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of pesticide residue detection on the surface of fruits, and particularly relates to a method and device for detecting pesticide residues on the surface of fruits using a Gaussian mixture model and Raman spectroscopy, as well as a computing device. Background Art
[0002] The problem of pesticide residues on the surface of fruits has attracted much attention. Traditional pesticide residue detection methods such as gas chromatography-mass spectrometry and liquid chromatography-mass spectrometry require sampling, extraction, and pretreatment of fruits, which destroys the integrity of the fruits and is not suitable for large-scale rapid screening. In addition, the sample pretreatment process is complex and the instrument equipment is expensive, making it difficult to meet the market demand for rapid and low-cost detection, and even more difficult to meet the on-site detection through retail terminals. Moreover, due to the uneven distribution of pesticide residues on the surface of fruits, traditional methods usually only detect a small number of sample points, making it difficult to comprehensively reflect the residue situation on the entire fruit surface. Additionally, in pesticide residue detection, ignoring the influence of temperature on Raman spectroscopy data leads to a decrease in the accuracy of detection results.
[0003] To solve the above problems, the present invention proposes a method for detecting pesticide residues on the surface of fruits using a Gaussian mixture model and Raman spectroscopy, which combines Raman spectroscopy technology and a Gaussian mixture model to process the heterogeneity of the pesticide residue concentration distribution on the surface of fruits, so as to further improve the reliability of pesticide residue detection. Summary of the Invention
[0004] In view of the above problems, the present invention provides a method and device for detecting pesticide residues on the surface of fruits using a Gaussian mixture model and Raman spectroscopy, as well as a computing device.
[0005] According to one aspect of the present invention, there is provided a method for detecting pesticide residues on the surface of fruits using a Gaussian mixture model and Raman spectroscopy, including:
[0006] Performing multi-point Raman spectroscopy acquisition on the surface of the fruit through a Raman spectrometer to obtain Raman spectroscopy data on the surface of the fruit, and performing baseline correction on the Raman spectroscopy data on the surface of the fruit according to the polynomial fitting method;
[0007] Extracting the characteristic peak position, peak intensity, peak area, and peak width from the corrected Raman spectroscopy data on the surface of the fruit as candidate features, and performing dimensionality reduction on the candidate features through the principal component analysis method to select a set of characteristic variables related to the pesticide residue concentration;
[0008] Constructing a Gaussian mixture pesticide residue concentration classification model according to the selected set of characteristic variables, and training the Gaussian components of the Gaussian mixture pesticide residue concentration classification model through the expectation-maximization algorithm to obtain the optimal number of Gaussian components;
[0009] Input the characteristic variable set of the fruit to be tested into the Gaussian mixture pesticide residue concentration classification model to obtain the probability of the pesticide residue types of the fruit to be tested; according to the pre-established mapping relationship between the pesticide residue types and the residue concentration, obtain the pesticide residue concentration; generate a fruit surface pesticide residue detection report for the fruit to be tested according to the pesticide residue types, the pesticide residue concentration, and the probability.
[0010] In an alternative manner, the step of reducing the dimension of the candidate features by the principal component analysis method and selecting the characteristic variable set related to the pesticide residue concentration further includes:
[0011] Perform standardization processing on the candidate features to ensure that each subsequent feature has a zero mean and a unit variance;
[0012] Calculate the covariance matrix of the standardized features, and the covariance matrix is:
[0013] C = (1 / (n - 1)) × X T × X
[0014] where X is the standardized feature matrix and n is the number of samples;
[0015] Perform eigenvalue decomposition on the covariance matrix to obtain the eigenvalues and the corresponding eigenvectors;
[0016] Arrange them in descending order according to the eigenvalue magnitudes, and calculate the cumulative contribution rate according to the contribution rate of each principal component;
[0017] Select the characteristic variables corresponding to the first K principal components whose cumulative contribution rate is greater than a preset threshold from the cumulative contribution rate to obtain the characteristic variable set.
[0018] In an alternative manner, the step of training the Gaussian components of the Gaussian mixture pesticide residue concentration classification model by the expectation maximization algorithm further includes:
[0019] Calculate the posterior probability that the sample x i belongs to the Kth Gaussian component, and the posterior probability is:
[0020]
[0021] where N(x i |μ k , ∑ k ) is the probability density of the sample x i under the Gaussian distribution with the mean μ k and the covariance matrix ∑ k ; π k , π j are the Kth and jth mixing coefficients respectively; j is similar to K and represents the jth Gaussian component; γ ikis the posterior probability, representing the probability that the sample x i belongs to the k-th Gaussian component; μ k is the mean vector of the k-th Gaussian component; μ j is the mean vector of the j-th Gaussian component; ∑ k 、∑ j are the covariance matrices of the k-th and j-th Gaussian components respectively;
[0022] Update the Gaussian components of the Gaussian mixture pesticide residue concentration classification model according to the posterior probability until the parameters converge or reach the preset number of iterations. The Gaussian components include the mean, covariance matrix, and mixing coefficient;
[0023] Among them, the update formula for the mean is:
[0024] μ k =(∑ i γ ik ×x i ) / ∑ i γ ik ;
[0025] The update formula for the covariance matrix is:
[0026] ∑ k =(∑ i γ ik ×(x i -μ k )(x i -μ k ) T ) / ∑ i γ ik ;
[0027] The update formula for the mixing coefficient is:
[0028] π k =(∑ i γ ik ) / n, where n is the total number of samples.
[0029] In an optional manner, the obtaining of the Raman spectrum data of the fruit surface by performing multi-point Raman spectrum acquisition on the fruit surface with a Raman spectrometer further includes:
[0030] Using a Raman spectrometer with a laser wavelength of 780 nm to 790 nm, uniformly select no less than five different sampling points on each fruit surface for spectrum acquisition; among them, the laser power at each sampling point is below 10 mW, the integration time is set to 2 seconds, and the spectral resolution is greater than or equal to 8 cm -1 ;
[0031] Collect spectral data three times for each sampling point, and take the average of the three spectral data as the Raman spectral data of that point, and record the spatial coordinate information of each sampling point.
[0032] In an alternative manner, the pesticide residue detection report includes the fruit name, sampling time, sampling location, pesticide type, pesticide residue concentration, detection probability, and pesticide residue distribution map; wherein, the pesticide residue distribution map shows the pesticide residue concentration levels in different regions of the fruit surface through color coding.
[0033] In an alternative manner, the front end of the Gaussian mixture pesticide residue concentration classification model includes a feature extractor stacked by multiple MBConv modules, wherein each MBConv module contains multiple depthwise separable convolutional layers, a bottleneck layer, an expansion layer, an SE attention layer, and a residual connection;
[0034] The back end of the Gaussian mixture pesticide residue concentration classification model includes multiple Gaussian mixture layers, wherein each Gaussian mixture layer includes an MBConv module composed of an MBConv1 network layer and an MBConv6 network layer; the feature dimensions of the bottleneck layer and the expansion layer of the MBConv1 network layer are the same; the feature dimension of the expansion layer of the MBConv6 network layer is 6 times that of the bottleneck layer; each MBConv module receives an input of X feature dimensions, expands to Y dimensions through the expansion layer, and then reduces the dimension to Z dimensions through depthwise separable convolution and the bottleneck layer, and finally outputs features of Z feature dimensions.
[0035] In an alternative manner, further comprising, for the baseline correction of the Raman spectral data of the fruit surface according to the polynomial fitting method:
[0036] Determine the order of the fitting polynomial according to the fruit type, and use the minimum value point in the Raman spectral data of the fruit surface as the baseline point; wherein, smooth-skinned berry fruits use a 3rd-order fitting polynomial; rough-skinned cellulose fruits use a 4 - 5th-order fitting polynomial;
[0037] Fit the polynomial according to the baseline point, and subtract the fitted polynomial from the Raman spectral data of the fruit surface to obtain the corrected spectrum.
[0038] In an alternative manner, the method further comprises:
[0039] During the Raman spectrum acquisition process, monitor the temperature of the fruit surface in real time;
[0040] Correct the Raman spectral data using different temperature compensation models according to the fruit type;
[0041] Among them, the temperature compensation model for smooth-skinned berry fruits is:
[0042] I corrected I(ω) = raw I(ω)+α×(T - T ref 0)×exp(-β×(ω - ω0) 2 )
[0043] Wherein, I corrected (ω) is the intensity of the corrected Raman spectrum at the Raman shift ω; I raw (ω) is the intensity of the original Raman spectrum at the Raman shift ω; T is the temperature of the fruit surface; T ref 0 is the reference temperature; ω0 is the center position of the characteristic peak; α is the temperature sensitivity coefficient; β is the peak broadening coefficient;
[0044] The temperature compensation model for the cellulose-based fruit with rough skin is:
[0045]
[0046] Wherein, ε is the Raman shift correction coefficient.
[0047] According to another aspect of the present invention, there is provided a fruit surface pesticide residue detection device using a Gaussian mixture model and Raman spectroscopy, comprising:
[0048] A Raman spectrum acquisition module, configured to collect Raman spectra at multiple points on the fruit surface through a Raman spectrometer, obtain Raman spectrum data of the fruit surface, and perform baseline correction on the Raman spectrum data of the fruit surface according to the polynomial fitting method;
[0049] A characteristic variable set extraction module, configured to extract the characteristic peak position, peak intensity, peak area, and peak width from the corrected Raman spectrum data of the fruit surface as candidate features, and perform dimensionality reduction on the candidate features by the principal component analysis method to select a characteristic variable set related to the pesticide residue concentration;
[0050] A Gaussian mixture model construction module, configured to construct a Gaussian mixture pesticide residue concentration classification model according to the selected characteristic variable set, and train the Gaussian components of the Gaussian mixture pesticide residue concentration classification model by the expectation maximization algorithm to obtain the optimal number of Gaussian components;
[0051] A pesticide residue detection module, configured to input the characteristic variable set of the fruit to be tested into the Gaussian mixture pesticide residue concentration classification model to obtain the probability of the pesticide residue type of the fruit to be tested; according to the mapping relationship established in advance between the pesticide residue type and the residue concentration, obtain the pesticide residue concentration; generate a fruit surface pesticide residue detection report for the fruit to be tested according to the pesticide residue type, pesticide residue concentration, and probability.
[0052] According to another aspect of the present invention, a computing device is provided, including: a processor, a memory, a communication interface, and a communication bus, and the processor, the memory, and the communication interface complete communication with each other through the communication bus;
[0053] The memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform operations corresponding to the above-mentioned method for detecting pesticide residues on the fruit surface by using the Gaussian mixture model and Raman spectroscopy.
[0054] According to the solution provided by the present invention, Raman spectroscopy is used to collect Raman spectra at multiple points on the fruit surface to obtain Raman spectral data of the fruit surface, and baseline correction is performed on the Raman spectral data of the fruit surface according to the polynomial fitting method; the position, intensity, area, and width of the characteristic peaks are extracted from the corrected Raman spectral data of the fruit surface as candidate features, and dimensionality reduction is performed on the candidate features by using the principal component analysis method to select a set of characteristic variables related to the pesticide residue concentration; a Gaussian mixture pesticide residue concentration classification model is constructed according to the selected set of characteristic variables, and the Gaussian components of the Gaussian mixture pesticide residue concentration classification model are trained by using the expectation maximization algorithm to obtain the optimal number of Gaussian components; the set of characteristic variables of the fruit to be tested is input into the Gaussian mixture pesticide residue concentration classification model to obtain the probability of the types of pesticide residues on the fruit to be tested; according to the pre-established mapping relationship between the types of pesticide residues and the residue concentration, the pesticide residue concentration is obtained; a detection report on the pesticide residues on the fruit surface of the fruit to be tested is generated according to the types of pesticide residues, the pesticide residue concentration, and the probability. The present invention combines Raman spectroscopy technology and Gaussian mixture model to handle the heterogeneity of the pesticide residue concentration distribution on the fruit surface, and further improves the reliability of pesticide residue detection.
[0055] The above description is only an overview of the technical solution of the present invention. In order to be able to understand the technical means of the present invention more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features, and advantages of the present invention more obvious and understandable, the following specific embodiments of the present invention are specifically given. Description of the Drawings
[0056] By reading the following detailed description of the preferred embodiments, various other advantages and benefits will become clear to those of ordinary skill in the art. The drawings are only for the purpose of showing the preferred embodiments and are not considered to be a limitation of the present invention. And throughout the drawings, the same reference numerals are used to represent the same components. In the drawings:
[0057] Figure 1 A flowchart showing the method for detecting pesticide residues on the fruit surface by using the Gaussian mixture model and Raman spectroscopy according to an embodiment of the present invention;
[0058] Figure 2Shows a schematic flowchart of the classification of pesticide residues in an embodiment of the present invention;
[0059] Figure 3 Shows a schematic diagram of the Gaussian mixture pesticide residue concentration classification model in an embodiment of the present invention;
[0060] Figure 4 Shows a schematic flowchart of the pesticide detection and processing procedure in an embodiment of the present invention;
[0061] Figure 5 Shows a schematic diagram of Raman spectroscopy analysis in an embodiment of the present invention;
[0062] Figure 6 Shows a schematic diagram of Raman spectroscopy baseline correction in an embodiment of the present invention;
[0063] Figure 7 Shows a schematic framework diagram of a fruit surface pesticide residue detection device using a Gaussian mixture model and Raman spectroscopy in an embodiment of the present invention;
[0064] Figure 8 Shows a schematic diagram of the structure of a computing device in an embodiment of the present invention. Detailed implementation manners
[0065] Hereinafter, exemplary embodiments of the present invention will be described in more detail with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present invention can be more thoroughly understood and the scope of the present invention can be fully conveyed to those skilled in the art.
[0066] Figure 1 Shows a schematic flowchart of a method for detecting fruit surface pesticide residues using a Gaussian mixture model and Raman spectroscopy in an embodiment of the present invention. Specifically, as Figure 1 shown, the method includes the following steps:
[0067] Step S101, perform multi-point Raman spectroscopy acquisition on the fruit surface through a Raman spectrometer to obtain fruit surface Raman spectroscopy data, and perform baseline correction on the fruit surface Raman spectroscopy data according to the polynomial fitting method.
[0068] In this embodiment, multi-point Raman spectroscopy acquisition is performed on the fruit surface through a Raman spectrometer without damaging the fruit sample. The acquisition process only takes a few seconds to 1 minute, and the detection is fast, which is suitable for large-scale screening. In addition, since the measurement can be directly performed on the fruit surface, the operation difficulty is reduced. Multi-point acquisition can more comprehensively reflect the distribution of pesticide residues on the fruit surface, and baseline correction is performed through polynomial fitting to eliminate background noise and fluorescence interference.
[0069] Specifically, prepare a Raman spectrometer and set parameters such as laser wavelength, power, and integration time. Uniformly select multiple sampling points on the surface of the fruit to be measured, and the number of sampling points depends on the size and surface area of the fruit. Use the Raman spectrometer to collect spectral data for each sampling point, ensure that the laser focus is aligned with the fruit surface, and record the spatial coordinate information of each sampling point. Use the polynomial fitting method to perform baseline correction on the Raman spectral data of each sampling point, select an appropriate polynomial order according to the fruit type, perform polynomial fitting through software such as Origin or Matlab, and subtract the fitting curve from the original spectrum to obtain the baseline-corrected spectral data (as Figure 6 shown, the left figure is the original spectrum, and the right figure is the spectrum after baseline correction).
[0070] In an optional manner, the multi-point Raman spectral collection on the fruit surface by the Raman spectrometer to obtain the Raman spectral data of the fruit surface further includes:
[0071] Use a Raman spectrometer with a laser wavelength of 780 nm to 790 nm, and uniformly select no less than five different sampling points on each fruit surface for spectral collection; among them, the laser power at each sampling point is below 10 mW, the integration time is set to 2 seconds, and the spectral resolution is greater than or equal to 8 cm-1;
[0072] Collect spectral data three times for each sampling point, take the average value of the three spectral data as the Raman spectral data of this point, and record the spatial coordinate information of each sampling point.
[0073] In this embodiment, uniformly selecting multiple sampling points on the fruit surface for spectral collection can more fully reflect the overall chemical composition information on the fruit surface and reduce the single-point spectral analysis error caused by local differences (such as color, texture, maturity, etc.) on the fruit surface. Using a lower laser power (<10 mW) can avoid thermal damage to the fruit surface and ensure the original state of the sample. The spectral resolution is greater than or equal to 8 cm-1, which reduces the excessive requirements for instrument performance while ensuring that the Raman spectral characteristic peaks are distinguishable, and is more conducive to market expansion.
[0074] Specifically, as Figure 2 shown, the laser wavelength of the Raman spectrometer is set within the range of 780 nm to 790 nm, the spectral resolution is greater than or equal to 8 cm-1, and the laser power is adjusted below 10 mW. Fix the fruit using a fixture or support to ensure that the fruit does not move during the measurement. As Figure 5As shown, no less than five different sampling points are evenly selected on the surface of each fruit (five points can be selected in the way of "upper, lower, left, right, center"). The laser of the Raman spectrometer is focused on the first sampling point, the integration time is set to 2 seconds, the spectral data is collected three times, and the average value of the three spectral data is calculated as the Raman spectral data of this sampling point. Repeat the above steps until the spectral collection of all sampling points is completed, and associate the Raman spectral data of each sampling point with its spatial coordinate information.
[0075] In an alternative way, the further steps of baseline correction of the Raman spectral data on the fruit surface according to the polynomial fitting method include:
[0076] Determine the order of the fitting polynomial according to the fruit type, and take the minimum value point in the Raman spectral data on the fruit surface as the baseline point; among them, smooth-skinned berry fruits adopt a 3rd-order fitting polynomial; rough-skinned cellulose fruits adopt a 4th-5th order fitting polynomial;
[0077] Fit the polynomial according to the baseline point, and subtract the fitted polynomial from the Raman spectral data on the fruit surface to obtain the corrected spectrum.
[0078] In this embodiment, by adjusting the order of the fitting polynomial, the baseline with different shapes and complexities can be adapted, and the baseline can be better fitted for different types of fruits and vegetables, thereby improving the correction effect. By automatically selecting the minimum value point as the baseline point, the influence of human factors on the correction result is reduced, and the degree of automation is higher compared with manually selecting multiple baseline points. In addition, the influence of polynomial fitting on the original spectral signal is small, and the characteristic peaks of the spectrum can be better retained. The corrected spectrum is obtained by subtracting the fitted polynomial from the original Raman spectral data on the fruit surface. Among them, the appropriate order of the polynomial is selected according to the fruit type and epidermal characteristics. For example, smooth-skinned berry fruits such as blueberries, grapes, strawberries, etc. adopt a 3rd-order fitting polynomial, and rough-skinned cellulose fruits such as apples, pears, kiwifruits, etc. adopt a 4th-5th order fitting polynomial. Specifically, the 4th order can be tried first to observe the fitting effect. If the baseline still has obvious bending, then use the 5th order. Because too low an order may not be able to fit the baseline well, and too high an order may overfit the spectral signal and cause the characteristic peaks to deform. In addition, the selection of the baseline point will also affect the correction effect. If the minimum value point is interfered by noise, it will lead to inaccurate baseline correction, and a better correction effect can be obtained through baseline correction methods such as AsLS (Asymmetric Least Squares).
[0079] Step S102: Extract the characteristic peak position, peak intensity, peak area, and peak width from the calibrated Raman spectrum data of the fruit surface as candidate features, and perform dimensionality reduction on the candidate features by the principal component analysis method to select a set of characteristic variables related to the pesticide residue concentration.
[0080] In this embodiment, extracting the parameters of the position, intensity, area, and width of the characteristic peaks can more comprehensively reflect the spectral peak information of the Raman spectrum, thereby more accurately describing the spectral changes. The PCA principal component analysis method is used to remove the redundant information between the candidate features and retain the characteristic variables most relevant to the change in the pesticide residue concentration. For each piece of calibrated Raman spectrum data, the second derivative method, Savitzky-Golay smoothing filtering method, etc. are used to identify the characteristic peaks. For each identified characteristic peak, the peak position (Raman shift corresponding to the peak value), peak intensity (height of the peak value), peak area (integral area of the peak), and peak width (half-height width of the peak) are extracted.
[0081] For example, 15 characteristic peaks are extracted from the spectrum of each apple, and the peak position, peak intensity, peak area, and peak width are extracted for each peak, with a total of 15 x 4 = 60 candidate features as shown in Table 1.
[0082] Table 1
[0083]
[0084] After PCA analysis, the cumulative variance contribution rate of the first 3 principal components reaches 90%. Select k = 3, and partial principal component loadings are shown in Table 2.
[0085] Table 2
[0086] Feature PC1 PC2 PC3 Peak 1 Position 0.1 -0.2 0.05 Peak 1 Intensity 0.3 0.1 -0.1 Peak 1 Area 0.25 0.15 -0.05 Peak 1 Width 0.05 -0.3 0.2 Peak 2 Position -0.1 0.05 0.3 Peak 2 Intensity 0.2 -0.1 0.15 ... ... ... ...
[0087] Assume that the analysis finds that PC1 and PC2 have a relatively high correlation with the residue concentration of a certain pesticide (such as chlorpyrifos). Select the features with larger absolute values from the loadings of PC1 and PC2. PC1: peak 1 intensity (0.3), peak 1 area (0.25); PC2: peak 1 width (-0.3). Then the set of characteristic variables related to the residue concentration of this pesticide is {peak 1 intensity, peak 1 area, peak 1 width}.
[0088] In an alternative manner, the performing dimensionality reduction on the candidate features by the principal component analysis method to select a set of characteristic variables related to the pesticide residue concentration further includes:
[0089] Perform standardization processing on the candidate features to ensure that each subsequent feature has a zero mean and unit variance;
[0090] Calculate the covariance matrix of the standardized features. The covariance matrix is:
[0091] C = (1 / (n - 1)) × X T × X
[0092] Where X is the standardized feature matrix and n is the number of samples;
[0093] Perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues and corresponding eigenvectors;
[0094] Arrange them in descending order according to the eigenvalue magnitudes, and calculate the cumulative contribution rate based on the contribution rate of each principal component;
[0095] Select the feature variables corresponding to the top K principal components whose cumulative contribution rate is greater than a preset threshold from the cumulative contribution rate to obtain a feature variable set.
[0096] In this embodiment, to eliminate the differences in dimension and numerical range between different features and ensure that the contribution of each feature to PCA is fair, each feature is standardized to have zero mean and unit variance. The covariance matrix measures the linear relationship between different features. The larger the covariance, the stronger the correlation between two features. Perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues and corresponding eigenvectors. Among them, the eigenvalue represents the variance of the principal component, and the eigenvector represents the direction of the principal component. Determine the importance of the principal components and calculate the cumulative contribution rate. Among them, the contribution rate represents the proportion of variance explained by each principal component, and the cumulative contribution rate represents the total proportion of variance explained by the top K principal components. Specifically, arrange them in descending order according to the eigenvalue magnitudes to obtain the sorted eigenvalues and eigenvectors. The contribution rate of each principal component = eigenvalue / sum of eigenvalues; cumulative contribution rate = sum of the top K eigenvalues / sum of eigenvalues. Set a preset threshold (for example, 95%), select the top K principal components whose cumulative contribution rate is greater than the preset threshold, and project the original features onto the selected principal components to obtain the dimension-reduced feature matrix.
[0097] Step S103, construct a Gaussian mixture pesticide residue concentration classification model according to the selected feature variable set, and train the Gaussian components of the Gaussian mixture pesticide residue concentration classification model through the expectation-maximization algorithm to obtain the optimal number of Gaussian components.
[0098] In this embodiment, the Gaussian mixture model (GMM) can not only predict the category of a sample, but also give the probability that the sample belongs to each category, and can model data distributions with multiple peaks or complex shapes. Different from hard classification methods (such as support vector machines), GMM adopts a soft classification method, allowing a sample to belong to multiple categories simultaneously, only with different probabilities. It is more flexible for pesticide residue concentration classification because some samples may be at the boundary of different concentrations and are difficult to clearly divide. When training GMM through the EM algorithm, the optimal number of Gaussian components is selected through different evaluation metrics (BIC or AIC), thereby automatically determining the number of categories.
[0099] In an alternative approach, the training of the Gaussian components of the Gaussian mixture pesticide residue concentration classification model by the expectation maximization algorithm further includes:
[0100] Calculating the posterior probability that the sample x i belongs to the Kth Gaussian component, and the posterior probability is:
[0101]
[0102] where N(x i |μ k ,∑ k ) is the probability density of the sample x i under the Gaussian distribution with the mean of μ k and the covariance matrix of ∑ k ; π k , π j are the Kth and jth mixing coefficients respectively; j is similar to K and is the jth Gaussian component; γ ik is the posterior probability, indicating the probability that the sample x i belongs to the kth Gaussian component; μ k is the mean vector of the kth Gaussian component; μ j is the mean vector of the jth Gaussian component; ∑ k , ∑ j are the covariance matrices of the kth and jth Gaussian components respectively;
[0103] Updating the Gaussian components of the Gaussian mixture pesticide residue concentration classification model according to the posterior probability until the parameters converge or reach the preset number of iterations, and the Gaussian components include the mean, the covariance matrix, and the mixing coefficient;
[0104] where the update formula for the mean is:
[0105] μ k =(∑ i γ ik ×x i ) / ∑ i γ ik ;
[0106] The update formula for the covariance matrix is:
[0107] ∑ k =(∑ i γ ik ×(x i -μ k )(x i -μ k ) T ) / ∑ i γik ;
[0108] The update formula for the mixing coefficient is:
[0109] π k =(∑ i γ ik ) / n, where n is the total number of samples.
[0110] In this embodiment, the EM algorithm does not rigidly assign each sample to a certain Gaussian component, but calculates the probability that each sample belongs to each Gaussian component (i.e., the posterior probability), which can better reflect the relationship between the sample and different Gaussian components and avoid the error caused by hard assignment. By iteratively updating the posterior probability and model parameters, the optimal solution can be gradually approximated, and effective parameter estimation can be performed even in the presence of latent variables. Although the EM algorithm may also fall into a local optimal solution, compared with other methods that directly optimize the GMM parameters, its iterative process is relatively smooth, and the parameter update is based on the posterior probability of all samples in each iteration, which can jump out of some poor local optimal solutions.
[0111] In an alternative manner, the front end of the Gaussian mixture pesticide residue concentration classification model includes a feature extractor stacked by multiple MBConv modules, where each MBConv module includes multiple depthwise separable convolutional layers, a bottleneck layer, an expansion layer, an SE attention layer, and a residual connection;
[0112] The back end of the Gaussian mixture pesticide residue concentration classification model includes multiple Gaussian mixture layers, where each Gaussian mixture layer includes an MBConv module composed of an MBConv1 network layer and an MBConv6 network layer; the feature dimensions of the bottleneck layer and the expansion layer of the MBConv1 network layer are the same; the feature dimension of the expansion layer of the MBConv6 network layer is 6 times that of the bottleneck layer; each MBConv module receives an input of X feature dimensions, expands to Y dimensions through the expansion layer, and then reduces the dimension to Z dimensions through depthwise separable convolution and the bottleneck layer, and finally outputs features of Z feature dimensions.
[0113] In this embodiment, such as Figure 3 , Figure 4As shown, the MBConv (Mobile Bottleneck Convolution) stacking module can extract multi-scale and multi-level features from the input data. By continuously stacking, it learns more abstract and discriminative feature representations. Compared with the standard convolution, the depthwise separable convolution significantly reduces the computational amount, lowers the complexity of the model, and makes it easier to deploy and run the model on terminal devices such as mobile phones. The bottleneck layer is used to reduce the feature dimension, reducing the computational amount and the number of parameters. The expansion layer is used to increase the feature dimension, introduce more non-linear transformations, and improve the expressive ability of the model. Among them, MBConv1 keeps the feature dimensions of the bottleneck layer and the expansion layer the same, facilitating the stable transfer of features; MBConv6 expands the feature dimension of the expansion layer to 6 times that of the bottleneck layer, introducing more non-linear transformations.
[0114] For example, select 5 stacked MBConv modules as the feature extractor. Among them, each MBConv module contains 3 depthwise separable convolution layers, a bottleneck layer (with a dimension of 32), an expansion layer (with a dimension of 96), a SE attention layer, and a residual connection. The input image size is 224x224. After passing through the feature extractor, the output feature dimension is 512. Use 2 Gaussian mixture layers. Each Gaussian mixture layer contains an MBConv1 module and an MBConv6 module. The dimensions of the bottleneck layer and the expansion layer of the MBConv1 module are both 64. The dimension of the bottleneck layer of the MBConv6 module is 64, and the dimension of the expansion layer is 384 (64 * 6). Each Gaussian mixture layer outputs 3 parameters (mean, variance, and mixing coefficient).
[0115] Step S104, input the feature variable set of the fruit to be tested into the Gaussian mixture pesticide residue concentration classification model to obtain the probability of the pesticide residue types of the fruit to be tested; according to the pre-established mapping relationship between the pesticide residue types and the residue concentration, obtain the pesticide residue concentration; generate the fruit surface pesticide residue detection report of the fruit to be tested according to the pesticide residue types, the pesticide residue concentration, and the probability.
[0116] In this embodiment, since the characteristic variables of pesticide residues (such as spectra, chemical components, etc.) often show complex multi-peak distributions, it is difficult for traditional methods to accurately model. The Gaussian mixture pesticide residue concentration classification model can use the weighted combination of multiple Gaussian distributions to fit the complex distribution, improving the accuracy of classification. The generated detection report is as follows:
[0117] Fruit name: Apple
[0118] Sampling time: 2023-10-27 10:00
[0119] Detection method: Hyperspectral imaging combined with Gaussian mixture model
[0120] Test result:
[0121] Types of pesticide residues: Dimethoate
[0122] Concentration of pesticide residues: 0.2 mg / kg
[0123] Confidence level: 80%
[0124] Standard reference: According to XX standard GB 2763 - 20XX, the residue limit of dimethoate in apples is 0.5 mg / kg.
[0125] Conclusion: The dimethoate residue concentration in this apple is lower than the XX standard and meets the food safety requirements.
[0126] In an alternative approach, the method further includes:
[0127] During the Raman spectrum acquisition process, the surface temperature of the fruit is monitored in real time;
[0128] The Raman spectrum data is corrected using different temperature compensation models according to the fruit type;
[0129] Among them, the temperature compensation model for the smooth - skinned berry fruits is:
[0130] I corrected (ω) = I raw (ω) + α×(T - T ref )×exp(-β×(ω - ω0) 2 )
[0131] Among them, I corrected (ω) is the intensity of the corrected Raman spectrum at the Raman shift ω; I raw (ω) is the intensity of the original Raman spectrum at the Raman shift ω; T is the surface temperature of the fruit; T ref is the reference temperature; ω0 is the center position of the characteristic peak; α is the temperature - sensitive coefficient; β is the peak - broadening coefficient;
[0132] The temperature compensation model for the rough - skinned cellulose fruits is:
[0133]
[0134] Among them, ε is the Raman shift correction coefficient.
[0135] In this embodiment, the intensity of Raman spectroscopy is significantly affected by temperature. Uncorrected temperature changes lead to deviations in detection results, affecting the accurate quantification of pesticide residues. The influence of temperature is mainly reflected in the intensity and broadening of Raman peaks. The influence of temperature on the Raman peak shape is described by a Gaussian function, which is suitable for berry fruits with smooth skin that are sensitive to temperature changes. The rough skin cellulose fruit model adopts a polynomial form and considers the influence of Raman shift, which is suitable for fruits with rough skin and high cellulose content, and can focus more on the correction of the overall intensity and consider different correction coefficients at different Raman shifts. Among them, for the berry standard sample, the characteristic peak of pesticide residue is found in the Raman spectra measured at different temperatures, and the Gaussian function is used to fit the characteristic peak to obtain the intensity, position, and broadening of the peak. Then, the relationships between intensity and temperature, and between broadening and temperature are established, and the optimal α and β values are determined by methods such as the least squares method. ω0 can be directly obtained from the results of Gaussian fitting. For the cellulose standard sample, the Raman spectra measured at different temperatures are normalized, and the relationships between spectral intensity, temperature, and Raman shift are established, and the optimal α, β, and ε values are determined by methods such as the least squares method.
[0136] In an alternative manner, the pesticide residue detection report includes the fruit name, sampling time, sampling location, pesticide type, pesticide residue concentration, detection probability, and pesticide residue distribution map; wherein, the pesticide residue distribution map shows the pesticide residue concentration levels in different regions of the fruit surface through a color-coding method.
[0137] In this embodiment, visualizing the pesticide residue information helps consumers, producers, and regulatory authorities better understand the pesticide residue status of fruits.
[0138] According to the solution provided by the present invention, Raman spectroscopy is used to collect Raman spectra at multiple points on the fruit surface to obtain Raman spectral data of the fruit surface. The Raman spectral data of the fruit surface is subjected to baseline correction according to the polynomial fitting method; the characteristic peak position, peak intensity, peak area, and peak width are extracted from the corrected Raman spectral data of the fruit surface as candidate features, and the candidate features are dimensionally reduced by the principal component analysis method to select a set of characteristic variables related to the pesticide residue concentration; a Gaussian mixture pesticide residue concentration classification model is constructed according to the selected set of characteristic variables, and the Gaussian components of the Gaussian mixture pesticide residue concentration classification model are trained by the expectation maximization algorithm to obtain the optimal number of Gaussian components; the set of characteristic variables of the fruit to be tested is input into the Gaussian mixture pesticide residue concentration classification model to obtain the probability of the pesticide residue type of the fruit to be tested; according to the pre-established mapping relationship between the pesticide residue type and the residue concentration, the pesticide residue concentration is obtained; a fruit surface pesticide residue detection report of the fruit to be tested is generated according to the pesticide residue type, the pesticide residue concentration, and the probability. The present invention combines Raman spectroscopy technology and Gaussian mixture model to handle the heterogeneity of the pesticide residue concentration distribution on the fruit surface, further improving the reliability of pesticide residue detection.
[0139] Figure 7 Fig. shows a schematic framework diagram of a fruit surface pesticide residue detection device with a Gaussian mixture model and Raman spectroscopy. The fruit surface pesticide residue detection device with a Gaussian mixture model and Raman spectroscopy includes:
[0140] A Raman spectrum acquisition module 710, configured to collect Raman spectra at multiple points on the fruit surface through a Raman spectrometer to obtain Raman spectral data of the fruit surface, and perform baseline correction on the Raman spectral data of the fruit surface according to the polynomial fitting method;
[0141] A characteristic variable set extraction module 720, configured to extract the characteristic peak position, peak intensity, peak area, and peak width from the corrected Raman spectral data of the fruit surface as candidate features, and perform dimensional reduction on the candidate features by the principal component analysis method to select a set of characteristic variables related to the pesticide residue concentration;
[0142] A Gaussian mixture model construction module 730, configured to construct a Gaussian mixture pesticide residue concentration classification model according to the selected set of characteristic variables, and train the Gaussian components of the Gaussian mixture pesticide residue concentration classification model by the expectation maximization algorithm to obtain the optimal number of Gaussian components;
[0143] The pesticide residue detection module 740 is used to input the characteristic variable set of the fruit to be tested into the Gaussian mixture pesticide residue concentration classification model to obtain the probability of the pesticide residue types of the fruit to be tested; according to the pre-established mapping relationship between the pesticide residue types and the residue concentration, obtain the pesticide residue concentration; and generate a fruit surface pesticide residue detection report for the fruit to be tested based on the pesticide residue types, the pesticide residue concentration, and the probability.
[0144] Figure 8 FIG. shows a schematic structural diagram of an embodiment of the computing device of the present invention, and the specific implementation of the computing device is not limited in the specific embodiments of the present invention.
[0145] As Figure 8 shown, the computing device may include: a processor 802, a communication interface 804, a memory 806, and a communication bus 808.
[0146] Wherein: the processor 802, the communication interface 804, and the memory 806 communicate with each other through the communication bus 808. The communication interface 804 is used to communicate with network elements of other devices such as clients or other servers. The processor 802 is used to execute the program 510, and specifically can execute the relevant steps in the above-mentioned embodiments of the method for detecting fruit surface pesticide residues by the Gaussian mixture model and Raman spectroscopy.
[0147] Specifically, the program 810 may include program codes, and the program codes include computer operation instructions.
[0148] The processor 802 may be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention. One or more processors included in the computing device may be of the same type of processor, such as one or more CPUs; or may be of different types of processors, such as one or more CPUs and one or more ASICs.
[0149] The memory 806 is used to store the program 810. The memory 806 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.
[0150] According to the solution provided by the present invention, Raman spectroscopy is used to collect Raman spectra at multiple points on the surface of a fruit to obtain Raman spectral data of the fruit surface. The baseline correction of the Raman spectral data of the fruit surface is performed according to the polynomial fitting method. The characteristic peak position, peak intensity, peak area, and peak width are extracted from the corrected Raman spectral data of the fruit surface as candidate features, and the dimensionality reduction of the candidate features is performed by the principal component analysis method to select a set of characteristic variables related to the pesticide residue concentration. A Gaussian mixture pesticide residue concentration classification model is constructed according to the selected set of characteristic variables, and the Gaussian components of the Gaussian mixture pesticide residue concentration classification model are trained by the expectation maximization algorithm to obtain the optimal number of Gaussian components. The set of characteristic variables of the fruit to be tested is input into the Gaussian mixture pesticide residue concentration classification model to obtain the probability of the pesticide residue types of the fruit to be tested. According to the pre-established mapping relationship between the pesticide residue types and the residue concentration, the pesticide residue concentration is obtained. A detection report on the pesticide residues on the surface of the fruit to be tested is generated according to the pesticide residue types, pesticide residue concentration, and probability. The present invention combines Raman spectroscopy technology and Gaussian mixture model to handle the heterogeneity of the pesticide residue concentration distribution on the fruit surface, further improving the reliability of pesticide residue detection.
[0151] Those skilled in the art can understand that the modules in the devices in the embodiments can be adaptively changed and arranged in one or more devices different from this embodiment. The modules or units or components in the embodiments can be combined into one module or unit or component, and in addition, they can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all the features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all the processes or units of any method or device so disclosed. Unless otherwise clearly stated, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) can be replaced by an alternative feature that provides the same, equivalent, or similar purpose. In addition, those skilled in the art can understand that although some of the embodiments herein include certain features included in other embodiments rather than other features, the combination of the features of different embodiments means that it is within the scope of the present invention and forms different embodiments. For example, in the following claims, any one of the claimed embodiments can be used in any combination. The present invention can be implemented by means of hardware including several different elements and by means of a properly programmed computer. In the unit claims listing several devices, several of these devices can be specifically embodied by the same hardware item. The steps in the above embodiments, unless otherwise specified, should not be construed as a limitation on the execution order.
Claims
1. A method for detecting pesticide residues on the surface of fruits using a Gaussian mixture model and Raman spectroscopy, characterized in that, Including: Collecting Raman spectra at multiple points on the fruit surface using a Raman spectrometer to obtain Raman spectral data of the fruit surface, and performing baseline correction on the Raman spectral data of the fruit surface according to the polynomial fitting method; Extracting the characteristic peak position, peak intensity, peak area, and peak width from the corrected Raman spectral data of the fruit surface as candidate features, and performing dimensionality reduction on the candidate features by the principal component analysis method to select a set of characteristic variables related to the pesticide residue concentration; Constructing a Gaussian mixture pesticide residue concentration classification model based on the selected set of characteristic variables, and training the Gaussian components of the Gaussian mixture pesticide residue concentration classification model by the expectation maximization algorithm to obtain the optimal number of Gaussian components; Inputting the set of characteristic variables of the fruit to be tested into the Gaussian mixture pesticide residue concentration classification model to obtain the probability of the pesticide residue types of the fruit to be tested; according to the pre-established mapping relationship between the pesticide residue types and the residue concentration, obtaining the pesticide residue concentration; generating a fruit surface pesticide residue detection report for the fruit to be tested based on the pesticide residue types, pesticide residue concentration, and probability.
2. The method for detecting pesticide residues on the surface of fruits by using the Gaussian mixture model and Raman spectroscopy according to claim 1, characterized in that, The further steps of performing dimensionality reduction on the candidate features by the principal component analysis method to select a set of characteristic variables related to the pesticide residue concentration include: Performing standardization processing on the candidate features to ensure that each subsequent feature has a zero mean and unit variance; Calculating the covariance matrix of the standardized features, and the covariance matrix is: C = (1 / (n - 1)) × X T × X where X is the standardized feature matrix and n is the number of samples; Performing eigenvalue decomposition on the covariance matrix to obtain eigenvalues and corresponding eigenvectors; Sorting the eigenvalues in descending order, and calculating the cumulative contribution rate according to the contribution rate of each principal component; Selecting the characteristic variables corresponding to the first K principal components with a cumulative contribution rate greater than a preset threshold from the cumulative contribution rate to obtain a set of characteristic variables.
3. The method for detecting pesticide residues on the surface of fruits by using the Gaussian mixture model and Raman spectroscopy according to claim 1, wherein, The further steps of training the Gaussian components of the Gaussian mixture pesticide residue concentration classification model by the expectation maximization algorithm include: Calculate sample x i The posterior probability belonging to the K-th Gaussian component, and the posterior probability is as follows: where, N(x i |μ k ,Σ k ) is the probability density of the sample x i under the Gaussian distribution with mean μ k and covariance matrix Σ k ; π k , π j are the K-th and j-th mixing coefficients respectively; j is the j-th Gaussian component; γ ik is the posterior probability, representing the probability that the sample x i belongs to the k-th Gaussian component; μ k is the mean vector of the k-th Gaussian component; μ j is the mean vector of the j-th Gaussian component; Σ k , Σ j are the covariance matrices of the k-th and j-th Gaussian components respectively; Updating the Gaussian components of the Gaussian mixture pesticide residue concentration classification model according to the posterior probability until the parameters converge or reach a preset number of iterations, and the Gaussian components include the mean, covariance matrix, and mixing coefficient; where the update formula for the mean is: μ k =(∑ i γ ik ×x i ) / ∑ i γ ik ; The update formula for the covariance matrix is: Σ k =(∑ i γ ik ×(x i -μ k )(x i -μ k ) T ) / ∑ i γ ik ; The update formula for the mixing coefficient is: π k = (∑ i γ ik ) / n, where n is the total number of samples.
4. The method for detecting pesticide residues on the surface of fruits by using the Gaussian mixture model and Raman spectroscopy according to claim 1, wherein The further steps of collecting Raman spectra at multiple points on the fruit surface using a Raman spectrometer to obtain Raman spectral data of the fruit surface include: Using a Raman spectrometer with a laser wavelength of 780 nm to 790 nm, uniformly selecting no less than five different sampling points on each fruit surface for spectral collection; wherein, the laser power at each sampling point is below 10 mW, the integration time is set to 2 seconds, and the spectral resolution is greater than or equal to 8 cm-1; Collecting spectral data three times at each sampling point, taking the average value of the three spectral data as the Raman spectral data of this point, and recording the spatial coordinate information of each sampling point.
5. The method for detecting pesticide residues on the surface of fruits using a Gaussian mixture model and Raman spectroscopy according to claim 1, characterized in that, The pesticide residue detection report includes the fruit name, sampling time, sampling location, pesticide types, pesticide residue concentration, detection probability, and pesticide residue distribution map; wherein, the pesticide residue distribution map shows the pesticide residue concentration levels in different regions of the fruit surface through color coding.
6. The method for detecting pesticide residues on the fruit surface by using the Gaussian mixture model and Raman spectroscopy according to claim 1, characterized in that The front end of the Gaussian mixture pesticide residue concentration classification model includes a feature extractor stacked by multiple MBConv modules. Each MBConv module contains multiple depthwise separable convolutional layers, a bottleneck layer, an expansion layer, an SE attention layer, and a residual connection. The back end of the Gaussian mixture pesticide residue concentration classification model includes multiple Gaussian mixture layers. Each Gaussian mixture layer includes an MBConv module composed of an MBConv1 network layer and an MBConv6 network layer. The feature dimensions of the bottleneck layer and the expansion layer of the MBConv1 network layer are the same. The feature dimension of the expansion layer of the MBConv6 network layer is 6 times that of the bottleneck layer. Each MBConv module receives an input of X feature dimensions, expands to Y dimensions through the expansion layer, and then reduces the dimension to Z dimensions through depthwise separable convolution and the bottleneck layer, and finally outputs features of Z feature dimensions.
7. The method for detecting pesticide residues on the fruit surface by using the Gaussian mixture model and Raman spectroscopy according to claim 1, wherein, The further baseline correction of the Raman spectroscopy data on the fruit surface according to the polynomial fitting method further includes: Determining the order of the fitting polynomial according to the fruit type, and taking the minimum value point in the Raman spectroscopy data on the fruit surface as the baseline point; among them, smooth-skinned berry fruits use a 3rd-order fitting polynomial; rough-skinned cellulose fruits use a 4-5th-order fitting polynomial. Fitting the polynomial according to the baseline point, and subtracting the fitted polynomial from the Raman spectroscopy data on the fruit surface to obtain the corrected spectrum.
8. The method for detecting pesticide residues on the fruit surface by using the Gaussian mixture model and Raman spectroscopy according to claim 7, characterized in that, The method further includes: During the Raman spectroscopy acquisition process, the temperature of the fruit surface is monitored in real time. Correcting the Raman spectroscopy data according to different temperature compensation models according to the fruit type. Among them, the temperature compensation model for smooth-skinned berry fruits is: I corrected I(ω) = raw I(ω)+α×(T - T ref )×exp(-β×(ω - ω0) 2 ) Among them, I corrected (ω) is the intensity of the corrected Raman spectrum at the Raman shift ω; I raw (ω) is the intensity of the original Raman spectrum at the Raman shift ω; T is the surface temperature of the fruit; T ref is the reference temperature; ω0 is the center position of the characteristic peak; α is the temperature sensitivity coefficient; β is the peak broadening coefficient; The temperature compensation model for rough-skinned cellulose fruits is: Among them, ε is the Raman shift correction coefficient.
9. A fruit surface pesticide residue detection device combining a Gaussian mixture model and Raman spectroscopy, characterized in that, Implementing the Gaussian mixture model and the Raman spectroscopy-based fruit surface pesticide residue detection method according to any one of claims 1-8, including: A Raman spectroscopy acquisition module for performing multi-point Raman spectroscopy acquisition on the fruit surface through a Raman spectrometer to obtain Raman spectroscopy data on the fruit surface, and performing baseline correction on the Raman spectroscopy data on the fruit surface according to the polynomial fitting method. A feature variable set extraction module for extracting the characteristic peak position, peak intensity, peak area, and peak width from the corrected Raman spectroscopy data on the fruit surface as candidate features, and reducing the dimension of the candidate features through the principal component analysis method, and selecting a feature variable set related to the pesticide residue concentration. A Gaussian mixture model construction module for constructing a Gaussian mixture pesticide residue concentration classification model according to the selected feature variable set, and training the Gaussian components of the Gaussian mixture pesticide residue concentration classification model through the expectation maximization algorithm to obtain the optimal number of Gaussian components. The pesticide residue detection module is used to input the characteristic variable set of the fruit to be tested into the Gaussian mixture pesticide residue concentration classification model to obtain the probability of the pesticide residue types of the fruit to be tested; according to the pre-established mapping relationship between the pesticide residue types and the residue concentration, obtain the pesticide residue concentration; generate a fruit surface pesticide residue detection report for the fruit to be tested based on the pesticide residue types, the pesticide residue concentration, and the probability.
10. A computing device, comprising: A processor, a memory, a communication interface, and a communication bus, where the processor, the memory, and the communication interface complete communication with each other through the communication bus; The memory is used to store at least one executable instruction, and the executable instruction causes the processor to execute the operations corresponding to the method for detecting fruit surface pesticide residues using the Gaussian mixture model and Raman spectroscopy according to any one of claims 1-8.