Method and system for detecting quality marker of agricultural product and terminal equipment
By combining Raman spectroscopy technology and deep learning models, the problems of low efficiency and poor accuracy in yam quality detection have been solved, and accurate and rapid detection of yam quality markers has been achieved, ensuring detection efficiency and accuracy.
Patent Information
- Application Number
- CN202511019911.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-10-24
AI Technical Summary
The existing methods for detecting the quality of yam are inefficient and have poor accuracy, and cannot achieve rapid and non-destructive on-site detection.
Raman spectroscopy technology is combined with a deep learning model to collect the reflected light of the target laser from agricultural products to perform baseline correction, separation of interference components and noise reduction processing. The target deep learning model is used to extract the target characteristic peaks of quality markers from the target spectral data.
It has achieved accurate and rapid detection of yam quality markers, improved detection efficiency and accuracy, and ensured food safety for consumers.
Smart Images

Figure CN120831346A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of deep learning, and in particular to a quality marker detection method, system and terminal device for agricultural products. BACKGROUND
[0002] Yam (Dioscorea spp) is a common medicinal and edible plant with high nutritional value and medicinal efficacy. The main pharmacological effects of yam include invigorating the spleen and stomach, nourishing kidney yin, etc., and it is a common medicinal material in various traditional Chinese medicine prescriptions. However, the quality of yam on the market is uneven, and especially some unqualified products cannot meet the needs of consumers due to non-standard cultivation, storage and other links.
[0003] Existing yam quality detection methods are mostly traditional chemical analysis methods, such as high-performance liquid chromatography (HPLC) and gas chromatography (GC), but these methods are tedious and time-consuming, and require high instrument investment, which cannot achieve rapid and non-destructive on-site detection. Raman spectroscopy, as a non-destructive detection technology based on molecular vibration, is widely used in drug and food quality detection. Using Raman spectroscopy can analyze the molecular structure, composition and content of substances, and can perform real-time and rapid detection without damaging the sample. Therefore, using Raman spectroscopy technology to detect the quality of medicinal and edible yam is an innovative technology with important application value. However, there is currently a lack of a precise and rapid detection method for medicinal and edible yam quality markers based on Raman spectroscopy.
[0004] Therefore, the prior art still needs to be improved and improved. SUMMARY
[0005] The present application provides a quality marker detection method, system and terminal device for agricultural products, aiming to solve the problem of low recognition efficiency and poor accuracy in identifying yam quality markers in the prior art.
[0006] In a first aspect, the embodiments of the present application provide a quality marker detection method for agricultural products, comprising:
[0007] Collecting the reflection light of the target laser of the agricultural products to obtain initial spectral data;
[0008] Baseline correction, interference component separation and noise reduction processing are performed on the initial spectral data to obtain target spectral data;
[0009] A target deep learning model is used to extract target characteristic peaks of quality markers in the agricultural products from the target spectral data, and the composition of the quality markers is inferred according to the target characteristic peaks.
[0010] In some embodiments, the target deep learning model comprises: a plurality of convolution modules connected in sequence, a flattening layer, a regularization layer, a first fully connected layer, a linear activation layer, and a second fully connected layer; the plurality of convolution modules are connected in sequence;
[0011] The target feature peak of the quality marker in the agricultural product is extracted from the target spectral data by using the target deep learning model, comprising:
[0012] The convolution module is used to perform feature extraction and expression on the target spectral data to obtain first feature data of the quality marker;
[0013] The flattening layer is used to perform dimension reduction processing on the first feature data to obtain one-dimensional vector data;
[0014] The regularization layer is used to perform regularization processing on the one-dimensional vector data to obtain regularization data;
[0015] The first fully connected layer is used to integrate features of the regularization data to obtain second feature data;
[0016] The linear activation layer is used to perform smooth weighting on the second feature data to obtain nonlinear data;
[0017] The second fully connected layer is used to map the nonlinear data to a target dimension to obtain the target feature peak of the quality marker.
[0018] In some embodiments, each convolution module comprises: a depth separable convolution layer, a normalization layer, a first point-wise convolution layer, a linear activation layer, and a second point-wise convolution layer connected in sequence;
[0019] The convolution module is used to perform feature extraction and expression on the target spectral data to obtain first feature data of the quality marker, comprising:
[0020] The depth separable convolution layer is used to perform channel-wise convolution operation on the target spectral data to obtain first convolution data of the quality marker;
[0021] The normalization layer is used to perform normalization processing on the first convolution data to obtain normalized data;
[0022] After the channel number of the normalized data is expanded by using the first point-wise convolution layer, the linear activation layer is used to add nonlinear features to the normalized data to obtain nonlinear feature data;
[0023] The second point-wise convolution layer is used to reduce the channel number of the nonlinear feature data to obtain the first feature data.
[0024] In some embodiments, the baseline correction, interference component separation and noise reduction processing of the initial spectral data to obtain target spectral data comprises:
[0025] After the baseline is obtained by smoothing fitting the initial spectral data using an asymmetric least squares method, the weight of the initial spectral data is iteratively adjusted, and a target constraint condition is introduced for optimization to screen out the baseline to obtain corrected data;
[0026] The corrected data is independently standardized according to a standardized normal variable to separate the interference components in the corrected data to obtain standardized data;
[0027] The standardized data is decomposed and reconstructed using discrete wavelet transform technology to separate noise data in the standardized data to obtain the target spectral data.
[0028] In some embodiments, after the baseline is obtained by smoothing fitting the initial spectral data using an asymmetric least squares method, the weight of the initial spectral data is iteratively adjusted, and a target constraint condition is introduced for optimization to screen out the baseline to obtain corrected data, comprising:
[0029] The initial spectral data is smoothed and fitted to obtain a current baseline fitting curve to determine the current weight of the current baseline fitting curve;
[0030] The next baseline fitting curve is calculated according to the current weight distribution, the weight ratio of the baseline region and the peak signal region is adjusted, and the target constraint condition is taken as a screening condition until an optimized baseline fitting curve is obtained;
[0031] The baseline is screened out from the initial spectral data according to the optimized baseline fitting curve to obtain the corrected data;
[0032] The target constraint condition includes non-negativity constraint and smoothness constraint.
[0033] In some embodiments, the corrected data is independently standardized according to a standardized normal variable to separate the interference components in the corrected data to obtain standardized data, comprising:
[0034] The average value and standard deviation of all wavelength points in the corrected data are calculated, and the corrected data is standardized and converted according to the average value and the standard deviation to obtain the standardized data.
[0035] In some embodiments, the standardized data is decomposed and reconstructed using discrete wavelet transform technology to separate noise data in the standardized data to obtain the target spectral data, comprising:
[0036] After the first frequency component is decomposed step by step until a preset decomposition layer number is reached, a first total frequency component and a second total frequency component are obtained;
[0037] After the second total frequency component is threshold processed and combined with the first total frequency component, the target spectral data is obtained.
[0038] In a second aspect, an embodiment of the present application provides a quality marker detection system of agricultural products, comprising:
[0039] The acquisition module is configured to acquire reflected light of the target laser by the agricultural products to obtain initial spectral data;
[0040] The processing module is configured to perform baseline correction, interference component separation and noise reduction processing on the initial spectral data to obtain target spectral data;
[0041] The inference module is configured to extract a target feature peak of the quality marker in the agricultural products from the target spectral data by using a target deep learning model, and infer a composition of the quality marker according to the target feature peak.
[0042] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, and when the computer program is executed by the processor, the steps of the quality marker detection method of agricultural products are implemented.
[0043] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the steps of the quality marker detection method of agricultural products are implemented.
[0044] Compared with the prior art, the quality marker detection method, system and terminal device of agricultural products provided by the present application can accurately predict and infer the composition of the quality marker of the agricultural products by performing baseline correction, interference component separation and noise reduction processing on the initial spectral data obtained by collecting the reflected light of the target laser by the agricultural products, and extracting the target feature peak of the quality marker in the agricultural products from the obtained target spectral data by using a target deep learning model, thereby improving the detection efficiency and accuracy. BRIEF DESCRIPTION OF DRAWINGS
[0045] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced as follows. It should be understood that the following drawings only show some of the embodiments of the present application, and therefore should not be regarded as a limitation on the scope. Other related drawings can also be obtained by those of ordinary skill in the art without creative labor.
[0046] Figure 1 A flow chart of a method for detecting a quality marker of an agricultural product provided by the present application;
[0047] Figure 2 A flow chart of a method for detecting a quality marker of an agricultural product provided by the present application;
[0048] Figure 3 A flow chart of a method for detecting a quality marker of an agricultural product provided by the present application;
[0049] Figure 4 A flow chart of a method for detecting a quality marker of an agricultural product provided by the present application;
[0050] Figure 5 A structure diagram of a target deep learning model in a method for detecting a quality marker of an agricultural product provided by the present application;
[0051] Figure 6 A structure diagram of a convolution module in a method for detecting a quality marker of an agricultural product provided by the present application;
[0052] Figure 7 A flow chart of a method for detecting a quality marker of an agricultural product provided by the present application;
[0053] Figure 8 A flow chart of a method for detecting a quality marker of an agricultural product provided by the present application;
[0054] Figure 9 A structure diagram of a system for detecting a quality marker of an agricultural product provided by the present application.
[0055] The drawings show: 10-acquisition module; 20-processing module; 30-inference module. DETAILED DESCRIPTION
[0056] The technical solutions of the embodiments of the present application will be described clearly and completely in the embodiments of the present application in combination with the drawings. Obviously, the described embodiments are only some of the embodiments of the present application, not all the embodiments.
[0057] The components of the application embodiments described and illustrated herein can be arranged and designed in a wide variety of different configurations. Therefore, the following detailed description of the application, read in conjunction with the accompanying drawings, is not intended to limit the scope of the application, but rather is presented as a selected embodiment of the application. All other embodiments obtained by persons of ordinary skill in the art by replacing elements of the application embodiments with other elements of equivalent structure and function are within the scope of the application.
[0058] Hereinafter, the terms "include", "have", and their conjugates, used in the various embodiments of the present application, merely indicate the presence of the features, numbers, steps, operations, elements, components, or combinations thereof, and do not exclude the possibility of the presence or addition of one or more other features, numbers, steps, operations, elements, components, or combinations thereof. In addition, the terms "first", "second", "third", and the like are used only to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0059] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of the present application belong. The terms (such as those defined in commonly used dictionaries) should be interpreted as having a meaning that is the same as the contextual meaning in the relevant technical field and should not be interpreted in an idealized or overly formal sense, unless clearly defined in the various embodiments of the present application.
[0060] The present application provides a quality marker detection method, system and terminal device for agricultural products. The quality marker detection method for agricultural products obtains initial spectral data by collecting the reflection light of the target laser of the agricultural products, and then performs baseline correction, interference component separation and noise reduction processing on the initial spectral data, and uses a target deep learning model to extract the target feature peak of the quality marker in the agricultural products from the target spectral data, so as to efficiently and accurately infer the composition of the quality marker, and improve the efficiency of quality monitoring of the agricultural products.
[0061] The quality marker detection method design scheme for agricultural products is described below through some specific embodiments.
[0062] Please refer to Figure 1 The present application embodiment provides a quality marker detection method for agricultural products, comprising steps S100-S300:
[0063] S100, collect the reflection light of the target laser of the agricultural products to obtain initial spectral data.
[0064] Exemplarily, the agricultural product in the present application takes yam as an example, and can also be wolfberry or astragalus.
[0065] Firstly, yam samples are collected:
[0066] Firstly, yam samples are collected from multiple yam producing areas (such as five regions of East China, South China, Southwest China, etc.), to ensure the universality and representativeness of the samples. For example, 30 yam samples are collected from each producing area, and finally 150 samples are collected.
[0067] Then, the yam samples are peeled, cut into thin slices, and the sample surface is ensured to be flat and uniform in thickness, to ensure the uniformity of the samples and avoid the influence of sample processing on the test results. Because the sample with uneven surface will be partially blurred in the microscope, the spatial resolution is reduced, and the baseline of the corresponding spectrum is offset. However, if the sample is too thick, the laser cannot penetrate the information, and if the sample is too thin, the laser penetrates the sample to irradiate the sample stage, introducing background interference (such as the Raman spectrum of the glass slide).
[0068] Then, the processed samples are fixed on the sample stage of the Raman spectrometer, to ensure that the samples are fixed during the measurement process and avoid the interference of external environmental changes on the test data.
[0069] Secondly, the Raman spectrometer is used to collect the samples:
[0070] Firstly, the parameters of the Raman spectrometer are set, and the laser wavelength of the Raman spectrometer can be set to 785 nm, the laser power is 14 mW, the resolution is 4 cm -1 , the integration time is 10 seconds, and each sample is collected 3 times.
[0071] Then, the Raman spectrometer is used to collect the Raman spectrum of the yam sample, that is, the reflected light of the target laser emitted by the Raman spectrometer is collected, to obtain the initial spectrum data. The laser wavelength, power and scanning time parameters of the Raman spectrometer need to be adjusted according to actual needs, and the adjustment process is as follows: first, the standard Raman waveform is determined by consulting literature, and then the laser power of the existing instrument is adjusted. The larger the laser power, the shorter the scanning time and exposure time, and the smaller the laser power, the longer the scanning time and exposure time. Therefore, for a high-power Raman spectrometer, the scanning time and exposure time are reduced; for a low-power Raman spectrometer, the scanning time and exposure time are increased, until the standard spectrum waveform is obtained, to obtain clear spectrum signals.
[0072] Secondly, different spectrum data (i.e. initial spectrum data) are obtained by analyzing yam samples from different parts, to provide a basis for subsequent analysis. In this stage, data collection of yam samples in multiple dimensions is carried out to study the influence of different producing areas and different processing procedures on the quality markers of yam.
[0073] Among them, when comparing the producing areas, the spectral data of the Shanyao samples from different producing areas are collected under the same environment and equipment parameters, and the spectral differences of the main medicinal components (such as saponins and polysaccharides) in the samples from different producing areas are analyzed. When comparing the storage methods, the spectral data of the Shanyao samples under normal temperature storage and cold storage are compared to monitor the change trend of the main medicinal components during storage, especially the degradation of saponins and starch.
[0074] It can be understood that in the present application, the quality markers of Shanyao are detected by sampling agricultural products using a Raman spectrometer to obtain Raman spectral data.
[0075] S200, baseline correction, interference component separation and noise reduction processing are performed on the initial spectral data to obtain target spectral data.
[0076] Illustratively, after collecting the initial spectral data, the original Raman spectral data (i.e. the initial spectral data) will be affected by baseline drift, noise and fluorescence background, so the collected spectral data needs to be preprocessed before data modeling, including baseline correction, interference component separation and noise reduction processing, etc.
[0077] Among them, the baseline drift problem in spectral collection causes measurement error and weakening of characteristic variables in the measured spectral data. Therefore, the initial spectral data is usually corrected by asymmetric least squares (ALS), the core idea of which is to adjust the weight by iteration, smooth fit the baseline region in the spectrum, and ignore the influence of peak signal, and finally obtain and deduct the baseline through mathematical optimization, so as to highlight the real spectral peak.
[0078] However, in the process of spectral measurement, the scattering of light caused by the physical properties (particle size, shape, etc.) of the sample will have a significant impact on the spectral signal, leading to variation of the spectral peak shape. Therefore, the commonly used preprocessing method is standard normal variable (SNV), the core of which is to standardize the spectrum of each sample independently. After SNV processing, the spectral mean is 0 and the standard deviation is 1, which eliminates the dimensional difference and scattering interference, can effectively separate the interference components and chemical information related to scattering in the spectrum, and thus enhance the characteristic performance of the chemical signal.
[0079] However, almost all spectral signals will be affected by noise, in order to eliminate random noise in the signal, discrete wavelet transform (DWT) can be used to process the data. The principle of discrete wavelet transform denoising is based on the characteristics of signal and noise in different frequency domain: signal is usually concentrated in low frequency part, while noise is mainly expressed as high frequency component. Therefore, by wavelet decomposition and reconstruction of spectral data, DWT can effectively separate signal and noise, so as to realize denoising. Among them, wavelet basis function and threshold type (soft threshold and) are optional, and appropriate strategy can be selected according to actual demand to eliminate random noise of spectrum and improve signal to noise ratio of sample.
[0080] It can be understood that the preprocessing operations of baseline correction, separation of interference components and denoising of initial spectral data in the present application can effectively eliminate baseline offset or fluctuation and scattering effect in the spectrum, so as to effectively improve the spectral quality and enhance the analysis accuracy, and lay a solid foundation for subsequent spectral qualitative and quantitative analysis.
[0081] In one embodiment, please refer to Figure 2 , step S200, baseline correction, separation of interference components and denoising of initial spectral data are carried out to obtain target spectral data, including:
[0082] S210, after the baseline is obtained by using asymmetric least squares method to smooth fit the initial spectral data, the weight of the initial spectral data is iteratively adjusted, and a target constraint condition is introduced for optimization, so as to screen out the baseline and obtain corrected data;
[0083] S220, according to the standardized normal variable, the corrected data is independently standardized to separate the interference components in the corrected data and obtain standardized data;
[0084] S230, the discrete wavelet transform technology is used to decompose and reconstruct the standardized data to separate the noise data in the standardized data and obtain the target spectral data.
[0085] Among them, the target constraint condition includes: non negative constraint and smoothness constraint.
[0086] Among them, the baseline refers to the non signal part in the spectral data caused by instrument drift, background noise or other factors, which is usually expressed as a smooth curve with slight fluctuation.
[0087] Exemplarily, the specific process of preprocessing the initial spectral data is as follows:
[0088] Firstly, the initial spectral data is corrected by baseline:
[0089] First, by designing a specific algorithm, such as weighted least squares or non-negative constrained optimization, the baseline is fitted by smoothing the initial spectral data, and the weights of different data points are dynamically adjusted, the weights of the baseline region are increased, and the weights of the peak signal are reduced, so that more attention is paid to the baseline region and the influence of the peak signal is weakened, and then the baseline fitting problem is converted into an optimization problem, such as finding a curve as smooth as possible and close to the baseline region, while meeting certain constraint conditions (such as non-negativity or monotonicity), so as to screen out the baseline and obtain corrected data.
[0090] Then, the spectral data of each sample in the corrected data is independently standardized by using the Standard Normal Variate (SNV), so that the mean of the processed spectrum is 0 and the standard deviation is 1, thereby eliminating the dimensional difference and scattering interference, effectively separating the interference components and chemical information related to scattering in the spectrum, and obtaining standardized data.
[0091] Secondly, the standardized data is decomposed and reconstructed by using discrete wavelet transform technology, that is, the standardized data is divided into low-frequency part (mainly containing useful signal) and high-frequency part (mainly containing noise) by wavelet decomposition, then the high-frequency part is processed by threshold to remove noise, and finally the signal is recovered by wavelet reconstruction, so that the noise data in the standardized data can be separated, and the target spectral data is obtained.
[0092] It can be understood that by baseline correction, the baseline shift or fluctuation caused by instrument drift, sample impurities or other factors is removed, the quality of the spectral data is improved, by iteratively adjusting the weight, the baseline region and the peak signal region can be automatically identified without manual intervention, and by subtracting the baseline, the contrast of the spectral peak is enhanced, which is convenient for subsequent quantitative or qualitative analysis, and the corrected spectral data is more suitable for chemometrics analysis, machine learning modeling and other applications.
[0093] By standardizing normal variable processing, the overall offset and scaling effect in the spectrum is eliminated, and the chemical information is retained. This is because scattering usually manifests as an overall offset or scaling of the spectrum, and the standard normal variable eliminates the influence of such overall offset and scaling by independently standardizing each spectrum, thereby retaining the chemical information in the spectrum.
[0094] In one embodiment, please refer to Figure 3 , after the baseline is fitted by smoothing the initial spectral data using the asymmetric least squares method in step S210, the weights of the initial spectral data are iteratively adjusted, and a target constraint condition is introduced for optimization, so as to screen out the baseline and obtain corrected data, including:
[0095] S211, smoothing and fitting the initial spectral data to obtain a current baseline fitting curve, to determine a current weight of the current baseline fitting curve;
[0096] S212, calculating a next baseline fitting curve according to the current weight distribution, adjusting the weight ratio of the baseline region and the peak signal region, and taking the target constraint condition as a screening condition, until an optimized baseline fitting curve is obtained;
[0097] S213, screening the baseline from the initial spectral data according to the optimized baseline fitting curve to obtain corrected data.
[0098] Exemplarily, the specific process of baseline correction is implemented as follows:
[0099] After obtaining the initial spectral data, the initial spectral data is smoothed and fitted to obtain a current baseline fitting curve, that is, the baseline is preliminarily assumed to be a simple smooth curve (such as a straight line or a low-order polynomial), and the initial weight (i.e., the current weight) distribution of the current baseline fitting curve is determined, and the peak signal region is generally given a lower weight.
[0100] Then, the weights of different data points in the initial spectral data are dynamically adjusted through iterative optimization, that is, a next baseline fitting curve is calculated according to the current weight distribution, and the weight ratio of the baseline region and the peak signal region is adjusted, for example, the weight of the baseline region is increased and the weight of the peak signal region is reduced in each iteration, and a new baseline fitting curve is calculated according to the current weight distribution to reduce the influence of the peak signal on the baseline fitting.
[0101] Secondly, a target constraint condition (including non-negativity constraint and smoothness constraint) is introduced for optimization, that is, the target constraint condition is taken as a screening condition until an optimized baseline fitting curve is obtained, so as to ensure that the fitting result conforms to the actual physical meaning. For example, the baseline is usually non-negative, so the baseline value is forced to be greater than or equal to zero during optimization.
[0102] Finally, the optimized baseline curve is obtained, and the baseline is deducted from the initial spectral data to obtain corrected data highlighting the real spectral peaks.
[0103] In one implementation method, the corrected data is independently standardized according to a standardized normal variable to separate the interference components in the corrected data and obtain standardized data, including:
[0104] The mean and standard deviation of all wavelength points in the corrected data are calculated, and the corrected data is standardized and converted according to the mean and standard deviation to obtain standardized data.
[0105] Exemplarily, the specific process of separating the interference components is as follows:
[0106] The input correction data is a spectral matrix, wherein each row represents a spectrum of a sample, and each column represents a spectral intensity value at a wavelength. The average value of all wavelength points of each sample (i.e., each row of the spectral matrix) is calculated, and the standard deviation of all wavelength points is calculated. However, if all wavelength point values of a spectrum are the same, the spectrum cannot be normalized and needs to be processed separately (e.g., skipped or set as a zero vector).
[0107] Then, the spectrum of each sample is subtracted from its average value and divided by its standard deviation to obtain a normalized spectrum, i.e., the transformed data. After the above operation, the average value of each spectrum becomes 0, and the standard deviation becomes 1.
[0108] In one embodiment, referring to Figure 4 , step S230, the normalized data is decomposed and reconstructed using a discrete wavelet transform technique to separate noise data in the normalized data to obtain target spectral data, including:
[0109] S231, the normalized data is decomposed using a wavelet basis function to obtain a first frequency component and a second frequency component, and then the first frequency component is decomposed step by step until a preset decomposition level is reached to obtain a first total frequency component and a second total frequency component;
[0110] S232, after threshold processing of the second total frequency component, the first total frequency component is combined to obtain the target spectral data.
[0111] Exemplarily, the specific steps of decomposition and reconstruction are as follows:
[0112] After obtaining the normalized data, the transformed data is usually composed of useful signals and noise. First, a suitable wavelet basis function and a decomposition level are determined. The selection of the wavelet basis function depends on the characteristics of the signal, and commonly used basis functions include Daubechies, Symlets, and Coiflets. The decomposition level is also determined according to the characteristics of the signal, and is generally selected to enable the low-frequency part to better represent the main characteristics of the signal. Daubechies is designed through a minimum phase filter, supports arbitrary length vanishing moments, and thus provides better signal approximation ability; Symlets retains most of the characteristics of Daubechies, and adjusts the filter coefficients to improve symmetry; and Coiflets is a further optimized wavelet basis.
[0113] Then, the standardized data is subjected to multi-scale wavelet decomposition: the standardized data is decomposed into a low-frequency part (an approximation component, i.e., a first frequency component) and a high-frequency part (a detail component, i.e., a second frequency component) for the first time. The low-frequency part is decomposed to obtain deeper low-frequency components and high-frequency components, and then all the obtained low-frequency components are decomposed again, and the decomposition is continued step by step until a preset decomposition layer number is reached, to obtain a first total frequency component and a second total frequency component.
[0114] Further, the second total frequency component is subjected to threshold processing, i.e., a suitable threshold is set according to noise characteristics and signal characteristics, and parts of the second total frequency component (high-frequency coefficients) that are less than the threshold are regarded as noise and are set to zero, or the coefficients of the second total frequency component that are less than the threshold are set to zero, and the coefficients that are greater than the threshold are shrunk to zero.
[0115] Finally, the data subjected to threshold processing is subjected to wavelet reconstruction: the second total frequency component subjected to threshold processing and the first total frequency component are subjected to wavelet reconstruction to restore the signal after noise reduction, to obtain target spectral data.
[0116] S300, using a target deep learning model to extract a target characteristic peak of a quality marker in the agricultural product from the target spectral data, and inferring a composition of the quality marker according to the target characteristic peak.
[0117] The target deep learning model comprises: a plurality of convolution modules connected in sequence, a flattening layer, a regularization layer, a first full connection layer, a linear activation layer, and a second full connection layer; the plurality of convolution modules are connected in sequence; each convolution module comprises: a depth separable convolution layer, a normalization layer, a first pointwise convolution layer, a linear activation layer, and a second pointwise convolution layer connected in sequence.
[0118] The quality marker is an effective component of the yam, and comprises: starch, saccharides, phenolic compounds, and the like.
[0119] Exemplarily, in conjunction with Figure 5 The Input dimension is an input (feature) dimension; the Block is a convolution module, which is a self-defined convolution block ConvNeXtBlock and a maximum pooling layer; the Flattening is a flattening layer; the Dropout is a regularization layer, which is a regularization technique for a neural network; the FC (Fully Connected Layer) is a full connection layer, which can integrate and globally model the extracted features of the model; and the Gelu is a Gaussian Error Linear Unit activation function, i.e., a linear activation layer. In conjunction with Figure 6wherein DC (Depthwise Convolution) is a depthwise separable convolution layer; LN (Layer Normalization) is a normalization layer; and PC (Pointwise Convolution) is a pointwise convolution layer.
[0120] After obtaining the target spectral data and the target deep learning model, the target spectral data is input into the target deep learning model, so as to extract the target characteristic peaks of the quality markers in the agricultural products, i.e., to extract the characteristic peaks corresponding to the quality markers of yam from the Raman spectrum waveform (i.e., the target spectral data).
[0121] wherein the common characteristic spectral peaks related to the quality of yam include: the absorption peaks between 400-800 cm -1 are attributed to the bending vibration of the glycoside ring skeleton, wherein the peak at 473 cm -1 is caused by the vibration of the pyranose ring skeleton, which is often used as a characteristic peak of starch polysaccharide, and the peak intensity can be used to reflect the degree of polymerization of polysaccharide, and the half-peak width is used to characterize the short-range order of starch. The absorption peak at 765 cm -1 belongs to the C-C stretching vibration of N-methyl formamide in allantoin. The absorption peaks between 800-1200 cm -1 correspond to C-O and C-C stretching and C-O-C bending related to the glycosidic bond, wherein the vibration at 866 cm -1 comes from C-O-C ring and C-H bending vibration, the vibration at 941 cm -1 comes from the C-O-C bending vibration of amylose alpha-1, 4 glycosidic bond. The vibration band at 1050 cm -1 is C-C stretching vibration, the vibration band at 1082 cm -1 is C-OH bending vibration, the vibration band at 1126 cm -1 is C-O stretching and C-OH bending vibration. And the vibration between 1200-1500 cm -1 comes from the coupling of hydrogen atoms. Among them, the vibration at 1258 cm -1 is related to the CH2OH side chain, the vibration at 1334 cm -1 is C-O-H bending vibration, the vibration at 1375 cm -1 is the bending vibration of CH2, C-H and C-O-H, and the vibration at 1455 cm -1 is the bending vibration of CH2 caused by the coupling vibration involving hydrogen atoms. Therefore, by analyzing these characteristic spectral peaks, the main components of yam can be inferred, and the quality thereof can be evaluated.
[0122] In addition, in order to verify the applicability of the method in other agricultural products, wolfberry and astragalus were also analyzed, and the results showed that the Raman characteristic peaks thereof had consistent identification characteristics, for example:
[0123] For example, the Raman characteristic peaks of Lycium barbarum are mainly concentrated in the following wavenumber regions: the benzene ring C=C stretching vibration peak (attributed to flavonoids and phenolic compounds) is observed at about 1600 cm -1 , which is one of the main antioxidant components; in addition, 1360 cm -1 is the C-H bending vibration, which is a characteristic fingerprint region of polysaccharides and carotenoids; the C-O stretching peak at 930 cm -1 is attributed to the structure of mannose and glucose, which is also one of the marker peaks of Lycium barbarum polysaccharides.
[0124] However, the characteristic Raman peaks of Astragalus membranaceus are commonly found at 1215 cm -1 (C-OH bending) and 1450 cm -1 (CH2 bending), which are related to its main active ingredients, isoflavones and polysaccharides, respectively; in particular, the aromatic ring C=C peak of flavonoids appears at 1580 cm -1 , which is an important basis for determining the content of its active ingredients.
[0125] It can be understood that in the present application, the target characteristic peaks of the quality markers in yam are extracted from the target spectral data by using the target deep learning model, and then analyzed to analyze the content of the quality markers in yam, thereby effectively evaluating the main components and quality of yam, realizing efficient detection of yam quality markers, improving detection efficiency and accuracy, and effectively preventing unqualified products from entering the market, ensuring the food safety of consumers.
[0126] Please refer to Figure 7 , step S300, using a target deep learning model to extract target characteristic peaks of quality markers in agricultural products from target spectral data, comprising:
[0127] S310, using a convolution module to perform feature extraction and expression on the target spectral data to obtain first feature data of the quality markers;
[0128] S320, using a flattening layer to perform dimension reduction processing on the first feature data to obtain one-dimensional vector data;
[0129] S330, using a regularization layer to perform regularization processing on the one-dimensional vector data to obtain regularization data;
[0130] S340, using a first fully connected layer to integrate the features of the regularization data to obtain second feature data;
[0131] S350, using a linear activation layer to perform smooth weighting on the second feature data to obtain nonlinear data;
[0132] S360, mapping the nonlinear data to a target dimension by using a second fully connected layer to obtain a target characteristic peak of the quality marker.
[0133] Exemplarily, the specific process of extracting the target characteristic peak by using the target deep learning model is as follows:
[0134] In the present application, the shape of the target spectral data is 221*1600 (sample number*feature dimension), so after obtaining the target spectral data, the target spectral data is input into the target deep learning model, and the data dimension of each input is 16*1*1600 (bitch size*channel number*feature dimension). After data input, the data is first passed through three blocks, i.e., convolution modules. The convolution modules perform feature extraction and expression on the target spectral data, i.e., by combining depthwise convolution and pointwise convolution, the powerful feature extraction capability can be maintained while reducing the computational complexity.
[0135] Then, after passing through each block, the data is subjected to a convolution and a maximum pooling operation, so that the channel number and the feature map size change. The change of the channel number and the feature map size is shown in Table 1.
[0136] Channel Number * Feature Number Block1 Block2 Block3 1*1600 16*800 32*400 64*200
[0137] Table 1
[0138] As can be seen from Table 1, after the target spectral data passes through three convolution layers, the size of the obtained first feature data becomes (64*200).
[0139] Then, the first feature data is input into the Flattening (i.e., flattening layer) for dimension reduction processing, i.e., the multi-dimensional first feature data is converted into one-dimensional vector data, so that the spatial features are converted into linear feature representation suitable for the use of the classifier.
[0140] Secondly, the Dropout (i.e. the regularization layer) performs regularization processing on the one-dimensional vector data to obtain the regularized data. The regularization processing refers to: in the training process, by adding an additional penalty term (regularization term) in the loss function of the model, the complexity or size of the model parameters is limited, random neurons are discarded (such as a dropout rate p = 0.5), and the complex dependence between features is broken, thereby avoiding the model from fitting too much noise in the training data. Then, in the actual training, a certain probability is randomly selected for each training batch to discard part of the neurons and set their outputs to zero, so that the network cannot completely rely on certain specific neurons for prediction, preventing the neural network from overfitting and increasing the generalization ability.
[0141] Next, the FC (i.e. the first fully connected layer) connected with the Dropout further integrates the regularized data into a higher level of abstract representation, i.e. flattens the input regularized data into a one-dimensional vector, and performs linear combination on all input features through a weight matrix to convert local features into global feature representation, obtaining second feature data, thereby realizing high-level feature fusion and avoiding overfitting.
[0142] Further, the Gelu (i.e. the linear activation layer) performs smooth weighting on the second feature data, i.e. introduces nonlinear features by using an activation function, obtains nonlinear data, and enables the neural network to learn more complex nonlinear mapping relationships.
[0143] Finally, the FC (i.e. the second fully connected layer) connected with the Gelu maps the nonlinear data to the target dimension of the classification task, such as 6 dimensions, i.e. maps the feature representation of the nonlinear data to the final output category or regression value, output category probability (classification task) or continuous value (regression task), and can also combine an activation function to generate the final prediction result, i.e. the target feature peak of the quality marker.
[0144] In one implementation method, please refer to Figure 8 , step S310, the target spectral data is subjected to feature extraction and expression by using a convolution module to obtain first feature data of the quality marker, including:
[0145] S311, the target spectral data is subjected to split-channel convolution operation by using a depthwise separable convolution layer to obtain first convolution data of the quality marker;
[0146] S312, the first convolution data is subjected to normalization processing by using a normalization layer to obtain normalized data;
[0147] S313, after the channel number of the normalized data is expanded by using a first pointwise convolution layer, the normalized data is added with nonlinear features by using a linear activation layer to obtain nonlinear feature data;
[0148] S314, the number of channels of the nonlinear feature data is reduced by using a second point-wise convolution layer to obtain first feature data.
[0149] Exemplarily, the specific process of each convolution module for feature extraction and expression of input features is as follows:
[0150] First, after obtaining the target spectral data, the DC (i.e., deep separable convolution layer) in the first convolution module independently performs convolution operation on the target spectral data in each input channel to obtain first convolution data of the quality marker. The channel-by-channel convolution operation reduces the number of parameters while retaining independent spatial features.
[0151] Then, the LN (i.e., normalization layer) normalizes all feature values of each sample in the first convolution data to obtain normalized data, which can reduce the gradient vanishing or explosion problem, speed up the convergence speed, and make the activation value of each layer distributed in a reasonable range, thereby improving the optimization efficiency.
[0152] Secondly, the PC1 (i.e., first point-wise convolution layer) doubles the number of channels of the normalized data, i.e., changes the number of input data channels by using a 1x1 convolution kernel to realize dimension reduction or dimension increase, and fuses the independent channel features extracted by the deep separable convolution to generate a higher level of abstract representation. Then, a linear activation layer is used to add nonlinear features to the normalized data to obtain nonlinear feature data, thereby completing the adjustment of the channel dimension and the feature fusion on the basis of the deep separable convolution, and providing more abundant input for the subsequent activation function.
[0153] Finally, the PC1 (second point-wise convolution layer) reduces the number of channels of the nonlinear feature data by half to keep the number of input and output channels consistent to obtain first feature data.
[0154] Among them, the other two convolution modules (i.e., the second convolution module and the third convolution module) realize the same function, which will not be repeated here.
[0155] Further, the target deep learning model in the present application is a DConvNeXt model. Compared with the traditional DCNN (one-dimensional convolutional neural network based on standard convolution operation) model, the DConvNeXt model introduces the design concept of ConvNeXt (an improved version of convolutional neural network architecture), which integrates depthwise separable convolution, pointwise convolution and normalization technology (such as layer normalization) into the 1D network. The DConvNeXt model can better extract the global features (waveforms) and local features (feature peaks) of the spectrum by combining the self-attention mechanism and the channel attention mechanism, realize more efficient feature extraction, enhance the nonlinear expression ability, and have a lighter design.
[0156] Among them, for small batches of data, traditional convolutional neural networks (i.e. DCNN) can also extract features for classification well, so traditional classification indicators cannot measure the performance difference between the two, and the convergence round and training time are introduced as indicators to estimate the performance of the model in large batches of data and more complex classification tasks.
[0157] Then, the DConvNeXt model and the traditional convolutional neural network in the present application are used to extract features of quality markers in agricultural products, and the feature extraction results of the two are compared as shown in Table 2:
[0158]
[0159] Table 2
[0160] As can be seen from Table 2, the accuracy indicators of the two models in the classification task are both 1.0, and the models can both complete the classification task well. The 1DConvNeXt model reaches the convergence state after only 27 rounds of training, while the other model needs 57 rounds, which indicates that it has higher learning efficiency and can capture key features in data faster. Fast convergence not only reduces the training time, but also reduces the risk of overfitting, especially on small sample data, where overfitting is particularly prominent.
[0161] Although the single round training time of the 1DConvNeXt model is slightly longer, the overall training efficiency is higher because fewer training rounds mean less consumption of computing resources. A model with fast convergence usually has better optimization characteristics, a smoother loss function surface and more stable gradient updates, which helps the model find a better solution in fewer rounds.
[0162] In practical applications, models may need to be frequently adjusted and retrained, and selecting models that converge faster can significantly speed up development and iteration, improving overall efficiency. At the same time, models that converge quickly are usually more stable after deployment and can better adapt to the needs of actual scenarios. In summary, considering convergence speed, generalization ability, training efficiency, and advantages in practical applications, the convolutional architecture 1DConvNeXt in this application outperforms traditional 1DCNN models in classification tasks in terms of comprehensive performance.
[0163] Among them, the existing machine learning models include KNN, SVM and random forest, etc.
[0164] Among them, KNN (K-Nearest Neighbors): K-Nearest Neighbors algorithm is an instance-based learning method, which calculates the distance (such as Euclidean distance) between samples, selects the nearest K neighbors, and then predicts according to the class or average value of these neighbors. SVM finds the maximum interval hyperplane to separate data or constructs a regression hyperplane to handle nonlinear problems. Random Forest (RF for short): Random Forest is an ensemble learning method based on decision trees. It constructs multiple decision trees, each tree is trained on a different subset of data, and outputs the final result by voting or averaging.
[0165] Then, the performance comparison of 1DConvNeXt and machine learning models is shown in Table 3:
[0166] Model Accuracy Precision Recall KNN 0.9714 0.9762 0.9744 RF 0.9411 0.9595 0.9249 SVM 0.9705 0.9761 0.9722 1DConvNeXt 1.0 1.0 1.0
[0167] Table 3
[0168] For the multi-classification task of small sample high-dimensional spectral data, 1DConvNeXt in this application as a modern convolutional neural network architecture can efficiently extract local and global features in spectral data by introducing large convolution kernels, depth separable convolution and Layer Normalization, etc. design, while reducing computational complexity.
[0169] Self-attention mechanism can capture the global dependency between different wavelength points in spectral data, further improving the feature capturing ability of convolution operation in long-range dependency modeling. It is particularly important for high-dimensional spectral data, as features may be distributed in different wavelength regions. Self-attention mechanism can dynamically allocate weights, highlight key wavelength points, and suppress noise.
[0170] The channel attention mechanism automatically screens the key feature dimensions in the spectral data by calculating the importance of different feature dimensions, thereby enhancing the model's ability to express features of high-dimensional data. This enables 1DConvNeXt to not only capture the global and local features of spectral data at the same time, but also effectively handle redundancy and noise problems in high-dimensional data. In small sample scenarios, the attention mechanism can make full use of limited data and capture key information in the data, thereby improving the generalization ability of the model and avoiding overfitting. Then, the DConvNeXt model in this application will be used in the field of three-dimensional image processing, drawing on the modern convolutional architecture of the Transformer architecture (i.e., the Convnext architecture) to introduce one-dimensional spectral data processing. Moreover, combining the efficient design of ConvNeXt with the dynamic weight distribution of the attention mechanism can better extract global and local features, enhance the feature expression ability of the model, and be more suitable for multi-classification tasks of high-dimensional spectral data of small samples, thereby significantly improving the training efficiency and classification performance of the model.
[0171] In summary, the model combining ConvNeXt, self-attention mechanism and channel attention mechanism has multiple advantages in the small sample high-dimensional spectral data classification task, such as efficient feature extraction, global dependency modeling, key feature screening and strong generalization ability.
[0172] To verify the versatility of the target deep learning model across different agricultural product types, this application further introduced a transfer learning strategy. The parameters of the DConvNeXt model pre-trained on the Chinese yam dataset were transferred to the wolfberry and astragalus datasets, and the fully connected layers were fine-tuned. The transfer learning results showed that even with only a small number of samples for fine-tuning, the model's accuracy on new samples remained above 95%, demonstrating the model's excellent transfer and generalization capabilities across agricultural products.
[0173] Furthermore, by freezing the convolutional feature extraction layer and training only the classification head layer, rapid adaptation to diverse samples can be achieved, significantly reducing training time. This strategy is suitable for rapid access to multiple sample types and expansion of detection systems in practical agricultural scenarios, demonstrating the practicality and feasibility of the proposed method for widespread application in a variety of medicinal and edible products.
[0174] See also Figure 9 The present invention provides a system for detecting quality markers of agricultural products, including:
[0175] The acquisition module 10 is used to collect the reflected light of the agricultural products to the target laser and obtain initial spectrum data.
[0176] The processing module 20 is used to perform baseline correction, interference component separation and noise reduction on the initial spectral data to obtain target spectral data.
[0177] The inference module 30 is configured to extract a target characteristic peak of a quality marker in the agricultural product from the target spectral data by using a target deep learning model, and infer a composition of the quality marker according to the target characteristic peak.
[0178] Exemplarily, the system of the present embodiment corresponds to the method for detecting the quality marker of the agricultural product of the above-mentioned embodiment, and the optional items in the above-mentioned embodiment are also applicable to the present embodiment, and thus will not be described herein again.
[0179] The present application also provides a terminal device, which exemplarily comprises a processor and a memory, wherein the memory stores a computer program, and the processor executes the computer program to enable the terminal device to perform the functions of each module in the method for detecting the quality marker of the agricultural product or the system for detecting the quality marker of the agricultural product.
[0180] The processor can be an integrated circuit chip with a signal processing capability. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), and a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or at least one of the above. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the disclosed methods, steps, and logic block diagrams in the embodiments of the present application.
[0181] The memory can be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory is configured to store a computer program, and the processor can execute the computer program after receiving an execution instruction.
[0182] The application further provides a computer readable storage medium for storing the computer program used in the terminal device. For example, the computer readable storage medium can include, but is not limited to, a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various storage media that can store program codes.
[0183] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can also be implemented in other manners. The described apparatus embodiments are merely illustrative. For example, the flowchart and the block diagram in the accompanying drawings show the possible implementation modes of the apparatus, method and computer program product according to the embodiments of the present application. In this regard, each block in the flowchart or the block diagram can represent a module, a program segment or a part of code, which contains one or more executable instructions for implementing the specified logic function. It should also be noted that, in alternative implementation modes, the functions noted in the blocks can occur in different orders from those noted in the accompanying drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and sometimes they can be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or the flowchart, and the combination of blocks in the block diagram and / or the flowchart, can be implemented by a dedicated hardware-based system for implementing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0184] In addition, each functional module or unit in the embodiments of the present application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0185] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of a software product, and the computer software product is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the embodiments of the present application.
[0186] The above merely provides the specific implementation of the present application, but the protection scope of the present application is not limited to this. Any person skilled in the art can easily think of the changes or replacements within the technical range disclosed by the present application, which should be covered in the protection scope of the present application.
Claims
1. A method for detecting a quality marker of an agricultural product, characterized by, The method comprises the following steps: Collecting the reflection light of the target laser of the agricultural product to obtain initial spectral data; Baseline correction, interference component separation and noise reduction processing are performed on the initial spectral data to obtain target spectral data; A target deep learning model is used to extract target characteristic peaks of a quality marker in the agricultural product from the target spectral data, and the composition of the quality marker is inferred according to the target characteristic peaks.
2. The method of detecting a quality marker of an agricultural product according to claim 1, wherein, The target deep learning model comprises a plurality of convolution modules connected in sequence, a flattening layer, a regularization layer, a first full connection layer, a linear activation layer and a second full connection layer; the plurality of convolution modules are connected in sequence; The target deep learning model is used to extract target characteristic peaks of a quality marker in the agricultural product from the target spectral data, comprising: The convolution module is used for feature extraction and expression of the target spectral data to obtain first feature data of the quality marker; The flattening layer is used for dimension reduction processing of the first feature data to obtain one-dimensional vector data; The regularization layer is used for regularization processing of the one-dimensional vector data to obtain regularization data; The first full connection layer is used for feature integration of the regularization data to obtain second feature data; The linear activation layer is used for smoothing and weighting of the second feature data to obtain nonlinear data; The second full connection layer is used to map the nonlinear data to a target dimension to obtain the target characteristic peaks of the quality marker.
3. The method for detecting quality markers of agricultural products according to claim 2, characterized in that: Each convolution module comprises a depth separable convolution layer, a normalization layer, a first pointwise convolution layer, a linear activation layer and a second pointwise convolution layer connected in sequence; The convolution module is used for feature extraction and expression of the target spectral data to obtain first feature data of the quality marker, comprising: The depth separable convolution layer is used for channel-wise convolution operation of the target spectral data to obtain first convolution data of the quality marker; The normalization layer is used for normalization processing of the first convolution data to obtain normalized data; The first pointwise convolution layer is used to expand the channel number of the normalized data, and the linear activation layer is used to add nonlinear features to the normalized data to obtain nonlinear feature data; The second pointwise convolution layer is used to reduce the channel number of the nonlinear feature data to obtain the first feature data.
4. The method for detecting quality markers of agricultural products according to claim 1, characterized in that: Baseline correction, interference component separation and noise reduction processing are performed on the initial spectral data to obtain target spectral data, comprising: An asymmetric least squares method is used to perform baseline fitting on the initial spectral data to obtain a baseline, iteratively adjust the weight of the initial spectral data, and introduce a target constraint condition for optimization to screen out the baseline to obtain corrected data; The corrected data is independently standardized according to a standardized normal variable to separate the interference components in the corrected data to obtain standardized data; Discrete wavelet transform technology is used to decompose and reconstruct the standardized data to separate noise data in the standardized data to obtain the target spectral data.
5. The method of detecting a quality marker of an agricultural product according to claim 4, wherein, The initial spectrum data is smoothed and fitted to obtain a baseline by using an asymmetric least squares method, weights of the initial spectrum data are iteratively adjusted, and a target constraint condition is introduced for optimization to screen out the baseline and obtain corrected data, including: The initial spectrum data is smoothed and fitted to obtain a current baseline fitting curve, so as to determine a current weight of the current baseline fitting curve; A next baseline fitting curve is calculated according to the current weight distribution, a weight ratio of a baseline region and a peak signal region is adjusted, and the target constraint condition is taken as a screening condition until an optimized baseline fitting curve is obtained; The baseline is screened out from the initial spectrum data according to the optimized baseline fitting curve to obtain the corrected data. The target constraint condition includes non-negativity constraint and smoothness constraint.
6. The method of detecting a quality marker of an agricultural product according to claim 4, wherein, The corrected data is independently standardized according to a standardized normal variable to separate interference components in the corrected data and obtain standardized data, including: The mean value and the standard deviation of all wavelength points in the corrected data are calculated, and the corrected data is standardized and converted according to the mean value and the standard deviation to obtain the standardized data.
7. The method for detecting quality markers of agricultural products according to claim 4, characterized in that: The standardized data is decomposed and reconstructed by using a discrete wavelet transform technology to separate noise data in the standardized data and obtain the target spectrum data, including: The standardized data is decomposed by using a wavelet basis function to obtain a first frequency component and a second frequency component, the first frequency component is decomposed step by step until a preset decomposition layer number is reached to obtain a first total frequency component and a second total frequency component; The second total frequency component is threshold processed and combined with the first total frequency component to obtain the target spectrum data.
8. A system for detecting a quality marker of an agricultural product, characterized by, Including: The acquisition module is configured to collect reflected light of the target laser of the agricultural product to obtain initial spectrum data; The processing module is configured to perform baseline correction, interference component separation and noise reduction processing on the initial spectrum data to obtain target spectrum data; The inference module is configured to extract a target characteristic peak of a quality marker in the agricultural product from the target spectrum data by using a target deep learning model, and infer a composition of the quality marker according to the target characteristic peak.
9. A terminal device, comprising: Including: A memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being executed by the processor to implement the steps of the detection method of the quality marker of the agricultural product according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, A computer program is stored, and the computer program is executed by a processor to implement the steps of the detection method of the quality marker of the agricultural product according to any one of claims 1-7.