Adaptive reasoning system and method for agricultural data and server

By adopting an adaptive inference system in agricultural intelligent systems, and optimizing the model structure and inference paths using multi-level processing models and multi-layer distillation methods, the existing systems have solved the problems of low operating efficiency and lack of dynamic adjustment capabilities in low computing power equipment, and efficient and real-time agricultural data processing and resource optimization are achieved.

CN119962690AInactive Publication Date: 2025-05-09CHINA UNICOM ONLINE INFORMATION TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510448834.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-10
Publication Date
2025-05-09
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing agricultural intelligent systems have shortcomings in multimodal data processing and real-time performance, which are difficult to operate efficiently in low-computing equipment, and lack dynamic adjustment capabilities, so they cannot adapt to the real-time fluctuations of agricultural data and the differences in task complexity.

Method used

Adaptive inference system is adopted to optimize the model structure through multi-level processing model and multi-layer distillation method, dynamically adjust the inference path and computing resource allocation, monitor performance and data distribution changes in real time, and adjust model parameters.

Benefits of technology

It significantly improves the real-time nature of agricultural data processing and resource utilization efficiency, reduces the dependence on hardware computing power, and can run efficiently in edge devices to adapt to dynamic data changes and task complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119962690A_ABST
    Figure CN119962690A_ABST
Patent Text Reader

Abstract

The invention discloses an adaptive reasoning system and method for agricultural data and a server. The adaptive reasoning system comprises a data acquisition module used for collecting multi-modal agricultural data; the data processing module is used for performing embedding, feature extraction and fusion processing on the multi-modal agricultural data by using a multi-level processing model; the model optimization module is used for transmitting hierarchical features of the teacher model to the student model through a multi-layer distillation method, and optimizing the size and performance of the student model to form a self-adaptive reasoning model; the reasoning path module is used for distributing computing resources according to the reasoning path; the performance monitoring module is used for monitoring reasoning performance and data distribution changes in real time and adjusting parameters of the self-adaptive reasoning model; and the application module is used for inputting the multi-modal agricultural data into the adaptive reasoning model for crop health scoring, pest and disease risk prediction and animal husbandry abnormal signal early warning. The system not only can improve the real-time performance of agricultural data processing, but also can significantly reduce the dependence on hardware computing power.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of agricultural intelligence, and in particular to an adaptive reasoning system, method and server for agricultural data. Background Art

[0002] The existing agricultural intelligent systems have the following key problems in multimodal data processing and real-time performance, which directly affect the application effect and popularity of intelligent systems in agricultural scenarios: First, data in agricultural scenarios often have multimodal characteristics, including image data of crop growth, time series data of environmental monitoring, and dynamic sensor data in livestock health management. In order to fully capture the characteristics of this data, existing systems generally use complex models such as deep neural networks. Although these models can achieve good performance in high-computing environments, they are difficult to run efficiently in low-computing devices due to their large parameter scale and high computational complexity. Common edge devices in agricultural production (such as field sensors and drone embedded chips) are usually resource-constrained and cannot support the computing needs of large-scale models. This results in low operating efficiency of intelligent systems in actual deployments, which cannot meet the real-time and efficiency requirements of agricultural scenarios.

[0003] Secondly, existing systems lack dynamic adjustment capabilities and are difficult to adapt to real-time fluctuations in agricultural data. Agricultural data has significant spatiotemporal dynamic characteristics, such as real-time changes in environmental variables (temperature, humidity), stage-by-stage characteristic changes during crop growth, and short-term drastic fluctuations in livestock health data (such as heart rate fluctuations). These dynamic changes place high demands on the adaptability of intelligent systems. However, most existing systems adopt a static reasoning strategy, that is, the model is directly deployed after offline training, and the model parameters or reasoning paths cannot be dynamically adjusted according to changes in real-time data. This static strategy not only limits the performance of the model in dynamic scenarios, but may also lead to inaccurate prediction results, especially in extreme environments or emergencies (such as pest and disease outbreaks), the system cannot respond quickly and provide high-quality decision support.

[0004] Third, in scenarios with limited resources, the inference paths of existing systems cannot be dynamically optimized, resulting in inefficient use of computing resources. In agricultural scenarios, different tasks (such as disease classification, crop health scoring, and environmental anomaly monitoring) vary greatly in complexity and require different computing resources. For example, disease classification tasks may require multi-layer reasoning of deep networks, while simple environmental monitoring tasks can be completed with only shallow networks. However, existing systems often adopt a fixed reasoning path and use the same computing resources for reasoning regardless of the complexity of the task. This "one-size-fits-all" strategy not only wastes precious computing resources, but may also lead to performance degradation of key tasks (such as pest and disease prediction) due to resource competition. In practical applications, this problem of inefficient resource utilization is particularly prominent, especially in edge computing devices or low-computing environments, which directly restricts the performance and scalability of the system.

[0005] The above problems have seriously restricted the promotion and application of intelligent systems in agricultural scenarios, resulting in the failure of many potential smart agricultural solutions to be implemented. Therefore, there is an urgent need for an efficient and low-resource intelligent system that can run efficiently in edge devices, adapt to dynamic data changes, and flexibly allocate computing resources according to task complexity. Summary of the invention

[0006] In order to address the deficiencies of the prior art, the present application provides an adaptive reasoning system, method and server for agricultural data. By optimizing the model structure, dynamically adjusting the reasoning path and efficiently utilizing computing resources, the method can not only improve the real-time performance of agricultural data processing, but also significantly reduce the dependence on hardware computing power, thereby providing a solution with more practical application value for smart agriculture scenarios.

[0007] The technical effects to be achieved by this application are achieved through the following solutions: According to a first aspect of the present application, there is provided an adaptive reasoning system for agricultural data, comprising: Data collection module: used to collect multimodal agricultural data, including crop image data, environmental monitoring data and livestock health data; Data processing module: used for embedding, feature extraction and fusion processing of the multimodal agricultural data using a multi-level processing model; Model optimization module: used to transfer the hierarchical features of the teacher model to the student model through a multi-layer distillation method, generate distilled data that meets the task requirements, quantize and sparsify the student model after distillation, and optimize the size and performance of the student model to form an adaptive reasoning model; Reasoning path module: dynamically selects the reasoning path according to the task characteristics and allocates computing resources according to the reasoning path; Performance monitoring module: used to monitor the reasoning performance and data distribution changes in real time, and adjust the parameters of the adaptive reasoning model according to the reasoning performance and data distribution changes; Application module: used to input multimodal agricultural data into the adaptive reasoning model to perform crop health scoring, pest and disease risk prediction, and livestock abnormal signal warning.

[0008] Preferably, in the data processing module, an image processing method based on OpenCV is used to process the crop image data, including color space conversion, highlighting detail features through edge enhancement technology, and removing noise; The environmental monitoring data is filled with missing values ​​and outliers are removed to ensure data integrity and consistency; For livestock health data, the sliding window algorithm is used to smooth abnormal fluctuations.

[0009] Preferably, when the data processing module extracts features from multimodal agricultural data, it uses a CLIP encoder to embed features from crop image data, and uses a multi-head attention mechanism to capture the correlation between local diseased areas and overall health status in the image; When extracting features from environmental monitoring data, feature vectors are generated through the table embedding layer in the multi-level processing model and input into a multi-layer feedforward neural network for nonlinear changes; The data processing module uses layer normalization to optimize the distribution of input data and adopts the Dropout mechanism to improve the generalization performance of the model by randomly discarding some neurons.

[0010] Preferably, in the model optimization module, the hierarchical features of the teacher model are transferred to the student model through the multi-layer distillation method, which specifically includes: knowledge distillation process, robustness optimization under anti-perturbation conditions, and dynamic adjustment of category adaptive distillation; wherein: In the knowledge distillation process, the knowledge transfer process between the teacher model and the student model is defined to compress complex features and retain key features; During the robustness optimization process, adversarial disturbances are introduced to train the student model’s anti-disturbance prediction capabilities; In the dynamic adjustment of category adaptive distillation, the attention to complex categories is improved by dynamically adjusting the distillation weight of each category.

[0011] Preferably, the optimization objective of the knowledge distillation process is described by the following loss function: ; in: represents the predicted distribution of the teacher model on the i-th sample, represents the predicted distribution of the student model, σ is the Softmax function, which is used to convert the logits value of the model into a probability distribution; T is the temperature parameter, which is used to smooth the probability distribution to emphasize the correlation between categories; is a weight factor used to weight the loss contribution of different samples; N is the total number of samples; The robustness optimization under disturbance conditions is generated by the FGSM method, which is calculated as follows: ; in: represents the original input data, is the disturbance intensity, is the gradient of the loss function with respect to the input data; in the loss function, adversarial distribution is introduced , specifically expressed as: ; in: represents the standard output distribution of the teacher model, represents the output distribution of the student model under adversarial conditions; L adv is the adversarial loss function; In the dynamic adjustment of category adaptive distillation, the category adaptive weight is calculated as follows: ;

[0012] Where: C i represents the complexity of category i, γ is the adjustment factor used to control the influence of complex categories on the overall training; j is the total number of categories.

[0013] Preferably, the student model after distillation is quantized and sparsely processed as follows: The dynamic range quantization method is used to scale the weights and calculate the zero offset. The quantization of the weights is expressed by the following formula: ;

[0014] in, is the original floating point weight, is the quantized integer weight, s is the scaling factor; In the initialization phase, a static sparse strategy is used to calculate the global importance of each feature by analyzing the L2 norm of the weight matrix, and remove features whose importance is lower than the threshold. The weights and neurons of are calculated according to the following formula: ;

[0015] Among them, I j represents the importance of feature j, W jis the jth column of the weight matrix, and n is the total number of features; For dynamically changing features, a dynamic sparse strategy is used to optimize the model's computing resource allocation in real time, and the sparse rate is calculated using the following formula: ; in, represents the performance gain of the target task, represents the increment of computational cost, is the minimum sparseness rate limit.

[0016] Preferably, in the reasoning path module, the optimal configuration of the reasoning path is generated based on the feature complexity of the input data and the task priority, and the probability of path selection is calculated by the following formula: ; in, Indicates the selection path d i The probability of For path d i The complexity evaluation function for the input data, is an adjustment parameter used to control the distribution preference of path selection; j is the total number of paths.

[0017] Preferably, in the performance monitoring module, by detecting the distribution difference between the input data and the training data, it is determined whether there is a drift phenomenon exceeding the threshold, and the drift is quantified using the following formula: ; Among them, P(x) is the probability distribution of input data, Q(x) is the probability distribution of training data, represents the L1 distance between distributions; D drift When the set threshold δ is exceeded, the process of adjusting or retraining model parameters is triggered; D drift is the offset of the model output; By recording the response time T of each inference i , the average reasoning time T of the task is calculated using the following formula avg : ; Where N is the total number of reasoning tasks; when T avg If the preset time limit is exceeded, the inference path or sparsity rate is dynamically adjusted to reduce the computing load.

[0018] According to a second aspect of the present application, there is provided an adaptive reasoning method for agricultural data using the adaptive reasoning system for agricultural data, comprising the following steps: Step 1: Collect multimodal agricultural data, including crop image data, environmental monitoring data, and livestock health data; Step 2: Embed, extract features and fuse the multimodal agricultural data using a multi-level processing model; Step 3: The hierarchical features of the teacher model are transferred to the student model through a multi-layer distillation method to generate distilled data that meets the task requirements. The student model after distillation is quantized and sparsified to optimize the size and performance of the student model to form an adaptive reasoning model. Step 4: Dynamically select the reasoning path according to the task characteristics and allocate computing resources according to the reasoning path; Step 5: monitor the reasoning performance and data distribution changes in real time, and adjust the parameters of the adaptive reasoning model according to the reasoning performance and the data distribution changes; Step 6: Input the multimodal agricultural data into the adaptive reasoning model to perform crop health scoring, pest and disease risk prediction, and livestock abnormal signal warning.

[0019] According to a third aspect of the present application, there is provided a server, comprising: a memory and at least one processor; The memory stores a computer program, and the at least one processor executes the computer program stored in the memory to implement the above-mentioned adaptive reasoning method for agricultural data.

[0020] According to an embodiment of the present application, the beneficial effects of using the adaptive reasoning system for agricultural data are: through dynamic sparsification, quantization compression, multimodal feature extraction, task hierarchical reasoning and other technical means, the model is lightweight and the reasoning efficiency is improved; In actual deployment, this method can integrate a performance monitoring module, monitor inference performance and data distribution changes in real time, dynamically adjust model parameters, and further improve the system's adaptability and resource utilization efficiency. Through these innovative designs, this method provides new ideas and technical support for the application of agricultural intelligent systems in resource-constrained environments, laying an important foundation for the development of smart agriculture. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the embodiments of the present application or the existing technical solutions, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0022] Figure 1 This is a structural block diagram of an adaptive reasoning system for agricultural data in one embodiment of the present application; Figure 2 This is a flow chart of an adaptive reasoning method for agricultural data in one embodiment of the present application; Figure 3 This is a structural block diagram of a server in an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0024] like Figure 1 As shown, an adaptive reasoning system for agricultural data in one embodiment of the present application includes: Data collection module: used to collect multimodal agricultural data, including crop image data, environmental monitoring data and livestock health data; Data processing module: used for embedding, feature extraction and fusion processing of the multimodal agricultural data using a multi-level processing model; Model optimization module: used to transfer the hierarchical features of the teacher model to the student model through a multi-layer distillation method, generate distilled data that meets the task requirements, quantize and sparsify the student model after distillation, and optimize the size and performance of the student model to form an adaptive reasoning model; Reasoning path module: dynamically selects the reasoning path according to the task characteristics and allocates computing resources according to the reasoning path; Performance monitoring module: used to monitor the reasoning performance and data distribution changes in real time, and adjust the parameters of the adaptive reasoning model according to the reasoning performance and data distribution changes; Application module: used to input multimodal agricultural data into the adaptive reasoning model to perform crop health scoring, pest and disease risk prediction, and livestock abnormal signal warning.

[0025] In one embodiment of the present application, in the data processing module, crop image data is usually collected regularly through high-resolution camera equipment, mainly used to record the status information of crop leaves, including disease characteristics and growth trends. These data are usually stored in JPEG or PNG format, and the resolution is generally above 1080p to ensure sufficient details for analysis. Environmental monitoring data is collected through sensors deployed in the field. These sensors can record key variables such as temperature, humidity, wind speed, etc. in real time. This type of data is stored in CSV format and has a clear timestamp to indicate the collection time of each data point. Livestock health data is collected through wearable devices, such as livestock's heart rate, body temperature, and activity level. These dynamic data are uploaded to the central server in the form of JSON or binary streams for subsequent processing.

[0026] After data collection is completed, multimodal agricultural data needs to be preprocessed. Different data use different data preprocessing methods: For crop image data, we use an image processing method based on OpenCV. First, we convert the image into a color space to remove the influence of lighting conditions. Second, we use edge enhancement technology to highlight details such as leaf boundaries, while removing blurry or noisy images to ensure the quality of input data. For time series data such as environmental monitoring data, methods such as filling missing values ​​and removing outliers are used to ensure the integrity and consistency of the data; For livestock health data, which are dynamic sensor data, the sliding window algorithm is used to smooth short-term fluctuations, thereby enhancing the interpretability and time dependence of the data.

[0027] When the data processing module extracts features from multimodal agricultural data, efficient processing mechanisms are designed for different types of data: The CLIP encoder is used to embed features in crop image data. The encoder can transform high-dimensional pixel space into low-dimensional semantic feature vectors. At the same time, the multi-head attention mechanism is used to capture the relationship between local diseased areas and overall health status in the image, thereby improving the ability to analyze complex image data. When extracting features from environmental monitoring data, feature vectors are generated through the table embedding layer in the multi-level processing model. These feature vectors are then input into a multi-layer feedforward neural network for nonlinear transformation to mine deep dependencies in time series data. This nonlinear transformation enables the model to more effectively capture the complex associations between environmental variables. In order to further optimize the feature extraction process, the Layer Normalization technology is introduced, which can effectively optimize the distribution of input data and enable the model to exhibit faster convergence performance when processing features from different data sources.

[0028] At the same time, in order to avoid the overfitting problem of the model in high-dimensional data processing, the Dropout mechanism is introduced in the feature extraction process. By randomly discarding some neurons, the generalization performance of the model is improved. It is suitable for processing high-dimensional images and time series data, and can significantly improve the performance of the model in actual scenarios.

[0029] By conducting in-depth analysis of the characteristics of multimodal data and combining advanced algorithms and optimization strategies, efficient and accurate feature extraction is achieved, laying a solid foundation for subsequent model training and reasoning.

[0030] In the model optimization module, the hierarchical features of the teacher model are transferred to the student model through a multi-layer distillation method, which includes: knowledge distillation process, robustness optimization under perturbation conditions, and dynamic adjustment of category adaptive distillation, which comprehensively improves the lightweight capability and reasoning efficiency of the model. By optimizing the knowledge transfer mechanism between the teacher model and the student model, it not only effectively reduces the computational cost of the model, but also retains the key feature expression capabilities required for efficient reasoning. Among them:

[0031] In the process of knowledge distillation, by defining the knowledge transfer process between the teacher model and the student model, efficient compression of complex features and retention of key features are achieved. The output of the teacher model is expressed in the form of a high-dimensional probability distribution, which contains rich contextual semantic information about the target task, while the student model generates a more concise expression by learning the output distribution of the teacher model to adapt to low-computing power devices. The optimization goal of the knowledge distillation process is described by the following loss function: ; in: represents the predicted distribution of the teacher model on the i-th sample, represents the predicted distribution of the student model, σ is the Softmax function, which is used to convert the logits value of the model into a probability distribution; T is the temperature parameter, which is used to smooth the probability distribution to emphasize the correlation between categories; is a weight factor used to weight the loss contribution of different samples, and N is the total number of samples. By adjusting the value of T, the impact of difficult-to-classify samples on the training of the student model can be enhanced. For example, at high temperatures, the student model is more likely to capture the way the teacher model handles the fuzzy boundaries between categories, thereby improving the overall classification performance.

[0032] In the robustness optimization stage under adversarial perturbation conditions, adversarial perturbations are introduced during the training process so that the student model can still maintain stable prediction capabilities when facing harsh environments (such as noisy data or abnormal data). Specifically, adversarial perturbations are generated by the Fast Gradient SignMethod (FGSM) method, which is calculated as follows: ; in: represents the original input data, is the disturbance intensity, is the gradient of the loss function with respect to the input data. By superimposing a small perturbation on the input data, the output probability distribution generated by the teacher model under adversarial conditions is used to further optimize the robustness of the student model. In the loss function, the adversarial distribution is introduced. , specifically expressed as: ; in: represents the standard output distribution of the teacher model, represents the output distribution of the student model under adversarial conditions; L adv is the adversarial loss function; by minimizing L adv , the student model is able to better simulate the prediction ability of the teacher model under non-stationary conditions.

[0033] The dynamic adjustment of category-adaptive distillation is designed for the complexity of diverse tasks in agricultural scenarios. By dynamically adjusting the distillation weight W of each category, the focus on complex categories is increased. The calculation method of category-adaptive weight is: ;

[0034] Where: C i represents the complexity of category i, such as the number of samples in the category or the similarity between categories; γ is a regulation factor used to control the degree of influence of complex categories on the overall training; j is the total number of categories. In this strategy, the distillation loss of complex categories is given a higher weight, allowing the student model to achieve higher accuracy on complex tasks. This strategy is particularly suitable for agricultural scenarios such as disease classification tasks, where some disease categories have a small number of samples and fuzzy features.

[0035] In one embodiment of the present application, the student model after distillation is quantized and sparsely processed to further reduce the computation and storage requirements of the model. The core of quantization is to map the floating point weights of the model (usually FP32) to lower precision integers (such as INT8 or INT4). Specifically:

[0036] The dynamic range quantization method is used to scale the weights and calculate the zero offset. The quantization of the weights is expressed by the following formula: ;

[0037] in, is the original floating point weight, is the quantized integer weight, and s is the scaling factor; dynamic range quantization can not only significantly reduce storage overhead, but also control the impact on model accuracy within a reasonable range.

[0038] By comprehensively analyzing the diversity of input data and the complexity of output features, the model is efficiently deployed on low-computing devices, while being able to flexibly respond to dynamic data changes in agricultural scenarios. Ultimately, the optimization scheme proposed in this invention not only improves the prediction performance of the model, but also achieves a level of real-time performance, robustness, and resource utilization efficiency that is unmatched by existing technologies.

[0039] Static sparsity strategy is used in the initialization phase to reduce the impact of long-term unimportant features on the calculation. In agricultural multimodal data, for example, specific environmental parameters (such as humidity) during the crop growth cycle may have lower changes and importance in certain periods of time. Static sparsity calculates the global importance of each feature by analyzing the L2 norm of the weight matrix and removes features with importance below a threshold. The weights and neurons of are calculated according to the following formula: ;

[0040] Among them, I j represents the importance of feature j, W j is the jth column of the weight matrix, n is the total number of features; by setting the global sparse threshold Culling This method is performed in the initialization phase of the model and does not affect the dynamics and flexibility of the model.

[0041] Static sparse methods have limited processing capabilities for dynamically changing features in agricultural data. To make up for this shortcoming, the present invention further proposes a dynamic sparse strategy for real-time optimization of the model's computing resource allocation. The core of dynamic sparseness is to dynamically adjust the activation rate of neurons in combination with the real-time changes in input data. Specifically, the dynamic sparse predictor takes time series data or image attention distribution as input, and calculates the sparse rate based on the importance of the task and the real-time activity of the input features:

[0042] ;

[0043] Active Neurons indicates the number of currently activated neurons, and TotalNeurons indicates the total number of neurons.

[0044] The adjustment of the sparse rate is achieved through the following formula: ; in, represents the performance gain of the target task, represents the increment of computational cost, is the minimum sparsity limit. It ensures that high-activity features are retained first and low-activity features are dynamically pruned when computing resources are limited.

[0045] In the reasoning path module, this application provides a dynamic reasoning path switching mechanism based on task complexity, which is used to intelligently allocate computing resources between different tasks. The selection of reasoning paths is based on three structures: deep network, shallow network and hybrid network, which are suitable for complex tasks, simple tasks and multimodal fusion tasks respectively. After the input data is feature extracted, the dynamic path selector generates the optimal configuration of the reasoning path based on the feature complexity and task priority of the input data. The probability of path selection is calculated by the following formula: ; in, Indicates the selection path d i The probability of For path d i The complexity evaluation function for the input data, is an adjustment parameter used to control the distribution preference of path selection; j is the total number of paths. Complexity evaluation function Including parameters such as the dimension of input features, sparsity rate, and priority of task objectives. For example, for disease classification tasks, if the input image resolution is high and the feature complexity is large, the deep network is more likely to be selected; while for simple tasks such as temperature and humidity monitoring, the shallow network is more likely to be selected.

[0046] After the path selection is completed, the dynamic switching mechanism further optimizes the reasoning efficiency. During the model reasoning process, if the system detects that the computing resource usage of the current task exceeds the set threshold, it will automatically switch to the reasoning path with lower resource requirements. For example, when the crop disease classification task occupies more GPU resources, the reasoning task of environmental data will be preferentially assigned to the shallow network for processing to avoid resource competition. At the same time, when a significant change in the input data is detected (such as a significant increase in the concentration of image attention distribution), the system will dynamically adjust the reasoning path and switch to a deeper network layer to capture more detailed features.

[0047] The output of the dynamic path selection module is the joint optimization result of the task result and the computing resource allocation strategy. Its core goal is to significantly reduce the reasoning time and resource usage while ensuring the accuracy of model reasoning. The output optimization result includes not only the final task prediction result, but also performance monitoring indicators (such as reasoning time, resource utilization) and the path adjustment strategy for the next round of reasoning.

[0048] The combination of sparse optimization and dynamic path selection can effectively deal with the contradiction between task complexity and resource constraints in agricultural scenarios. The static sparse strategy ensures the simplified processing of long-term stable features, the dynamic sparse strategy provides priority support for key features that change in real time, and the dynamic path selection module maximizes the balance between reasoning efficiency and accuracy by intelligently allocating computing resources. The overall framework performs significantly better than existing technologies in agricultural multimodal data processing, providing solid technical support for the application of agricultural intelligent systems in low-computing power devices.

[0049] This application sets up a performance monitoring module to ensure the efficient and stable operation of the system in agricultural scenarios, and to maintain the accuracy and continuity of reasoning even in the face of dynamically changing data environments and unforeseen abnormal inputs. The real-time analysis of the performance monitoring module and the dynamic response of the self-healing mechanism ensure the robustness of the system and the efficiency of resource utilization.

[0050] The core of the performance monitoring module is a comprehensive real-time evaluation of the system's operating status. Its input is the model's real-time inference data and performance indicators, including input feature distribution, inference time, resource usage, and accuracy of prediction results. For input feature distribution, the system determines whether there is a significant drift phenomenon by detecting the distribution difference between input data and training data. Specific methods include:

[0051] By detecting the distribution difference between the input data and the training data, it is determined whether there is a drift phenomenon exceeding the threshold. The drift is quantified using the following formula: ; Among them, P(x) is the probability distribution of input data, Q(x) is the probability distribution of training data, represents the L1 distance between distributions; D drift When the set threshold δ is exceeded, the process of adjusting or retraining model parameters is triggered; D drift is the offset of the model output; By recording the response time T of each inference i , the average reasoning time T of the task is calculated using the following formula avg : ; Where N is the total number of reasoning tasks; when T avgIf the preset time limit is exceeded, the inference path or sparsity rate is dynamically adjusted to reduce the computational load. For example, in a multi-task scenario, when the inference time of the disease classification task increases significantly, the performance monitoring module can optimize the overall performance by reducing the resource allocation ratio of shallow tasks.

[0052] Resource utilization is monitored by real-time tracking of CPU, GPU, and memory usage. Assuming the total system resources are R total , the resource usage of the current task is R used , then the resource utilization U is expressed as:

[0053] ;

[0054] When U exceeds the specified threshold U max When the performance monitoring module is running low, it will actively trigger the reasoning path adjustment strategy, giving priority to switching low-priority tasks to shallow networks or performing sparse optimization to ensure the reasonable allocation of resources.

[0055] Prediction accuracy is one of the core indicators of performance monitoring, which is quantified by real-time calculation of the accuracy of the model's prediction results. The definition of prediction accuracy is as follows:

[0056] ;

[0057] Among them, Correct predictions indicates the number of samples whose prediction results are consistent with the true labels, and Total predictions indicates the total number of samples. min When the performance monitoring module fails, it will analyze the possible causes of prediction deviation, such as data distribution drift, model parameter aging, etc., and trigger the self-healing mechanism.

[0058] The self-healing mechanism in one embodiment of the present application focuses on responding to abnormal situations and dynamically restoring the normal operating state of the system. Its input includes the trigger signal of the anomaly detection and the historical operation record of the system. The first step of the self-healing mechanism is anomaly location, that is, identifying the specific cause of the anomaly. For example, when sensor data is missing, the self-healing mechanism will determine whether it is caused by sensor failure or network delay by checking the data input log; when the logical relationship of the prediction results is inconsistent (for example, the same crop is predicted as two incompatible diseases in the disease classification), the self-healing mechanism will re-analyze the reasoning process of the model and locate the level at which the anomaly occurs.

[0059] After the anomaly is located, the self-healing mechanism starts the recovery process. For input data anomalies, the self-healing mechanism uses alternative models or historical prediction values ​​for fallback operations. Alternative models are pre-trained simplified models that can provide basic prediction results in the case of limited resources or data anomalies.

[0060] Assume that the input data of the current time step is x t , while the historical forecast value is (where k is the fallback window), the fallback prediction formula is: ;

[0061] This method can smooth the impact of abnormal data and ensure the continuity and stability of system output. If the anomaly is caused by aging of model parameters or changes in data distribution, the self-healing mechanism will trigger the online update process of the model.

[0062] Online updates consist of two parts: lightweight parameter adjustment and local retraining. Lightweight parameter adjustment is achieved by optimizing the learning rate and sparsity rate, and its goal is to quickly adapt to subtle changes in data distribution. Local retraining uses the latest input data to incrementally update the key layers of the model, such as retraining the multi-head attention layer to capture new feature patterns.

[0063] The output of the self-healing mechanism is the operating status of the system after recovery, including the predicted results after repair and the updated performance indicators. Through the synergy of performance monitoring and self-healing mechanism, the present invention can effectively respond to dynamic changes and abnormal situations in complex agricultural scenarios, ensuring the stability, real-time and efficiency of the system. The complete closed-loop design of the implementation logic of the overall mechanism from input to recovery provides important technical guarantees for the smart agricultural system.

[0064] like Figure 2 As shown, the adaptive reasoning method for agricultural data using the adaptive reasoning system for agricultural data comprises the following steps: Step 1: Collect multimodal agricultural data, including crop image data, environmental monitoring data, and livestock health data; Step 2: Embed, extract features and fuse the multimodal agricultural data using a multi-level processing model; Step 3: The hierarchical features of the teacher model are transferred to the student model through a multi-layer distillation method to generate distilled data that meets the task requirements. The student model after distillation is quantized and sparsified to optimize the size and performance of the student model to form an adaptive reasoning model. Step 4: Dynamically select the reasoning path according to the task characteristics and allocate computing resources according to the reasoning path; Step 5: monitor the reasoning performance and data distribution changes in real time, and adjust the parameters of the adaptive reasoning model according to the reasoning performance and the data distribution changes; Step 6: Input the multimodal agricultural data into the adaptive reasoning model to perform crop health scoring, pest and disease risk prediction, and livestock abnormal signal warning.

[0065] like Figure 3 As shown, a server in an embodiment of the present application includes: a memory 301 and at least one processor 302; The memory 301 stores computer programs, and the at least one processor 302 executes the computer programs stored in the memory 301 to implement the above-mentioned adaptive reasoning method for agricultural data.

[0066] It should be noted that the above detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the art to which the present application belongs.

[0067] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should also be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.

[0068] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.

[0069] In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or inherent to these processes, methods, products, or apparatuses.

[0070] For ease of description, spatially relative terms, such as "above", "above", "on the upper surface of", "above", etc., may be used herein to describe the spatial positional relationship between a device or feature and other devices or features as shown in the figure. It should be understood that spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation described in the figure. For example, if the device in the accompanying drawings is inverted, the device described as "above other devices or structures" or "above other devices or structures" will be positioned as "below other devices or structures" or "below other devices or structures". Thus, the exemplary term "above" may include both "above" and "below". The device may also be positioned in other different ways, such as rotated 90 degrees or in other orientations, and the spatially relative descriptions used herein are interpreted accordingly.

[0071] In the above detailed description, reference is made to the accompanying drawings, which form a part of this document. In the accompanying drawings, similar symbols typically identify similar components unless the context indicates otherwise. The illustrated embodiments described in the detailed description, drawings, and claims are not meant to be limiting. Other embodiments may be used, and other changes may be made, without departing from the spirit or scope of the subject matter presented herein.

[0072] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. An adaptive reasoning system for agricultural data, characterized in that: include: Data collection module: used to collect multimodal agricultural data, including crop image data, environmental monitoring data and livestock health data; Data processing module: used for embedding, feature extraction and fusion processing of the multimodal agricultural data using a multi-level processing model; Model optimization module: used to transfer the hierarchical features of the teacher model to the student model through a multi-layer distillation method, generate distilled data that adapts to task requirements, quantize and sparsify the student model after distillation, and optimize the size and performance of the student model to form an adaptive reasoning model; Reasoning path module: dynamically selects the reasoning path according to the task characteristics and allocates computing resources according to the reasoning path; Performance monitoring module: used to monitor the reasoning performance and data distribution changes in real time, and adjust the parameters of the adaptive reasoning model according to the reasoning performance and data distribution changes; Application module: used to input multimodal agricultural data into the adaptive reasoning model to perform crop health scoring, pest and disease risk prediction, and livestock abnormal signal warning.

2. The adaptive reasoning system for agricultural data according to claim 1, characterized in that: In the data processing module, the crop image data is processed using an OpenCV-based image processing method, including color space conversion, highlighting detail features through edge enhancement technology, and removing noise; The environmental monitoring data is filled with missing values ​​and outliers are removed to ensure data integrity and consistency; For livestock health data, the sliding window algorithm is used to smooth abnormal fluctuations.

3. The adaptive reasoning system for agricultural data according to claim 2, characterized in that: When the data processing module extracts features from multimodal agricultural data, it uses a CLIP encoder to embed features into crop image data, and uses a multi-head attention mechanism to capture the relationship between local diseased areas and overall health status in the image; When extracting features from environmental monitoring data, feature vectors are generated through the table embedding layer in the multi-level processing model and input into a multi-layer feedforward neural network for nonlinear changes; The data processing module uses layer normalization to optimize the distribution of input data and adopts the Dropout mechanism to improve the generalization performance of the model by randomly discarding some neurons.

4. The adaptive reasoning system for agricultural data according to claim 1, characterized in that: In the model optimization module, the hierarchical features of the teacher model are transferred to the student model through a multi-layer distillation method, which specifically includes: knowledge distillation process, robustness optimization under anti-perturbation conditions, and dynamic adjustment of category adaptive distillation; among which: In the knowledge distillation process, the knowledge transfer process between the teacher model and the student model is defined to compress complex features and retain key features; During the robustness optimization process, adversarial disturbances are introduced to train the student model’s anti-disturbance prediction capabilities; In the dynamic adjustment of category adaptive distillation, the attention to complex categories is improved by dynamically adjusting the distillation weight of each category.

5. The adaptive reasoning system for agricultural data according to claim 4, characterized in that: The optimization objective of the knowledge distillation process is described by the following loss function: ; in: represents the predicted distribution of the teacher model on the i-th sample, represents the predicted distribution of the student model, σ is the Softmax function, which is used to convert the logits value of the model into a probability distribution; T is the temperature parameter, which is used to smooth the probability distribution to emphasize the correlation between categories; is a weight factor used to weight the loss contribution of different samples; N is the total number of samples; The robustness optimization under disturbance conditions is generated by the FGSM method, which is calculated as follows: ; in: represents the original input data, is the disturbance intensity, is the gradient of the loss function with respect to the input data; in the loss function, adversarial distribution is introduced , specifically expressed as: ; in: represents the standard output distribution of the teacher model, represents the output distribution of the student model under adversarial conditions; L adv is the adversarial loss function; In the dynamic adjustment of category adaptive distillation, the category adaptive weight is calculated as follows: ; Where: C i represents the complexity of category i, γ is the adjustment factor used to control the influence of complex categories on the overall training; j is the total number of categories.

6. The adaptive reasoning system for agricultural data according to claim 5, characterized in that: The quantization and sparsification of the distilled student model are as follows: The dynamic range quantization method is used to scale the weights and calculate the zero offset. The quantization of the weights is expressed by the following formula: ; in, is the original floating point weight, is the quantized integer weight, s is the scaling factor; In the initialization phase, a static sparse strategy is used to calculate the global importance of each feature by analyzing the L2 norm of the weight matrix, and remove features whose importance is lower than the threshold. The weights and neurons of are calculated according to the following formula: ; Among them, I j represents the importance of feature j, W j is the jth column of the weight matrix, and n is the total number of features; For dynamically changing features, a dynamic sparse strategy is used to optimize the model's computing resource allocation in real time, and the sparse rate is calculated using the following formula: ; in, represents the performance gain of the target task, represents the increment of computational cost, is the minimum sparseness rate limit.

7. The adaptive reasoning system for agricultural data according to claim 1, characterized in that: In the reasoning path module, the optimal configuration of the reasoning path is generated based on the feature complexity and task priority of the input data. The probability of path selection is calculated by the following formula: ; in, Indicates the selection path d i The probability of For path d i The complexity evaluation function for the input data, is an adjustment parameter used to control the distribution preference of path selection; j is the total number of paths.

8. The adaptive reasoning system for agricultural data according to claim 1, characterized in that: In the performance monitoring module, by detecting the distribution difference between the input data and the training data, it is determined whether there is a drift phenomenon exceeding the threshold. The drift is quantified using the following formula: ; Among them, P(x) is the probability distribution of input data, Q(x) is the probability distribution of training data, represents the L1 distance between distributions; D drift When the set threshold δ is exceeded, the process of adjusting or retraining model parameters is triggered; D drift is the offset of the model output; By recording the response time T of each inference i , the average reasoning time T of the task is calculated using the following formula avg : ; Where N is the total number of reasoning tasks; when T avg If the preset time limit is exceeded, the inference path or sparsity rate is dynamically adjusted to reduce the computing load.

9. An adaptive reasoning method for agricultural data using the adaptive reasoning system for agricultural data according to any one of claims 1 to 8, characterized in that: The steps include: Step 1: Collect multimodal agricultural data, including crop image data, environmental monitoring data, and livestock health data; Step 2: Embed, extract features and fuse the multimodal agricultural data using a multi-level processing model; Step 3: The hierarchical features of the teacher model are transferred to the student model through a multi-layer distillation method to generate distilled data that meets the task requirements. The student model after distillation is quantized and sparsified to optimize the size and performance of the student model to form an adaptive reasoning model. Step 4: Dynamically select the reasoning path according to the task characteristics and allocate computing resources according to the reasoning path; Step 5: monitor the reasoning performance and data distribution changes in real time, and adjust the parameters of the adaptive reasoning model according to the reasoning performance and the data distribution changes; Step 6: Input the multimodal agricultural data into the adaptive reasoning model to perform crop health scoring, pest and disease risk prediction, and livestock abnormal signal warning.

10. A server, characterized in that: include: memory and at least one processor; The memory stores a computer program, and the at least one processor executes the computer program stored in the memory to implement the adaptive reasoning method for agricultural data as described in claim 9.

Citation Information

Patent Citations

  • Micro LED detection method and system based on defect entropy dynamic depth reasoning

    CN118864982A

  • Self-adaptive resource optimization and model generalization method in end-side cloud collaborative intelligent system

    CN119088547A

  • Multi-modal intelligent irrigation decision algorithm based on causal inference

    CN119128634A

  • Lightweight image classification neural network architecture system based on knowledge distillation

    CN119514594A

  • Large model increment training method and system based on dynamic sparsification

    CN119669714A

Cited By

  • Multi-modal data distillation agricultural pest detection large model construction method and system

    CN120654101A

  • Multimodal data distillation agricultural pest and disease detection large model construction method and system

    CN120654101B