Agricultural product safety risk prediction and adaptive supervision system based on deep learning
By constructing an agricultural product safety risk prediction system that integrates multimodal data fusion, adaptive attention feature extraction, and progressive deep learning networks, the system addresses the issues of lagging traditional regulatory methods and data heterogeneity. It enables real-time assessment and preventative regulation of agricultural product safety risks, thereby improving regulatory efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-07
AI Technical Summary
Existing deep learning-based agricultural product safety risk prediction systems face technical challenges such as strong data heterogeneity, complex risk characteristics, and difficulty in interpreting prediction results. Traditional regulatory methods are outdated and lack systematicity, making preventive regulation impossible.
Construct a deep learning-based agricultural product safety risk prediction and adaptive supervision system, including multimodal data fusion, adaptive attention feature extraction, growth variable prediction and self-correction, and progressive deep learning network, to achieve unified processing and real-time risk assessment of multi-source heterogeneous data.
It achieves comprehensive and accurate identification of agricultural product safety risks, can adapt to the special characteristics of different agricultural products and planting environments, adjusts model parameters in real time, improves regulatory efficiency and the accuracy and stability of prediction, and forms a virtuous cycle of prediction-disposal-feedback-optimization.
Smart Images

Figure CN121810072A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of agricultural product safety supervision, in particular to an agricultural product safety risk prediction and adaptive supervision system based on deep learning, which is applied to the prediction, evaluation, early warning and regulation of safety risks in the planting link of agricultural products. BACKGROUND
[0002] With the increasing concern about food safety issues, the safety of agricultural products, as an important source of food, is directly related to public health. Current agricultural product safety risk supervision mainly relies on manual sampling and experience-based judgment, which has many shortcomings: on the one hand, traditional supervision methods often lag behind risk occurrence and can only deal with problems after they occur, making it difficult to achieve preventive supervision; on the other hand, experience-based judgment lacks systematicness and scientificity and cannot cope with the complexity and variability of the planting environment of agricultural products.
[0003] With the development of deep learning technology, it has achieved remarkable results in image recognition, natural language processing and other fields, providing a new approach to agricultural product safety risk prediction. However, existing deep learning-based agricultural product safety risk prediction systems still face technical challenges such as strong data heterogeneity, complex risk characteristics, and difficulty in interpreting prediction results. In particular, the fusion processing of multi-source heterogeneous data, the automatic identification of key risk characteristics, the real-time correction of prediction models, and the risk classification and disposal, etc., the existing technology has not yet provided a systematic solution.
[0004] Therefore, there is an urgent need for an intelligent system that can fully utilize multi-source data and achieve a closed loop of prediction and supervision, improving the accuracy and timeliness of agricultural product safety risk prediction and achieving a shift from passive response to proactive prevention. SUMMARY
[0005] The purpose of the present application is to provide an agricultural product safety risk prediction and adaptive supervision system based on deep learning, aiming to solve the problems of inaccurate prediction and delayed disposal in traditional agricultural product safety supervision and achieve intelligent management of the whole process from data collection to risk disposal.
[0006] The present application proposes an agricultural product safety risk prediction and adaptive supervision system based on deep learning, comprising:
[0007] An agricultural product environment data acquisition module for acquiring data information of the planting link of agricultural products, the data information including growth environment, soil, fertilizer, chemical fertilizer, pesticide, origin and variety information of agricultural products;
[0008] An agricultural product environment data storage module connected to the agricultural product environment data acquisition module for storing the data information collected by the agricultural product environment data acquisition module in the form of distributed big data;
[0009] The agricultural product environment data analysis module is connected with the agricultural product environment data storage module and is used for analyzing and modeling data information stored in the agricultural product environment data storage module. The agricultural product environment data analysis module comprises:
[0010] The multi-modal data fusion unit is used for fusing different types of agricultural product environment data into a unified feature representation.
[0011] The adaptive attention feature extraction unit is used for dynamically adjusting the weights of the unified feature representation and enhancing key risk features.
[0012] The growth variable prediction and self-correction unit is used for predicting agricultural product growth variables based on the enhanced key risk features and performing real-time correction.
[0013] The progressive deep learning network unit is used for performing multi-level conversion and risk classification on the predicted agricultural product growth variables.
[0014] The agricultural product safety quality evaluation module is connected with the agricultural product environment data analysis module and is used for evaluating, classifying and warning agricultural product safety risks according to the prediction, classification and identification results of the agricultural product environment data analysis module.
[0015] The agricultural product environment adaptive optimization module is connected with the agricultural product safety quality evaluation module and is used for analyzing the deviation between the environmental risk data of the agricultural product safety quality evaluation module and target safety quality indicators and calculating adjustment parameters to guide the selection of pesticides, fertilizers, chemical fertilizers, production sites and varieties.
[0016] The visual warning module is connected with the agricultural product safety quality evaluation module and the agricultural product environment adaptive optimization module and is used for presenting the environmental data collected by the agricultural product environment data collection module, the safety quality prediction data predicted by the agricultural product environment data analysis module, the safety risk prediction data of the agricultural product safety quality evaluation module and the adjusted guidance parameters of the agricultural product environment adaptive optimization module.
[0017] Preferably, the multi-modal data fusion unit comprises:
[0018] The data preprocessing subunit is used for detecting outliers, processing missing values and standardizing collected multi-source data.
[0019] The graph knowledge graph construction subunit is used for defining entities in structured data as graph nodes and defining relationships between entities as graph edges to construct a complete agricultural product safety risk knowledge graph.
[0020] The multi-modal feature extraction subunit is used for extracting visual features, time pattern features and concept features from image data, time series data and text description data, respectively.
[0021] A heterogeneous data fusion subunit is configured to build a shared representation space, map different modal features to a unified semantic space, and realize feature complementary enhancement.
[0022] Preferably, the adaptive attention feature extraction unit comprises:
[0023] A multi-granularity attention subunit is configured to design channel-level attention, spatial-level attention, and semantic-level attention, and assign importance to features of different dimensions.
[0024] A dynamic weight adjustment subunit is configured to gradually increase the weight of key feature regions according to the training iteration process, realize automatic identification and enhancement of key risk features, and realize automatic identification and enhancement of key risk features.
[0025] A salient feature identification subunit is configured to build a feature importance scoring mechanism, quantify the contribution of each feature to risk prediction, and generate an attention heat map.
[0026] A multi-level attention propagation subunit is configured to realize hierarchical attention of shallow, middle, and deep layers, and design an inter-layer attention transmission mechanism.
[0027] Preferably, the growth variable prediction and self-correction unit comprises:
[0028] A multi-variable growth prediction subunit is configured to predict key variables such as crop growth period, expected yield, quality indicators, and residual risks.
[0029] A multi-level data comparison subunit is configured to design a real-time comparison layer, a short-term trend comparison layer, and a long-term pattern comparison layer, and analyze data deviations.
[0030] An intelligent correction decision subunit is configured to build a decision tree based on comparison results, determine the source of deviation, and trigger corresponding adjustment suggestions.
[0031] A closed-loop optimization and incremental learning subunit is configured to build a correction log recording mechanism, track historical correction conditions, and realize parameter smoothing update.
[0032] Preferably, the progressive deep learning network unit comprises:
[0033] A multi-level feature mapping subunit is configured to receive multi-modal fusion features, perform dimension unification and standardization, and build multi-resolution feature representations.
[0034] A deep feature conversion subunit is configured to design a multi-layer nonlinear transformation network, extract more abstract risk features layer by layer, and build a residual connection mechanism.
[0035] A risk pattern recognition subunit is configured to build a hierarchical classification head, simultaneously output risk types and risk levels, and realize a multi-task learning framework.
[0036] The model optimization subunit is configured to construct a loss function combination, balance prediction accuracy and model generalization ability, and design a learning rate self-adaptive adjustment strategy.
[0037] Preferably, the agricultural product safety quality evaluation module comprises:
[0038] A safety quality model is configured to determine the quality risk of the agricultural product according to risk data and an agricultural product safety control index.
[0039] A quality evaluation unit is configured to perform safety quality evaluation according to the data stored in the safety quality model. If the quality risk data is greater than the agricultural product safety control index, the product is unqualified. If the quality risk data is less than or equal to the agricultural product safety control index, the product is qualified.
[0040] A risk level confirmation unit is configured to output the risk level of the product quality prediction.
[0041] Preferably, the safety quality model is configured to analyze the risks of different pesticides, fertilizers, chemical fertilizers, production sites and variety planting links according to the prediction, classification and identification of the agricultural product environment data analysis module, classify the risks of different pesticides, fertilizers, chemical fertilizers, production sites and varieties, confirm the risk levels according to the risk degrees, and store and update the confirmed data to the safety quality model.
[0042] Preferably, the risk level confirmation unit comprises:
[0043] A risk level refinement division subunit is configured to design a five-level risk evaluation system based on the risk prediction results, and define clear determination standards and thresholds.
[0044] A hierarchical disposal process subunit is configured to generate corresponding disposal schemes for different levels of risks, including a routine inspection plan, an intelligent isolation scheme, a production suspension rectification plan and an emergency plan.
[0045] A disposal execution and monitoring subunit is configured to design a disposal task decomposition and distribution mechanism, and construct an execution progress real-time tracking system.
[0046] A closed-loop feedback subunit is configured to construct a disposal effect evaluation mechanism, realize feedback of the disposal results to the prediction model, and optimize the risk prediction accuracy.
[0047] Preferably, the data collected by the agricultural product environmental data acquisition module includes: the pH and fertility of the soil in the crop's growing environment, based on the crop's requirements for soil pH and fertility; the types, quantities, and application seasons of pesticides used in crop planting, cultivation, and fertilization; the types, quantities, and application seasons of fertilizers and pesticides that affect agricultural products, and the calculation of pesticide and fertilizer yields and quality; and environmental data, including air, irrigation, and sunlight data, as well as ambient temperature data.
[0048] Preferably, the visualization early warning module is used to present environmental data collected by the agricultural product environmental data acquisition module, safety and quality prediction data predicted by the agricultural product environmental data analysis module, safety risk prediction data from the agricultural product safety and quality assessment module, and guidance parameters adjusted by the agricultural product environmental adaptive optimization module in the form of bar charts, line charts, classification charts, or heat distribution maps. The visualization early warning module provides a multi-level visualization display of complete data from the overall level, regional level, agricultural product level, enterprise level to individual level, meeting the information needs of users at different levels.
[0049] This invention constructs a closed loop for predicting and adaptively regulating agricultural product safety risks through innovative technologies such as multimodal data fusion, adaptive attention feature extraction, growth variable prediction and self-correction, progressive deep learning networks, and multi-level risk assessment and collaborative management. It has the following beneficial effects:
[0050] 1. It realizes the fusion representation of multi-source heterogeneous data, unifies the processing of structured and unstructured data, and greatly improves the comprehensiveness and accuracy of risk identification;
[0051] 2. Through an adaptive attention mechanism, key risk characteristics are automatically identified and enhanced, enabling the system to adapt to the specific characteristics of different agricultural products and planting environments;
[0052] 3. The innovative self-correction mechanism can compare the prediction results with the actual data in real time and adjust the model parameters in a timely manner, ensuring the accuracy and stability of long-term predictions;
[0053] 4. Progressive deep learning networks can extract and transform risk features layer by layer, deeply explore the complex relationships between potential risk factors, and significantly improve the ability to identify hidden risks;
[0054] 5. A complete closed loop from risk prediction to tiered disposal has been established, and the disposal results are fed back to the data collection stage, forming a virtuous cycle of prediction-disposal-feedback-optimization, which greatly improves regulatory efficiency. Attached Figure Description
[0055] Figure 1This is a diagram illustrating the overall architecture of the deep learning-based agricultural product safety risk prediction and adaptive supervision system of the present invention.
[0056] Figure 2 This is a schematic diagram of the structure of the agricultural product environmental data analysis module of the present invention;
[0057] Figure 3 This is a flowchart illustrating the workflow of the multimodal data fusion unit of the present invention.
[0058] Figure 4 This is a schematic diagram illustrating the working principle of the adaptive attention feature extraction unit of the present invention.
[0059] Figure 5 This is a flowchart illustrating the growth variable prediction and self-correction unit of the present invention.
[0060] Figure 6 This is a schematic diagram of the structure of the progressive deep learning network unit of the present invention;
[0061] Figure 7 This is a flowchart illustrating the workflow of the agricultural product safety and quality assessment module of the present invention.
[0062] Figure 8 This is a schematic diagram of the multi-level risk assessment and handling coordination mechanism of the present invention;
[0063] Figure 9 This is a schematic diagram illustrating the multi-level display of the visual early warning module of the present invention. Detailed Implementation
[0064] Please refer to the attached document. Figures 1-9 The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. The scope of protection of the present invention is not limited to the specific embodiments described below.
[0065] This invention provides a deep learning-based agricultural product safety risk prediction and adaptive supervision system, which includes an agricultural product environmental data acquisition module 10, an agricultural product environmental data storage module 20, an agricultural product environmental data analysis module 30, an agricultural product safety and quality assessment module 40, an agricultural product environmental adaptive optimization module 50, and a visualization early warning module 60.
[0066] like Figure 1As shown, the agricultural product environmental data acquisition module 10 is used to collect data information from the agricultural product planting process, including information on the agricultural product's growth environment, soil, fertilizers, chemical fertilizers, pesticides, origin, and variety. In a preferred embodiment of the present invention, this data specifically includes: acquiring the pH and fertility of the soil in the crop's growth environment based on the crop's requirements for soil pH and fertility; the types, quantities, and application seasons of pesticides used in crop planting, cultivation, and fertilization; the types, quantities, and application seasons of chemical fertilizers and pesticides that affect agricultural products; and relevant data used to calculate pesticide and fertilizer yields and quality. In addition, the environmental data also includes air, irrigation, and sunlight data, as well as ambient temperature data.
[0067] The agricultural product environmental data storage module 20 is connected to the agricultural product environmental data acquisition module 10 and is used to store the data information collected by the agricultural product environmental data acquisition module 10 in a distributed big data format. This module adopts a distributed storage architecture, which can not only meet the needs of large-scale data storage, but also provide an efficient data reading and sharing mechanism to ensure the reliability and accessibility of the data.
[0068] The agricultural product environmental data analysis module 30 is connected to the agricultural product environmental data storage module 20 and is the core module of this system. It is used to analyze and model the data information stored in the agricultural product environmental data storage module 20. For example... Figure 2 As shown, the module includes a multimodal data fusion unit 31, an adaptive attention feature extraction unit 32, a growth variable prediction and self-correction unit 33, and a progressive deep learning network unit 34.
[0069] The multimodal data fusion unit 31 is a fundamental component of the agricultural product environmental data analysis module 30, used to fuse different types of agricultural product environmental data into a unified feature representation. For example... Figure 3 As shown, the unit includes a data preprocessing subunit 311, a graph knowledge graph construction subunit 312, a multimodal feature extraction subunit 313, and a heterogeneous data fusion subunit 314.
[0070] The data preprocessing subunit 311 performs outlier detection, missing value handling, and standardization on the collected multi-source data. In practical applications, the 3σ principle is usually used for outlier detection, that is, data exceeding the mean ± 3 times the standard deviation are considered outliers. For missing values, interpolation methods based on agricultural knowledge are used for filling, for example, for missing values of soil pH, the average value of historical data of the same plot can be used for filling. Data standardization uses the Min-Max method to uniformly scale all types of data to the [0,1] interval for easier subsequent processing.
[0071] The graph knowledge graph construction subunit 312 defines entities in structured data as graph nodes and relationships between entities as graph edges, thus constructing a complete knowledge graph of agricultural product safety risks. For example, pesticides, fertilizers, and soil are defined as nodes, and application and impact are defined as edges, forming triples such as herbicide-(application)-rice, thereby constructing a semantically rich knowledge graph.
[0072] The multimodal feature extraction subunit 313 extracts visual features, temporal pattern features, and conceptual features from image data, time-series data, and text description data, respectively. For image data, a convolutional neural network is used to extract features, typically using a pre-trained ResNet50 model, outputting a 2048-dimensional feature vector. For time-series data, a Long Short-Term Memory (LSTM) network is used to extract time-series features, with the network setting containing 128 hidden units, outputting a 128-dimensional feature vector. For text data, a BERT model is used to extract semantic features, outputting a 768-dimensional feature vector.
[0073] The heterogeneous data fusion subunit 314 constructs a shared representation space, mapping features from different modalities to a unified semantic space to achieve complementary feature enhancement. Specifically, it first maps features from each modality to the same dimension (typically 256 dimensions) through a fully connected layer, and then uses a cross-modal attention mechanism to fuse them, generating a unified feature representation. The fusion formula is as follows:
[0074] ,
[0075] in, The fused feature representation is a vector with a dimension of 256×1; This represents the number of modalities, which is typically set to 3 in this embodiment, corresponding to the three modalities of image, time series, and text. For the first The features of each modality are also 256×1 dimensional vectors, for example It can represent image features, Representing time series characteristics, Representing text features; The corresponding attention weight is a scalar value that satisfies... This indicates the proportion of contribution of different modalities to the final feature. For vegetable agricultural products, visual features (such as color and shape) are more important for assessing safety risks. The value is typically set within the range of 0.5 to 0.6; however, for grain crops, environmental growth conditions (time-series data) have a greater impact. It is usually set in the range of 0.4 to 0.5.
[0076] The adaptive attention feature extraction unit 32 receives features fused from multimodal sources and dynamically adjusts the weights of the unified feature representation to enhance key risk features. For example... Figure 4 As shown, the unit includes a multi-granularity attention subunit 321, a dynamic weight adjustment subunit 322, a salient feature recognition subunit 323, and a multi-level attention propagation subunit 324.
[0077] The multi-granularity attention subunit 321 designs channel-level attention, spatial-level attention, and semantic-level attention to assign importance weights to features in different dimensions. Channel-level attention focuses on different dimensions of features, such as assigning different weights to pesticide residue features and soil heavy metal features; spatial-level attention focuses on the spatial distribution of features, such as assigning different weights to risk features in different areas of farmland; and semantic-level attention focuses on the semantic meaning of features, such as assigning different weights to features indicating excessive pesticides and insufficient soil fertility.
[0078] The dynamic weight adjustment subunit 322 gradually increases the weights of key feature regions according to the training iteration process, realizing the automatic identification and enhancement of key risk features. The initial weights are set based on expert experience, and are gradually adjusted as the model training progresses, increasing the weights of key features. The adjustment formula is:
[0079] ,
[0080] in, The attention weight value represents the feature representation of the i-th sample in the k-th layer in the j-th iteration, and is a scalar value. This represents the attention weight of the previous layer, and is also a scalar value; The initial attention weight is usually set to 0.1, which is a scalar constant. This is the weighting growth factor, usually set to 1.05, and is also a scalar constant; This represents the iteration count, an integer index value starting from 1. In practical applications, for particularly important risk characteristics (such as organophosphorus pesticide residue indicators), it can be... Setting the value to 0.15 accelerates weight growth; while for relatively minor features (such as slight uneven fertilization), it can be set to... The value was reduced to 0.08 to mitigate its impact. This formula uses an accumulation mechanism to make the weights of important features grow exponentially with the number of iterations, while the weights of unimportant features grow more slowly.
[0081] The salient feature identification subunit 323 constructs a feature importance scoring mechanism to quantify the contribution of each feature to risk prediction and generate an attention heatmap. The scoring mechanism is based on the degree of influence of each feature on the prediction result and is calculated through gradient backpropagation. The formula for calculating the feature importance score is:
[0082] ,
[0083] in, Let represent the importance score of the i-th feature, which is a non-negative scalar value; The output indicates the predicted risk level of agricultural products (levels 1-5) or the probability value of a specific risk type. Let represent the i-th feature, which is an element in the feature vector; It represents the partial derivative of the predicted output with respect to the features, reflecting the sensitivity of the prediction result to changes in the features; This indicates an absolute value operation. A higher score indicates a greater impact of the feature on the prediction result, and it should be assigned a higher attention weight. For example, in fruit products, the pesticide residue feature... Values typically above 0.7 indicate their critical importance for predicting safety risks; however, in root and tuber agricultural products, soil heavy metal content characteristics... The value is even higher, usually reaching 0.8 or above.
[0084] The multi-level attention propagation subunit 324 implements hierarchical attention at the shallow, intermediate, and deep levels, and designs an inter-layer attention transfer mechanism. Shallow attention (the first 1-3 layers of the network) focuses on basic features such as soil properties and fertilizer composition; intermediate attention (the middle 4-6 layers of the network) focuses on feature combinations and interactions, such as the interaction between fertilizer and soil; deep attention (the last 7-9 layers of the network) focuses on higher-order semantics and complex risk patterns, such as potential risks caused by multiple factors. Inter-layer attention is transferred through a residual connection mechanism to ensure that the deep network can fully utilize the key information extracted from the shallow layers.
[0085] The growth variable prediction and self-correction unit 33 utilizes enhanced features to predict agricultural product growth variables and designs a self-correction mechanism to continuously improve prediction accuracy. For example... Figure 5 As shown, the unit includes a multivariate growth prediction subunit 331, a multi-level data comparison subunit 332, an intelligent correction decision subunit 333, and a closed-loop optimization and incremental learning subunit 334.
[0086] The multivariate growth prediction subunit 331 predicts key variables such as crop growth period, expected yield, quality indicators, and residue risk. Taking rice as an example, the predicted growth period includes the number of days from sowing to heading, grain filling, and maturity, with a prediction accuracy of ±3 days; the expected yield prediction is based on historical data and current growth conditions, with an accuracy of ±5%; quality indicators include protein content, amylose content, etc., with an accuracy within ±8%; and residue risk predicts possible pesticide residue levels, with accuracy depending on the specific pesticide type, typically within ±15%.
[0087] The multi-level data comparison subunit 332 is designed with a real-time comparison layer, a short-term trend comparison layer, and a long-term pattern comparison layer to analyze data bias. The real-time comparison layer is updated hourly, comparing the difference between the currently collected data and the predicted value, with a bias threshold of 5%. The short-term trend comparison layer is updated daily, analyzing the consistency between the data change trend over the past 3-7 days and the predicted trend, with a bias threshold of 10%. The long-term pattern comparison layer is updated weekly, evaluating the pattern matching degree throughout the entire growth cycle, with a bias threshold of 15%. The threshold settings take into account the growth characteristics of different agricultural products. For example, leafy vegetables grow rapidly, so their real-time comparison bias threshold can be reduced to 3%, while fruit trees grow slowly, so the threshold can be increased to 8%.
[0088] The intelligent correction decision subunit 333 constructs a decision tree based on the comparison results, determines the source of the deviation, and triggers corresponding adjustment suggestions. The decision tree first determines the type of deviation (whether it is data acquisition deviation or model prediction deviation), and then further subdivides the source of the deviation. For example, for data acquisition deviation, it may be due to sensor failure, sudden environmental changes, or human intervention; for model prediction deviation, it may be caused by inaccurate parameters, new risk factors, or seasonal changes. Based on different sources of deviation, the system generates targeted adjustment suggestions.
[0089] The closed-loop optimization and incremental learning subunit 334 constructs a calibration log recording mechanism to track historical calibrations and achieve smooth parameter updates. This subunit employs an incremental learning strategy, assigning higher weights (typically 0.7) to new data and lower weights (typically 0.3) to historical data, ensuring the model can adapt to environmental changes while maintaining stability. The parameter update formula is:
[0090] ,
[0091] in, The updated model parameters are represented by a vector containing all the weights and biases in the neural network. Represents the original model parameters, dimensions, and... same; This represents the update parameters calculated based on the new data, with dimensions and... same; The weights are updated using a scalar constant ranging from [0,1], typically set to 0.3. This parameter setting has been validated through extensive experiments, achieving a good balance between model stability and adaptability. This is particularly relevant for rapidly changing agricultural product safety risk factors (such as seasonal pests and diseases). The value can be appropriately increased to 0.4-0.5 to accelerate model updates; for relatively stable factors (such as soil background values), it can be reduced to 0.1-0.2 to maintain prediction stability.
[0092] The progressive deep learning network unit 34 is a core component of the agricultural product environmental data analysis module 30, used for multi-level transformation and risk classification of predicted agricultural product growth variables. For example... Figure 6 As shown, the unit includes a multi-level feature mapping subunit 341, a deep feature transformation subunit 342, a risk pattern recognition subunit 343, and a model optimization subunit 344.
[0093] The multi-level feature mapping subunit 341 receives multi-modal fusion features, performs dimensionality unification and standardization, and constructs a multi-resolution feature representation. This subunit employs a dimensionality reduction mapping function:
[0094] ,
[0095] in, Indicates the first The input layer feature mapping result of each sample is a dimensional vector; Represents the first input layer The dimension reduction matrix of the sample vectors, with dimension . ,in The mapped feature dimensions, The original feature dimension; Indicates the first The model input for each sample is a dimensional vector; This represents the matrix transpose operation. Different dimensionality reduction parameters can be set for different types of agricultural products. For example, leafy vegetables can be represented using 256-dimensional features (m=256), while fruit trees can be represented using 512-dimensional features (m=512), to adapt to the complexity of different agricultural products. In this system, the original feature dimension n is usually the feature dimension after multimodal fusion, approximately 1024 dimensions.
[0096] The deep feature transformation subunit 342 designs a multi-layer nonlinear transformation network to extract more abstract risk features layer by layer and construct a residual connection mechanism. The nonlinear transformation uses the following calculation formula:
[0097] ,
[0098] in, This represents the output vector of the i-th sample in the k-th layer of the model, with the dimension being the number of hidden units in that layer (usually 128, 256, or 512). Indicates that the i-th sample is in the i-th position. The output vector of the layer model has the same dimension as the number of hidden units in the previous layer; Indicates the first The weight matrix of the layer model has the dimension of the number of hidden units in the current layer × the number of hidden units in the previous layer; This represents the bias vector of the k-th layer model, with the dimension being the number of hidden units in the current layer; This represents the activation function, which is typically the ReLU function used in this system, defined as follows: The input value is set to the maximum value between 0 and 0 to increase the model's nonlinear expressive power. To address the difficulty of training deep networks, this system sets a residual connection every two layers to ensure effective gradient propagation. In agricultural product safety risk prediction, the front-layer network (layers 1-3) mainly extracts basic risk features, such as specific pesticide residue indicators; the middle-layer network (layers 4-6) extracts risk interaction features, such as the interaction risk between pesticides and soil types; and the deep network (layers 7-9) extracts higher-order risk patterns, such as complex risk scenarios caused by multiple factors.
[0099] The risk pattern recognition subunit 343 constructs a hierarchical classification head, simultaneously outputting risk type and risk level to achieve a multi-task learning framework. Risk types include pesticide residue risk, heavy metal pollution risk, and microbial contamination risk; risk levels are divided into five levels: safe (almost no risk), concern (minor risk), alert (moderate risk), dangerous (serious risk), and emergency (extreme risk). The classifier uses a softmax function to output a probability distribution.
[0100] ,
[0101] in, This indicates that the model predicts the i-th sample pair. The probability of each category is a scalar value that takes the value [0,1]. The corresponding classifier output (unnormalized score) is a real number. Indicates to The natural exponent is used to convert any real number to a positive number; This indicates the total number of categories. In this system, there are 8 risk types and 5 risk levels. This represents the sum of index scores for all categories, used for normalization to ensure that the sum of all probabilities is 1. For different types of agricultural products, the system may focus on different risk types. For example, for leafy vegetables, the threshold for distinguishing pesticide residue risk types is more stringent. A threshold exceeding 0.3 indicates the presence of such a risk; for grain-based agricultural products, the focus is on the risk of mycotoxins, with a threshold set at 0.25.
[0102] Model optimization subunit 344 constructs a combination of loss functions to balance prediction accuracy and model generalization ability, and designs an adaptive learning rate adjustment strategy. The loss function consists of two parts: classification loss and regularization loss. The classification loss uses cross-entropy loss.
[0103] ,
[0104] in, The classification loss is a scalar value; Indicates the total number of training samples; Indicates the total number of categories; Indicates the first The true labels of each sample are one-hot encoded. If the sample Category but ,otherwise This represents taking the natural logarithm of the predicted probability, used to quantify prediction bias; This represents the summation of losses over all samples and all classes, yielding the overall loss. L2 regularization is used for the regularized loss to prevent overfitting. The total loss function is:
[0105] ,
[0106] in, The total loss is a scalar value; For classification loss; Regularization loss is typically defined as the sum of squares of the model parameters; This is the regularization coefficient, a scalar constant, usually set to 0.001, which controls the strength of regularization. For agricultural product categories with small sample sizes (such as specialty fruits), it can be appropriately increased. The learning rate is set to 0.005 to strengthen regularization and prevent overfitting; for common agricultural products with sufficient sample size, it can be reduced to 0.0005 to reduce regularization constraints. A cosine annealing strategy is used for the learning rate, with an initial learning rate of 0.001, a minimum learning rate of 0.00001, and a cycle of 10 rounds.
[0107] The agricultural product safety and quality assessment module 40 is connected to the agricultural product environmental data analysis module 30, and is used to evaluate, classify, and issue early warnings about agricultural product safety risks based on the prediction, classification, and identification results of the agricultural product environmental data analysis module 30. Figure 7 As shown, the module includes a safety quality model 41, a quality assessment unit 42, and a risk level confirmation unit 43.
[0108] The safety and quality model 41 is used to assess the quality risk of agricultural products based on risk data and agricultural product safety control indicators. This model, based on relevant national standards and industry specifications, establishes a safety control indicator system for different agricultural products, including pesticide residue limits, heavy metal content limits, and microbial contamination levels. For example, for vegetable products, the residue limit for organophosphorus pesticides is typically set at 0.1 mg / kg, and the limit for the heavy metal cadmium is 0.05 mg / kg.
[0109] The quality assessment unit 42 performs a safety and quality assessment based on the data stored in the safety and quality model. The assessment principle is: if the quality risk data is greater than the agricultural product safety control index, it is judged as unqualified; if the quality risk data is less than or equal to the agricultural product safety control index, it is judged as qualified. In practical applications, to increase the fault tolerance of the assessment, a 90% warning line is usually set, that is, when the risk data reaches 90% of the safety control index, the system begins to issue an early warning.
[0110] Risk level confirmation unit 43 is used to output the risk level of the product quality prediction. For example... Figure 8 As shown, this unit includes a risk level fine classification subunit 431, a graded handling process subunit 432, a handling execution and monitoring subunit 433, and a closed-loop feedback subunit 434.
[0111] The risk level is further refined into sub-units. Based on risk prediction results, a five-level risk assessment system is designed, defining clear judgment criteria and thresholds. The five risk levels are as follows:
[0112] Level 1 (Security Level): Risk indicators < 50% of security control indicators;
[0113] Level 2 (Attention Level): 50% of safety control indicators ≤ Risk indicators < 80%;
[0114] Level 3 (Alert Level): Safety control indicators ≤ 80% of risk indicators < 100%;
[0115] Level 4 (Hazard Level): Safety control indicators ≤ 100% ≤ Risk indicators < 120%;
[0116] Level 5 (Emergency Level): Risk indicators ≥ 120% of safety control indicators;
[0117] The tiered response process subunit 432 generates corresponding response plans for different levels of risk. For Level 1 risks, the system generates a routine inspection plan and minor adjustment suggestions, such as appropriately adjusting the amount of fertilizer and irrigation frequency; for Level 2 risks, it triggers an intelligent isolation plan to isolate potential pollution sources; for Level 3 risks, it generates a production shutdown and rectification plan, including equipment inspection and environmental restoration plans; for Level 4 and Level 5 risks, it activates emergency response plans, including pollution source control, regional isolation, and professional treatment measures.
[0118] The disposal execution and monitoring subunit 433 designs a disposal task decomposition and allocation mechanism and constructs a real-time execution progress tracking system. This subunit breaks down complex disposal tasks into specific operational steps, clarifies the personnel responsible for each step, the completion deadline, and the quality standards, and monitors the execution progress in real time through mobile terminals to ensure that disposal measures are implemented effectively.
[0119] The closed-loop feedback subunit 434 constructs a mechanism for evaluating the effectiveness of the response, enabling feedback of the response results to the prediction model and optimizing the accuracy of risk prediction. After the response is completed, the system evaluates the effectiveness, including whether the risk has been eliminated, whether there is any residual risk, and the efficiency and cost of the response process. The evaluation results are fed back to the prediction model to optimize model parameters and response strategies.
[0120] The agricultural product environmental adaptive optimization module 50 is connected to the agricultural product safety and quality assessment module 40. It analyzes the deviation between the environmental risk data from the agricultural product safety and quality assessment module 40 and the target safety and quality indicators, and calculates adjustment parameters to guide the selection of pesticides, fertilizers, chemical fertilizers, production areas, and varieties. By analyzing risk deviations, this module generates targeted optimization suggestions, such as adjusting fertilizer application rates, replacing pesticides with lower toxicity ones, and changing irrigation methods, thereby achieving continuous optimization of agricultural product safety and quality.
[0121] The visualization early warning module 60 is connected to the agricultural product safety and quality assessment module 40 and the agricultural product environmental adaptive optimization module 50. It is used to present environmental data collected by the agricultural product environmental data acquisition module 10, safety and quality prediction data predicted by the agricultural product environmental data analysis module 30, safety risk prediction data from the agricultural product safety and quality assessment module 40, and guidance parameters adjusted by the agricultural product environmental adaptive optimization module 50. For example... Figure 9 As shown, this module uses various formats such as bar charts, line charts, classification charts, or heat maps to achieve multi-level visualization, providing complete data from the overall level, regional level, agricultural product level, enterprise level to individual level, meeting the information needs of users at different levels.
[0122] Preferably, the system displays the overall situation of agricultural product safety nationwide or in a given region at the overall level, such as the distribution ratio of various risks and the proportion of high-risk areas; the regional level displays the risk distribution of specific areas, such as risk hotspot maps at the county or township level; the agricultural product level displays the risk status of different agricultural products, such as the safety rating of different vegetable varieties; the enterprise level displays risk monitoring data for specific production enterprises; and the individual level displays detailed monitoring information for specific farmland plots. This multi-layered visualization design enables regulatory authorities, production enterprises, and consumers to obtain the necessary risk information, improving the system's practicality and ease of use.
[0123] Through the collaborative work of the above modules, this invention realizes intelligent management of the entire process from data collection, analysis and processing to risk prediction, assessment, early warning and disposal, providing a systematic solution for the prevention and control of agricultural product safety risks.
[0124] Based on Embodiment 1, the multimodal data fusion unit 31 of the present invention includes a data preprocessing subunit 311, a graph knowledge graph construction subunit 312, a multimodal feature extraction subunit 313, and a heterogeneous data fusion subunit 314.
[0125] In this embodiment, the data preprocessing subunit 311 employs differentiated processing strategies for different types of data. For example, for time-series data (such as temperature and humidity changes), moving average filtering is used to remove noise with a window size of 5; for discrete data (such as pesticide usage records), frequency statistics and anomaly detection methods are used; and for spatial data (such as soil distribution), spatial interpolation algorithms are used to fill in missing values. This targeted preprocessing strategy significantly improves data quality.
[0126] The graph knowledge graph construction subunit 312 employs a hierarchical graph structure in its implementation. For complex agricultural production systems, a single planar graph is insufficient to express multi-level semantic relationships. Therefore, this embodiment designs a three-layer graph structure: the base layer contains entities and their basic attributes; the relation layer defines the relationships between entities; and the reasoning layer constructs complex causal relationships and risk rules based on the first two layers. This hierarchical design enables the system to express and reason about more complex risk patterns.
[0127] The multimodal feature extraction subunit 313 employs a modality-specific optimal network structure. For example, for plant growth images, the DenseNet121 network is used, which performs excellently in plant recognition tasks; for time-series meteorological data, a bidirectional GRU network is used, which outperforms the standard LSTM in capturing long-term dependencies; and for text descriptions, a domain-adaptive BERT model is used, which improves semantic understanding accuracy by fine-tuning on agricultural text corpora.
[0128] The heterogeneous data fusion subunit 314 implements an adaptive fusion weighting mechanism. Different agricultural products have different safety risk characteristics, and correspondingly, the importance of different modalities of data also varies. For example, for leafy vegetables, pesticide use information (text records) is more critical; while for root crops, soil conditions (sensor data) are more important. This embodiment designs an adaptive weighting adjustment algorithm based on crop type, which can automatically adjust the fusion weights of each modal of data according to the characteristics of different agricultural products.
[0129] Based on Embodiment 1, the adaptive attention feature extraction unit 32 of the present invention includes a multi-granularity attention subunit 321, a dynamic weight adjustment subunit 322, a salient feature recognition subunit 323, and a multi-level attention propagation subunit 324.
[0130] In this embodiment, the multi-granularity attention subunit 321 further refines the design of the attention mechanism. In addition to basic channel-level, spatial-level, and semantic-level attention, temporal-level attention and relational-level attention are introduced. Temporal-level attention focuses on key periods in the agricultural product growth cycle, such as sowing, flowering, and fruiting, assigning different weights to risk characteristics at different stages. Relational-level attention focuses on the interactions between features, such as the effect of the interaction between temperature and humidity on pesticide degradation rates. This multi-granularity attention design enables the system to capture risk characteristics from more dimensions.
[0131] The dynamic weight adjustment subunit 322 employs a weight update strategy based on reinforcement learning. Traditional fixed update strategies are ill-suited to adapting to dynamic changes in different environments and crops. This embodiment introduces the Q-learning algorithm, modeling weight adjustment as a decision-making process and guiding the model to learn the optimal weight adjustment strategy through a reward and punishment mechanism. Specifically, positive rewards are given when weight adjustment leads to improved prediction accuracy, and negative rewards are given otherwise, enabling the model to autonomously learn the most effective weight adjustment method.
[0132] The salient feature recognition subunit 323 implements uncertainty-based feature importance assessment. Traditional gradient-based methods may produce misleading results when data noise is high or the model is unstable. This embodiment uses a Bayesian neural network framework to estimate the uncertainty of feature importance through Monte Carlo sampling. Only when the confidence interval of the feature importance score is sufficiently high (95% confidence level) is it identified as a salient feature, which greatly improves the reliability of the recognition.
[0133] The multi-level attention propagation subunit 324 incorporates a cross-layer adaptive gating mechanism. In deep networks, simple inter-layer connections can lead to information redundancy or noise accumulation. This embodiment introduces a gating mechanism to dynamically control the information flow between different layers:
[0134] ,
[0135] ,
[0136] in, Indicates from the first layer to the first The layer's gate value, For the sigmoid function, and For learnable parameters, and They represent the first Layer and first The characteristic of a layer is that © represents element-wise multiplication. Indicates the updated number Layer features. This gating mechanism can adaptively select useful information to transmit and filter noise, significantly improving the effectiveness of attention propagation.
[0137] Based on Example 1, the growth variable prediction and self-correction unit 33 of the present invention includes a multivariate growth prediction subunit 331, a multi-level data comparison subunit 332, an intelligent correction decision subunit 333, and a closed-loop optimization and incremental learning subunit 334.
[0138] In this embodiment, the multivariate growth prediction subunit 331 employs an integrated prediction strategy. A single model struggles to handle multiple types of prediction tasks simultaneously and adapt to different crop characteristics. This embodiment designs an integrated system composed of multiple expert models, each focusing on a specific type of prediction task or a specific type of crop. For example, for growth period prediction, an expert system based on plant physiology models is used; for yield prediction, a statistical model based on historical data is used; and for quality indicators, a regression model based on environmental factors is used. The final result of the integrated prediction is obtained through a weighted average, with the weights dynamically adjusted based on the historical accuracy of each model.
[0139] The multi-level data comparison subunit 332 implements an adaptive threshold adjustment mechanism. A fixed deviation threshold cannot adapt to the differences in characteristics of different agricultural products and growth stages. This embodiment introduces a dynamic threshold algorithm, which automatically adjusts the deviation threshold based on the statistical characteristics of historical data and the current growth stage. For example, a lower threshold (3%–5%) is used for stages with rapid growth rates (such as the vegetative growth stage), while a higher threshold (8%–10%) is used for stages with stable growth (such as the maturity stage). This adaptive threshold mechanism effectively reduces false alarms and false negatives.
[0140] The intelligent correction decision subunit 333 is designed with a deviation attribution algorithm based on causal reasoning. Traditional decision tree methods often only consider correlations and ignore causal relationships, which may lead to incorrect correction directions. This embodiment introduces a reasoning model based on causal graphs, which models the causal relationships in the agricultural product growth system through structural equation modeling to achieve accurate attribution of deviation causes. For example, when a yield prediction deviation is detected, the system can distinguish whether it is due to normal fluctuations caused by weather changes or a systemic deviation caused by improper water and fertilizer management, thereby generating a targeted correction strategy.
[0141] The closed-loop optimization and incremental learning subunit 334 employs a hierarchical incremental learning framework. Different types of new data have varying impacts on the model, requiring differentiated processing. This embodiment designs a three-layer incremental learning strategy: for data reflecting short-term changes (such as daily environmental data), an online learning approach is used, assigning high weights (0.7-0.9) for rapid updates; for seasonally changing data, a periodic update approach is used with medium weights (0.3-0.5); and for data reflecting long-term trends (such as variety improvement information), a periodic full update approach is used with lower weights (0.1-0.3). This hierarchical strategy balances the model's rapid adaptability and long-term stability.
[0142] Based on Embodiment 1, the progressive deep learning network unit 34 of the present invention includes a multi-level feature mapping subunit 341, a deep feature transformation subunit 342, a risk pattern recognition subunit 343, and a model optimization subunit 344.
[0143] In this embodiment, the multi-level feature mapping subunit 341 implements a feature decomposition and recombination mechanism. Traditional feature mapping often treats all features equally, failing to fully utilize prior knowledge in the field of agricultural product safety. This embodiment first categorizes features into three main types based on domain knowledge: physical features (such as temperature and humidity), chemical features (such as pH value and nutrient content), and biological features (such as microbial diversity). Then, it performs dimensionality reduction processing on each type of feature separately, and finally recombines the processed features. This domain knowledge-based decomposition and recombination method improves the effectiveness of feature representation.
[0144] The deep feature transformation subunit 342 employs a dynamic depth adjustment mechanism. Networks with fixed depths struggle to adapt to risk prediction tasks of varying complexity. This embodiment designs a dynamic depth adjustment algorithm that automatically adjusts the network depth based on the complexity of the input data. Specifically, the system first estimates the task complexity (based on feature entropy and sample distribution), and then determines how many network layers to activate. For simple tasks (such as the risk of conventional fertilizer use), only 3-5 network layers are activated; for complex tasks (such as the comprehensive risk of multiple pesticide mixtures), 7-9 network layers are activated. This dynamic adjustment mechanism improves the model's expressive power while reducing computational resource consumption.
[0145] The risk pattern recognition subunit 343 designs a hierarchical risk classification framework. Agricultural product safety risks are multi-layered and multi-category, making it difficult for a single classifier to accurately represent this complex structure. This embodiment adopts a hierarchical classification structure: the first layer determines the major risk categories (e.g., chemical risk, biological risk); the second layer determines the specific risk types (e.g., pesticide residues, heavy metal pollution); and the third layer determines the risk levels (e.g., safe level, alert level). This hierarchical design not only improves classification accuracy but also makes the classification results easier to interpret and apply.
[0146] Model optimization subunit 344 implements a multi-objective optimization strategy. Predicting agricultural product safety risks requires considering multiple performance metrics simultaneously, such as accuracy, recall, and time efficiency. This embodiment employs the Pareto multi-objective optimization method, modeling model training as a multi-objective optimization problem to find the optimal balance point among various performance metrics. Simultaneously, an early stopping strategy is introduced to avoid overfitting, and an adaptive batch size adjustment algorithm is designed to automatically adjust the training batch size based on the gradient variance, improving training stability and efficiency.
[0147] Based on Example 1, the agricultural product safety and quality assessment module 40 of the present invention includes a safety and quality model 41, a quality assessment unit 42, and a risk level confirmation unit 43.
[0148] In this embodiment, the safety quality model 41 designs a hierarchical safety indicator system. Traditional safety indicators are often too general and difficult to adapt to the characteristics of different agricultural products. This embodiment constructs a three-layer indicator system: the basic layer includes general safety indicators, such as pesticide residue limits and heavy metal content; the classification layer sets specific indicators for different categories of agricultural products, such as sweetness for fruits and vegetables and nitrate content for leafy vegetables; the special layer focuses on the unique risks of specific crops, such as the cadmium contamination risk of rice. This hierarchical design makes safety assessments more accurate and comprehensive.
[0149] The quality assessment unit 42 implements a fuzzy comprehensive evaluation mechanism. Traditional binary evaluation (qualified / unqualified) is overly simplistic and fails to reflect the complexity of safety risks. This embodiment employs fuzzy logic theory to model the safety assessment as a fuzzy reasoning process. First, membership functions for each indicator are defined, such as the safety, critical, and exceedance membership degrees for pesticide residue indicators. Then, a comprehensive evaluation result is derived through fuzzy rule reasoning. This fuzzy evaluation method can better handle the interactions and uncertainties between indicators, providing more detailed risk assessment results.
[0150] Risk level confirmation unit 43 employs an environmentally sensitive risk rating strategy. The same risk indicator may have different practical effects under different environmental conditions. For example, the same level of pesticide residue may be more dangerous under drought conditions (because the degradation rate is reduced), while it may be relatively safe under high temperature and humidity conditions (because degradation is accelerated). This embodiment achieves environmentally sensitive risk rating by establishing a correlation model between risk indicators and environmental conditions, greatly improving the scientific rigor and practicality of the rating.
[0151] Based on Example 6, the safety and quality model 41 of the present invention classifies the risks of pesticides, fertilizers, chemical fertilizers, production areas and varieties in different stages of planting according to the prediction, classification and identification of the agricultural product environmental data analysis module 30, classifies the risks of pesticides, fertilizers, chemical fertilizers, production areas and varieties in different stages, confirms the level according to the degree of risk, and stores and updates the confirmed data to the safety and quality model 41.
[0152] In this embodiment, the safety and quality model 41 employs a risk factor interaction analysis framework. Agricultural product safety risks are often not caused by a single factor, but rather by the interaction of multiple factors. For example, the persistence of a specific pesticide residue may significantly increase under specific soil conditions, posing a higher risk. This embodiment designs second-order and third-order interaction analysis models to systematically assess the interactions of various risk factors. For instance, for the risk assessment of the pesticide-soil-climate ternary combination, it not only considers the independent risks of each factor but also assesses the second-order interactions of pesticide-soil, pesticide-climate, and soil-climate, as well as the third-order interactions of pesticide-soil-climate. This interaction analysis makes the risk assessment more comprehensive and accurate.
[0153] Furthermore, this embodiment also implements an automatic risk feature discovery mechanism. As agricultural production conditions and technologies continuously change, new risk features may emerge. Traditional fixed risk models struggle to adapt to such dynamic changes. This embodiment employs a risk feature discovery algorithm based on anomaly detection, automatically identifying potential new risk features by monitoring changes in data patterns. Once a significant anomaly is detected, the system triggers an in-depth analysis process to assess its likelihood of being a potential risk feature and decide whether to include it in the risk assessment framework. This dynamic discovery mechanism enables the system to continuously evolve and address new risk challenges.
[0154] Meanwhile, the safety and quality model 41 also incorporates an automatic update mechanism for its risk knowledge base. As scientific research progresses, knowledge about agricultural product safety risks is constantly being updated. This embodiment establishes an automatic connection channel with authoritative academic databases, regularly capturing the latest research findings. After natural language processing and expert rule filtering, valuable risk knowledge is automatically extracted and updated into the model. This automatic update mechanism ensures that the model always reflects the latest scientific understanding, improving the scientific rigor and cutting-edge nature of risk assessment.
[0155] Based on Embodiment 6, the risk level confirmation unit 43 of the present invention includes a risk level fine division subunit 431, a graded handling process subunit 432, a handling execution and monitoring subunit 433, and a closed-loop feedback subunit 434.
[0156] In this embodiment, the risk level refinement subunit 431 implements a context-aware risk rating mechanism. The same risk indicator may require different rating standards in different contexts. For example, for exported agricultural products, both domestic and target country safety standards need to be considered; for agricultural products consumed by special populations (such as infants and pregnant women), stricter rating standards should be adopted. This embodiment designs a context parameter library covering factors such as consumption region, consumer group, and usage method. The system dynamically adjusts the rating standards according to specific contexts, making risk rating more accurate and practical.
[0157] The tiered disposal process subunit 432 employs scenario-based disposal solution generation technology. Traditional fixed disposal solutions are difficult to adapt to complex and ever-changing realities. This embodiment constructs a disposal solution knowledge graph, modeling factors such as agricultural product type, risk type, environmental conditions, and available resources as graph nodes and relationships. Through a graph neural network, it learns the optimal disposal path, automatically generating customized disposal solutions for different scenarios. For example, for the same pesticide residue risk, different disposal solutions will be generated for large farms and small family farms, taking into account differences in equipment, manpower, and technical conditions.
[0158] The disposal execution and monitoring subunit 433 is designed with an intelligent task scheduling system. In actual disposal processes, it is often necessary to coordinate resources from multiple parties to ensure that tasks are executed efficiently according to priority. This embodiment implements a task scheduling algorithm based on constraint satisfaction, modeling disposal tasks as jobs with preconditions, resource requirements, and completion deadlines, and solving for the optimal scheduling scheme. At the same time, a dynamic replanning mechanism is introduced, which can quickly regenerate an adjusted scheduling scheme when the execution environment changes (such as resource shortages or emergencies), ensuring the continuity and effectiveness of the disposal process.
[0159] The closed-loop feedback subunit 434 employs a multi-level assessment framework. The assessment of treatment effectiveness needs to consider multiple dimensions, including the degree of risk elimination, treatment costs, and environmental impact. This embodiment designs a framework consisting of short-term, medium-term, and long-term assessments: short-term assessment focuses on whether the risk is immediately eliminated; medium-term assessment focuses on the sustained effects of treatment measures (e.g., 2-4 weeks); and long-term assessment focuses on the impact of treatment measures on the agricultural ecosystem (e.g., soil health, biodiversity). This multi-level assessment ensures that treatment measures not only address the current problem but also promote the long-term healthy development of the agricultural system.
[0160] Based on Example 1, the data collected by the agricultural product environmental data acquisition module 10 of the present invention includes: the acidity and fertility of the soil in the crop growth environment, based on the requirements of crops for soil pH and fertility; the types, quantities, and application seasons of pesticides used in crop planting, cultivation, and fertilization; the types, quantities, and application seasons of fertilizers and pesticides that affect agricultural products, and the calculation of pesticide and fertilizer yields and quality, as well as environmental data, including air, irrigation, and sunlight data, and ambient temperature data.
[0161] In this embodiment, the agricultural product environmental data acquisition module 10 employs a multi-source heterogeneous sensor network. To adapt to the acquisition needs of different types of data, the system is designed with a comprehensive acquisition network composed of multiple sensors. Among them, the soil sensor uses electrochemical sensing technology to monitor pH value (accuracy ±0.1), conductivity (accuracy ±0.01 mS / cm), and the content of major nutrients in real time; pesticide usage data is automatically recorded by intelligent spraying equipment, including spraying time, pesticide type, concentration, and dosage; environmental data acquisition uses an integrated weather station to monitor temperature (accuracy ±0.5℃), humidity (accuracy ±3%), light intensity (accuracy ±2%), and rainfall (accuracy ±0.2mm). All sensors adopt a low-power design and are powered by solar energy to achieve long-term stable operation.
[0162] Data collection frequency is dynamically adjusted based on data type and change characteristics. Environmental data (such as temperature and humidity) changes rapidly, so a high-frequency collection strategy is used, typically every 5 to 10 minutes; soil data changes slowly, so a medium-frequency collection strategy is used, typically every 2 to 4 hours; agricultural operation data (such as fertilization and pesticide application) is recorded using event-triggered recording to ensure data integrity and accuracy.
[0163] To improve data quality, the system implements an edge computing preprocessing mechanism. Sensor nodes integrate ARM Cortex-M4 processors to perform local verification and preprocessing before data upload, including outlier filtering, data smoothing, and simple statistical feature extraction. This edge computing strategy not only reduces transmission bandwidth requirements but also improves data reliability and reduces the processing burden on the central server.
[0164] Customized sensing solutions were designed for specific agricultural products and environmental conditions. For example, specialized rapid heavy metal detection sensors were added for leafy vegetables, which are particularly sensitive to heavy metals; CO2 concentration and ventilation monitoring were added for greenhouse environments; and water quality and nutrient solution composition monitoring were strengthened for hydroponics. This customized design makes data collection more comprehensive and accurate, providing a solid foundation for subsequent risk analysis.
[0165] Based on Embodiment 1, the visualization early warning module 60 of the present invention is used to present environmental data collected by the agricultural product environmental data acquisition module 10, safety and quality prediction data predicted by the agricultural product environmental data analysis module 30, safety risk prediction data of the agricultural product safety and quality assessment module 40, and guidance parameters adjusted by the agricultural product environmental adaptive optimization module 50 in the form of bar charts, line charts, classification charts, or heat distribution maps. The visualization early warning module 60 provides complete data from the overall level, regional level, agricultural product level, enterprise level to individual level through multi-level visualization, meeting the information needs of users at different levels.
[0166] In this embodiment, the visualization and early warning module 60 employs interactive multidimensional visualization technology. Traditional static charts are insufficient to display the multidimensional characteristics of agricultural product safety risks. This embodiment designs an interactive visualization framework, allowing users to explore risk data from different angles and dimensions through zooming, filtering, and drill-down operations. For example, users can view the risk distribution from a global heatmap, click on a high-risk area to drill down to a specific agricultural product category, and then filter by time range to view the risk evolution trend. This interactive design significantly improves the information density and usability of the visualization.
[0167] The system provides customized visualization interfaces for different user roles. Regulatory authorities focus on the distribution of macro risks and key regulatory areas, enterprises focus on their own product quality and improvement directions, researchers focus on data patterns and regularities, and consumers focus on the safety of specific products. This embodiment designs customized visualization templates for different roles, automatically highlighting the core indicators and data dimensions that each role is concerned with, while also providing a custom view function to meet individual needs.
[0168] In terms of risk warning, the system employs a multi-channel warning mechanism. In addition to traditional visual alerts, it integrates various notification channels such as SMS, email, and mobile app push notifications, automatically selecting the appropriate notification strategy based on the risk level and urgency. For example, for Level 5 (urgent) risks, the system will simultaneously trigger a red alert on the screen, an SMS notification, and a phone alarm; while for Level 1 (security) risks, improvements will only be notified via email or in-app messages.
[0169] To improve data understandability, the system implements Natural Language Generation (NLG) technology, transforming complex data analysis results into easily understandable textual descriptions. For example, the trend of increasing pesticide residue risk in a certain area over the past 30 days is automatically transformed into specific recommendations such as a 15% increase in pesticide use in the area recently, leading to increased residue risk, and adjustments to pesticide frequency and type. This data-to-language conversion greatly improves the system's understandability and usability, especially for non-professional users.
[0170] In summary, this invention, through the close cooperation of the agricultural product environmental data acquisition module 10, agricultural product environmental data storage module 20, agricultural product environmental data analysis module 30, agricultural product safety and quality assessment module 40, agricultural product environmental adaptive optimization module 50, and visualization early warning module 60, constructs a complete closed loop for agricultural product safety risk prediction and adaptive supervision. It realizes intelligent management of the entire process from data acquisition, analysis and processing to risk prediction, assessment, early warning and disposal, and provides a systematic solution for the prevention and control of agricultural product safety risks.
[0171] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A deep learning-based agricultural product safety risk prediction and adaptive monitoring system, characterized in that, include: The agricultural product environmental data acquisition module is used to collect data information from the agricultural product planting process. The data information includes the agricultural product's growth environment, soil, fertilizer, chemical fertilizer, pesticide, place of origin, and variety information. An agricultural product environmental data storage module is connected to the agricultural product environmental data acquisition module and is used to store the data information collected by the agricultural product environmental data acquisition module in a distributed big data format. An agricultural product environmental data analysis module, connected to the agricultural product environmental data storage module, is used to analyze and model the data information stored in the agricultural product environmental data storage module. The agricultural product environmental data analysis module includes: The multimodal data fusion unit is used to fuse different types of agricultural product environmental data into a unified feature representation; An adaptive attention feature extraction unit is used to dynamically adjust the weights of the unified feature representation to enhance key risk features; A growth variable prediction and self-correction unit is used to predict agricultural product growth variables based on the enhanced key risk characteristics and perform real-time correction. A progressive deep learning network unit is used to perform multi-level transformation and risk classification on the predicted agricultural product growth variables; The agricultural product safety and quality assessment module is connected to the agricultural product environmental data analysis module and is used to evaluate, classify, and warn of agricultural product safety risks based on the prediction, classification, and identification results of the agricultural product environmental data analysis module. An agricultural product environmental adaptive optimization module, connected to the agricultural product safety and quality assessment module, is used to analyze the deviation between the environmental risk data of the agricultural product safety and quality assessment module and the target safety and quality indicators, and to calculate adjustment parameters to guide the selection of pesticides, fertilizers, chemical fertilizers, production areas and varieties. The visualization early warning module is connected to the agricultural product safety and quality assessment module and the agricultural product environmental adaptive optimization module. It is used to present the environmental data collected by the agricultural product environmental data acquisition module, the safety and quality prediction data predicted by the agricultural product environmental data analysis module, the safety risk prediction data of the agricultural product safety and quality assessment module, and the guidance parameters adjusted by the agricultural product environmental adaptive optimization module.
2. The deep learning-based agricultural product safety risk prediction and adaptive supervision system according to claim 1, characterized in that, The multimodal data fusion unit includes: The data preprocessing subunit is used to perform outlier detection, missing value handling, and standardization on the collected multi-source data. The graph knowledge graph construction subunit is used to define entities in structured data as graph nodes and relationships between entities as graph edges, thereby constructing a complete knowledge graph of agricultural product safety risks. The multimodal feature extraction subunit is used to extract visual features, temporal pattern features, and conceptual features from image data, time-series data, and text description data, respectively. The heterogeneous data fusion subunit is used to construct a shared representation space, mapping features of different modalities to a unified semantic space to achieve feature complementarity enhancement.
3. The deep learning-based agricultural product safety risk prediction and adaptive supervision system according to claim 1, characterized in that, The adaptive attention feature extraction unit includes: Multi-granularity attention subunits are used to design channel-level attention, spatial-level attention, and semantic-level attention, and to assign importance weights to features of different dimensions; The dynamic weight adjustment subunit is used to gradually increase the weight of key feature regions according to the training iteration process, so as to realize the automatic identification and enhancement of key risk features; The salient feature identification subunit is used to construct a feature importance scoring mechanism, quantify the contribution of each feature to risk prediction, and generate an attention heatmap. A multi-level attention propagation subunit is used to achieve hierarchical attention at the shallow, medium and deep levels, and to design an attention transfer mechanism between levels.
4. The deep learning-based agricultural product safety risk prediction and adaptive supervision system according to claim 1, characterized in that, The growth variable prediction and self-correction unit includes: The multivariate growth prediction subunit is used to predict key variables such as crop growth period, expected yield, quality indicators, and residue risk. Multi-level data comparison sub-units are used to design real-time comparison layers, short-term trend comparison layers, and long-term pattern comparison layers to analyze data deviations. The intelligent correction decision subunit is used to build a decision tree based on the comparison results, determine the source of the deviation, and trigger corresponding adjustment suggestions; The closed-loop optimization and incremental learning subunit is used to build a correction log recording mechanism to track historical corrections and achieve smooth parameter updates.
5. The deep learning-based agricultural product safety risk prediction and adaptive supervision system according to claim 1, characterized in that, The progressive deep learning network unit includes: The multi-level feature mapping subunit is used to receive multi-modal fusion features, perform dimensional unification and standardization, and construct multi-resolution feature representations; The deep feature transformation subunit is used to design multi-layer nonlinear transformation networks, extract more abstract risk features layer by layer, and construct residual connection mechanisms. The risk pattern recognition subunit is used to construct a hierarchical classification head, while outputting risk type and risk level to realize a multi-task learning framework. The model optimization subunit is used to construct a combination of loss functions, balance prediction accuracy and model generalization ability, and design an adaptive learning rate adjustment strategy.
6. The deep learning-based agricultural product safety risk prediction and adaptive supervision system according to claim 1, characterized in that, The agricultural product safety and quality assessment module includes: Safety and quality models are used to assess the quality risks of agricultural products based on risk data and agricultural product safety control indicators. The quality assessment unit is used to perform safety and quality assessment based on the data stored in the safety and quality model. If the quality risk data is greater than the agricultural product safety control index, it is unqualified; if the quality risk data is less than or equal to the agricultural product safety control index, it is qualified. The risk level confirmation unit is used to output the risk level of the product quality prediction.
7. The deep learning-based agricultural product safety risk prediction and adaptive supervision system according to claim 6, characterized in that, The safety and quality model, based on the prediction, classification, and identification of risks in different stages of pesticide, fertilizer, chemical fertilizer, origin, and variety planting by the agricultural product environmental data analysis module, classifies the risks of pesticides, fertilizers, chemical fertilizers, origin, and varieties in different stages, confirms the level according to the degree of risk, and stores and updates the confirmed data to the safety and quality model.
8. The deep learning-based agricultural product safety risk prediction and adaptive supervision system according to claim 6, characterized in that, The risk level confirmation unit includes: The risk level is further subdivided into sub-units, which are used to design a five-level risk assessment system based on risk prediction results, and to define clear judgment criteria and thresholds. The tiered response process subunit is used to generate corresponding response plans for different levels of risk, including routine inspection plans, intelligent isolation plans, production stoppage and rectification plans, and emergency plans. The disposal execution and monitoring subunit is used to design disposal task decomposition and allocation mechanisms and build a real-time execution progress tracking system. The closed-loop feedback subunit is used to build a mechanism for evaluating the effectiveness of the response, enabling feedback of the response results to the prediction model and optimizing the accuracy of risk prediction.
9. The deep learning-based agricultural product safety risk prediction and adaptive supervision system according to claim 1, characterized in that, The data collected by the agricultural product environmental data acquisition module includes: the pH and fertility of the soil in the crop's growing environment, based on the crop's requirements for soil pH and fertility; the types, quantities, and application seasons of pesticides used in crop planting, cultivation, and fertilization; the types, quantities, and application seasons of fertilizers and pesticides that affect agricultural products, and the calculation of pesticide and fertilizer yields and quality; and environmental data, including air, irrigation, and sunlight data, as well as ambient temperature data.
10. The deep learning-based agricultural product safety risk prediction and adaptive supervision system according to claim 1, characterized in that, The visualization and early warning module is used to present environmental data collected by the agricultural product environmental data acquisition module, safety and quality prediction data predicted by the agricultural product environmental data analysis module, safety risk prediction data from the agricultural product safety and quality assessment module, and guidance parameters adjusted by the agricultural product environmental adaptive optimization module in the form of bar charts, line charts, classification charts, or heat distribution maps. The visualization and early warning module displays complete data from the overall level, regional level, agricultural product level, enterprise level to individual level through multi-level visualization, meeting the information needs of users at different levels.