A method for intelligent automatic detection of pesticide residues

By analyzing the spectral maps of pesticide solution samples and mixed pesticide solution samples, determining the distinction band and comprehensive distinction degree, selecting the preferred characteristic wavelength, and training the pesticide prediction model, the problem of low pesticide residue detection accuracy in the existing technology is solved, and higher prediction accuracy and automatic detection effect are achieved.

CN119715490BActive Publication Date: 2025-04-22SHENZHEN SITECHNO BIOTECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510205917.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-25
Publication Date
2025-04-22
Estimated Expiration
2045-02-25

AI Technical Summary

Technical Problem

When using fluorescence spectroscopy to detect pesticide residues, the prior art encounters the problem of the proximity of the characteristic peaks of different pesticides spectrals, resulting in poorer component prediction accuracy of mixed pesticides.

Method used

By obtaining the spectral maps of pesticide solution samples of different concentrations and mixed pesticide solution samples, determine the differentiation band and comprehensive distinction of pesticides, select the wavelength with the largest comprehensive distinction as the preferred characteristic wavelength, train the initial pesticide prediction model, and predict the concentration of pesticides.

Benefits of technology

The prediction accuracy of mixed pesticide solution samples is improved and the automatic detection effect of pesticide residues is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119715490B_ABST
    Figure CN119715490B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of chemical analysis, and in particular to an intelligent automatic detection method for pesticide residues, the method comprising: obtaining pesticide solution samples and mixed pesticide solution samples; determining first spectra of pesticide solution samples of different concentrations, and second spectra of each mixed pesticide solution sample at different wavelengths; determining the comprehensive discrimination of the distinguishing band of pesticides at any wavelength according to the first spectra and the second spectra; selecting M wavelengths with the largest comprehensive discrimination in each distinguishing band as preferred characteristic wavelengths; using the fluorescence intensity of the preferred characteristic wavelength of the mixed pesticide solution sample as a training sample to train an initial pesticide prediction model to obtain a pesticide prediction model; inputting the fluorescence intensity of the preferred characteristic wavelength in the fluorescence spectrum of the grain sample to be detected into the pesticide prediction model, and predicting the concentration of the pesticide through the pesticide prediction model. The present invention improves the prediction accuracy, which is beneficial to improving the automatic detection effect of pesticide residues.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of chemical analysis, and in particular to an intelligent automatic detection method for pesticide residues. Background Art

[0002] Pesticide residues refer to traces of any specific pesticide or its metabolites, degradation products and reaction products found in agricultural products and their processed products. Among them, pesticide residues are an important factor affecting food safety, so it is extremely important to detect pesticide residues. Fluorescence spectroscopy technology has gradually attracted attention due to its high sensitivity, fast detection speed and simple operation. Pesticides can emit light with a longer wavelength than the laser after being excited by ultraviolet or visible light, which is fluorescence. When fluorescence spectroscopy is used for quantitative analysis of substances, the mathematical relationship between fluorescence intensity and solution concentration is mainly used for regression prediction, such as using support vector machines for regression prediction.

[0003] However, since food often contains a variety of pesticides such as organophosphorus and carbamates, the characteristic peaks of the spectra of some different pesticides are close. When the pesticides are mixed, different pesticides have similar spectral characteristics. In the full spectrum, some wavelengths are not able to distinguish pesticides well, and even interfere with the detection of pesticide components. This leads to poor prediction accuracy when using support vector machines to predict the composition of mixed pesticides through the full spectrum, resulting in poor detection of pesticide residues. Summary of the invention

[0004] In order to solve the technical problem of poor detection effect of pesticide residues, the purpose of the present invention is to provide an intelligent automatic detection method for pesticide residues. The technical solution adopted is as follows:

[0005] The embodiment of the present invention provides an intelligent automatic detection method for pesticide residues, comprising: obtaining pesticide solution samples at different concentrations of each pesticide and a mixed pesticide solution sample obtained by mixing pesticide solution samples of corresponding concentrations of all pesticides; determining first spectra of pesticide solution samples at different wavelengths and second spectra of each mixed pesticide solution sample at different wavelengths, wherein the abscissa of the first spectra and the second spectra are wavelengths and the ordinate is fluorescence intensity; determining the comprehensive discrimination degree of a distinguishing band of pesticides at any wavelength according to the first spectra of pesticides and the second spectra of the mixed pesticide solution sample, wherein the distinguishing band is a band for distinguishing the components of pesticides in the mixed pesticide solution sample; selecting M wavelengths with the largest comprehensive discrimination degree in each distinguishing band as preferred characteristic wavelengths, where M is a natural number greater than or equal to 1; using the fluorescence intensity of the mixed pesticide solution sample at the preferred characteristic wavelength as a training sample to train an initial pesticide prediction model to obtain a pesticide prediction model; inputting the fluorescence intensity of the preferred characteristic wavelength in the fluorescence spectrum of a grain sample to be detected into the pesticide prediction model, and predicting the concentration of the pesticide through the pesticide prediction model.

[0006] Optionally, determining the comprehensive discrimination degree of the distinguishing bands of the pesticide at any wavelength based on the first spectrum of the pesticide and the second spectrum of the mixed pesticide solution sample includes: segmenting the first spectrum to obtain multiple first bands, segmenting the second spectrum to obtain multiple second bands; encoding each first band of the first spectrum to obtain a first coding sequence, encoding each second band of the second spectrum to obtain a second coding sequence; determining the similarity between the first coding sequence and the second coding sequence in the synchronization window based on the fluorescence intensity of the first coding sequence and the second coding sequence at each position in the synchronization window; calculating the mean similarity between the second coding sequence and the first coding sequence in any synchronization window, and recording the synchronization window with the largest mean similarity as the similarity window; The band of the similar window in the second spectrum is recorded as the prominent band of any pesticide in the mixed pesticide solution sample; according to the minimum fluorescence intensity, maximum fluorescence intensity and frequency of the wavelength of the prominent band of any pesticide in the mixed pesticide solution sample at different wavelengths at different concentrations, the pesticide discrimination degree of the wavelength of the prominent band of the pesticide solution sample is determined; the intersection of the prominent bands of the pesticide in the second spectrum is taken as the distinguishing band of the pesticide and the pesticide discrimination degree of any wavelength on the distinguishing band; according to the average pesticide discrimination degree of any wavelength of the distinguishing band of the pesticide in the second spectrum, the maximum frequency of the distinguishing band of the pesticide at any wavelength and the number of mixed pesticide solution samples, the comprehensive discrimination degree of the distinguishing band of the pesticide at any wavelength is determined.

[0007] Optionally, determining the similarity of the first coding sequence and the second coding sequence in the synchronization window based on the fluorescence intensity of the first coding sequence and the second coding sequence at each position in the synchronization window includes: calculating a first difference between the absolute value of the fluorescence intensity of the first coding sequence at each position in the synchronization window and the absolute value of the fluorescence intensity of the second coding sequence at the corresponding position in the synchronization window; superimposing the absolute values ​​of the first difference under each synchronization window to obtain a first superimposed value; and performing inverse proportional normalization processing on the first superimposed value to obtain the similarity between the first coding sequence and the second coding sequence in the synchronization window.

[0008] Optionally, determining the pesticide discrimination degree of the wavelength of the prominent band of the pesticide solution sample based on the minimum fluorescence intensity and the maximum fluorescence intensity of different wavelengths in the prominent band of the mixed pesticide solution sample at different concentrations and the frequency of the wavelength of the prominent band appearing in all prominent bands includes: taking the intersection of the range consisting of the minimum fluorescence intensity and the maximum fluorescence intensity of different wavelengths in the prominent band of the mixed pesticide solution sample at different concentrations to obtain the intersection value; taking the union of the range consisting of the minimum fluorescence intensity and the maximum fluorescence intensity of different wavelengths in the prominent band of the mixed pesticide solution sample at different concentrations to obtain the union value; calculating a first ratio between the intersection value and the union value, and a first product between the first ratio and the union value; and performing inverse proportional normalization processing on the first product to obtain the pesticide discrimination degree of the wavelength of the prominent band of the pesticide solution sample.

[0009] Optionally, determining the comprehensive discrimination degree of the pesticide discrimination band at any wavelength based on the average pesticide discrimination degree of the pesticide discrimination band at any wavelength in the second spectrum, the maximum frequency of the pesticide discrimination band at any wavelength, and the number of mixed pesticide solution samples includes: calculating a second ratio between the maximum frequency and the number; and determining a second product between the average pesticide discrimination degree and the second ratio as the comprehensive discrimination degree of the pesticide discrimination band at any wavelength.

[0010] Optionally, the first spectrum graph is segmented to obtain multiple first bands, including: differentiating the first spectrum graph to obtain the rate of change of the fluorescence intensity corresponding to each wavelength; traversing from the starting wavelength of the first spectrum graph, when the difference between the rate of change of the fluorescence intensity corresponding to the traversed wavelength and the previous wavelength is less than a first threshold, merging the traversed wavelength into the previous wavelength to obtain a first band; when the difference between the rate of change of the fluorescence intensity corresponding to the traversed wavelength and the previous wavelength is greater than or equal to the first threshold, using the traversed wavelength as a new starting point, and forming a new first band to continue traversing, until the last wavelength is traversed, to obtain multiple first bands.

[0011] Optionally, the second spectrum graph is segmented to obtain multiple second bands, including: differentiating the second spectrum graph to obtain the rate of change of fluorescence intensity corresponding to each wavelength; traversing from the starting wavelength of the second spectrum graph, when the difference in the rate of change of fluorescence intensity corresponding to the traversed wavelength and the previous wavelength is less than a first threshold, merging the traversed wavelength into the previous wavelength to obtain a second band; when the difference in the rate of change of fluorescence intensity corresponding to the traversed wavelength and the previous wavelength is greater than or equal to the first threshold, using the traversed wavelength as a new starting point, and forming a new second band to continue traversing, until the last wavelength is traversed to obtain multiple second bands.

[0012] Optionally, encoding each first band of the first spectrogram to obtain a first coding sequence includes: determining the start of the first spectrogram as a first value, jumping to a second value when a first band division appears in the first spectrogram, and encoding the first spectrogram in sequence to obtain a first coding sequence.

[0013] Optionally, encoding each second band of the second spectrum graph to obtain a second coding sequence includes: determining the start of the second spectrum graph as a first value, jumping to a second value when a second band division appears in the second spectrum graph, and encoding the second spectrum graph in sequence to obtain a second coding sequence.

[0014] Optionally, the fluorescence intensity of the mixed pesticide solution samples at the preferred characteristic wavelength is used as a training sample to train the initial pesticide prediction model, and the pesticide prediction model is obtained, including: all mixed pesticide solution samples are divided into a training set and a test set according to a predetermined ratio; the mixed pesticide solution samples in the training set are input into the initial pesticide prediction model for training to obtain a pre-trained pesticide prediction model; and the pre-trained pesticide prediction model is tested using the mixed pesticide solution samples in the test set to obtain the pesticide prediction model.

[0015] In a second aspect, an embodiment of the present invention discloses an intelligent automatic detection system for pesticide residues, comprising: a processor and a memory; wherein the memory is used to store computer programs that can be run on the processor; and the processor is used to execute the program stored in the memory to implement the steps of the intelligent automatic detection method for pesticide residues as mentioned in the first aspect.

[0016] The invention has the following beneficial effects: firstly, pesticide solution samples at different concentrations of each pesticide and mixed pesticide solution samples obtained by mixing pesticide solution samples at corresponding concentrations of all pesticides are obtained; then, first spectra of pesticide solution samples at different wavelengths of different concentrations and second spectra of each mixed pesticide solution sample at different wavelengths are determined, wherein the abscissa of the first spectra and the second spectra are the wavelength and the ordinate is the fluorescence intensity; then, according to the first spectra of the pesticide and the second spectra of the mixed pesticide solution sample, the comprehensive discrimination degree of the distinguishing band of the pesticide at any wavelength is determined, wherein the distinguishing band is the band for distinguishing the components of the pesticide in the mixed pesticide solution sample; secondly, in each distinguishing band, M wavelengths with the largest comprehensive discrimination degree are selected as preferred characteristic wavelengths, wherein M is a natural number greater than or equal to 1; and the fluorescence intensity of the mixed pesticide solution sample at the preferred characteristic wavelength is used as a training sample to train an initial pesticide prediction model to obtain a pesticide prediction model; finally, the fluorescence intensity of the preferred characteristic wavelength in the fluorescence spectrum of the grain sample to be detected is input into the pesticide prediction model, and the concentration of the pesticide is predicted by the pesticide prediction model.

[0017] In this way, the embodiment of the present invention can analyze the spectra of solution samples of various pesticides and mixed pesticide solution samples when predicting pesticide components using the spectrum of a mixed pesticide solution, and perform feature analysis and screening on different wavelengths. In combination with the different performance characteristics of different wavelengths on different pesticides, the comprehensive discrimination of the pesticide differentiation band at any wavelength is determined, and finally the wavelength with the largest comprehensive discrimination is selected as the preferred feature wavelength. The prediction of pesticide components based on the support vector machine is optimized. When the support vector machine is used to predict the components of mixed pesticides through the full spectrum, the prediction accuracy is improved, so that the prediction effect of the mixed pesticide solution sample is better, which is conducive to improving the automatic detection effect of pesticide residues. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 A flow chart of an intelligent automatic detection method for pesticide residues provided by one embodiment of the present invention;

[0020] Figure 2 A schematic diagram of the spectrum of a pesticide at different concentrations provided by an embodiment of the present invention;

[0021] Figure 3 A schematic diagram of a spectrum of a mixed pesticide solution sample at a certain concentration provided by an embodiment of the present invention;

[0022] Figure 4 A schematic diagram of a second spectrum of a mixed pesticide solution sample provided by an embodiment of the present invention;

[0023] Figure 5 A schematic structural diagram of an intelligent automatic detection system for pesticide residues provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0024] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the intelligent automatic detection method for pesticide residues proposed by the present invention, its specific implementation, structure, characteristics and effects, in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0025] Unless defined otherwise, 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 invention belongs.

[0026] The specific scheme of the intelligent automatic detection method for pesticide residues provided by the present invention is described in detail below in conjunction with the accompanying drawings.

[0027] Embodiment 1:

[0028] See also Figure 1 , which shows a flow chart of an intelligent automatic detection method for pesticide residues provided by an embodiment of the present invention, including:

[0029] Step S101, obtaining pesticide solution samples at different concentrations of each pesticide and a mixed pesticide solution sample obtained by mixing pesticide solution samples at corresponding concentrations of all pesticides.

[0030] Specifically, the embodiment of the present invention can select several commonly used pesticide ingredients for food, such as organophosphorus and carbamate. The pesticide of each ingredient is diluted with pure water to a standard solution of a use concentration (for example, 0.5 mg / mL), and then the standard solution is separated into several portions, and each is diluted by different multiples (1 times, 2 times, ..., 10 times), and 1 mL is extracted from each portion as a pesticide solution sample to obtain pesticide solution samples at different concentrations of each pesticide. Then, all the solutions of all pesticides of different concentrations are merged in turn, and 1 mL is extracted from each portion as a mixed pesticide solution sample. Among them, each mixed pesticide solution sample contains and only has one concentration of solution of all pesticides.

[0031] Step S102, determining first spectra of pesticide solution samples of different concentrations at different wavelengths, and second spectra of each mixed pesticide solution sample at different wavelengths.

[0032] The abscissa of the first spectrum graph and the second spectrum graph is the wavelength, and the ordinate is the fluorescence intensity.

[0033] Specifically, the embodiment of the present invention uses a fluorescence photometer to record the fluorescence spectra of all pesticide solution samples and mixed pesticide solution samples, with an excitation wavelength of 285nm and a scanning wavelength range of 300nm-550nm. The first spectrum graphs of pesticide solution samples with different concentrations at different wavelengths and the second spectrum graphs of mixed pesticide solution samples at different wavelengths are obtained. The horizontal coordinates of the first spectrum graph and the second spectrum graph are wavelength (nm), and the vertical coordinates of the first spectrum graph and the second spectrum graph are fluorescence intensity. For example, Figure 2 As shown, Figure 2 A schematic diagram of the spectrum of a pesticide at different concentrations provided by an embodiment of the present invention, Figure 3 A schematic diagram of the spectrum of a mixed pesticide solution sample at a certain concentration provided by an embodiment of the present invention.

[0034] Among them, any wavelength is taken as a feature of the spectrum, and the fluorescence intensity corresponding to the wavelength is the feature value. The fluorescence intensity corresponding to the full spectrum, that is, all features, reflects the overall characteristics of any pesticide solution sample, and the overall characteristics of different pesticides are different, and this difference can distinguish the pesticides. Therefore, in the spectrum of the mixed pesticide solution sample, the similarity between the overall characteristics and the overall characteristics of any pesticide spectrum reflects the concentration of the pesticide in the mixed pesticide solution sample.

[0035] Step S103, determining the comprehensive discrimination degree of the discrimination waveband of the pesticide at any wavelength according to the first spectrum of the pesticide and the second spectrum of the mixed pesticide solution sample.

[0036] The distinguishing band is a band for distinguishing the components of pesticides in the mixed pesticide solution sample.

[0037] Specifically, the spectrum can be divided into: bands, each of which will have different changes depending on the concentration. According to the consistency of the performance of the band of the spectrum of the pesticide solution sample in the corresponding band in the mixed pesticide solution sample, it can be concluded whether the corresponding pesticide is significant in the mixed pesticide solution sample. Therefore, the spectrum is segmented first. Furthermore, for the spectrum of a mixed pesticide solution sample, the more it conforms to the spectrum of a certain pesticide solution sample, it means that not only the concentration is similar, but also the interference of other pesticides is relatively small. Therefore, by comparing the division of the bands and the fluorescence intensity range of the bands, the performance of individual pesticides in any band of the mixed pesticide spectrum can be obtained. In addition, since each band has a different fluorescence intensity range in different pesticides, its degree of discrimination for different pesticides is different, so the band's discrimination of pesticides should be further calculated based on the fluorescence intensity.

[0038] More specifically, when determining the comprehensive discrimination degree of the distinguishing bands of pesticides at any wavelength, as an optional embodiment of the present invention, firstly, the first spectrum is segmented to obtain a plurality of first bands, and the second spectrum is segmented to obtain a plurality of second bands; and each first band of the first spectrum is encoded to obtain a first coding sequence, and each second band of the second spectrum is encoded to obtain a second coding sequence; then, according to the fluorescence intensity of the first coding sequence and the second coding sequence at each position in the synchronization window, the similarity between the first coding sequence and the second coding sequence in the synchronization window is determined; secondly, the mean similarity between the second coding sequence and the first coding sequence in any synchronization window is calculated, and the synchronization window with the largest mean similarity is recorded as the similarity window; and the similarity window is The band in the second spectrum is recorded as the prominent band of any pesticide in the mixed pesticide solution sample; then, according to the minimum fluorescence intensity, maximum fluorescence intensity and frequency of the wavelength of the prominent band of any pesticide in the mixed pesticide solution sample at different concentrations and different wavelengths, the pesticide discrimination degree of the wavelength of the prominent band of the pesticide solution sample is determined; and the intersection of the prominent bands of the pesticides in the second spectrum is taken as the distinguishing band of the pesticide and the pesticide discrimination degree of any wavelength on the distinguishing band; finally, according to the average pesticide discrimination degree of any wavelength of the distinguishing band of the pesticide in the second spectrum, the maximum frequency of the distinguishing band of the pesticide at any wavelength and the number of mixed pesticide solution samples, the comprehensive discrimination degree of the distinguishing band of the pesticide at any wavelength is determined.

[0039] Specifically, segmenting the first spectrum graph to obtain multiple first bands includes: taking the derivative of the first spectrum graph to obtain the change rate of the fluorescence intensity corresponding to each wavelength; traversing from the starting wavelength of the first spectrum graph, when the difference between the change rate of the fluorescence intensity corresponding to the traversed wavelength and the previous wavelength is less than a first threshold, merging the traversed wavelength into the previous wavelength to obtain the first band; when the difference between the change rate of the fluorescence intensity corresponding to the traversed wavelength and the previous wavelength is greater than or equal to the first threshold, using the traversed wavelength as a new starting point, and forming a new first band to continue traversing until the last wavelength is traversed to obtain multiple first bands. The second spectrum graph is segmented to obtain multiple second bands, including: differentiating the second spectrum graph to obtain the change rate of the fluorescence intensity corresponding to each wavelength; traversing from the starting wavelength of the second spectrum graph, when the difference between the change rate of the fluorescence intensity corresponding to the traversed wavelength and the previous wavelength is less than a first threshold, merging the traversed wavelength into the previous wavelength to obtain a second band; when the difference between the change rate of the fluorescence intensity corresponding to the traversed wavelength and the previous wavelength is greater than or equal to the first threshold, using the traversed wavelength as a new starting point, and forming a new second band to continue traversing until the last wavelength is traversed to obtain multiple second bands.

[0040] Specifically, the embodiment of the present invention obtains the fluorescence intensity change rate corresponding to each wavelength by taking the derivative of the spectrum of any sample. When the fluorescence intensity change rate changes greatly, it is reflected in the spectrum as a significant change in the slope. Therefore, the fluorescence intensity change rate can be used as the basis for segmentation. The embodiment of the present invention takes the 300nm wavelength as the starting point and as the first band, and traverses backward in sequence. When the difference between the fluorescence intensity change rate corresponding to the traversed wavelength and the previous wavelength is less than 0.1, the traversed wavelength is merged into the band of the previous wavelength. When the difference between the fluorescence intensity change rate corresponding to the traversed wavelength and the previous wavelength is greater than or equal to 0.1, the traversed wavelength is used as the new starting point and a new band is formed. Continue traversing until the last wavelength is traversed to obtain several bands of the spectrum. It should be noted that due to the existence of characteristic peaks, the spectra of solution samples of the same pesticide with different concentrations have the same bands and different bands, and the different bands reflect the difference in concentration. For example, Figure 4 As shown, Figure 4 A schematic diagram of a second spectrum of a mixed pesticide solution sample provided by an embodiment of the present invention is shown in FIG. Figure 4 In the second spectrum of the mixed pesticide solution sample, the bands.

[0041] More specifically, as an optional embodiment of the present invention, encoding each first band of the first spectrum graph to obtain a first coding sequence includes: determining the start of the first spectrum graph as a first value, jumping to a second value when a first band division appears in the first spectrum graph, and encoding the first spectrum graph in sequence to obtain the first coding sequence. Encoding each second band of the second spectrum graph to obtain a second coding sequence includes: determining the start of the second spectrum graph as a first value, jumping to a second value when a second band division appears in the second spectrum graph, and encoding the second spectrum graph in sequence to obtain the second coding sequence.

[0042] Specifically, in the embodiment of the present invention, the first value can be 0, and the second value can be 1. In the embodiment of the present invention, any spectrum is encoded, starting at 0, and jumping when band division occurs, for example Figure 4 The encoding sequence of the second spectrum of the mixed pesticide solution sample shown can be In this way, the coding sequences corresponding to several spectra are obtained.

[0043] More specifically, for the second spectrum of any mixed pesticide solution sample in the embodiment of the present invention, the more similar its coding sequence is to the coding sequence of the first spectrum of any pesticide solution sample, the more similar it is to the concentration of the pesticide solution sample, and the interference of other pesticide components is also small. If only some bands are similar in coding, and other bands are not similar in coding, it means that the similar bands can show the characteristics of the pesticide solution sample, and their directivity is more significant. In this way, the prominent bands of any pesticide in the spectrum of the mixed pesticide solution sample can be obtained.

[0044] More specifically, the embodiment of the present invention first uses 10 nm as the starting window size, 2 nm as the step size, and 50 nm as the ending window size to obtain a plurality of windows. For any window, a synchronous window slide is performed between the coding sequence A of the second spectrum of the mixed pesticide solution sample and the coding sequence B of the first spectrum of any pesticide solution sample, and the similarity of any synchronous window of the coding sequence A and the coding sequence B is calculated. The synchronous window is the window with the same relative position in the sequence.

[0045] More specifically, as an optional embodiment of the present invention, determining the similarity of the first coding sequence and the second coding sequence in the synchronization window based on the fluorescence intensity of the first coding sequence and the second coding sequence at each position in the synchronization window includes: calculating the first difference between the absolute value of the fluorescence intensity of the first coding sequence at each position in the synchronization window and the absolute value of the fluorescence intensity of the second coding sequence at the corresponding position in the synchronization window; superimposing the absolute values ​​of the first difference under each synchronization window to obtain a first superimposed value; and performing inverse proportional normalization processing on the first superimposed value to obtain the similarity of the first coding sequence and the second coding sequence in the synchronization window.

[0046] Specifically, the embodiment of the present invention performs forward differentiation on the coding sequence A and the coding sequence B to obtain a forward differential sequence of the coding sequence A and the coding sequence B, wherein the differential sequence reflects the segmentation situation.

[0047] The embodiment of the present invention specifically uses the following formula to calculate the similarity between the first coding sequence and the second coding sequence in the synchronization window:

[0048]

[0049] In the above formula, Indicates the similarity between the first coding sequence and the second coding sequence in the synchronization window. Indicates the size of the synchronization window. The value of the c-th position of the synchronization window of the second coding sequence on the forward differential sequence of the second coding sequence and the first coding sequence. Represents the value of the c-th position of the synchronization window of the first coding sequence on the forward differential sequence between the second coding sequence and the first coding sequence.

[0050] in, It means to make a difference in the absolute values ​​of all the values ​​at the same position in the synchronization window, and then sum them up to represent the segment difference. Because 1 and -1 in the forward difference sequence both represent band segmentation, the value of the sum reflects the difference in window segmentation. The larger the value, the greater the difference, and thus the smaller the similarity. (-) indicates the inverse normalization function, which is used to Perform inverse proportional normalization.

[0051] More specifically, in the embodiment of the present invention, the window is recorded as , the first coding sequence of the first spectrum of the pesticide solution samples of all pesticide concentrations is recorded as .window Next, calculate the second encoding sequence and The similarity mean of any synchronization window is calculated, and the synchronization window with the largest similarity mean is recorded as window The similar windows under the same window are recorded as the bands in the spectrum of the similar windows with the largest similarity average among all similar windows under the same window as the prominent bands of the pesticide. Among them, any pesticide has a prominent band in the spectrum of the mixed pesticide solution sample, and the prominent band can best reflect the composition of the pesticide in the mixed pesticide.

[0052] More specifically, as an optional embodiment of the present invention, according to the minimum fluorescence intensity, maximum fluorescence intensity and frequency of the wavelength of the prominent band of any pesticide in the mixed pesticide solution sample at different concentrations and different wavelengths, determining the pesticide discrimination degree of the wavelength of the prominent band of the pesticide solution sample includes:

[0053] The intersection of the ranges consisting of the minimum fluorescence intensity and the maximum fluorescence intensity of the prominent band of any pesticide in the mixed pesticide solution sample at different wavelengths at different concentrations is taken to obtain the intersection value; the union of the ranges consisting of the minimum fluorescence intensity and the maximum fluorescence intensity of the prominent band of any pesticide in the mixed pesticide solution sample at different wavelengths at different concentrations is taken to obtain the union value; the first ratio between the intersection value and the union value, and the first product between the first ratio and the union value are calculated; the first product is inversely normalized to obtain the pesticide discrimination degree of the wavelength of the prominent band of the pesticide solution sample.

[0054] Specifically, due to the overlap of prominent bands of different pesticides, a more detailed single wavelength should be considered. When different pesticides have different fluorescence intensity ranges at a wavelength in any prominent band and do not appear repeatedly in different prominent bands, this wavelength can better distinguish the components of mixed pesticides. Therefore, for the spectrum of any mixed pesticide solution sample, the pesticide differentiation degree at any wavelength in any prominent band is calculated.

[0055] The embodiment of the present invention specifically uses the following formula to calculate the pesticide discrimination degree of any wavelength in any prominent band:

[0056]

[0057] In the above formula, It represents the pesticide discrimination degree of the tth wavelength in the prominent band of the sth pesticide. Indicates the type of pesticide. It represents the fluorescence intensity of the s-th pesticide at the t-th wavelength in the prominent band of the s-th pesticide. , It represents the minimum fluorescence intensity and maximum fluorescence intensity of the s-th pesticide at different concentrations. It represents the intersection-and-joint ratio of the fluorescence intensity ranges of all pesticides, and indicates the difference in the fluorescence intensity ranges of the pesticides. The larger the value, the higher the overlap of the fluorescence intensity ranges, and the less prominent the expression of a certain pesticide, so the pesticide differentiation is small. is a self-set function, which indicates the frequency of the tth wavelength of the prominent band of the sth pesticide appearing in all prominent bands. The larger the value, the weaker the uniqueness of the wavelength, and the weaker the pesticide discrimination. (-) indicates the inverse normalization function, which is used to Perform inverse proportional normalization.

[0058] More specifically, the embodiment of the present invention obtains the prominent bands of all pesticides in the spectra of all mixed pesticide solution samples, and for the s-th pesticide, takes the intersection of the prominent bands of the s-th pesticide on the spectra of all mixed pesticide solution samples, which is recorded as the distinguishing band of the s-th pesticide. Then obtain the distinguishing bands of all pesticides, and the pesticide distinguishing degrees of any wavelength on all distinguishing bands. Finally, for any wavelength in any distinguishing band, the higher and more stable the pesticide distinguishing degree of the wavelength, the more capable the wavelength is of distinguishing pesticides, and the comprehensive distinguishing degree of the wavelength is calculated. Furthermore, the embodiment of the present invention divides the pesticide distinguishing degree of any wavelength on any prominent band into 10 pesticide distinguishing degree ranges from 0 to 1, obtains the frequency of each pesticide distinguishing degree at the wavelength in the spectra of all mixed pesticide solution samples, and obtains the maximum frequency therein.

[0059] More specifically, as an optional embodiment of the present invention, determining the comprehensive discrimination degree of the pesticide discrimination band at any wavelength based on the average pesticide discrimination degree of the pesticide discrimination band at any wavelength in the second spectrum, the maximum frequency of the pesticide discrimination band at any wavelength, and the number of mixed pesticide solution samples includes: calculating a second ratio between the maximum frequency and the number; determining a second product between the average pesticide discrimination degree and the second ratio as the comprehensive discrimination degree of the pesticide discrimination band at any wavelength.

[0060] Specifically, the embodiment of the present invention specifically uses the following formula to calculate the comprehensive discrimination degree of the pesticide discrimination band at any wavelength:

[0061]

[0062] In the above formula, It represents the comprehensive discrimination degree of the tth wavelength in the discrimination band of the sth pesticide. It represents the average pesticide discrimination degree of the tth wavelength of the discrimination band of the sth pesticide in the spectra of all mixed pesticide solution samples. represents the maximum frequency at the tth wavelength of the distinguishing band of the sth pesticide, Represents the total number of spectra of mixed pesticide solution samples.

[0063] Step S104: Select M wavelengths with the largest comprehensive discrimination in each discrimination band as preferred characteristic wavelengths, where M is a natural number greater than or equal to 1.

[0064] Specifically, since the proportion of components in each mixed pesticide solution sample is different, there are also large differences in the spectrum. Therefore, all mixed pesticide solution samples should be comprehensively screened for wavelength characteristics. The preferred characteristic wavelength needs to have a large degree of distinction in mixed pesticide solutions of any component ratio.

[0065] More specifically, M wavelengths with the largest comprehensive discrimination are selected in each discrimination band, and M can be set according to actual conditions. In the embodiment of the present invention, M is set to 3 as the preferred characteristic wavelengths. It should be noted that if the discrimination bands to which different preferred characteristic wavelengths belong overlap, a wavelength with the largest comprehensive discrimination should be selected for the discrimination bands to which they belong. If there is still overlap, continue to select until there is no overlap.

[0066] Step S105 , using the fluorescence intensity of the mixed pesticide solution sample at the preferred characteristic wavelength as a training sample to train an initial pesticide prediction model to obtain a pesticide prediction model.

[0067] Specifically, the embodiment of the present invention divides all mixed pesticide solution samples into a training set and a test set according to a predetermined ratio; then the mixed pesticide solution samples in the training set are input into the initial pesticide prediction model for training to obtain a pre-trained pesticide prediction model; finally, the pre-trained pesticide prediction model is tested using the mixed pesticide solution samples in the test set to obtain a pesticide prediction model.

[0068] More specifically, the embodiment of the present invention divides all mixed pesticide solution samples into a training set and a test set in a ratio of 7:3. The input is the fluorescence intensity of the preferred characteristic wavelength, and the output is the concentration of all pesticides. A support vector machine is used for learning to establish a pesticide prediction model for grain samples.

[0069] Step S106, inputting the fluorescence intensity of the preferred characteristic wavelength in the fluorescence spectrum of the grain sample to be detected into the pesticide prediction model, and predicting the concentration of the pesticide through the pesticide prediction model.

[0070] Specifically, the embodiment of the present invention obtains the fluorescence spectrum of the grain sample to be tested, and inputs the fluorescence intensity corresponding to the preferred characteristic wavelength into the pesticide prediction model to obtain the concentration of each pesticide. The residual degree of each pesticide in the grain can be determined according to the concentration of each pesticide. The higher the concentration of the pesticide, the higher the residual degree of the pesticide in the grain.

[0071] The embodiment of the present invention can analyze the spectra of solution samples of various pesticides and mixed pesticide solution samples when predicting pesticide components using the spectrum of a mixed pesticide solution, and perform feature analysis and screening on different wavelengths. In combination with the different performance characteristics of different wavelengths on different pesticides, the comprehensive discrimination of the pesticide discrimination bands at any wavelength is determined, and finally the wavelength with the largest comprehensive discrimination is selected as the preferred feature wavelength. The prediction of pesticide components based on the support vector machine is optimized. When the support vector machine is used to predict the components of mixed pesticides through the full spectrum, the prediction accuracy is improved, so that the prediction effect of the mixed pesticide solution sample is better, which is conducive to improving the automatic detection effect of pesticide residues.

[0072] Embodiment 2:

[0073] Corresponding to the intelligent automatic detection method for pesticide residues provided in the above embodiment, based on the same technical concept, an embodiment of the present invention further provides an intelligent automatic detection system for pesticide residues, which is used to execute the above intelligent automatic detection method for pesticide residues. Figure 5 A schematic diagram of the structure of an intelligent automatic detection system for pesticide residues provided by an embodiment of the present invention is shown in FIG. Figure 5 As shown in the hardware level, the pesticide residue intelligent automatic detection system includes a processor, and optionally, an internal bus, a network interface, and a memory. Among them, the memory may include a memory, such as a high-speed random access memory (Random-Access Memory, RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the pesticide residue intelligent automatic detection system may also include hardware required for other services.

[0074] The processor, network interface and memory can be interconnected through an internal bus, which can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0075] The memory is used to store programs. Specifically, the program may include program code, and the program code includes computer operation commands. The memory may include internal memory and non-volatile memory, and provide instructions and data to the processor.

[0076] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a device for locating the specified user at the logical level. The processor executes the program stored in the memory and is specifically used to execute: Figure 1 The method disclosed in the illustrated embodiment implements the functions and beneficial effects of each method in the previous method embodiments, which will not be described in detail here.

[0077] It should be noted that the intelligent automatic detection system for pesticide residues provided by the embodiment of the present invention and the intelligent automatic detection method for pesticide residues provided by the embodiment of the present invention are based on the same application concept. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned intelligent automatic detection method for pesticide residues, and has the same or similar beneficial effects, and the repeated parts will not be repeated.

[0078] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0079] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

Claims

1. A method for intelligent automatic detection of pesticide residues, characterized in that: The intelligent automatic detection method for pesticide residues comprises: Obtain pesticide solution samples at different concentrations of each pesticide and a mixed pesticide solution sample obtained by mixing pesticide solution samples at corresponding concentrations of all pesticides; Determine first spectra of the pesticide solution samples of different concentrations at different wavelengths, and second spectra of each of the mixed pesticide solution samples at different wavelengths, wherein the abscissa of the first spectra and the second spectra is the wavelength, and the ordinate is the fluorescence intensity; Determine the comprehensive discrimination degree of the distinguishing wavelength band of the pesticide at any wavelength according to the first spectrum of the pesticide and the second spectrum of the mixed pesticide solution sample, wherein the distinguishing wavelength band is a wavelength band for distinguishing the components of the pesticide in the mixed pesticide solution sample; Select M wavelengths with the largest comprehensive discrimination in each discrimination band as preferred characteristic wavelengths, where M is a natural number greater than or equal to 1; Using the fluorescence intensity of the mixed pesticide solution sample at the preferred characteristic wavelength as a training sample to train an initial pesticide prediction model to obtain a pesticide prediction model; Inputting the fluorescence intensity of the preferred characteristic wavelength in the fluorescence spectrum of the grain sample to be detected into the pesticide prediction model, and predicting the concentration of the pesticide by the pesticide prediction model; The method for determining the comprehensive discrimination degree includes: Segmenting the first spectrum graph to obtain a plurality of first bands, and segmenting the second spectrum graph to obtain a plurality of second bands; Encoding each of the first wavebands of the first spectrum to obtain a first encoding sequence, and encoding each of the second wavebands of the second spectrum to obtain a second encoding sequence; Determining the similarity between the first coding sequence and the second coding sequence in the synchronization window according to the fluorescence intensity of each position of the first coding sequence and the second coding sequence in the synchronization window; Calculate the average similarity between the second coding sequence and the first coding sequence in any synchronization window, and record the synchronization window with the largest similarity average as a similarity window; Recording the wavelength band of the similar window in the second spectrum as the prominent wavelength band of any pesticide in the mixed pesticide solution sample; Determine the pesticide discrimination degree of the wavelength of the prominent band of the pesticide solution sample according to the minimum fluorescence intensity and the maximum fluorescence intensity of any pesticide at different wavelengths in the prominent band of the mixed pesticide solution sample at different concentrations and the frequency of the wavelength of the prominent band appearing in all prominent bands; Taking the intersection of the prominent bands of the pesticide in the second spectrum as the distinguishing band of the pesticide, and the pesticide distinguishing degree of any wavelength on the distinguishing band; The comprehensive discrimination degree of the pesticide discrimination band at any wavelength is determined based on the average pesticide discrimination degree of any wavelength of the pesticide discrimination band in the second spectrum, the maximum frequency of the pesticide discrimination band at any wavelength, and the number of mixed pesticide solution samples.

2. The intelligent automatic detection method for pesticide residues according to claim 1, characterized in that: Determining the similarity between the first coding sequence and the second coding sequence in the synchronization window according to the fluorescence intensity of each position of the first coding sequence and the second coding sequence in the synchronization window includes: Calculating a first difference between the absolute value of the fluorescence intensity of the first coding sequence at each position in the synchronization window and the absolute value of the fluorescence intensity of the second coding sequence at the corresponding position in the synchronization window; Superimposing the absolute values ​​of the first difference values ​​under each synchronization window to obtain a first superimposed value; The first superposition value is subjected to inverse proportional normalization processing to obtain the similarity between the first coding sequence and the second coding sequence within the synchronization window.

3. The intelligent automatic detection method for pesticide residues according to claim 1, characterized in that: Determining the pesticide discrimination degree of the wavelength of the prominent waveband of the pesticide solution sample according to the minimum fluorescence intensity and the maximum fluorescence intensity of any pesticide at different wavelengths in the prominent waveband of the mixed pesticide solution sample at different concentrations and the frequency of the wavelength of the prominent waveband appearing in all prominent wavebands includes: Taking the intersection of the range consisting of the minimum fluorescence intensity and the maximum fluorescence intensity of any pesticide at different wavelengths in the prominent band of the mixed pesticide solution sample at different concentrations to obtain the intersection value; Taking a union of the ranges consisting of the minimum fluorescence intensity and the maximum fluorescence intensity of any pesticide at different wavelengths in the prominent band of the mixed pesticide solution sample at different concentrations to obtain a union value; Calculating a first ratio between the intersection value and the union value, and a first product between the first ratio and the union value; The first product is subjected to inverse proportional normalization processing to obtain the pesticide discrimination degree of the wavelength of the prominent wavelength band of the pesticide solution sample.

4. The method for intelligent automatic detection of pesticide residues according to claim 1, characterized in that: Determining the comprehensive discrimination degree of the pesticide discrimination waveband at any wavelength according to the average pesticide discrimination degree of any wavelength of the pesticide discrimination waveband in the second spectrum, the maximum frequency of the pesticide discrimination waveband at any wavelength, and the number of the mixed pesticide solution samples comprises: calculating a second ratio between the maximum frequency and the number; The second product between the average pesticide discrimination degree and the second ratio is determined as the comprehensive discrimination degree of the pesticide discrimination waveband at any wavelength.

5. The intelligent automatic detection method for pesticide residues according to claim 1, characterized in that: The segmenting of the first spectrum graph to obtain a plurality of first bands comprises: Deriving the first spectrum graph to obtain a change rate of the fluorescence intensity corresponding to each wavelength; Starting from the starting wavelength of the first spectrum, when the difference between the changing speed of the fluorescence intensity corresponding to the traversed wavelength and the previous wavelength is less than a first threshold, the traversed wavelength is merged into the previous wavelength to obtain a first wavelength band; When the difference in the change rate of the fluorescence intensity corresponding to the traversed wavelength and the previous wavelength is greater than or equal to the first threshold, the traversed wavelength is used as a new starting point, and a new first band is formed to continue traversing until the last wavelength is traversed to obtain multiple first bands.

6. The method for intelligent automatic detection of pesticide residues according to claim 1, characterized in that: The segmenting of the second spectrum graph to obtain a plurality of second bands comprises: Deriving the second spectrum graph to obtain a change rate of the fluorescence intensity corresponding to each wavelength; Starting from the starting wavelength of the second spectrum, when the difference between the changing speed of the fluorescence intensity corresponding to the traversed wavelength and the previous wavelength is less than a first threshold, the traversed wavelength is merged into the previous wavelength to obtain a second wavelength band; When the difference in the change rate of the fluorescence intensity corresponding to the traversed wavelength and the previous wavelength is greater than or equal to the first threshold, the traversed wavelength is used as a new starting point, and a new second band is formed to continue traversing until the last wavelength is traversed to obtain multiple second bands.

7. The method for intelligent automatic detection of pesticide residues according to claim 1, characterized in that: The encoding of each of the first wavebands of the first spectrum graph to obtain a first encoding sequence comprises: The start of the first spectrum is determined to be a first value, and when the first band division appears in the first spectrum, a jump is performed to obtain a second value, and the first spectrum is encoded in sequence to obtain the first encoding sequence.

8. The method for intelligent automatic detection of pesticide residues according to claim 1, characterized in that: The encoding of each of the second wavebands of the second spectrum graph to obtain a second encoding sequence comprises: The start of the second spectrum graph is determined to be a first value, and when the second band division appears in the second spectrum graph, a jump is performed to obtain a second value, and the second spectrum graph is encoded in sequence to obtain the second encoding sequence.

9. The method for intelligent automatic detection of pesticide residues according to claim 1, characterized in that: The step of using the fluorescence intensity of the mixed pesticide solution sample at the preferred characteristic wavelength as a training sample to train the initial pesticide prediction model to obtain the pesticide prediction model comprises: All mixed pesticide solution samples are divided into training sets and test sets according to a predetermined ratio; Inputting the mixed pesticide solution samples of the training set into the initial pesticide prediction model for training to obtain a pre-trained pesticide prediction model; The pre-trained pesticide prediction model is tested using the mixed pesticide solution samples of the test set to obtain the pesticide prediction model.

Citation Information

Patent Citations

  • Method for quantitatively detecting pesticide residues in grains by adopting terahertz frequency band FTIR (Fourier Transform Infrared Spectroscopy) technology

    CN103969212A

  • Pesticide residue detection device and detection method

    CN110455947A