An intelligent detection method for pesticide residues in vegetables
Through the integration of multi-source heterogeneous data and the application of real-time adjustment of models, the problems of single data and simple model in vegetable pesticide residue detection are solved, and the accurate assessment of vegetable pesticide residue risks and the generation of test reports are achieved, ensuring vegetable quality, safety and consumer health.
Patent Information
- Application Number
- CN202410938409.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-13
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-07-13
AI Technical Summary
In the detection of vegetable pesticide residues, the existing technology has problems such as single data source and simple detection model, resulting in inaccurate, incomplete and lack of real-time adjustments.
By obtaining multi-source heterogeneous data such as vegetable species, growth environment, application records and meteorology, a basic model for pesticide residues is constructed to generate preliminary risk probability, and a real-time adjustment model is constructed based on historical data to obtain the final risk probability. If the final risk probability exceeds the preset threshold, samples are collected for accurate detection and a detection report is generated based on the detection results.
It has achieved an accurate assessment of the risk of pesticide residues in vegetables, ensured the quality and safety of vegetables and consumers' health, and improved the detection efficiency and accuracy.
Smart Images

Figure CN118779829B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of agricultural information technology, and in particular to an intelligent detection method for pesticide residues in vegetables. Background Art
[0002] In the context of vegetable quality and safety testing, the problem of accurate assessment of vegetable pesticide residues is particularly prominent, and the demand for efficient and accurate testing technology is more urgent. Achieving comprehensive and accurate pesticide residue testing and effectively protecting consumer health have become crucial links in the field of vegetable quality and safety. Traditional vegetable pesticide residue testing methods often have many shortcomings. They rely only on a single testing method or local data collection, and do not adequately control the entire process of vegetable production. They lack the integration and analysis of multi-source heterogeneous data, making it difficult to accurately assess the risk of pesticide residues in vegetables. There is a large room for improvement in testing efficiency and accuracy, which may lead to inaccurate or untimely test results. Early warning and prevention and control of pesticide residue risks are relatively weak, and they cannot cope well with the complex and changing vegetable production and market circulation.
[0003] In the current relevant technologies, there are technical problems in the detection of vegetable pesticide residues due to a single data source and a simple detection model, resulting in inaccurate and incomplete detection results and a lack of real-time adjustment. Summary of the invention
[0004] This application provides an intelligent detection method for pesticide residues in vegetables. It obtains multi-source heterogeneous data such as vegetable types, growth environment, pesticide application records and meteorology, and constructs a basic model for pesticide residues to generate a preliminary risk probability for target vegetable samples. A real-time adjustment model is constructed based on historical data to obtain the adjustment factor, and the final risk probability is obtained after application. If the final risk probability exceeds the preset threshold, samples are collected for precise testing, and a test report is generated by combining the precise test results and the final risk probability, thereby achieving the technical effect of ensuring vegetable quality safety and consumer health.
[0005] The present application provides an intelligent detection method for vegetable pesticide residues, comprising:
[0006] Acquire multi-source heterogeneous data, wherein the multi-source heterogeneous data includes vegetable variety data, growth environment data, pesticide application record data and meteorological data; construct a basic model for pesticide residues based on the multi-source heterogeneous data, and generate a preliminary pesticide residue risk probability for a target vegetable sample based on the basic model for pesticide residues; construct a real-time adjustment model based on historical pesticide residue risk probability data and corresponding precise detection results of pesticide residues; input the preliminary pesticide residue risk probability of the target vegetable sample into the real-time adjustment model to obtain an adjustment factor for the preliminary pesticide residue risk probability; apply the adjustment factor to the preliminary pesticide residue risk probability to obtain a final pesticide residue risk probability for the target vegetable sample; determine whether the final pesticide residue risk probability exceeds a preset threshold, and if so, collect the target vegetable sample, and perform precise detection of pesticide residues on the collected target vegetable sample to obtain a precise detection result; combine the precise detection result of the pesticide residue with the final pesticide residue risk probability to generate a pesticide residue detection report for the target vegetable sample.
[0007] The intelligent detection method for pesticide residues in vegetables proposed in this application first obtains multi-source heterogeneous data such as vegetable types, growth environment, pesticide application records and meteorology, and constructs a basic model for pesticide residues to generate a preliminary risk probability for target vegetable samples. A real-time adjustment model is constructed based on historical data to obtain the adjustment factor, and the final risk probability is obtained after application. If the final risk probability exceeds the preset threshold, samples are collected for precise testing, and a test report is generated by combining the precise test results and the final risk probability, thereby achieving the technical effect of ensuring the quality and safety of vegetables and the health of consumers. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the technical solution of the embodiment of the present invention, the accompanying drawings of the embodiment of the present invention will be briefly introduced below. A flow chart is used in the present application to illustrate the operations performed by the system according to the embodiment of the present application. It should be understood that the preceding or following operations are not necessarily performed accurately in order. On the contrary, various steps S may be processed in reverse order or simultaneously as needed. At the same time, other operations may also be added to these processes, or one or more operations may be removed from these processes.
[0009] Figure 1 A schematic flow chart of an intelligent detection method for pesticide residues in vegetables provided in an embodiment of the present application. DETAILED DESCRIPTION
[0010] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below.
[0011] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0012] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict, and the terms "first\second" involved are merely to distinguish similar objects and do not represent a specific ordering of objects. The terms "including" and "having" and any variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps S or units is not necessarily limited to those steps S or units that are clearly listed, but may include other steps S or modules that are not clearly listed or inherent to these processes, methods, products, or devices. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field of this application. The terms used herein are for the purpose of describing the embodiments of the present application only.
[0013] The present application embodiment provides an intelligent detection method for pesticide residues in vegetables, such as Figure 1 As shown, the method includes:
[0014] Step S100, obtaining multi-source heterogeneous data, the multi-source heterogeneous data includes vegetable type data, growth environment data, pesticide application record data and meteorological data. Specifically, the multi-source heterogeneous data refers to the data on vegetable type related information, vegetable growth environment conditions, specific conditions of pesticide application and meteorological conditions recorded in the process of vegetable planting and management. Select the vegetable sample to be tested, prepare the data acquisition equipment, set the scope and accuracy of data acquisition, such as the subdivision of vegetable types, the measurement accuracy of environmental parameters, the detail of pesticide application records, the frequency of meteorological data acquisition, etc., perform data acquisition operations, obtain vegetable type data records, the vegetable type data represents the specific variety classification of vegetables, and its characteristic is to clarify the basic attributes of vegetables. Continue to perform data acquisition operations to obtain growth environment data records, the growth environment data represents the soil, temperature, light and other conditions in which vegetables grow, and its characteristic is to reflect the external environmental factors of vegetable growth. Further perform data acquisition operations to obtain pesticide application record data, the pesticide application record data represents the time, type, amount and method of pesticide use in the process of vegetable planting, and its characteristic is to show the details of pesticide use. Finally, the data collection operation is performed to obtain meteorological data records. Meteorological data represents the average daily temperature, precipitation, wind speed, and sunshine duration related to vegetable growth. Its characteristics are to show the impact of external meteorological conditions on vegetable growth. The time alignment and data cleaning operations during the entire data collection process are recorded.
[0015] In a possible implementation, multi-source heterogeneous data is obtained, and the multi-source heterogeneous data includes vegetable type data, growth environment data, pesticide application record data and meteorological data. Step S100 further includes step S110, collecting the vegetable type data and growth environment data in real time from the agricultural Internet of Things system, wherein the growth environment data includes soil moisture, pH value, temperature and light intensity. Specifically, the vegetable type data and growth environment data are collected in real time through the agricultural Internet of Things system. Various sensors in the agricultural Internet of Things system can accurately monitor and collect relevant information. For the collection of vegetable type data, specific vegetable varieties can be identified, providing a basis for subsequent analysis of their characteristics and potential impact on pesticide residues. The soil moisture in the growth environment data is directly related to the vegetable root system's uptake of water and nutrients, affecting its growth and metabolism, and may be related to the pesticide residue situation. The soil pH value will change the activity of chemical substances in the soil, including the stability and decomposition rate of pesticides. The temperature and light intensity will affect the growth rate, physiological metabolism and photosynthesis of vegetables, thereby indirectly affecting the degree of pesticide residues.
[0016] Step S120, extracting the pesticide application record data from the agricultural management system, the pesticide application record data including the time of application, type of pesticide, dosage and application method. Specifically, the pesticide application record data is extracted from the agricultural management system, which records the application of pesticides in detail during the vegetable planting process. The time of application determines the residual period of pesticides on vegetables. The degradation and residual conditions of pesticides may be very different when applied at different times. The difference in pesticide types means the difference in their toxicity, residual characteristics and degradation rate. The amount of application directly affects the level of residual. The application methods such as spraying and root irrigation will result in different distribution and residual conditions of pesticides on vegetables.
[0017] Step S130, obtaining the meteorological data from the meteorological monitoring station, the meteorological data including the average daily temperature, precipitation, wind speed and duration of light. Specifically, the meteorological data is obtained from the meteorological monitoring station, the average daily temperature in the meteorological data has a significant impact on the degradation rate of pesticides, high temperature usually accelerates the degradation of pesticides, low temperature may slow it down, precipitation can wash away the pesticides on the surface of vegetables, and affect the migration and penetration of pesticides in the soil, wind speed may change the diffusion range of pesticides in the air and the degree of attachment on the surface of vegetables, and the duration of light indirectly affects the pesticide residues by affecting the photosynthesis and physiological activities of vegetables.
[0018] Step S140, time-align and clean the vegetable variety data, growth environment data, pesticide application record data and meteorological data to form a structured multi-source heterogeneous data set. Specifically, the collected and extracted vegetable variety data, growth environment data, pesticide application record data and meteorological data are time-aligned and cleaned. Time alignment is to ensure that data from different sources are consistent in the time dimension and can be effectively associated and compared. Data cleaning is to remove duplicate, erroneous, missing or abnormal data to improve the quality and accuracy of the data, provide a reliable structured multi-source heterogeneous data set for subsequent modeling and analysis, and provide a solid data foundation for accurately assessing the risk of pesticide residues in vegetables, thereby ensuring the quality and safety of vegetables and the health of consumers.
[0019] Step S200, construct a basic model of pesticide residues based on the multi-source heterogeneous data, and generate a preliminary pesticide residue risk probability for the target vegetable sample based on the basic model of pesticide residues. Specifically, when constructing the basic model of pesticide residues and generating the preliminary pesticide residue risk probability for the target vegetable sample, the multi-source heterogeneous data is preprocessed, including data cleaning to remove possible noise, errors or missing values to ensure the quality and reliability of the data, perform data normalization operations to unify data of different dimensions and ranges to the same scale to facilitate subsequent processing and analysis, and construct a multimodal feature extraction network. The first feature extraction module for vegetable type data focuses on analyzing the inherent characteristics of different vegetable varieties, such as metabolic characteristics, tissue structure, etc., and their potential relationship with pesticide residues. The second feature extraction module for processing growth environment data studies factors such as soil moisture, pH value, temperature, and light intensity. The third feature extraction module will focus on the direct effects of application time, pesticide type, dosage and application method on pesticide residues when processing the application record data. The fourth feature extraction module will explore how daily average temperature, precipitation, wind speed and light duration affect pesticide residues indirectly when processing meteorological data. The features extracted by each module are fused. The fused features contain key information from different data sources and can more comprehensively reflect the factors related to pesticide residues. The fused features are input into the prediction network. The prediction network outputs the preliminary pesticide residue risk probability by learning and analyzing these fused features and using complex algorithms and model structures. This probability value is based on a comprehensive evaluation of multi-source heterogeneous data, representing a preliminary estimate of the pesticide residue risk that may exist in the target vegetable sample under the current data. Through the careful processing, feature extraction and fusion of multi-source heterogeneous data, and the intelligent analysis of the prediction network, a basic model of pesticide residues is constructed, and the preliminary pesticide residue risk probability of the target vegetable sample is generated, which provides an important basis for further analysis and decision-making.
[0020] In a possible implementation, a basic model of pesticide residues is constructed based on the multi-source heterogeneous data, and a preliminary pesticide residue risk probability of the target vegetable sample is generated based on the basic model of pesticide residues. Step S200 further includes step S210, preprocessing the multi-source heterogeneous data, including data cleaning and normalization. Specifically, the multi-source heterogeneous data is preprocessed, and the data cleaning step is to eliminate noise, errors and missing values in the data. Through careful inspection and screening, the accuracy and completeness of the data are ensured to provide a reliable basis for subsequent processing. The normalization operation unifies the data of different dimensions and value ranges into a standard interval, eliminating the impact that may be caused by differences in data scales, so that different types of data are comparable in subsequent analysis.
[0021] Step S220, construct a multimodal feature extraction network, the multimodal feature extraction network includes a first feature extraction module for processing vegetable type data, a second feature extraction module for processing growth environment data, a third feature extraction module for processing pesticide application record data, and a fourth feature extraction module for processing meteorological data. Specifically, a multimodal feature extraction network is constructed, the first feature extraction module for processing vegetable type data, deeply explores the intrinsic characteristics of different vegetable types, such as the potential relationship between variety characteristics, physiological structure, etc. and pesticide residues, the second feature extraction module focuses on the growth environment data, and carefully analyzes how environmental factors such as soil moisture, pH value, temperature and light intensity affect the growth of vegetables and the response to pesticides, the third feature extraction module targets the pesticide application record data, and comprehensively sorts out the direct mechanism of pesticide residues such as the time of application, the type of pesticide, the dosage and the application method, and the fourth feature extraction module targets the meteorological data, and explores the influence of meteorological conditions such as the average daily temperature, precipitation, wind speed and light duration on the pesticide residues of vegetables through indirect channels.
[0022] Step S230, the features output by the multimodal feature extraction network are fused to obtain fused features. Specifically, the features output by the multimodal feature extraction network from different modules are fused, and the fusion process brings together the scattered clues into an overall picture, comprehensively considering various factors such as vegetable types, growth environment, pesticide application conditions and meteorological conditions, to form a fused feature that can fully reflect information related to pesticide residues.
[0023] Step S240, the fusion feature is input into the prediction network, and the prediction network outputs a preliminary pesticide residue risk probability. Specifically, the fusion feature is input into the prediction network, and the prediction network is like an intelligent evaluator. Based on the input fusion feature, the prediction network uses complex mathematical models and algorithms to output a preliminary pesticide residue risk probability. The probability value is a preliminary estimate of the pesticide residue risk of the target vegetable sample.
[0024] Step S250, using a loss function to jointly optimize the multimodal feature extraction network and the prediction network to obtain a basic model of pesticide residues. Specifically, a loss function is used to jointly optimize the multimodal feature extraction network and the prediction network. The loss function is used to measure the gap between the model prediction results and the actual situation. By continuously adjusting the parameters of the network, the prediction results of the model are closer and closer to the actual situation, thereby obtaining a basic model of pesticide residues that can accurately assess the risk of pesticide residues, realizing the construction of a basic model of pesticide residues from multi-source heterogeneous data, and providing a powerful tool for accurately assessing the risk of vegetable pesticide residues.
[0025] In one possible implementation, a basic model of pesticide residues is constructed based on the multi-source heterogeneous data, and a preliminary pesticide residue risk probability of the target vegetable sample is generated based on the basic model of pesticide residues. Step S200 further includes step S260, obtaining multi-source heterogeneous data of the target vegetable sample, including type data, growth environment data, pesticide application record data and meteorological data of the target vegetable sample. Specifically, multi-source heterogeneous data of the target vegetable samples are obtained, and various types of information related to the samples are collected. For species data, the vegetable variety to which it belongs is clarified, and its inherent biological characteristics and potential reaction characteristics to pesticides are understood. In terms of growth environment data, factors such as soil moisture, pH value, temperature and light intensity are covered. These environmental conditions play a key role in the growth process of vegetables and will also affect the pesticide residue situation. The pesticide application record data records in detail the application time, type of pesticide used, dosage and application method for the sample, which is directly related to the possibility and degree of pesticide residue on vegetables. Meteorological data include average daily temperature, precipitation, wind speed and light duration. These external meteorological factors affect the growth of vegetables and pesticide residues through indirect channels.
[0026] Step S270, input the multi-source heterogeneous data of the target vegetable sample into the trained pesticide residue basic model, and the pesticide residue basic model obtains a preliminary probability value representing the risk level of pesticide residue in the target vegetable sample based on the input multi-source heterogeneous data. Specifically, the multi-source heterogeneous data is obtained, including the vegetable type data, which may use specific codes to represent different varieties; in the growth environment data, the soil moisture may be presented as a percentage value, the pH value is a specific number, the temperature is in degrees Celsius, and the light intensity is measured in lux; in the pesticide application record data, the application time is accurate to the specific date and time, the pesticide type is identified by a code, the dosage is in grams or milliliters, and the application method also has a corresponding classification code; in terms of meteorological data, the average daily temperature is also recorded in degrees Celsius, the precipitation is measured in millimeters, the wind speed is calculated in meters per second, and the light duration is in hours. The model has a classification code for each type. Different weights are assigned to the data. The model will multiply each type of data by its respective weight and add up the results. The basic pesticide residue model will eventually produce a numerical value, which is converted into a value between 0 and 1 through a specific probability conversion function, thereby obtaining a preliminary probability value that can represent the degree of pesticide residue risk of the target vegetable sample. The probability value is not generated arbitrarily, but is based on the model's learning and understanding of a large amount of historical data, as well as in-depth analysis and precise inference of multi-source heterogeneous data of the currently input target vegetable samples. It is a preliminary but highly valuable quantitative estimate of the pesticide residue risk of the target vegetable samples.
[0027] Step S280, the preliminary probability value output by the pesticide residue basic model is used as the preliminary pesticide residue risk probability of the target vegetable sample. Specifically, a pesticide residue basic model is established. The establishment of the model is based on the collection and analysis of pesticide residue data of a large number of vegetable samples. The data covers various vegetable varieties, different planting environments, types and dosages of pesticides used, and post-harvest processing methods. The data is processed and mined through statistical analysis to determine the key factors affecting the pesticide residue risk probability and establish the relationship between them. When the target vegetable sample is to be detected, various characteristic data related to the sample are first obtained, including the variety characteristics of the vegetable, the soil and climatic conditions of the planting site, and the detailed information of the pesticides used. The characteristic data is input into the pesticide residue basic model, and the input data is calculated and analyzed. The model determines the characteristics of the vegetable variety. If it is a variety that is prone to pesticide residue, the weight of the risk assessment is increased accordingly. For vegetables planted in areas with serious soil pollution, the possibility assessment of their residual risk will also be increased, and a preliminary probability value for the target vegetable sample is output. This probability value is regarded as the preliminary pesticide residue risk probability of the sample.
[0028] Step S300, construct a real-time adjustment model based on historical pesticide residue risk probability data and corresponding pesticide residue precise detection results. Specifically, collect historical data, including pesticide residue risk probability data in different time periods, different vegetable varieties, and different planting environments, and the corresponding precise pesticide residue detection results, organize and classify the collected historical data, and divide them according to factors such as vegetable types, planting areas, and seasons, so as to more clearly analyze the relationship between the data, use statistical methods to calculate indicators such as correlation coefficients, means, and variances, find out the potential associations and laws between pesticide residue risk probability and pesticide residues, and build a model based on the analyzed associations and laws. Due to the complex data relationship and the large number of features, use random forests to determine parameters such as the number of trees in the forest and the maximum depth of each tree. Divide the organized data into training sets, validation sets, and test sets, and use the training set data to train the model. By continuously adjusting the parameters of the model, the model can learn the inherent laws between pesticide residues and risk probability. During the training process, the validation set data is used to test the model. The performance is evaluated in real time. Evaluation indicators (such as mean square error, accuracy, recall rate, etc.) are used to determine whether the model is overfitting or underfitting, and the complexity of the model, regularization parameters, etc. are adjusted accordingly to optimize the performance of the model. The optimized model is evaluated using independent test set data, and the model prediction results are compared with the actual pesticide residue risk probability. The specific values of various evaluation indicators are calculated. If the performance of the model does not meet the expected accuracy requirements, the data processing and model architecture are reviewed. Different feature combinations may need to be tried and model hyperparameters may need to be adjusted. After multiple iterations and optimizations, a model that can accurately reflect the relationship between pesticide residue risk probability and pesticide residue amount and can adjust the prediction results in real time according to new input data is finally obtained. In actual applications, when new pesticide residue detection results are input, the model can quickly adjust the output pesticide residue risk probability in real time according to the previously learned rules and relationships, providing timely and accurate basis for relevant decision-making.
[0029] In a possible implementation, a real-time adjustment model is constructed based on historical pesticide residue risk probability data and corresponding pesticide residue precise detection results, and step S300 further includes step S310, obtaining historical pesticide residue risk probability data of vegetables of the same type as the target vegetable sample, and the pesticide residue precise detection results corresponding to the historical pesticide residue risk probability data. Specifically, the type of the target vegetable sample is determined, and a large amount of historical data of vegetables of the same type as the target vegetable sample is widely searched through channels such as agricultural databases, relevant research reports, and records of agricultural detection agencies. For each historical sample, its pesticide residue risk probability data is obtained, and the data is obtained through the previous evaluation model, detection method or statistical analysis. The corresponding precise pesticide residue detection results are obtained, and the detection results should be accurate values obtained by high-precision chemical analysis methods, such as chromatography, etc. The screened historical data are preprocessed, and the data are standardized and normalized to make the data from different sources and units comparable, and the historical pesticide residue risk probability data and the corresponding pesticide residue precise detection results are accurately matched and associated.
[0030] Step S320, taking the historical pesticide residue risk probability data as input, taking the deviation between the historical pesticide residue risk probability data and the corresponding pesticide residue precise detection result as output, and training the neural network model. Specifically, constructing the neural network model, selecting a feedforward neural network with multiple hidden layers, determining the number of model input layer nodes, which should match the characteristic dimension of the historical pesticide residue risk probability data, setting the number of output layer nodes to reflect the deviation between the historical pesticide residue risk probability data and the corresponding pesticide residue precise detection result, taking the historical pesticide residue risk probability data as input, taking the deviation between the two as the expected output, and using the training data to train the neural network. During training, using stochastic gradient descent, constantly adjusting the weights and biases of the model to minimize the error between the predicted deviation and the actual deviation, after completing the training, using the validation set data to evaluate the neural network model, and measuring the performance of the model by calculating evaluation indicators such as mean square error, mean absolute error, and determination coefficient. If the model performance does not meet expectations, the model is adjusted by increasing or decreasing the number of hidden layer nodes, adjusting the learning rate, applying regularization technology, etc., and retraining and evaluating after adjustment.
[0031] Step S330, the trained neural network model is used as the real-time adjustment model to quantify the degree of deviation of the pesticide residue risk probability. Specifically, the trained and optimized neural network model is determined as the real-time adjustment model. When a new target vegetable sample needs to evaluate the pesticide residue risk probability, the relevant data is input into the model, and the model will output a quantitative result of the degree of deviation of the pesticide residue risk probability, providing a basis for subsequent decision-making and processing, continuously monitoring the performance of the model and the accuracy of the output results, and with the continuous accumulation of new data, the model is regularly retrained and updated with new data to ensure that the model can adapt to changing situations and new detection requirements.
[0032] In a possible implementation, the historical pesticide residue risk probability data is used as input, and the deviation between the historical pesticide residue risk probability data and the corresponding pesticide residue accurate detection result is used as output to train the neural network model, and step S320 further includes step S321, performing time series processing on the historical pesticide residue risk probability data, and constructing a time series data set according to the timestamp of the data. Specifically, the historical pesticide residue risk probability data is obtained, and the data is generated at different time points, so it is necessary to perform time series processing on it, and arrange the data in chronological order according to the timestamp information attached to the data, so as to construct a complete time series data set.
[0033] Step S322, slice the time series data set using a sliding time window to obtain a number of fixed-length time segments, each of which contains N continuous historical pesticide residue risk probability data. Specifically, the slicing operation is performed using a sliding time window method to more effectively process the time series data set. The sliding time window has a fixed length. Through the sliding window, the entire time series data set is divided into a number of continuous time segments, each of which contains N historical pesticide residue risk probability data.
[0034] Step S323, taking the N historical pesticide residue risk probability data in each time segment as input, and taking the accurate detection result of the pesticide residue corresponding to the next moment after the end of the time segment as the training target, constructing a training sample. Specifically, taking the N historical pesticide residue risk probability data in each time segment as input, and setting the accurate detection result of the pesticide residue corresponding to the next moment after the end of each time segment as the training target, each set of input historical data and its corresponding pesticide residue detection result at the next moment constitutes a training sample.
[0035] Step S324, use the constructed training samples to train the long short-term memory neural network, and use the trained long short-term memory neural network as a real-time adjustment model. Specifically, after constructing a large number of training samples, use the samples to train the long short-term memory neural network. During the training process, the long short-term memory neural network learns the potential relationship and pattern between the historical pesticide residue risk probability data and the future pesticide residue. After repeated training and optimization, when the performance of the long short-term memory neural network on the training samples reaches the expected accuracy and stability, the training is completed, and the long short-term memory neural network is used as a real-time adjustment model to predict and analyze new pesticide residue risk probability data to provide support for relevant decisions. As new data is continuously generated, we can also regularly use new training samples to update and improve the real-time adjustment model to ensure that it can always accurately reflect the dynamic relationship between the pesticide residue risk probability and the actual residue.
[0036] Step S400, input the preliminary pesticide residue risk probability of the target vegetable sample into the real-time adjustment model to obtain an adjustment factor for the preliminary pesticide residue risk probability. Specifically, the preliminary pesticide residue risk probability of the target vegetable sample is obtained, and the preliminary probability is obtained by the output of the previous pesticide residue basic model. The preliminary pesticide residue risk probability is used as input data and passed to the trained real-time adjustment model. After receiving the input data, the real-time adjustment model will process and analyze the input preliminary risk probability based on its internal complex calculation and mapping relationship. Within the model, a variety of factors are comprehensively considered, such as the pesticide residue situation of similar vegetable samples in the recent period, the impact of the current season and climate conditions on pesticide residues, and the common pests and diseases and prevention and control measures in the vegetable planting area. Related features and information, the model finally outputs an adjustment factor for the preliminary pesticide residue risk probability. The adjustment factor reflects the degree of correction of the preliminary probability, and is used to adjust and optimize the preliminary pesticide residue risk probability to obtain a more accurate and reliable pesticide residue risk assessment result.
[0037] Step S500, applying the adjustment factor to the preliminary pesticide residue risk probability to obtain the final pesticide residue risk probability of the target vegetable sample. Specifically, after obtaining the adjustment factor for the preliminary pesticide residue risk probability, apply it to the preliminary probability to obtain the final pesticide residue risk probability of the target vegetable sample, multiply the adjustment factor by the preliminary pesticide residue risk probability, and make adjustments. When performing the calculation, ensure that the units and dimensions of the data are unified to ensure the accuracy and rationality of the calculation results, and obtain the adjusted final pesticide residue risk probability. The final probability comprehensively considers the preliminary assessment results and various adjustment factors, and can more accurately reflect the pesticide residue risk situation of the target vegetable sample, providing a more reliable basis for subsequent decision-making.
[0038] Step S600, determine whether the final pesticide residue risk probability exceeds the preset threshold value, if so, collect the target vegetable sample, and accurately detect the pesticide residue amount of the collected target vegetable sample to obtain an accurate detection result. Specifically, the final pesticide residue risk probability of the target vegetable sample is obtained, and a preset threshold value for judging the risk level is set. The preset threshold value is determined by the relevant food safety standards and regulations formulated by the country and region to determine the threshold range. The final pesticide residue risk probability is compared with the preset threshold value. If the final pesticide residue risk probability exceeds the preset threshold value, it means that the target vegetable sample may have a high pesticide residue risk, and the process of collecting target vegetable samples is started. After the collection is completed, the collected target vegetable samples are quickly sent to a professional testing laboratory, and the pesticide residue amount in the sample is accurately detected using high-precision testing equipment and strictly verified testing methods. Finally, the accurate detection result of the pesticide residue amount of the target vegetable sample is obtained. The accurate detection result will provide a strong basis for further evaluation and decision-making.
[0039] Step S700, combines the precise detection results of the pesticide residues with the final pesticide residue risk probability to generate a pesticide residue detection report for the target vegetable sample. Specifically, the precise detection results of the pesticide residues in the target vegetable samples and the calculated final pesticide residue risk probability are obtained, and a document template specifically used to generate a pesticide residue detection report is created. The template includes the title of the report, basic information columns for vegetable samples (such as vegetable type, origin, sampling time, etc.), and the main body of the report lists the precise detection results of pesticide residues in detail, including the name of each pesticide detected, the specific residue value, and the comparison with the relevant standard limit. The final pesticide residue risk probability is displayed in a chart to show the degree of risk probability, and a comprehensive analysis and interpretation of the test results and risk probabilities are performed to explain the test results. The report can also include a brief introduction to the detection methods and equipment to increase the credibility and transparency of the report. The entire report will be reviewed and proofread to ensure the accuracy of the data, logical coherence and language standardization. After the review is correct, the generated report will be saved and distributed in electronic or paper form for use and reference by relevant departments. The precise detection results of pesticide residues are effectively combined with the final pesticide residue risk probability to generate a comprehensive, accurate and valuable pesticide residue detection report for target vegetable samples.
[0040] In a possible implementation, the precise detection result of the pesticide residue is combined with the final pesticide residue risk probability to generate a pesticide residue detection report for the target vegetable sample, and step S700 further includes step S710, after obtaining the final pesticide residue risk probability of the target vegetable sample, the final pesticide residue risk probability is compared with a plurality of preset risk level thresholds. Specifically, after obtaining the final pesticide residue risk probability of the target vegetable sample, a plurality of preset risk level thresholds are obtained, and the thresholds are set in advance based on comprehensive factors such as relevant standards, regulations, scientific research, and actual experience, and the final pesticide residue risk probability is compared with the preset risk level thresholds in turn.
[0041] Step S720, according to the comparison result, determine the pesticide residue risk level of the vegetable sample. Specifically, the thresholds of three levels of low risk, medium risk and high risk are preset, which are threshold 1 and threshold 2 respectively. If the final pesticide residue risk probability is less than threshold 1, the pesticide residue risk level of the vegetable sample is determined to be low risk. If the final pesticide residue risk probability is greater than or equal to threshold 1 but less than threshold 2, its risk level is determined to be medium risk. If the final pesticide residue risk probability is greater than or equal to threshold 2, it is determined to be high risk.
[0042] Step S730, combining the pesticide residue risk level, the accurate detection result of the pesticide residue amount and the final pesticide residue risk probability to generate a pesticide residue detection report for the target vegetable sample. Specifically, after the pesticide residue risk level is determined, a pesticide residue detection report for the target vegetable sample is generated. First, a standardized report template is created, including the report title and basic information (such as the type of vegetable sample, origin, collection time, etc.). In the main body of the report, the determined pesticide residue risk level is first clearly listed so that readers can quickly understand the degree of risk. The precise detection results of pesticide residues are presented in detail, including the specific name of each pesticide detected, the residue value, and the comparison with the relevant standard limit. The final pesticide residue risk probability is clearly displayed, and the relationship between the pesticide residue risk level, the precise detection results and the final risk probability is comprehensively analyzed and explained. It is explained how the risk level is determined based on the probability and the detection results, and their impact on vegetable safety. In the report, instructions on the detection method, detection equipment, sampling process, etc. are added to enhance the integrity and credibility of the report. The generated pesticide residue detection report is saved and distributed in electronic or paper form, and provided to relevant regulatory departments, growers, sellers and other people in need, providing them with a strong basis for decision-making and management.
[0043] In a possible implementation, the precise detection result of the pesticide residue is combined with the final pesticide residue risk probability to generate a pesticide residue detection report for the target vegetable sample. Step S700 further includes step S740, and when the precise detection result of the pesticide residue of the target vegetable sample exceeds the preset residue limit standard, an additional collection instruction is automatically generated. Specifically, after the target vegetable sample is accurately detected for pesticide residue, the detection result is compared with the preset residue limit standard. The residue limit standard is determined in advance based on comprehensive factors such as relevant laws and regulations, food safety requirements, and industry specifications. If the precise detection result of the pesticide residue of the target vegetable sample exceeds the preset residue limit standard, the generation of an additional collection instruction is automatically triggered. The generated additional collection instruction will clearly specify the relevant details of additional collection from the same batch of vegetables as the target vegetable sample, including the number of collections, the location of collection, and the method of collection.
[0044] Step S750, additional vegetable samples are collected from the same batch of vegetables as the target vegetable sample according to the additional collection instruction. Specifically, according to the additional collection instruction, the staff will collect additional vegetable samples from the specified same batch of vegetables as required, and the sample collection process will follow strict sampling specifications to ensure the representativeness and accuracy of the samples.
[0045] Step S760 performs an accurate detection of pesticide residues on the additional vegetable samples collected, and obtains additional accurate detection results. Specifically, after the additional vegetable samples are collected, the same accurate detection method and equipment as the target vegetable samples are used to perform an accurate detection of pesticide residues on these additional samples. After the detection is completed, the additional accurate detection results are obtained.
[0046] Step S770, the additional precise test results are summarized and analyzed with the precise test results of the target vegetable samples to evaluate the overall pesticide residue risk level of the batch of vegetables. Specifically, the additional precise test results are summarized with the previous precise test results of the target vegetable samples, and the overall pesticide residue risk level of the batch of vegetables is evaluated by calculating statistical indicators such as the mean value, standard deviation, and excess ratio.
[0047] Step S780, based on the evaluation results, generate pesticide residue risk warning information. Specifically, based on the evaluation results, determine the pesticide residue risk status of the batch of vegetables. If the risk level is high and reaches or exceeds the preset warning threshold, the system will automatically generate corresponding pesticide residue risk warning information based on established rules and templates. The warning information may include basic information of the batch of vegetables (such as vegetable type, batch number, origin, etc.), specific conditions of pesticide residues (types of pesticides exceeding the standard, residue amounts), conclusions of risk assessment, and recommended measures (such as suspension of sales, recall, strengthening of supervision, etc.). The generated pesticide residue risk warning information will be promptly transmitted to the relevant responsible departments, production enterprises, regulatory agencies and other stakeholders so that they can quickly take corresponding countermeasures to ensure the public's food safety.
[0048] The embodiment of the present application uses multi-source heterogeneous data such as vegetable types, growth environment, pesticide application records and meteorology to build a basic model for pesticide residues to generate a preliminary risk probability for target vegetable samples. A real-time adjustment model is built based on historical data to derive an adjustment factor, which is applied to obtain the final risk probability. If the final risk probability exceeds a preset threshold, samples are collected for precise testing, and a test report is generated by combining the precise test results and the final risk probability, thereby achieving the technical effect of ensuring vegetable quality safety and consumer health.
[0049] The above specific implementation manner does not constitute a limitation to the protection scope of the present application. It should be understood by those skilled in the art that various modifications, combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the protection scope of the present application. In some cases, the actions or steps S recorded in the present application can be performed in an order different from that in the embodiment and still achieve the desired results. In addition, the process depicted in the accompanying drawings does 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.
Claims
1. An intelligent detection method for pesticide residues in vegetables, characterized in that: The method comprises: Acquire multi-source heterogeneous data, wherein the multi-source heterogeneous data includes vegetable variety data, growth environment data, pesticide application record data and meteorological data; Based on the multi-source heterogeneous data, fusion features are obtained, a basic model for pesticide residues is constructed, and the fusion features are input into the basic model for pesticide residues to generate a preliminary pesticide residue risk probability for the target vegetable sample; Based on historical pesticide residue risk probability data and the corresponding pesticide residue accurate detection results, a real-time adjustment model is constructed to quantify the degree of deviation of pesticide residue risk probability; Inputting the preliminary pesticide residue risk probability of the target vegetable sample into the real-time adjustment model to obtain an adjustment factor for the preliminary pesticide residue risk probability; Applying the adjustment factor to the preliminary pesticide residue risk probability to obtain a final pesticide residue risk probability of the target vegetable sample; Determine whether the final pesticide residue risk probability exceeds a preset threshold value, and if so, collect the target vegetable samples, and perform accurate detection of the pesticide residue on the collected target vegetable samples to obtain accurate detection results; The precise detection result of the pesticide residue is combined with the final pesticide residue risk probability to generate a pesticide residue detection report for the target vegetable sample.
2. The intelligent detection method for pesticide residues in vegetables according to claim 1, characterized in that: Acquire multi-source heterogeneous data, including: Collect the vegetable type data and growth environment data in real time from the agricultural Internet of Things system, wherein the growth environment data includes soil moisture, pH value, temperature and light intensity; Extract the pesticide application record data from the agricultural management system, wherein the pesticide application record data includes the time of application, type of pesticide, dosage and application method; Acquire the meteorological data from a meteorological monitoring station, wherein the meteorological data includes average daily temperature, precipitation, wind speed, and sunshine duration; The vegetable variety data, growth environment data, pesticide application record data and meteorological data are time aligned and cleaned to form a structured multi-source heterogeneous data set.
3. The intelligent detection method for pesticide residues in vegetables according to claim 1, characterized in that: Based on the multi-source heterogeneous data, a basic model of pesticide residues is constructed, including: Preprocessing the multi-source heterogeneous data, including data cleaning and normalization; Constructing a multimodal feature extraction network, the multimodal feature extraction network comprising a first feature extraction module for processing vegetable type data, a second feature extraction module for processing growth environment data, a third feature extraction module for processing pesticide application record data, and a fourth feature extraction module for processing meteorological data; Fusing the features output by the multimodal feature extraction network to obtain fused features; Inputting the fusion features into a prediction network, which outputs a preliminary pesticide residue risk probability; The multimodal feature extraction network and the prediction network are jointly optimized and trained using a loss function to obtain a basic model of pesticide residues.
4. The intelligent detection method for pesticide residues in vegetables according to claim 1, characterized in that: The preliminary pesticide residue risk probability of the target vegetable samples is generated based on the pesticide residue basic model, including: Obtain multi-source heterogeneous data of target vegetable samples, including species data, growth environment data, pesticide application record data, and meteorological data of target vegetable samples; The multi-source heterogeneous data of the target vegetable samples are input into the trained pesticide residue basic model, and the pesticide residue basic model obtains a preliminary probability value representing the pesticide residue risk level of the target vegetable samples according to the input multi-source heterogeneous data; The preliminary probability value output by the basic pesticide residue model is used as the preliminary pesticide residue risk probability of the target vegetable samples.
5. The intelligent detection method for pesticide residues in vegetables according to claim 1, characterized in that: The method further comprises: Obtaining historical pesticide residue risk probability data of vegetables of the same type as the target vegetable sample, and accurate detection results of pesticide residues corresponding to the historical pesticide residue risk probability data; The historical pesticide residue risk probability data is used as input, and the deviation between the historical pesticide residue risk probability data and the corresponding pesticide residue accurate detection result is used as output to train the neural network model; The trained neural network model is used as the real-time adjustment model to quantify the degree of deviation of the pesticide residue risk probability.
6. The intelligent detection method for pesticide residues in vegetables according to claim 5, characterized in that: The neural network model is a long short-term memory neural network, and training the neural network model includes: Performing time series processing on the historical pesticide residue risk probability data, and constructing a time series data set according to the timestamps of the data; Slicing the time series data set using a sliding time window to obtain a number of time segments of fixed length, each time segment containing N consecutive historical pesticide residue risk probability data; Taking N historical pesticide residue risk probability data in each time segment as input, the accurate detection result of pesticide residue corresponding to the next moment after the end of the time segment is taken as the training target to construct the training sample; The long short-term memory neural network is trained using the constructed training samples, and the trained long short-term memory neural network is used as a real-time adjustment model.
7. The intelligent detection method for pesticide residues in vegetables according to claim 1, characterized in that: The method further comprises: After obtaining the final pesticide residue risk probability of the target vegetable sample, comparing the final pesticide residue risk probability with a plurality of preset risk level thresholds; Determining the pesticide residue risk level of the vegetable sample according to the comparison result; The pesticide residue risk level, the accurate detection results of the pesticide residue amount and the final pesticide residue risk probability are combined to generate a pesticide residue detection report for the target vegetable sample.
8. The intelligent detection method for pesticide residues in vegetables according to claim 1, characterized in that: The method further comprises: When the precise detection result of the pesticide residue of the target vegetable sample exceeds the preset residue limit standard, an additional collection instruction is automatically generated; According to the additional collection instruction, additional vegetable samples are collected from the vegetables in the same batch as the target vegetable sample; Conducting accurate testing of pesticide residues on additional vegetable samples collected additionally to obtain additional accurate test results; The additional precise test results are summarized and analyzed with the precise test results of the target vegetable samples to evaluate the overall pesticide residue risk level of the batch of vegetables; Based on the assessment results, pesticide residue risk warning information is generated.
Citation Information
Patent Citations
Gas compressor rotation stall prediction method based on multi-source data fusion
CN114186337A
Dynamically selecting from multiple streams for presentation by predicting events using artificial intelligence
US20230149819A1