An apparatus and method for improving the accuracy of pesticide residue detection in food.
By evaluating differences and detail retention within a local window of spectral data and adaptively adjusting the length of the denoising window, the problem of noise interference in spectral data is solved, thereby improving the accuracy and reliability of food pesticide residue detection.
Patent Information
- Application Number
- CN202511371986.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-24
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2045-09-24
AI Technical Summary
Spectral data are easily affected by noise in the detection of pesticide residues in food, leading to inaccurate test results. Existing noise reduction methods are difficult to effectively remove noise while ensuring that important information is not filtered out.
By establishing a difference evaluation of spectral data within a local window, the differences in denoising effect and detail retention of spectral data are determined. The length of the denoising window is adjusted, and the denoising intensity is adaptively adjusted in combination with the absorption peak distribution of the spectral data to achieve adaptive denoising.
It improves the noise reduction effect of spectral data, enhances the accuracy and reliability of pesticide residue detection in food, and ensures the accuracy of detection results.
Smart Images

Figure CN121215077B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of physical testing technology, specifically to an apparatus and method for improving the accuracy of pesticide residue detection in food. Background Technology
[0002] Improving the accuracy of pesticide residue detection in food helps ensure that pesticide residue levels in food meet standards, protecting consumers from harmful substances. It also helps trace pesticide use and optimize agricultural production processes. Spectroscopic technology can provide the chemical fingerprint of food samples for pesticide residue detection, distinguishing between multiple pesticide residues and complex backgrounds, enhancing the accuracy and adaptability of detection, and meeting the needs of food testing for speed, accuracy, and portability. The quality of spectral data is crucial to the accuracy and reliability of detection. However, in actual testing, spectral data is easily affected by various factors such as environmental interference or irrelevant signals generated by the instrument itself, introducing significant noise. This noise can mask the characteristic spectra of pesticide residues, leading to inaccurate results. Therefore, noise reduction processing is necessary for the obtained spectral data.
[0003] Generally, the degree of noise interference in spectral data varies, and the intensity of denoising required varies. When the filter window selected for denoising is too large, important information may be removed. When the filter window selected for denoising is too small, the purpose of denoising cannot be achieved, thus affecting the accuracy of food pesticide residue detection results. Summary of the Invention
[0004] To address the aforementioned technical problems, this application provides an apparatus and method for improving the accuracy of pesticide residue detection in food. The specific technical solution adopted is as follows:
[0005] In a first aspect, one embodiment of this application provides a method for improving the accuracy of pesticide residue detection in food, the method comprising the following steps:
[0006] Collect different samples of food containing pesticide residues to be detected, collect spectral data of the samples at different wavelengths, denoise the spectral data using a first preset length as the window length, and obtain the denoised spectral data of each wavelength of the sample.
[0007] The spectral data of any wavelength of the same sample is recorded as the target spectral data. A local window of the target spectral data is established. The difference in denoising effect of the target spectral data is determined based on the difference between all spectral data contained in the local window of the target spectral data before and after denoising. The detail retention of the target spectral data is determined based on the difference in the change trend of all spectral data before and after denoising contained in the local window of the target spectral data before and after denoising. The second correction length of the target spectral data is determined by combining the difference in denoising effect of the target spectral data.
[0008] The importance of corrections for local bands in the target spectral data is determined based on the distribution of spectral absorbance values of all spectral data contained within a local window of the target spectral data.
[0009] Based on the corrected importance of local bands, the second correction length, and the first preset length of all spectral data of the same sample, the spectral denoising data of the sample is obtained. Based on the spectral denoising data of all samples, the detection of pesticide residues in food is realized.
[0010] Furthermore, the method for establishing the local window of the target spectral data is as follows:
[0011] A window centered on the target spectral data and with a first preset length is denoted as the local window of the target spectral data.
[0012] Furthermore, the method for obtaining the difference in denoising effect of the target spectral data is as follows:
[0013] The variance of all spectral data contained within a local window of the target spectral data is denoted as the first variance of the target spectral data.
[0014] The variance of all spectral data contained within a local window of the denoised target spectral data is denoted as the second variance of the target spectral data.
[0015] The difference in denoising effect of the target spectral data is determined based on the difference between the first variance and the second variance of the target spectral data.
[0016] Furthermore, the specific process of determining the difference in denoising effect of the target spectral data based on the difference between the first variance and the second variance of the target spectral data includes:
[0017] The ratio of the first variance to the second variance of the target spectral data is denoted as the first ratio of the target spectral data; the absolute value of the difference between the first variance and the second variance of the target spectral data is denoted as the first difference of the target spectral data; the positive correlation result between the first ratio and the first difference of the target spectral data is denoted as the difference in denoising effect of the target spectral data.
[0018] Furthermore, the method for obtaining the detail retention of the target spectral data is as follows:
[0019] Based on the changing trends of all spectral data before and after denoising contained within a local window of the target spectral data before and after denoising, the slope corresponding to all spectral data before and after denoising is determined.
[0020] The mean of the absolute values of the differences in slopes at corresponding positions of all spectral data before and after denoising within a local window of the target spectral data before and after denoising is denoted as the first mean of the target spectral data. The negative correlation processing result of the first mean of the target spectral data is denoted as the detail retention of the target spectral data.
[0021] Furthermore, the method for obtaining the slope corresponding to the spectral data is as follows:
[0022] Curve fitting is performed on all spectral data contained within a local window of the target spectral data to obtain a local fitting curve for the target spectral data. Based on the local fitting curve of the spectral data, the slope of the corresponding position of all spectral data contained within the local window of the target spectral data is calculated.
[0023] Furthermore, the method for obtaining the second correction length of the target spectral data is as follows:
[0024] The minimum difference between the detail retention and the denoising effect of the target spectral data is recorded as the first extreme value of the target spectral data; the maximum difference between the detail retention and the denoising effect of the target spectral data is recorded as the second extreme value of the target spectral data; the ratio of the first extreme value to the second extreme value of the target spectral data is recorded as the correction coefficient of the target spectral data.
[0025] The result of positive correlation processing between the correction coefficient of the target spectral data and the first preset length is denoted as the second correction length of the target spectral data.
[0026] Furthermore, the method for obtaining the corrected importance of local bands in the target spectral data is as follows:
[0027] All spectral data contained within a local window of the target spectral data are denoted as the spectral data contained within a local band of the target spectral data; the sum of the spectral absorbance values of all spectral data contained within a local band of the target spectral data is denoted as the cumulative importance of the local band of the target spectral data.
[0028] The sum of the cumulative importance of the local bands of all spectral data is denoted as the comprehensive cumulative importance. The ratio of the cumulative importance of the local bands of the target spectral data to the comprehensive cumulative importance is denoted as the relative importance of the local bands of the target spectral data.
[0029] The variance contribution rate of each local band of the target spectral data is obtained separately. The positive correlation between the relative importance of the local bands of the target spectral data and the variance contribution rate is recorded as the corrected importance of the local bands of the target spectral data.
[0030] Furthermore, the method for obtaining the spectral denoising data of the sample is as follows:
[0031] The product of the local band correction importance of the target spectral data and the first preset length is recorded as the first product of the target spectral data; the sum of the first products of all spectral data within a window centered on the target spectral data and with the second correction length of the target spectral data is recorded as the window length reference value of the target spectral data; and the odd number closest to the window length reference value of the target spectral data is recorded as the third correction length of the target spectral data.
[0032] The third correction length of the spectral data is used as the window length for denoising the spectral data to obtain the denoised spectral data of the sample.
[0033] Secondly, another embodiment of this application provides an apparatus for improving the accuracy of pesticide residue detection in food, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method for improving the accuracy of pesticide residue detection in food described above.
[0034] The embodiments of this application have at least the following beneficial effects:
[0035] This application first evaluates the effectiveness of denoising on all spectral data within a local window of the target spectral data based on the differences between the denoised and undenoised data. It then assesses the denoising effect difference of the target spectral data and, combined with an evaluation of the ability of the local window size to retain local detail information of the target spectral data, adjusts the first preset length to obtain a second corrected length for the target spectral data. Considering that different bands of spectral data are affected by noise to varying degrees, and that denser spectral information is more susceptible to noise, the application evaluates the concentration of spectral bands corresponding to absorption peaks in the spectral data to obtain the corrected importance of local bands in the target spectral data. Finally, based on the corrected importance of local bands, the second corrected length, and the first preset length of all spectral data for the same sample, it obtains the denoised spectral data of the sample. Using the denoised spectral data of all samples, it achieves food pesticide residue detection, enabling adaptive denoising based on the actual quality and requirements of the spectral data. This improves the denoising effect of spectral data and solves the problem of insufficient accuracy in food pesticide residue detection results due to poor denoising performance. Attached Figure Description
[0036] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 A flowchart illustrating the steps of a method for improving the accuracy of pesticide residue detection in food, provided as an embodiment of this application;
[0038] Figure 2 This is a flowchart illustrating the process of obtaining the difference in noise reduction effect according to one embodiment of this application. Detailed Implementation
[0039] To further illustrate the technical means and effects adopted by this application to achieve the intended purpose of the invention, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of an apparatus and method for improving the accuracy of pesticide residue detection in food according to this application. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0041] The following description, in conjunction with the accompanying drawings, details a specific scheme for an apparatus and method for improving the accuracy of pesticide residue detection in food provided in this application.
[0042] Please see Figure 1 The document illustrates a flowchart of a method for improving the accuracy of pesticide residue detection in food, according to an embodiment of this application. The method includes the following steps:
[0043] Step S001: Collect different samples of food containing pesticide residues to be detected, collect spectral data of the samples at different wavelengths, denoise the spectral data using a first preset length as the window length, and obtain the denoised spectral data of each wavelength of the sample.
[0044] Collect food samples for pesticide residue testing and collect spectral data of the samples.
[0045] It is understandable that, in order to improve the accuracy of pesticide residue detection in food, multiple samples of the food to be tested for pesticide residues should be collected, and the average of the pesticide residue detection results of all samples should be recorded as the pesticide residue detection result of the food to be tested for pesticide residues. In this embodiment, a total of 5 samples of the food to be tested for pesticide residues were collected; in this embodiment, spectral data were collected in the wavelength range of 900nm to 1681nm, with a sampling interval of 1nm. In practical applications, as other implementation methods, implementers can decide the number of food samples to be tested for pesticide residues and the wavelength range of the spectral data according to the actual situation, and this application does not impose any special restrictions.
[0046] Using the first preset length as the window length, the moving average filtering algorithm is used to denoise the spectral data of the sample, and the denoised spectral data of the sample is obtained.
[0047] In this embodiment, the first preset length is set to 11.
[0048] Furthermore, the first preset length is adjusted according to the actual quality and requirements of the spectral data to obtain the most suitable window length for denoising the spectral data.
[0049] At this point, the spectral data and the denoised spectral data for each sample have been obtained.
[0050] Step S002: Record the spectral data of any wavelength of the same sample as the target spectral data, establish a local window of the target spectral data, determine the difference in denoising effect of the target spectral data based on the difference between all spectral data contained in the local window of the target spectral data before and after denoising, determine the detail retention of the target spectral data based on the difference in the change trend of all spectral data before and after denoising contained in the local window of the target spectral data before and after denoising, and determine the second correction length of the target spectral data based on the difference in denoising effect of the target spectral data.
[0051] The spectral data of any wavelength of the same sample is recorded as the target spectral data, and the window centered on the target spectral data and with a first preset length is recorded as the local window of the target spectral data.
[0052] The difference in denoising effect of the target spectral data is determined based on the differences between all spectral data contained in a local window of the target spectral data before and after denoising.
[0053] The variance of all spectral data contained within a local window of the target spectral data is denoted as the first variance of the target spectral data; the variance of all spectral data contained within a local window of the denoised target spectral data is denoted as the second variance of the target spectral data; the ratio of the first variance to the second variance of the target spectral data is denoted as the first ratio of the target spectral data; the absolute value of the difference between the first variance and the second variance of the target spectral data is denoted as the first difference of the target spectral data; the positive correlation result between the first ratio and the first difference of the target spectral data is denoised as the difference in denoising effect of the target spectral data.
[0054] It is understood that a positive correlation is applied to the first ratio and the first difference of the target spectral data, ensuring that the first ratio and the first difference of the target spectral data are positively correlated with the difference in denoising effect of the target spectral data. It is understood that the positive correlation in this application refers to the relationship between the independent and dependent variables, where the independent variables are the first ratio and the first difference of the target spectral data, and the dependent variable is the difference in denoising effect of the target spectral data. A positive correlation means that the dependent variable increases (decreases) as the independent variable increases (decreases), and can be an additive or multiplicative relationship.
[0055] Preferably, as an embodiment of this application, the product of the first ratio and the first difference of the target spectral data is recorded as the denoising effect difference of the target spectral data.
[0056] In practical applications, as another implementation method, the sum of the normalized value of the first difference of the target spectral data and the first ratio of the target spectral data is recorded as the difference in denoising effect of the target spectral data.
[0057] In this embodiment, the sigmoid function is used to calculate the normalized value. The sigmoid function is a well-known technique and will not be described in detail here. As other implementation methods, implementers can use other methods of the prior art, such as the tanh function.
[0058] The greater the difference between all spectral data within a local window of the target spectral data before and after denoising, the more significant the denoising effect on all spectral data within that local window. In this case, the greater the difference in denoising effect between the target spectral data. The flowchart for obtaining the difference in denoising effect is as follows: Figure 2 As shown.
[0059] The same method can be used to obtain the difference in denoising effect of spectral data of any wavelength of the same sample.
[0060] Based on the changing trends of all spectral data before and after denoising contained within a local window of the target spectral data before and after denoising, the slope corresponding to all spectral data before and after denoising is determined.
[0061] Using the order of spectral data within a local window as the independent variable and the values of the spectral data as the dependent variable, curve fitting is performed on all spectral data contained within the local window of the target spectral data to obtain a local fitting curve. Based on the local fitting curve, the slope of the corresponding positions of all spectral data contained within the local window of the target spectral data is calculated. Similarly, using the order of denoised spectral data within a local window as the independent variable and the values of the denoised spectral data as the dependent variable, curve fitting is performed on all spectral data contained within the local window of the denoised target spectral data to obtain a local fitting curve. Based on the local fitting curve, the slope of the corresponding positions of all spectral data contained within the local window of the denoised target spectral data is calculated.
[0062] The slope of the corresponding position of the spectral data is the slope of the order of the spectral data in the local window to the corresponding point on the target spectral data. Similarly, the slopes of the corresponding positions of all spectral data contained in the local window of the denoised target spectral data are calculated.
[0063] The detail retention of the target spectral data is determined by the difference between the slopes of the corresponding positions of all spectral data before and after denoising within a local window of the target spectral data before and after denoising.
[0064] The mean of the absolute values of the differences in slopes at corresponding positions of all spectral data before and after denoising within a local window of the target spectral data before and after denoising is denoted as the first mean of the target spectral data. The negative correlation processing result of the first mean of the target spectral data is denoted as the detail retention of the target spectral data.
[0065] It is understood that negative correlation processing is applied to the first mean of the target spectral data, ensuring a negative correlation between the first mean of the target spectral data and the detail retention of the target spectral data. It is understood that the negative correlation in this application refers to the relationship between the independent and dependent variables, where the independent variable is the first mean of the target spectral data and the dependent variable is the detail retention of the target spectral data. The negative correlation means that the dependent variable decreases (increases) as the independent variable increases (decreases), and can be an inverse relationship, a subtraction relationship, etc.
[0066] Preferably, as an embodiment of this application, the negative of the first mean of the target spectral data is used as the exponent of an exponential function with the natural constant as the base, and the calculation result of the exponential function is recorded as the detail retention of the target spectral data.
[0067] The smaller the difference between the slopes of all corresponding positions of the target spectral data before and after denoising within the local window of the target spectral data before and after denoising, the higher the similarity of all the spectral data before and after denoising within the local window of the target spectral data, and the better the size of the local window can preserve the local detail information of the target spectral data. In this case, the denoising effect on the target spectral data position is better.
[0068] The same method can be used to obtain the detail retention of spectral data at any wavelength of the same sample.
[0069] The minimum difference between the detail retention and denoising effect of the target spectral data is recorded as the first extreme value of the target spectral data; the maximum difference between the detail retention and denoising effect is recorded as the second extreme value of the target spectral data; the ratio of the first extreme value to the second extreme value of the target spectral data is recorded as the correction coefficient of the target spectral data. The positive correlation result between the correction coefficient of the target spectral data and the first preset length is recorded as the second correction length of the target spectral data.
[0070] Preferably, as an embodiment of this application, the product of the correction coefficient of the target spectral data and the first preset length is denoted as the first correction length of the target spectral data. The odd number closest to the first correction length of the target spectral data is denoted as the second correction length of the target spectral data.
[0071] The second correction length of the spectral data for any wavelength of the same sample can be obtained using the same method.
[0072] This completes the second correction length for obtaining spectral data of all wavelengths for the same sample.
[0073] Step S003: Determine the importance of corrections for local bands of the target spectral data based on the distribution of spectral absorbance values of all spectral data contained within a local window of the target spectral data.
[0074] The degree of noise interference varies for spectral data in different bands. The denser the spectral information, the more susceptible the spectral data is to noise. Therefore, by combining the concentration of the spectral bands corresponding to the absorption peaks of the spectral data, the second correction length and the first preset length of the spectral data are further adjusted to improve the reliability of pesticide residue detection using the denoised spectral data.
[0075] All spectral data contained within a local window of the target spectral data are denoted as the spectral data contained within the local band of the target spectral data. The sum of the spectral absorbance values of all spectral data contained within the local band of the target spectral data is denoted as the cumulative importance of the local band of the target spectral data.
[0076] The cumulative importance of spectral data at any wavelength of the same sample can be obtained using the same method.
[0077] The sum of the cumulative importance of the local bands of all spectral data is denoted as the comprehensive cumulative importance. The ratio of the cumulative importance of the local bands of the target spectral data to the comprehensive cumulative importance is denoted as the relative importance of the local bands of the target spectral data.
[0078] The relative importance of spectral data at any wavelength of the same sample can be obtained using the same method.
[0079] The greater the relative importance, the denser the spectral information in the local bands of the spectral data, and the more susceptible the spectral data is to noise.
[0080] Using a significance analysis algorithm, the variance contribution rate of each local band of the target spectral data is obtained. The positive correlation between the relative importance of the local bands of the target spectral data and the variance contribution rate is recorded as the corrected importance of the local bands of the target spectral data.
[0081] Preferably, as an embodiment of this application, the product of the relative importance of the local bands of the target spectral data and the variance contribution rate is denoted as the corrected importance of the local bands of the target spectral data.
[0082] In this embodiment, the PCA principal component analysis algorithm is selected as the significance analysis algorithm. The use of the PCA principal component analysis algorithm to obtain the variance contribution rate is a well-known technique and will not be described in detail here. The larger the variance contribution rate of the local bands of the spectral data, the more important the spectral information of the local bands of the spectral data is.
[0083] The same method can be used to obtain the corrected importance of spectral data for any wavelength of the same sample.
[0084] This highlights the importance of correcting for obtaining spectral data of all wavelengths for the same sample.
[0085] Step S004: Based on the corrected importance of local bands, the second correction length, and the first preset length of all spectral data of the same sample, obtain the spectral denoising data of the sample, and realize the detection of pesticide residues in food based on the spectral denoising data of all samples.
[0086] The product of the corrected importance of a local band of the target spectral data and the first preset length is denoted as the first product of the target spectral data. The first product of the spectral data for any wavelength of the same sample can be obtained using the same method. The sum of the first products of all spectral data within a window centered on the target spectral data and with a second corrected length is denoted as the window length reference value of the target spectral data. The odd number closest to the window length reference value of the target spectral data is denoted as the third corrected length of the target spectral data.
[0087] The third correction length of the spectral data for any wavelength of the same sample can be obtained using the same method.
[0088] The third correction length of the spectral data is used as the window length for denoising the spectral data. The moving average filtering algorithm is used to denoise all spectral data of the same sample to obtain the denoised spectral data of the sample. The denoised spectral data of the sample is the accurate denoising result of the spectral data of the sample.
[0089] Accurate noise reduction of the spectral data of the samples was achieved using spectral analysis to obtain the detection results of pesticide residues in the food samples. The average of the detection results of pesticide residues in all samples was taken as the pesticide residue detection result of the food to be tested.
[0090] This achieves high-precision detection of pesticide residues in food.
[0091] This application also proposes an apparatus for improving the accuracy of pesticide residue detection in food, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the steps described above. Since a method for improving the accuracy of pesticide residue detection in food has been described in detail above, it will not be repeated here.
[0092] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments of this specification have been described above. Additionally, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are possible or may be advantageous.
[0093] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0094] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them; modifications to the technical solutions described in the foregoing embodiments, or equivalent substitutions of some of the technical features, do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for improving the accuracy of detection of pesticide residues in food, characterized by, The method comprises the following steps: Collecting different samples of food to be detected for pesticide residues, collecting spectral data of the samples at different wavelengths, denoising the spectral data with a first preset length as a window length, and obtaining denoised spectral data of each wavelength of the samples; Regarding the spectral data of any wavelength of the same sample as target spectral data, establishing a local window of the target spectral data, determining the denoising effect difference of the target spectral data according to the difference between all spectral data contained in the local window of the target spectral data before and after denoising, determining the detail retention degree of the target spectral data according to the difference in the trend of all spectral data before and after denoising contained in the local window of the target spectral data, and determining the second correction length of the target spectral data in combination with the denoising effect difference of the target spectral data; Determining the correction importance of the local band of the target spectral data according to the distribution of the spectral absorption values of all spectral data contained in the local window of the target spectral data; Obtaining spectral denoising data of the samples according to the correction importance of the local band of all spectral data of the same sample, the second correction length and the first preset length, and realizing food pesticide residue detection according to the spectral denoising data of all samples.
2. The method for improving the detection accuracy of pesticide residues in food according to claim 1, characterized in that, The method for establishing the local window of the target spectral data is: Regarding a window with the target spectral data as the center and the first preset length as the length as the local window of the target spectral data.
3. The method for improving the detection accuracy of pesticide residues in food according to claim 1, characterized in that, The method for obtaining the denoising effect difference of the target spectral data is: Regarding the variance of all spectral data contained in the local window of the target spectral data as the first variance of the target spectral data; Regarding the variance of all spectral data contained in the local window of the denoised target spectral data as the second variance of the target spectral data; Determining the denoising effect difference of the target spectral data according to the difference between the first variance and the second variance of the target spectral data.
4. The method for improving the detection accuracy of pesticide residues in food according to claim 3, characterized in that, The specific process of determining the denoising effect difference of the target spectral data according to the difference between the first variance and the second variance of the target spectral data comprises: Regarding the ratio of the first variance to the second variance of the target spectral data as the first ratio of the target spectral data; Regarding the absolute value of the difference between the first variance and the second variance of the target spectral data as the first difference of the target spectral data; Regarding the positive correlation processing result of the first ratio and the first difference of the target spectral data as the denoising effect difference of the target spectral data.
5. The method for improving the detection accuracy of pesticide residues in food according to claim 1, characterized in that, The method for obtaining the detail retention degree of the target spectral data is: Determining the corresponding slopes of all spectral data before and after denoising according to the trend of all spectral data before and after denoising contained in the local window of the target spectral data; Regarding the absolute value of the difference between the corresponding slopes of all spectral data before and after denoising contained in the local window of the target spectral data as the first mean value of the target spectral data, and regarding the negative correlation processing result of the first mean value of the target spectral data as the detail retention degree of the target spectral data.
6. The method for improving the detection accuracy of pesticide residues in food according to claim 5, characterized in that, The method for obtaining the corresponding slope of the spectral data is: Curve fitting is performed on all the spectral data contained in the local window of the target spectral data to obtain a local fitting curve of the target spectral data, and the slope of the corresponding position of all the spectral data contained in the local window of the target spectral data is calculated according to the local fitting curve of the spectral data.
7. The method for improving the detection accuracy of pesticide residues in food according to claim 1, characterized in that, The method for obtaining the second correction length of the target spectral data is: The minimum value in the difference between the detail retention degree and the denoising effect of the target spectral data is recorded as the first extreme value of the target spectral data, and the maximum value in the difference between the detail retention degree and the denoising effect of the target spectral data is recorded as the second extreme value of the target spectral data; The ratio of the first extreme value to the second extreme value of the target spectral data is recorded as the correction coefficient of the target spectral data; The positive correlation processing result of the correction coefficient of the target spectral data and the first preset length is recorded as the second correction length of the target spectral data.
8. The method for improving the detection accuracy of pesticide residues in food according to claim 1, characterized in that, The method for obtaining the correction importance of the local band of the target spectral data is: All the spectral data contained in the local window of the target spectral data is recorded as the spectral data contained in the local band of the target spectral data, and the cumulative sum of the spectral absorption values of all the spectral data contained in the local band of the target spectral data is recorded as the cumulative importance of the local band of the target spectral data; The cumulative sum of the cumulative importance of the local band of all the spectral data is recorded as the comprehensive cumulative importance, and the ratio of the cumulative importance of the local band of the target spectral data to the comprehensive cumulative importance is recorded as the relative importance of the local band of the target spectral data; The variance contribution rate of the local band of each spectral data is obtained respectively, and the positive correlation processing result of the relative importance of the local band of the target spectral data and the variance contribution rate is recorded as the correction importance of the local band of the target spectral data.
9. The method for improving the detection accuracy of pesticide residues in food according to claim 1, characterized in that, The method for obtaining the spectral denoising data of the sample is: The product of the correction importance of the local band of the target spectral data and the first preset length is recorded as the first product of the target spectral data, the cumulative sum of the first product of all the spectral data in the window of the target spectral data with the second correction length of the target spectral data as the center is recorded as the window length reference value of the target spectral data, and the odd number closest to the window length reference value of the target spectral data is recorded as the third correction length of the target spectral data; The third correction length of the spectral data is used as the window length for denoising the spectral data to obtain the spectral denoising data of the sample.
10. An apparatus for improving the detection accuracy of pesticide residues in food, comprising a memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that, The processor executes the computer program to realize the steps of the method for improving the detection accuracy of food and pesticide residues according to any one of claims 1-9.
Citation Information
Patent Citations
Spectral data intelligent processing method for vegetable pesticide residue detection
CN117809070A
Protein quality intelligent detection method and system based on spectral analysis
CN119574488A