Intelligent pesticide detection method and detection system for traceability
By enhancing Raman spectral and hyperspectral data acquisition and preprocessing of agricultural product samples, a pesticide detection model is constructed, and data cross-analysis is used for multi-dimensional databases, the problems of long detection cycles and easy data tampering in traditional detection methods are solved, and rapid detection of pesticide residues and visualization of traceability information are realized, and detection and traceability efficiency and agricultural product safety monitoring capabilities are improved.
Patent Information
- Application Number
- CN202411524999.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-25
AI Technical Summary
Traditional pesticide residue detection methods have a long detection cycle, which cannot achieve rapid on-site detection, and the detection data are easily tampered with, reducing the credibility and effectiveness of the traceability system.
A pesticide intelligent detection method for traceability is adopted. By obtaining the surface-enhanced Raman spectral data and hyperspectral data of agricultural product samples, pre-processing and screening out the Raman characteristic peaks and hyperspectral characteristic bands of pesticide molecules, a pesticide detection model is constructed, and a multi-dimensional database is used for cross-analysis of data to realize the visualization of traceability information.
It has achieved rapid and accurate detection of pesticide residues in agricultural products, improved the efficiency of pesticide detection and traceability, formed an information traceability system for the entire supply chain of agricultural products, and improved the safety monitoring and early warning capabilities of agricultural products.
Smart Images

Figure CN119510387A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of pesticide detection technology, and more specifically, to an intelligent pesticide detection method and detection system for tracing the source. Background Art
[0002] With the continuous improvement of agricultural productivity and the development of agricultural industrialization, the production of agricultural products has become increasingly dependent on exogenous substances such as pesticides, antibiotics and hormones. The problems brought about by large-scale agricultural production have gradually surfaced. In order to ensure the output and quality of agricultural products, pesticides are sprayed during the growth cycle of agricultural products to ensure that agricultural products are protected from pests during the growth process and to increase yields. However, the spraying of pesticides will cause pesticide residues in the roots, stems, leaves and fruits of agricultural products. When the pesticide residue exceeds the standard, it will endanger human health after consumption. Therefore, it is necessary to test the pesticide residue in agricultural products.
[0003] Traditional pesticide residue detection methods are mainly based on analytical instruments, but the extraction, purification, and detection process of agricultural product samples results in a long detection cycle, making it impossible to achieve rapid on-site detection. In order to achieve detection in each link, a large number of detection equipment must be used. Therefore, it is difficult to ensure that the pesticides applied to agricultural products do not exceed the prescribed standards in each link. Even if a large number of detection equipment can be used in each link for pesticide residue detection, since each link is independent, it cannot be guaranteed that the pesticide residue data detected in the vegetable production process and sales outlets will not be tampered with, thus reducing the credibility and effectiveness of the traceability system. Therefore, how to achieve rapid detection of pesticide residues in agricultural products and solve the current problems of uncertainty in the flow of pesticide residue hazards, difficulty in traceability, and inaccurate information query are the key points that need to be paid attention to. Summary of the invention
[0004] In order to solve the above technical problems, the present invention proposes an intelligent pesticide detection method and detection system for traceability, with the aim of realizing rapid and accurate detection of pesticide residues in agricultural products, and performing multi-dimensional cross-analysis on pesticide residue detection data, so as to realize visualization of traceability information and emergency traceability processing of pesticide residue detection.
[0005] The first aspect of the present invention provides a method for intelligent detection of pesticides for tracing, comprising:
[0006] Acquire surface enhanced Raman spectral data and hyperspectral data of agricultural product samples containing pesticides, pre-process the two types of spectral data collected, and obtain Raman characteristic peaks and hyperspectral characteristic bands of pesticide molecules;
[0007] Based on the Raman characteristic peaks and hyperspectral characteristic bands of pesticide molecules, spectral characteristic variables are screened in the two spectral data after preprocessing, and the best spectral characteristic combination is selected from the screened spectral characteristic variables;
[0008] Using the optimal spectral feature combination to obtain training samples, constructing a pesticide detection model and using the training samples for training, and using the trained pesticide detection model to detect and identify the types of pesticide residues in agricultural products;
[0009] Agricultural product residue detection data is obtained based on agricultural product representation information, agricultural product geographic information and pesticide residue type information, a multidimensional database is constructed through cloud services, and the agricultural product residue detection data is cross-analyzed using the multidimensional database to achieve visualization of traceability information.
[0010] In this scheme, the two types of spectral data collected are preprocessed, and the characteristic peaks and characteristic wavelengths of the pesticide molecules are obtained, specifically:
[0011] Perform big data retrieval based on the category information of agricultural product samples to obtain the types of pesticides involved in the production process of agricultural products, and select a preset number of pesticide types as common pesticide types based on the frequency of occurrence of different pesticide types;
[0012] Agricultural product samples containing pesticides are set according to the common pesticide types, surface enhanced Raman spectroscopy data and hyperspectral data of the agricultural product samples are collected respectively, and the surface enhanced Raman spectra are cleaned, smoothed and denoised, baseline corrected, spectrum frequency shift range intercepted and normalized to obtain surface enhanced Raman spectroscopy curves of various types of agricultural product samples at different concentrations after pretreatment;
[0013] The hyperspectral data are preprocessed by using SG smoothing, standard normal variable transformation and multivariate scattering correction methods to obtain hyperspectral curves of various types of agricultural products after preprocessing;
[0014] By acquiring surface-enhanced Raman spectra and hyperspectral analysis of various types of pesticide standard solutions, the Raman characteristic peaks and attributions of different types of pesticides and hyperspectral sensitive bands are analyzed, and the acquired Raman characteristic peaks and hyperspectral sensitive bands are used to mark them in the processed surface-enhanced Raman spectrum curves and hyperspectral curves.
[0015] In this scheme, spectral feature variables are screened in the two pre-processed spectral data based on the Raman characteristic peaks and hyperspectral characteristic bands of pesticide molecules, specifically:
[0016] Obtain the labeling results of the Raman characteristic peaks and hyperspectral characteristic bands of the pesticide molecules in the processed surface-enhanced Raman spectral curve and the hyperspectral curve, and use the competitive adaptive reweighted sampling method to screen the spectral characteristic variables in the pre-processed surface-enhanced Raman spectral curve and the hyperspectral curve;
[0017] Compare the screened spectral feature variables with the labeling results to determine whether there is a corresponding relationship. If there is no corresponding relationship, remove the spectral feature variable to construct a spectral feature variable set;
[0018] The correlation coefficients between the spectral feature variables of the same category are obtained in the spectral feature variable set, and the spectral feature variables are de-redundanted by using the correlation coefficients to obtain a simplified spectral feature variable set.
[0019] In this scheme, the best spectral feature combination is selected from the spectral feature variables obtained by screening, specifically:
[0020] The improved cuckoo algorithm is used to evaluate the spectral feature combination in the spectral feature variable set, the initial spectral feature combination is randomly generated, the maximum information coefficient between different spectral feature variables and pesticide identification and classification is calculated, and the maximum information coefficient in the initial spectral feature combination and the contribution index characterizing the spectral feature combination are used;
[0021] The mRMR algorithm was expanded using the Pearson correlation coefficient to calculate correlation data. The spectral feature combination was selected based on the principle that the correlation between the spectral feature variables and the pesticide identification and classification was the largest and the correlation between the spectral feature variables was the smallest. The correlation index of the spectral feature combination was characterized based on the correlation data.
[0022] Based on the LDA-SVM assumed recognition prediction model, the spectral feature variable set is randomly divided into several initial spectral feature combinations, and the classification accuracy mean of the recognition prediction model is trained and verified in turn using the cross-validation method, and the classification accuracy mean is used as the importance indicator;
[0023] Based on the contribution index, relevance index and importance index, the improved cuckoo algorithm is used for multi-objective optimization to evaluate the spectral feature combination and generate the best spectral feature combination.
[0024] In this scheme, based on the contribution index, relevance index and importance index, the improved cuckoo algorithm is used for multi-objective optimization to evaluate the spectral feature combination and generate the best spectral feature combination, specifically:
[0025] Based on the contribution index, relevance index and importance index as the optimization selection target, each target is weighted and the objective function of spectral feature combination is constructed.
[0026] Based on the cuckoo search algorithm, multi-objective optimization is performed, the spectral feature variable set is feature encoded, the initial feature combination is randomly generated to initialize the population, the objective function score of the spectral feature combination is calculated, the current optimal bird's nest is retained according to the objective function score, and the population is randomly divided into two sub-groups;
[0027] A step size factor that changes adaptively with the number of iterations is introduced, and the step size factor is used to improve the standard Levy flight. The standard Levy flight and the improved Levy flight are used to update the two subgroups respectively, and the updated subgroup bird nest positions are obtained. The objective function scores are decoded to update the global optimal bird nest.
[0028] The preferred random walk is adopted to eliminate the bird nests whose objective function scores do not meet the preset requirements, generate the same number of new bird nests, update the subgroup optimal bird nest information and update the global optimal bird nest. After reaching the maximum number of iterations, the global optimal solution is output to obtain the best spectral feature combination.
[0029] In this solution, a pesticide detection model is constructed and trained using training samples. The trained pesticide detection model is used to detect and identify the types of pesticide residues in agricultural products. Specifically:
[0030] A pesticide detection model is constructed based on the AlexNet network, index parameters are extracted from agricultural product samples according to the optimal spectral feature combination, training samples and test samples are divided using the index parameters, and the training samples are imported into the AlexNet network for feature extraction;
[0031] Five convolutional layers are used to perform feature convolution calculations using convolution kernels of different sizes. The results of the convolution operation are calculated using activation functions, and the feature dimensions are further reduced by downsampling through the pooling layer.
[0032] The features output by the pooling layer are imported into the fully connected layer. The softmax classifier is used in the three fully connected layers to obtain the probability distribution of different pesticide type labels corresponding to the training samples. After the forward propagation training is completed, the network parameters are updated based on the forward propagation loss through back propagation, and the network classification effect is verified.
[0033] The network is tested using the test samples. If the classification performance of the network meets the preset requirements, the pesticide detection model is output, and the surface enhanced Raman spectral data and hyperspectral data of the target agricultural product are obtained as input to the pesticide detection model to identify the types of pesticide residues in the target agricultural product.
[0034] In this solution, a multidimensional database is constructed through cloud services, and the agricultural product residue detection data is cross-analyzed using the multidimensional database to realize the visualization of traceability information, specifically:
[0035] Construct a multidimensional database based on the pesticide residue detection database, pesticide MRL knowledge base, crop pest knowledge base, crop geographic location database and agricultural product pesticide information as data sources in combination with cloud services, and store the multidimensional database in the cloud platform;
[0036] Classify pesticides by properties according to the type information of target agricultural products, unify the names in the multidimensional database, search the MRL standards in the multidimensional database based on the unified type names, and classify them based on the agricultural product supply chain according to the MRL standards;
[0037] Pesticide residue warning is carried out according to the classified MRL standard, and each sample is geographically located according to the pesticide residue warning, and the detailed geographical location and warning information are visualized for traceability information.
[0038] The second aspect of the present invention provides a pesticide intelligent detection system for tracing, comprising a spectrum acquisition unit, a spectrum feature screening unit, a pesticide detection unit, a multidimensional database unit and a pesticide tracing unit;
[0039] The spectrum acquisition unit is responsible for collecting surface enhanced Raman spectrum data and hyperspectral data of the target agricultural product, and preprocessing the collected two types of spectrum data;
[0040] The spectral feature screening unit is responsible for screening spectral feature variables in two spectral data corresponding to the agricultural product samples containing pesticides, and selecting the best spectral feature combination from the screened spectral feature variables;
[0041] The pesticide detection unit is responsible for constructing a pesticide detection model and performing model training, and using the trained pesticide detection model to detect and identify the types of pesticide residues in agricultural products;
[0042] The multidimensional database unit is responsible for constructing a multidimensional database based on agricultural product representation information, agricultural product geographic information and pesticide residue type information through cloud services;
[0043] The pesticide traceability unit uses a multidimensional database to perform cross-analysis on agricultural product residue detection data to achieve visualization of traceability information.
[0044] Compared with the prior art, the present invention has the following beneficial effects:
[0045] The present invention can quickly and accurately detect pesticide residues in agricultural products, and conduct multi-dimensional cross-analysis on pesticide residue detection data, realize the visualization of traceability information of pesticide residue detection, and improve the efficiency of pesticide detection and traceability;
[0046] Connecting the agricultural product supply chain through the cloud platform will form an information traceability system for the entire agricultural product supply chain, effectively improving the safety monitoring and early warning of agricultural products. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments or exemplary embodiments of the present invention, the drawings required for use in the embodiments or exemplary descriptions will be 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 according to the drawings without paying creative work.
[0048] Figure 1 A flow chart of a smart pesticide detection method for tracing the source is shown;
[0049] Figure 2 A flow chart of selecting the best spectral feature combination according to an embodiment is shown;
[0050] Figure 3 A flowchart of an embodiment of building a pesticide detection model to identify types of pesticide residues is shown;
[0051] Figure 4 A block diagram of an intelligent pesticide detection system for traceability is shown. DETAILED DESCRIPTION
[0052] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0053] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0054] Figure 1 A flow chart of a smart pesticide detection method for source tracing is shown.
[0055] like Figure 1 As shown, this embodiment provides a smart pesticide detection method for tracing the source, including:
[0056] S102, acquiring surface enhanced Raman spectral data and hyperspectral data of agricultural product samples containing pesticides, preprocessing the two types of spectral data collected, and acquiring Raman characteristic peaks and hyperspectral characteristic bands of pesticide molecules;
[0057] S104, screening spectral feature variables in the two pre-processed spectral data based on the Raman characteristic peaks and hyperspectral characteristic bands of the pesticide molecules, and selecting the best spectral feature combination from the screened spectral feature variables;
[0058] S106, using the optimal spectral feature combination to obtain training samples, constructing a pesticide detection model and using the training samples for training, and using the trained pesticide detection model to detect and identify the types of pesticide residues in agricultural products;
[0059] S108, obtaining agricultural product residue detection data based on agricultural product representation information, agricultural product geographic information and pesticide residue type information, building a multidimensional database through cloud services, and using the multidimensional database to cross-analyze the agricultural product residue detection data to achieve visualization of traceability information.
[0060] It should be noted that big data retrieval is performed based on the category information of agricultural product samples to obtain the types of pesticides involved in the planting and production process of agricultural products, and a preset number of pesticide types are selected as common pesticide types based on the frequency of occurrence of different types of pesticides, such as fenpropimorph, carbendazim and boscalid. Agricultural product samples containing pesticides are set up according to the common pesticide types, and surface enhanced Raman spectral data and hyperspectral data of agricultural product samples are collected by laser Raman spectrometer and hyperspectral imaging system respectively. The surface enhanced Raman spectrum is subjected to data cleaning, smoothing and denoising, baseline correction, spectral frequency shift range interception and normalization processing, such as using SG smoothing method, second-order derivative method, airPLS method, etc., to obtain surface enhanced Raman spectral curves of various types of agricultural product samples at different concentrations after pretreatment; the hyperspectral data are pretreated by using SG smoothing, standard normal variable transformation and multivariate scattering correction method to obtain hyperspectral curves of various types of agricultural products after pretreatment; the surface enhanced Raman spectra and hyperspectral analysis of various types of pesticide standard solutions are performed to determine the Raman characteristic peaks and attributions of different types of pesticides and the hyperspectral sensitive bands. For example, the characteristic peak of boscalid is mainly located at 718cm -1 、767cm -1 、1006cm -1 、1110cm -1 、1237cm -1 、1292cm -1 、1487cm -1 The acquired Raman characteristic peaks and hyperspectral sensitive bands are used to mark the processed surface enhanced Raman spectral curves and hyperspectral curves.
[0061] It should be noted that the Raman characteristic peaks and hyperspectral characteristic bands of pesticide molecules are obtained in the processed surface enhanced Raman spectral curve and hyperspectral curve. The competitive adaptive reweighted sampling method is used to screen the spectral characteristic variables in the pre-processed surface enhanced Raman spectral curve and hyperspectral curve. The competitive adaptive reweighted sampling method helps to eliminate useless information variables in the spectrum and compress the collinear variables in the spectral data. The screened spectral characteristic variables are compared with the marking results to determine whether there is a corresponding relationship. If there is no corresponding relationship, the spectral characteristic variable is eliminated to construct a spectral characteristic variable set; the correlation coefficient between the spectral characteristic variables of the same category is obtained in the spectral characteristic variable set, and the spectral characteristic variables are de-redundanted using the correlation coefficient to obtain a simplified spectral characteristic variable set.
[0062] Figure 2 A flow chart of selecting the best spectral feature combination according to an embodiment is shown;
[0063] According to an embodiment of the present invention, the best spectral feature combination is selected from the spectral feature variables obtained by screening, specifically:
[0064] S202, using an improved cuckoo algorithm to evaluate spectral feature combinations in a set of spectral feature variables, randomly generating initial spectral feature combinations, calculating maximum information coefficients between different spectral feature variables and pesticide identification and classification, and using the maximum information coefficient in the initial spectral feature combination and a contribution index characterizing the spectral feature combination;
[0065] S204, using the Pearson correlation coefficient to expand the mRMR algorithm, calculate the correlation data, select the spectral feature combination based on the principle that the correlation between the spectral feature variable and the pesticide identification and classification is the largest and the correlation between the spectral feature variables is the smallest, and characterize the correlation index of the spectral feature combination according to the correlation data;
[0066] S206, based on the LDA-SVM assumed recognition prediction model, the spectral feature variable set is randomly divided into a number of initial spectral feature combinations, and the classification accuracy mean of the recognition prediction model is trained and verified in turn using a cross-validation method, and the classification accuracy mean is used as the importance indicator;
[0067] S208, using an improved cuckoo algorithm to perform multi-objective optimization based on the contribution index, the relevance index, and the importance index, the spectral feature combination is evaluated to generate the best spectral feature combination.
[0068] It should be noted that the maximum information coefficient is a data analysis based on mutual information. The higher the similarity of two random variables, the greater the mutual information. Divide the values of the random variables (X, Y) into a and b grids in sequence, obtain a×b grid grid divisions, and take the frequency of the data points falling in the (x, y)th grid as the joint distribution p(x, y), the frequency of the data points falling in the xth row as the marginal distribution p(x), and the frequency of the data points falling in the yth column as the marginal distribution p(y). Traverse different a×b grid grid divisions and obtain the maximum value of the mutual information as the maximum information coefficient. The calculation formula of the maximum information coefficient is:
[0069]
[0070] Where MIC(X;Y) is the maximum information coefficient of the random variable (X,Y), a and b are the number of grid grid divisions, B is the upper limit of the number of grid networks, and I(X;Y) is the mutual information of the random variable (X,Y).
[0071] The mRMR algorithm was expanded using the Pearson correlation coefficient to calculate the correlation data between spectral feature variables and pesticide identification and classification; the expression of the mRMR algorithm after the Pearson correlation coefficient expansion is: R(x i ; f) represents the spectral characteristic variable x i Pearson correlation coefficient between pesticide identification classification f, R(x i ;x j ) represents the spectral feature variable x in the spectral feature combination i With the spectral characteristic variable x j Pearson correlation coefficient between them, S represents the selected spectral feature variables, |S| represents the number of selected spectral feature variables, Ω s represents a candidate spectral feature variable in a spectral feature variable set;
[0072] The mean square error of the 10-fold cross-validation method under the spectral feature variable was obtained, and the data was randomly divided into 10 equal parts. Each time, the prediction model was identified based on 9 parts of the data according to the LDA-SVM hypothesis, and the remaining data was predicted. This was repeated 10 times until all samples were predicted. The calculation formula for the mean square error was: y i is the true value of the i-th spectral characteristic variable, is the predicted value of the i-th spectral feature variable, and n is the total number of spectral feature variables in the spectral feature combination.
[0073] Based on the contribution index, relevance index and importance index as the optimization selection target, each target is weighted, the objective function of the spectral feature combination is constructed, multi-objective optimization is performed based on the cuckoo search algorithm, the spectral feature variable set is feature encoded, the initial feature combination is randomly generated to initialize the population, the objective function score of the spectral feature combination is calculated, the current optimal bird nest is retained according to the objective function score, and the population is randomly divided into two sub-groups; a step factor that changes adaptively with the number of iterations is introduced, and the step factor is used to improve the standard Levy flight, and the adaptively changing step factor α max is the upper limit of the step factor variation interval, s is the random value of the step factor variation interval, T i is the current iteration number, T max is the total number of iterations. The standard Levy flight and the improved Levy flight are used to update the two subgroups respectively, obtain the updated subgroup bird nest position, decode to obtain the objective function score, and update the global optimal bird nest; the preferred random walk is used to eliminate the bird nests whose objective function scores do not meet the preset requirements, generate the same number of new bird nests, update the subgroup optimal bird nest information and update the global optimal bird nest, and output the global optimal solution after reaching the maximum number of iterations to obtain the best spectral feature combination.
[0074] Figure 3 A flow chart of an embodiment for constructing a pesticide detection model to identify types of pesticide residues is shown.
[0075] According to an embodiment of the present invention, a pesticide detection model is constructed and trained using training samples, and the trained pesticide detection model is used to detect and identify the types of pesticide residues in agricultural products, specifically:
[0076] S302, constructing a pesticide detection model based on the AlexNet network, extracting index parameters from agricultural product samples according to the optimal spectral feature combination, dividing training samples and test samples using the index parameters, and importing the training samples into the AlexNet network for feature extraction;
[0077] S304, using 5 convolution layers to perform feature convolution calculations using convolution kernels of different sizes, using an activation function to calculate the result of the convolution operation, and further using a pooling layer to reduce the feature dimension by downsampling;
[0078] S306, importing the features output by the pooling layer into the fully connected layer, using the softmax classifier in the set 3-layer fully connected layer to obtain the probability distribution of different pesticide type labels corresponding to the training samples, after the forward propagation training is completed, back propagating based on the forward propagation loss to update the network parameters and verify the network classification effect;
[0079] S308, using the test samples to test the network, if the classification performance of the network meets the preset requirements, then outputting the pesticide detection model, obtaining the surface enhanced Raman spectroscopy data and hyperspectral data of the target agricultural product as the input of the pesticide detection model, and identifying the types of pesticide residues in the target agricultural product.
[0080] It should be noted that the AlexNet network has a total of 8 weighted network layers, including 5 convolutional layers and 3 fully connected layers. The convolutional layer extracts the main features of the surface enhanced Raman spectroscopy data and hyperspectral data of the target agricultural products. The result after the convolution operation needs to enter the activation function for calculation, and the ReLU function is used as the activation function. In the pooling layer, downsampling is used to reduce the feature dimension, further extract the features, and reduce the parameters. The fully connected layer with the softmax function as the activation function realizes multi-category classification and outputs the probability distribution of multiple pesticide types.
[0081] It should be noted that a multidimensional database is constructed based on the pesticide residue detection database, pesticide maximum residue limit (MRL) knowledge base, crop pest knowledge base, crop geographic location database and agricultural product pesticide information as data sources combined with cloud services, and the multidimensional database is stored in the cloud platform; pesticides are classified by nature according to the type information of the target agricultural products, and the names are unified in the multidimensional database. The MRL standard is retrieved in the multidimensional database based on the unified type name, and the agricultural product supply chain is classified based on the MRL standard, based on the links of agricultural product planting, transportation, distribution, retail, and consumption. Pesticide residue warning is carried out according to the classified MRL standard, and each sampling geography is located according to the pesticide residue warning, and the detailed geographic location and warning information are traced and visualized. Users can timely, conveniently and objectively understand the entire circulation process of agricultural products from planting to sales, and use the warning information to view and trace all information such as the growing place, fertilization, pesticide application, sales, and logistics of agricultural products with excessive pesticides.
[0082] According to the warning information of the target agricultural product pesticide residue warning, historical warning instances are screened in the cloud multidimensional database, warning data are extracted from the historical warning instances, and the economic and social impacts are analyzed using the warning data. Evaluation indicators are screened by the warning characteristics corresponding to the economic and social impacts, and the weight information of the evaluation indicators is obtained using the analytic hierarchy process. Parameters are extracted from the warning information of the target agricultural product pesticide residue warning using the evaluation indicators, and the degree of influence is evaluated by combining the extracted parameters with the weight information. Similarity screening is performed again in the cloud database based on the evaluation results of the degree of economic and social impacts, and warning processing instances whose similarities meet the preset threshold are obtained. Warning processing measures for pesticide residue warning are determined according to the frequency of use of warning processing measures.
[0083] Figure 4 A block diagram of an intelligent pesticide detection system for traceability is shown.
[0084] This embodiment provides a pesticide intelligent detection system 4 for tracing the source, which includes: a spectrum acquisition unit 401, a spectrum feature screening unit 402, a pesticide detection unit 403, a multidimensional database unit 404 and a pesticide tracing unit 405;
[0085] The spectrum acquisition unit is responsible for collecting surface enhanced Raman spectrum data and hyperspectral data of the target agricultural product, and preprocessing the collected two types of spectrum data;
[0086] The spectral feature screening unit is responsible for screening spectral feature variables in two spectral data corresponding to the agricultural product samples containing pesticides, and selecting the best spectral feature combination from the screened spectral feature variables;
[0087] The pesticide detection unit is responsible for constructing a pesticide detection model and performing model training, and using the trained pesticide detection model to detect and identify the types of pesticide residues in agricultural products;
[0088] The multidimensional database unit is responsible for constructing a multidimensional database based on agricultural product representation information, agricultural product geographic information and pesticide residue type information through cloud services;
[0089] The pesticide traceability unit uses a multidimensional database to perform cross-analysis on agricultural product residue detection data to achieve visualization of traceability information.
[0090] The third aspect of the present invention provides a computer-readable storage medium, which includes a program for an intelligent pesticide detection method for traceability. When the program for an intelligent pesticide detection method for traceability is executed by a processor, the steps of an intelligent pesticide detection method for traceability are implemented.
[0091] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0092] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0093] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0094] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.
[0095] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0096] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A smart pesticide detection method for tracing the source, characterized in that: The following steps are involved: Acquire surface enhanced Raman spectral data and hyperspectral data of agricultural product samples containing pesticides, pre-process the two types of spectral data collected, and obtain Raman characteristic peaks and hyperspectral characteristic bands of pesticide molecules; Based on the Raman characteristic peaks and hyperspectral characteristic bands of pesticide molecules, spectral characteristic variables are screened in the two spectral data after preprocessing, and the best spectral characteristic combination is selected from the screened spectral characteristic variables; Using the optimal spectral feature combination to obtain training samples, constructing a pesticide detection model and using the training samples for training, and using the trained pesticide detection model to detect and identify the types of pesticide residues in agricultural products; Agricultural product residue detection data is obtained based on agricultural product representation information, agricultural product geographic information and pesticide residue type information, a multidimensional database is constructed through cloud services, and the agricultural product residue detection data is cross-analyzed using the multidimensional database to achieve visualization of traceability information.
2. A pesticide intelligent detection method for tracing the source according to claim 1, characterized in that: The two types of spectral data collected are preprocessed to obtain the characteristic peaks and characteristic wavelengths of the pesticide molecules, specifically: Perform big data retrieval based on the category information of agricultural product samples to obtain the types of pesticides involved in the production process of agricultural products, and select a preset number of pesticide types as common pesticide types based on the frequency of occurrence of different pesticide types; Agricultural product samples containing pesticides are set according to the common pesticide types, surface enhanced Raman spectroscopy data and hyperspectral data of the agricultural product samples are collected respectively, and the surface enhanced Raman spectra are cleaned, smoothed and denoised, baseline corrected, spectrum frequency shift range intercepted and normalized to obtain surface enhanced Raman spectroscopy curves of various types of agricultural product samples at different concentrations after pretreatment; The hyperspectral data are preprocessed by using SG smoothing, standard normal variable transformation and multivariate scattering correction methods to obtain hyperspectral curves of various types of agricultural products after preprocessing; By acquiring surface-enhanced Raman spectra and hyperspectral analysis of various types of pesticide standard solutions, the Raman characteristic peaks and attributions of different types of pesticides and hyperspectral sensitive bands are analyzed, and the acquired Raman characteristic peaks and hyperspectral sensitive bands are used to mark them in the processed surface-enhanced Raman spectrum curves and hyperspectral curves.
3. The method for intelligent detection of pesticides for tracing the source according to claim 1, characterized in that: Based on the Raman characteristic peaks and hyperspectral characteristic bands of pesticide molecules, spectral characteristic variables are screened in the two pre-processed spectral data, specifically: Obtain the labeling results of the Raman characteristic peaks and hyperspectral characteristic bands of the pesticide molecules in the processed surface-enhanced Raman spectral curve and the hyperspectral curve, and use the competitive adaptive reweighted sampling method to screen the spectral characteristic variables in the pre-processed surface-enhanced Raman spectral curve and the hyperspectral curve; Compare the screened spectral feature variables with the labeling results to determine whether there is a corresponding relationship. If there is no corresponding relationship, remove the spectral feature variable to construct a spectral feature variable set; The correlation coefficients between the spectral feature variables of the same category are obtained in the spectral feature variable set, and the spectral feature variables are de-redundanted by using the correlation coefficients to obtain a simplified spectral feature variable set.
4. The method for intelligent detection of pesticides for tracing the source according to claim 1, characterized in that: The best spectral feature combination is selected from the screened spectral feature variables, specifically: The improved cuckoo algorithm is used to evaluate the spectral feature combination in the spectral feature variable set, the initial spectral feature combination is randomly generated, the maximum information coefficient between different spectral feature variables and pesticide identification and classification is calculated, and the maximum information coefficient in the initial spectral feature combination and the contribution index characterizing the spectral feature combination are used; The mRMR algorithm was expanded using the Pearson correlation coefficient to calculate correlation data. The spectral feature combination was selected based on the principle that the correlation between the spectral feature variables and the pesticide identification and classification was the largest and the correlation between the spectral feature variables was the smallest. The correlation index of the spectral feature combination was characterized based on the correlation data. Based on the LDA-SVM assumed recognition prediction model, the spectral feature variable set is randomly divided into several initial spectral feature combinations, and the classification accuracy mean of the recognition prediction model is trained and verified in turn using the cross-validation method, and the classification accuracy mean is used as the importance indicator; Based on the contribution index, relevance index and importance index, the improved cuckoo algorithm is used for multi-objective optimization to evaluate the spectral feature combination and generate the best spectral feature combination.
5. A pesticide intelligent detection method for tracing the source according to claim 4, characterized in that: Based on the contribution index, relevance index and importance index, the improved cuckoo algorithm is used for multi-objective optimization to evaluate the spectral feature combination and generate the best spectral feature combination, specifically: Based on the contribution index, relevance index and importance index as the optimization selection target, each target is weighted and the objective function of spectral feature combination is constructed. Based on the cuckoo search algorithm, multi-objective optimization is performed, the spectral feature variable set is feature encoded, the initial feature combination is randomly generated to initialize the population, the objective function score of the spectral feature combination is calculated, the current optimal bird's nest is retained according to the objective function score, and the population is randomly divided into two sub-groups; A step size factor that changes adaptively with the number of iterations is introduced, and the step size factor is used to improve the standard Levy flight. The standard Levy flight and the improved Levy flight are used to update the two subgroups respectively, and the updated subgroup bird nest positions are obtained. The objective function scores are decoded to update the global optimal bird nest. The preferred random walk is adopted to eliminate the bird nests whose objective function scores do not meet the preset requirements, generate the same number of new bird nests, update the subgroup optimal bird nest information and update the global optimal bird nest. After reaching the maximum number of iterations, the global optimal solution is output to obtain the best spectral feature combination.
6. A pesticide intelligent detection method for tracing the source according to claim 1, characterized in that: Build a pesticide detection model and use training samples for training. Use the trained pesticide detection model to detect and identify the types of pesticide residues in agricultural products. Specifically: A pesticide detection model is constructed based on the AlexNet network, index parameters are extracted from agricultural product samples according to the optimal spectral feature combination, training samples and test samples are divided using the index parameters, and the training samples are imported into the AlexNet network for feature extraction; Five convolutional layers are used to perform feature convolution calculations using convolution kernels of different sizes. The results of the convolution operation are calculated using activation functions, and the feature dimensions are further reduced by downsampling through the pooling layer. The features output by the pooling layer are imported into the fully connected layer. The softmax classifier is used in the three fully connected layers to obtain the probability distribution of different pesticide type labels corresponding to the training samples. After the forward propagation training is completed, the network parameters are updated based on the forward propagation loss through back propagation, and the network classification effect is verified. The network is tested using the test samples. If the classification performance of the network meets the preset requirements, the pesticide detection model is output, and the surface enhanced Raman spectral data and hyperspectral data of the target agricultural product are obtained as input to the pesticide detection model to identify the types of pesticide residues in the target agricultural product.
7. The method for intelligent detection of pesticides for tracing the source according to claim 1, characterized in that: A multidimensional database is constructed through cloud services, and the agricultural product residue detection data is cross-analyzed using the multidimensional database to realize the visualization of traceability information, specifically: Construct a multidimensional database based on the pesticide residue detection database, pesticide MRL knowledge base, crop pest knowledge base, crop geographic location database and agricultural product pesticide information as data sources in combination with cloud services, and store the multidimensional database in the cloud platform; Classify pesticides by properties according to the type information of target agricultural products, unify the names in the multidimensional database, search the MRL standards in the multidimensional database based on the unified type names, and classify them based on the agricultural product supply chain according to the MRL standards; Pesticide residue warning is carried out according to the classified MRL standard, and each sample is geographically located according to the pesticide residue warning, and the detailed geographical location and warning information are visualized for traceability information.
8. A smart pesticide detection system for tracing the source, characterized in that: A pesticide intelligent detection method for tracing as described in any one of claims 1 to 7, comprising a spectral acquisition unit, a spectral feature screening unit, a pesticide detection unit, a multidimensional database unit and a pesticide tracing unit; The spectrum acquisition unit is responsible for collecting surface enhanced Raman spectrum data and hyperspectral data of the target agricultural product, and preprocessing the collected two types of spectrum data; The spectral feature screening unit is responsible for screening spectral feature variables in two spectral data corresponding to the agricultural product samples containing pesticides, and selecting the best spectral feature combination from the screened spectral feature variables; The pesticide detection unit is responsible for constructing a pesticide detection model and performing model training, and using the trained pesticide detection model to detect and identify the types of pesticide residues in agricultural products; The multidimensional database unit is responsible for constructing a multidimensional database based on agricultural product representation information, agricultural product geographic information and pesticide residue type information through cloud services; The pesticide traceability unit uses a multidimensional database to perform cross-analysis on agricultural product residue detection data to achieve visualization of traceability information.
Citation Information
Cited By
Mancozeb residue intelligent detection and analysis method and system
CN119804356A