Planting optimization method and system based on large model, electronic equipment and storage medium
By using lightweight fine-tuning and dynamic optimization techniques based on large models, customized planting plans are generated, solving the problem of adaptability to complex environments in agricultural planting and realizing intelligent management of efficient resource utilization and stable yield.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-07
- Publication Date
- 2026-03-17
AI Technical Summary
Existing technologies are insufficient to accurately adapt to complex and ever-changing production environments in agricultural planting, lack dynamic optimization capabilities, resulting in low resource utilization efficiency, unstable yield and quality, and high computational overhead, making it difficult to expand applications.
A large-scale model-based planting optimization method is adopted. By inputting the original dataset into the basic large-scale model and performing lightweight fine-tuning, a regionally adaptable large-scale model is formed. Combined with multi-source heterogeneous data and dynamic feedback mechanism, customized planting schemes are generated, and the target planting strategy is determined through iterative dynamic optimization.
It enables more precise and intelligent planting decisions, improves resource utilization efficiency, reduces production inputs, ensures the stability of yield and quality, and supports intelligent and unmanned operation of agricultural management.
Smart Images

Figure CN121685184A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of large model, in particular to a planting optimization method and system based on large model, an electronic device and a storage medium. BACKGROUND
[0002] Agricultural planting planning and management is the core link to improve the efficiency of agricultural production. Traditional methods mainly rely on farmers' experience, static agronomic specifications or simple statistical analysis based on historical data, which have strong subjectivity, poor adaptability and other problems, and are difficult to cope with complex and variable production environments. In recent years, with the development of data science and artificial intelligence technology, planting structure optimization methods based on mathematical programming and management decision support means integrating Internet of Things and remote sensing technology have emerged to some extent, promoting the fine development of agriculture.
[0003] However, the related dynamic planting optimization method still has significant limitations in dealing with the spatio-temporal variability and uncertainty in actual production, which are as follows: first, traditional mathematical models are difficult to accurately depict the strong coupling and nonlinear complex relationship between soil, climate, crops and other multiple factors, and have insufficient modeling accuracy and high development cost; second, the adaptation ability to regional climate, soil, planting system and other heterogeneity characteristics is weak, and the optimization scheme is prone to "illness"; third, there is a lack of unified integration and quantification mechanism for multi-dimensional uncertainty of natural environment, biology and market, and the model has insufficient robustness; fourth, the decision system mainly relies on fixed rules, and it is difficult to realize closed-loop dynamic adjustment based on real-time farmland data; fifth, the complex model has large calculation overhead, which restricts its efficient expansion application in large-scale scenarios.
[0004] Although artificial intelligence technology represented by deep learning has shown great potential in single-point tasks such as crop identification and yield prediction, related research has not yet formed a systematic solution that integrates the multi-source data fusion and prediction ability of large models with regional rapid adaptation and whole-process dynamic optimization. The related technology has obvious technical gaps when facing the inherent regional heterogeneity, high dynamicity and multiple uncertainties of agricultural planting. How to integrate the advanced learning ability of large models with dynamic optimization technology to realize more accurate, intelligent and regionally adaptive planting decisions has become a problem to be solved. SUMMARY
[0005] To solve or partially solve the problems in the related art, the present application provides a planting optimization method and system based on large model, an electronic device and a storage medium, which can generate customized planting schemes and management suggestions that are more in line with the actual situation of the region and more fine to the grid or plot level, greatly improve resource utilization efficiency, reduce production investment, dynamically adjust planting strategies and management measures, and ensure the stability of yield and quality.
[0006] The first aspect of this application provides a planting optimization method based on a large model, comprising: The original dataset is input into the original large model; the original dataset includes at least the environmental temporal features and image temporal features of the target planting area; the original large model includes at least the base large model and the region adapter; Based on the original dataset and the region adapter, the original large model is fine-tuned to obtain a region-adaptive large model; The regional adaptability model generates predicted data for the target planting area based on the original dataset. Iterative dynamic optimization is performed based on the predicted data and real-time status data of the target planting area, as well as the preset optimization goals and constraints, and the target planting strategy of the target planting area is determined through a gating mechanism.
[0007] In an optional real-time mode, after determining the target planting strategy for the target planting area through a gating mechanism, the method further includes: The target planting strategy is executed, and feedback data of the target planting area is collected in real time; the feedback data is used to achieve continuous learning of the large-scale regional adaptability model through a dual-loop feedback mechanism. Determine the update frequency and type of the feedback data; If the feedback data is high-frequency seasonal data, then the status of the target planting area is updated based on the feedback data; If the feedback data is low-frequency seasonal end-of-season data, then the parameters of the area adapter are updated based on the feedback data.
[0008] In an optional real-time mode, if the feedback data is low-frequency seasonal terminal data, updating the parameters of the area adapter based on the feedback data includes: The feedback data is compared with the prediction data of the large-scale regional adaptability model; If the comparison result exceeds a preset threshold, the parameters of the region adapter are updated.
[0009] In an optional real-time mode, the region adapter includes an adapter matrix; the step of fine-tuning the original large model based on the original dataset and the region adapter to obtain a region-adaptive large model includes: Freeze the original parameters of the base model, and generate the output data of the base model based on the original dataset through forward propagation; A loss function is constructed based on the output data, and the parameters of the adapter matrix in the region adapter are adjusted using the loss function to obtain the large-scale region adaptation model.
[0010] In an optional real-time mode, the prediction data includes several prediction tasks. The step of iteratively and dynamically optimizing based on the prediction data and real-time status data of the target planting area, as well as preset optimization objectives and constraints, and determining the target planting strategy for the target planting area through a gating mechanism includes: Based on the predicted data, the real-time state data, and the preset optimization target and constraints, several state vectors are generated, as well as the transition dynamics when the predicted task is executed under each of the state vectors; For each state vector, the expected value corresponding to the state vector is iteratively calculated based on the transition dynamics and the preset optimization objective and constraints; until the expected value converges, the prediction task corresponding to the maximum expected value is determined as the planting strategy corresponding to the state vector. The target planting strategy is determined by dynamically assigning weights to each state vector corresponding to the planting strategy through a gating mechanism.
[0011] In an optional real-time mode, the step of iteratively calculating the expected value corresponding to the state vector based on the transition dynamics and the preset optimization objective and constraints includes: Set a reward function corresponding to the preset optimization objective and constraints; For each state vector, in the first round of iterative calculation, the expected value corresponding to each state vector is calculated based on the reward function, the transition dynamics, and the initial expected value; Starting from the second round of iterations, the expected value of the current round is calculated based on the expected value calculated in the previous round.
[0012] In an optional real-time mode, the step of inputting the raw dataset into the original large model further includes: Set the first weight, second weight, and third weight for the query vector, key vector, and value vector respectively; A query vector is calculated based on the environmental time features and the first weight; a key vector is calculated based on the image time features and the second weight; and a value vector is calculated based on the image time features and the third weight. Based on the query vector, the key vector, and the value vector, the environmental temporal features and the image temporal features are fused in a multimodal manner using a cross-attention mechanism.
[0013] The second aspect of this application provides a planting optimization method based on a large model, comprising: The input module is used to input the raw dataset into the original large model; the raw dataset includes at least the environmental temporal features and image temporal features of the target planting area; the original large model includes at least the base large model and the region adapter. The fine-tuning module is used to fine-tune the original large model based on the original dataset and the region adapter to obtain a region-adaptive large model; The prediction module is used to generate predicted data for the target planting area based on the original dataset using the regional adaptability model. The optimization module is used to perform iterative dynamic optimization based on the predicted data and real-time status data of the target planting area, as well as preset optimization targets and constraints, and to determine the target planting strategy of the target planting area through a gating mechanism.
[0014] A third aspect of this application provides an electronic device, comprising: Processor; and A memory that stores executable code, which, when executed by the processor, causes the processor to perform the method described above.
[0015] A fourth aspect of this application provides a computer-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, causes the processor to perform the method described above.
[0016] The technical solution provided in this application may include the following beneficial results: This application provides a planting optimization method based on a large model, comprising: inputting an original dataset into an original large model; the original dataset including at least environmental temporal features and image temporal features of the target planting area; the original large model including at least a base large model and a regional adapter; fine-tuning the original large model based on the original dataset and the regional adapter to obtain a regionally adapted large model; generating predicted data for the target planting area based on the original dataset using the regionally adapted large model; iteratively and dynamically optimizing based on the predicted data and real-time status data of the target planting area, as well as preset optimization objectives and constraints, and determining the target planting strategy for the target planting area through a gating mechanism. Through the above scheme, artificial intelligence large models, the Internet of Things, big data analysis, and agricultural production are deeply integrated, realizing intelligent, automated, and unmanned agricultural management, improving production efficiency and agricultural product quality; simultaneously, by optimizing resource utilization and reducing environmental pollution, it promotes the sustainable development of regional agriculture, and can generate customized planting plans and management suggestions that are more in line with regional realities and more refined to the grid or plot level, significantly improving resource utilization efficiency, reducing production inputs, dynamically adjusting planting strategies and management measures, and ensuring the stability of yield and quality.
[0017] The technical solution of this application can also efficiently fine-tune the basic large model through lightweight technology, so that it can deeply understand and adapt to the unique environment, crops, farming habits and socio-economic characteristics of the region, forming a regionally adapted large model. This avoids training a large model from scratch for each region, significantly reducing the computing resources and time costs required for model training and deployment. It adopts a modular architecture, has good scalability, and is easy to promote to agricultural production of different crop types, different geographical regions and different scales.
[0018] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0019] The above and other objects, features and advantages of this application will become more apparent from the more detailed description of exemplary embodiments thereof in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments thereof.
[0020] Figure 1 This is a schematic flowchart illustrating a planting optimization method based on a large model, as shown in an embodiment of this application. Figure 2 This is a schematic flowchart illustrating the region-adaptive large model learning continuous method in an embodiment of this application; Figure 3 This is a flowchart illustrating the lightweight fine-tuning method for a large regional adaptation model as shown in the embodiments of this application; Figure 4 This is a flowchart illustrating the dynamic optimization method for solving the target planting strategy as shown in the embodiments of this application; Figure 5 This is a flowchart illustrating a planting optimization method based on a large model, as shown in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a planting optimization system based on a large model, as shown in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an electronic device shown in an embodiment of this application. Detailed Implementation
[0021] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to make this application more thorough and complete, and to fully convey the scope of this application to those skilled in the art.
[0022] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0023] It should be understood that although the terms "first," "second," "third," etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0024] Explanation of related terms: Regional Adaptive Large Model: This refers to an intelligent model that is based on a general, pre-trained basic agricultural large model and is formed by efficient and lightweight fine-tuning or parameter adaptation of characteristic data such as the unique environment, crops, and farming habits of a specific geographical region. It is capable of high-precision prediction, state perception, and complex relationship reasoning in that region.
[0025] Lightweight fine-tuning techniques refer to methods used when adapting large pre-trained models to specific tasks or domains, training only a small number of newly added parameters or some existing parameters, rather than updating the entire model's parameters. Examples include LoRA (Low-Rank Adaptation) and Adapter-based fine-tuning.
[0026] Multi-source heterogeneous data refers to datasets that originate from different sources and possess varying formats, structures, and characteristics. In the agricultural field, it typically includes environmental data, remote sensing data, historical data, and agricultural activity data.
[0027] Dynamic optimization refers to an optimization method that continuously or periodically adjusts decision variables based on the system state and external environment that change over time, in order to achieve the optimal cumulative goal or satisfy dynamic constraints throughout the entire decision-making cycle.
[0028] Dynamic Feedback Mechanism: This refers to the mechanism that feeds back the implementation effects of system decisions and new real-time monitoring data to the decision-making system to update the model status, adjust model parameters, or correct decision-making strategies, thereby achieving continuous learning and optimization.
[0029] State perception refers to the system's ability to accurately acquire and understand the current state information of the farmland system (such as crop growth stage, health status, soil moisture and nutrient status, and pest and disease risks) by using sensor data, remote sensing data, historical data, etc., through model analysis and reasoning.
[0030] RALM: Regional Agricultural Large Model, is the name given to a crop large model adapted to a specific region after fine-tuning LoRA, namely the regional adaptation large model in this application.
[0031] While artificial intelligence technologies, represented by deep learning, have demonstrated strong potential in single-point tasks such as crop identification and yield prediction, related research has yet to develop a systematic solution that integrates the multi-source data fusion and prediction capabilities of large models with rapid regional adaptation and dynamic optimization throughout the entire process. These technologies exhibit significant gaps when facing the inherent regional heterogeneity, high dynamism, and multiple uncertainties of agricultural planting. How to integrate the advanced learning capabilities of large models with dynamic optimization techniques to achieve more accurate, intelligent, and regionally adaptable planting decisions has become an urgent problem to be solved.
[0032] To address the aforementioned issues, this application provides a planting optimization method based on a large model, which can generate customized planting plans and management suggestions that are more in line with the actual conditions of the region and more refined to the grid or plot level. This significantly improves resource utilization efficiency, reduces production input, dynamically adjusts planting strategies and management measures, and ensures the stability of yield and quality.
[0033] The technical solutions of the embodiments of this application are described in detail below with reference to the accompanying drawings.
[0034] Figure 1 This is a schematic flowchart illustrating a planting optimization method based on a large model, as shown in an embodiment of this application.
[0035] See Figure 1 The method includes: Step 110: Input the original dataset into the original large model; the original dataset includes at least the environmental temporal features and image temporal features of the target planting area; the original large model includes at least the base large model and the regional adapter.
[0036] In this embodiment, taking a cornfield as the target planting area, soil moisture sensors, temperature sensors, and a small weather station can be deployed in the target planting area, and satellite remote sensing data (such as Sentinel-2) can be connected to the data source. Real-time environmental data such as soil moisture, temperature, and plot microclimate can be collected daily or weekly in a time-series order. Furthermore, multispectral images from the latest remote sensing satellites can be extracted based on an improved Swing Transformer to obtain image data related to spatiotemporal characteristics, monitoring corn growth, leaf color, and signs of potential pests and diseases. Additionally, data on recent agricultural activities by farmers, such as manual weeding and fertilization, can be collected. The target planting area can be composed of several grids.
[0037] In one example, the structure of the original large model was improved by adding a region adapter to the basic model. For example, a LoRA-trainable region adapter was injected into a specific layer of the basic large model (such as the attention matrix in a Transformer). The original large model can adopt a multimodal spatiotemporal Transformer architecture with an input encoding layer, which includes an environmental factor encoder, a remote sensing image encoder, and an agronomical knowledge encoder. The environmental factor encoder can perform 1D (1-dimensional) convolution + position encoding on the collected environmental data according to the collection time. Each time step in the time series generates a unique, learnable vector representation. This vector representation is added to the environmental data at the corresponding time step to obtain the environmental temporal features. ,in This refers to a d-dimensional real vector space. By performing location encoding on environmental data, both the content of the environmental data and its temporal location can be considered. For example, subsequent large-scale models can understand the difference between "three consecutive days of high temperatures" and "three days of scattered high temperatures." For image data related to spatiotemporal features, remote sensing image encoders can perform dimensionality reduction to obtain block features, thereby obtaining the image temporal features. ,in That is, the space formed by a three-dimensional real tensor of dimension (h, w, d), where h is the height, w is the width, and d is the depth. The dimension d is the same. An agronomic knowledge encoder can embed prior knowledge such as crop variety and growth stage into a knowledge vector. ,in Knowledge vectors can transform agricultural planting-related knowledge and language into mathematical forms that large models can "understand" and "operate" on, thereby enabling large models to possess semantic understanding, logical reasoning, and knowledge application capabilities. By cleaning, calibrating, and integrating environmental data, image data, and agricultural activity data, a plot-level spatiotemporal dataset (i.e., the original dataset) is formed.
[0038] In an optional embodiment of this application, step 110 is followed by: Set the first weight, second weight, and third weight for the query vector, key vector, and value vector respectively; The query vector is calculated based on environmental time features and the first weight; the key vector is calculated based on image time features and the second weight; and the value vector is calculated based on image time features and the third weight. Multimodal fusion of environmental and image temporal features is performed using a cross-attention mechanism based on query vectors, key vectors, and value vectors.
[0039] Cross-Attention mechanism is used to align multi-source heterogeneous data for query vectors. Key vector Sum value vector Set their respective first weights. Second weight and the third weight Based on environmental time characteristics and first weight Calculate query vector Based on image temporal features Second weight Calculate the key vector Based on image temporal features and the third weight calculation value vector In one example, it is calculated using the following equation 1: (1) Based on the query vector Key vector Sum value vector Environmental temporal features through cross-attention mechanism and image temporal characteristics Multimodal fusion is performed, and the calculation formula is shown in Equation 2: (2) in, For attention, d is the feature dimension, which is related to the environmental and temporal features. The dimension d is the same.
[0040] Step 120: Fine-tune the original large model based on the original dataset and the region adapter to obtain a region-adaptive large model.
[0041] The original large model can be fine-tuned using the original dataset and a region adapter to obtain a region-adaptive large model. During the fine-tuning process, the parameters of the basic large model remain unchanged, and only the parameters of the region adapter are trained to minimize the loss function between predictions and historical observations. Lightweight techniques (such as LoRA and Adapter-based fine-tuning) are used to efficiently fine-tune the basic large model, enabling it to deeply understand and adapt to the unique environment, crops, farming habits, and socio-economic characteristics of the target planting area.
[0042] Step 130: Generate predicted data for the target planting area based on the original dataset using a large regional adaptation model.
[0043] The regional adaptability model is based on the original dataset and provides real-time sensing output and prediction data for the target planting area. For example, it can measure soil moisture changes, crop transpiration, nutrient uptake rate, and predicted yield potential in different areas (grid level) of the target planting area under different irrigation and fertilization schemes in the coming week. Combined with real-time remote sensing image data and weather forecasts, it can predict the local risk of future pest and disease outbreaks and the risk of runoff caused by excessive irrigation / fertilization.
[0044] Step 140: Iterative dynamic optimization is performed based on the predicted data and real-time status data of the target planting area, as well as the preset optimization goals and constraints, and the target planting strategy of the target planting area is determined through a gating mechanism.
[0045] In this embodiment, a dynamic optimization algorithm is used to dynamically optimize the planting strategy for the target planting area. Specifically, based on real-time sensing output and prediction data of the target planting area (including the predicted status and potential risks of different grids in the target planting area), real-time status data of the target planting area (such as average soil moisture and crop growth stage), and preset optimization objectives and constraints, the optimization objectives include maximizing yield and minimizing water and fertilizer input, while constraints include local water resource quotas and total fertilizer application limits. Iterative learning is performed in a simulated environment to find irrigation and fertilization strategies that maximize long-term cumulative rewards (balancing yield and resource efficiency) under the uncertainty of the current prediction data. For example, if future high temperatures and drought are predicted, and the soil moisture in a certain area is low, it may be recommended to increase the irrigation frequency and amount in that area; if heavy rain is predicted, irrigation may be postponed and the fertilization plan adjusted to avoid nutrient loss. For areas with light soil texture and steep slopes, a strategy of small, frequent irrigation may be recommended to reduce runoff. After iterative dynamic optimization, a target planting strategy for the target planting area can be generated through a gating mechanism based on the current state of the target planting area. The target planting strategy provides corresponding tasks for different aspects of the problem. In one example, a target planting strategy could be a detailed irrigation plan (when, where, and amount of water) and fertilization recommendations (type, amount, application time, and application area) for different grids within a target planting area over a week. The final generated target planting strategy can be pushed to the user terminal, displaying a plot map and recommended irrigation and fertilization areas and specific amounts, or generating corresponding control commands based on the target planting strategy. These commands can then control the intelligent irrigation system to perform corresponding actions, achieving differentiated and precise irrigation for specific regions.
[0046] This application provides a planting optimization method based on a large model, comprising: inputting an original dataset into an original large model; the original dataset including at least environmental temporal features and image temporal features of the target planting area; the original large model including at least a base large model and a regional adapter; fine-tuning the original large model based on the original dataset and the regional adapter to obtain a regionally adapted large model; generating predicted data for the target planting area based on the original dataset using the regionally adapted large model; iteratively and dynamically optimizing based on the predicted data and real-time status data of the target planting area, as well as preset optimization objectives and constraints, and determining the target planting strategy for the target planting area through a gating mechanism. Through the above scheme, artificial intelligence large models, the Internet of Things, big data analysis, and agricultural production are deeply integrated, realizing intelligent, automated, and unmanned agricultural management, improving production efficiency and agricultural product quality; simultaneously, by optimizing resource utilization and reducing environmental pollution, it promotes the sustainable development of regional agriculture, and can generate customized planting plans and management suggestions that are more in line with regional realities and more refined to the grid or plot level, significantly improving resource utilization efficiency, reducing production inputs, dynamically adjusting planting strategies and management measures, and ensuring the stability of yield and quality.
[0047] As one possible implementation of this application Figure 2 This is a schematic flowchart illustrating the region-adaptive large model learning continuous method in an embodiment of this application.
[0048] See Figure 2 This method is executed after the target planting strategy for the target planting area is determined through a gating mechanism, and includes: Step 210: Execute the target planting strategy and collect feedback data from the target planting area in real time; the feedback data is used to achieve continuous learning of the regional adaptability model through a dual-loop feedback mechanism.
[0049] After implementing the target planting strategy, feedback data from the target planting area is continuously collected in real time to dynamically optimize the regional adaptability model. Feedback data can include soil temperature and humidity, and changes in maize growth in the target planting area. After preprocessing, part of the feedback data is used to update the regional adaptability model's perception of the current state of the target planting area, and another part serves as a feedback signal for strategy evaluation and adjustment in the reinforcement learning algorithm. This dual-loop feedback mechanism enables continuous learning of the regional adaptability model, driving prediction and optimization decisions in the next cycle. This dual-loop feedback mechanism is a dynamic feedback mechanism. For example, if the recommended irrigation amount fails to effectively alleviate drought stress in a certain area, the irrigation strategy for that area will be adjusted in the next round of decision-making, potentially triggering the regional adapter to perform deeper fine-tuning of water-response-related parameters in the regional adaptability model.
[0050] Step 220: Determine the update frequency and type of the feedback data.
[0051] The dual-loop feedback mechanism in this application includes a fast feedback loop and a slow feedback loop. The fast feedback loop and the slow feedback loop are selected according to the update frequency and type of the feedback data.
[0052] Step 230: If the feedback data is high-frequency seasonal data, then update the status of the target planting area based on the feedback data.
[0053] If the feedback data is high-frequency (e.g., daily / weekly) seasonal data, a rapid feedback loop is implemented. This loop corrects the regional adaptability model's perception of the current target planting area's status based on the feedback data, thereby updating the target planting area's status. The rapid feedback loop ensures that the regional adaptability model's decisions are always based on the latest ground conditions, enabling rapid response to unforeseen events. It serves as a state correction loop for tactical adjustments.
[0054] Step 240: If the feedback data is low-frequency seasonal terminal data, then compare the feedback data with the prediction data of the regional adaptability large model.
[0055] If the feedback data is low-frequency (such as seasonal end-of-season data after each harvest or after the growing season), it enters a slow feedback loop, where the feedback data (such as total yield or total resource consumption) is comprehensively compared with the prediction data of the regional adaptability model.
[0056] Step 250: If the comparison result exceeds the preset threshold, update the parameters of the area adapter.
[0057] If the comparison between the feedback data and the predicted data exceeds a preset threshold, the parameters of the regional adapter are fine-tuned. The feedback data of the completed season is added to the historical dataset, and the lightweight fine-tuning process is run again to correct the parameters of the large regional adaptation model. This is a strategic optimization model parameter correction loop.
[0058] This application provides a method for continuous learning of a regionally adaptable large model, which can monitor changes in key environmental factors such as climate and pests in real time, and quickly predict their potential impact on crop growth using a regionally adaptable large model. It can dynamically adjust planting strategies and management measures to help crops better cope with adverse environments, improve their resistance to drought, floods, and pests, and ensure the stability of yield and quality. Through a dual-loop feedback mechanism, the model can continuously learn and optimize, effectively improving resource utilization efficiency, ensuring crop yield, and reducing environmental risks.
[0059] As one possible implementation of this application Figure 3 This is a flowchart illustrating the lightweight fine-tuning method for a large regional adaptation model, as shown in an embodiment of this application.
[0060] See Figure 3 The region adapter includes an adapter matrix, and the method includes: Step 310: Freeze the original parameters of the basic large model, and generate the output data of the original large model based on the original dataset through forward propagation.
[0061] During the lightweight fine-tuning of the original large model, the original parameters of the base large model are frozen. That is, an m x n real matrix. The original dataset is forward-propagated, and the modification amount of the original parameters is calculated using the adapter matrix (including matrix A and matrix B). The calculation formula is shown in Formula 3: (3) Among them, A N(0, σ 2 That is, A is a variable with a mean of 0 and a variance of σ. 2 The normal distribution is given, and B is initialized to 0.
[0062] The original dataset generates output data after forward propagation. The calculation formula is shown in Formula 4: (4) Where x represents the feature vector (or feature matrix) of the original dataset, with dimensions equal to or greater than 1. The number of columns is the same.
[0063] Step 320: Construct a loss function based on the output data, and adjust the parameters of the adapter matrix in the region adapter using the loss function to obtain a large-scale region adaptation model.
[0064] A loss function can be constructed based on the output data. loss function As shown in Formula 5: (5) Where N is the number of samples, representing the total number of pest samples used to calculate the loss value of the current batch. For example, if a training batch contains 64 farmland images, then N is 64, and the loss function calculates the average loss of these 64 samples. The predicted probability, included in the output data h, represents the confidence probability that RALM predicts the i-th sample as a "positive example" (i.e., "insect infestation exists"), and its value ranges from 0 to 1. γ (gamma) is the focusing parameter used to adjust the weight of "easy" and "difficult" samples on the contribution to the loss. In one example, . Class weight is a weighting coefficient associated with the class, used to balance the importance of "pest-infested" and "pest-free" samples. Since the vast majority of samples in field data are "pest-free," "pest-infested" samples are very rare, direct training would cause the model to be biased towards the majority class. Its purpose is to artificially increase the weight of minority class (insect pest) samples in the loss calculation. This is typically calculated before training begins, based on the label distribution of the entire training set. For the... If a sample is a positive example (insect pest), then If it is a negative example (no pests), then , For positive examples, The weights are negative examples.
[0065] The original dataset represents the raw data before fine-tuning, which was either unlabeled or weakly labeled. After lightweight fine-tuning, the model outputs enhanced or labeled high-quality data through forward propagation. Taking the corn pest detection task as an example, the input original dataset includes: image temporal features: 10m resolution multispectral satellite image of a county in the North China Plain (without pest annotations); environmental temporal features: daily temperature, precipitation, and humidity data of the region (time series); weakly labeled: only containing a binary label of "whether pests have occurred" (without specific type or location information). The output dataset after RALM processing includes: automatic annotation: for each remote sensing image, outputting: pest type (e.g., corn borer, armyworm), occurrence location (boundary box within the image), severity (0-1 continuous value); environmental correlation analysis: such as "the probability of locust hatching increases when the temperature is >30℃ and the humidity is <60% for 5 consecutive days". Through lightweight fine-tuning of RALM, not only is the model performance improved, but the raw data is also transformed into digital assets with agronomical value, providing core data support for regional smart agriculture.
[0066] During the lightweight fine-tuning process, the parameters of the adapter matrix are adjusted with the goal of minimizing the loss function to obtain a large-scale regionally adapted model. After lightweight fine-tuning, a lightweight "regional adapter" including the adapter matrix is generated. During deployment, only the basic large-scale model and the corresponding regional adapter need to be loaded to form a large-scale regionally adapted model.
[0067] This application provides a lightweight fine-tuning method for large models. By using lightweight technology, the basic large model is efficiently fine-tuned to enable it to deeply understand and adapt to the unique environment, crops, farming habits, and socio-economic characteristics of the region, forming a regionally adapted large model. This avoids training a large model from scratch for each region, significantly reducing the computational resources and time costs required for model training and deployment. The modular architecture has good scalability and is easy to extend to different crop types, different geographical regions, and different scales of agricultural production.
[0068] As one possible implementation of this application Figure 4 This is a flowchart illustrating the dynamic optimization method for solving the target planting strategy as shown in the embodiments of this application.
[0069] See Figure 4 The prediction data includes several prediction tasks, and this method includes: Step 410: Generate several state vectors based on the predicted data, real-time state data, and preset optimization objectives and constraints, as well as the transition dynamics when performing the prediction task under each state vector.
[0070] The prediction data generated by the regional adaptability large model includes several prediction tasks, such as different irrigation amounts and fertilization schemes for the target planting area in the coming week. In one example, the prediction task can be defined as an action A, which is a set of discrete management options, such as irrigation options {no irrigation, 10mm irrigation, 20mm irrigation}, or fertilization options {no fertilization, 5kg / ha nitrogen application}, listing the available management options. Based on the prediction data, real-time state data, and preset optimization objectives and constraints, several state vectors S are defined. In one example, the state vector s ∈ {drought, suitable, overly wet}. Furthermore, the transition dynamics P(s, a, s') can be generated for each state vector when performing each prediction task, where s is the current state of the target planting area, s' is the next state s' predicted by the regional adaptability large model after taking action a. The transition dynamics P(s, a, s') is a probabilistic model jointly determined by the state (e.g., evaporation, rainfall) and the action. For example, irrigating 20mm under drought conditions has a 90% probability of transitioning to a suitable condition and a 10% probability (due to strong evaporation) of transitioning to drought; not irrigating under suitable conditions has a 70% probability of remaining suitable (no rain) and a 30% probability of transitioning to drought (sunny and windy). In actual planting, the situation may be more complex and requires model simulation.
[0071] Step 420: For each state vector, set the reward function corresponding to the preset optimization objective and constraints.
[0072] For each state vector S, a reward function R(s, a, s') corresponding to the preset optimization objective and constraints can be set. The reward function R(s, a, s') is a function aligned with multiple optimization objectives, representing the immediate reward obtained when transitioning to the next state s' after performing action a in state s. Examples of reward function R(s, a, s') settings are as follows: Soil changes from dry to suitable: r = +5 (crop grows well); Soil remains suitable: r = +2 (maintains good condition); Soil changes from suitable to overly wet: r = -3 (potential root rot, wasted water); Soil changes from dry to dry: r = -5 (crop suffers stress). In practical applications, the reward function can be designed to be more complex, incorporating factors such as water costs, market prices, yield gains, and environmental impacts.
[0073] Step 430: In the first round of iterative calculation, the expected value corresponding to each state vector is calculated based on the reward function, transition dynamics, and initial expected value.
[0074] The core idea of the dynamic optimization algorithm (such as the algorithm for solving Markov decision processes) used in this application is to find a policy (π), which is a function that determines the optimal action 'a' to take in any state 's' to maximize the expected value from the current state to the end of the growing season. For each state, the expected value corresponding to each action can be calculated and compared, and the largest expected value can be taken as the expected value for that state.
[0075] In the first round of iterative calculation, an initial expected value can be set (e.g., set to 0). Based on the reward function R(s,a, s'), the transition dynamics P(s, a, s'), and the initial expected value, the expected value of executing action A corresponding to each prediction task can be calculated. Expected value It can be calculated using formula 6: (6) in, Let π(a|s) represent the expected value of state s under policy π, where π(a|s) represents the probability of choosing action a in state s. In the optimal policy, the best action with a probability of 1 is usually chosen directly. β is the discount factor (0<β<1), which means that the present value of future rewards is not as valuable as the immediate reward.
[0076] In one example, assuming the target planting area is in state s = drought and the discount factor β = 0.9, it is necessary to calculate whether irrigation or no irrigation is better. Assume that in the initial state, both V(suitable) and V(drought) are set to 0.
[0077] Step 1: Calculate the expected value V(drought, irrigation) of performing the "irrigate 20mm" action using Formula 6. After performing the "irrigate 20mm" action, there is a 90% probability of returning to suitable conditions and a 10% probability of returning to drought. The calculation process is shown in Formula 7 below:
[0078] Step 2: Calculate the expected value V(drought, no irrigation) of performing the "no irrigation" action using Formula 6. After performing the "no irrigation" action, there is a 100% probability of remaining in drought (assuming no rain). The calculation process is shown in Formula 8 below:
[0079] Step 3: Compare and update expected values: Among all the calculated expected values, take the maximum value as the new value for the state of drought: V_new(drought) = max[V(drought, irrigation), V(drought, no irrigation)] = max[4.4, -5] = 4.4. The strategy at this time is irrigation.
[0080] Repeat the above three steps to update the expected values of the other states (suitable, overly wet). Assume that V(suitable) becomes 3.0 after calculation.
[0081] Step 440: Starting from the second round of iteration, calculate the expected value of the current round based on the expected value calculated in the previous round, until the expected value converges. Then, determine the prediction task corresponding to the maximum expected value as the planting strategy corresponding to the state vector.
[0082] In the second iteration, the expected value calculated in the previous round is used to calculate the expected value for the current round. For example, it is calculated again using Formula 6. The calculation process is shown in Equation 9 below:
[0083] Calculate again using Formula 6 The calculation process is shown in Equation 10 below: (10) Compare and update the expected value: Among all the calculated expected values, take the maximum value as the new value for the state of drought: V_new(drought) = max[7.23, -1.04] = 7.23. The strategy at this time is still irrigation.
[0084] This process is repeated iteratively until the expected value converges. Ultimately, for each state, we can obtain an expected value V*(s) and an optimal policy π*(s), and determine the optimal action as the planting policy corresponding to that state.
[0085] Step 450: The weight of the planting strategy corresponding to each state vector is dynamically allocated through a gating mechanism to determine the target planting strategy.
[0086] Gating mechanisms essentially involve dynamically calculating a feature weight mask for each state vector. Based on the current state of the target planting region, the weights of the planting strategy corresponding to each state vector are calculated, thereby determining the optimal target planting strategy. This achieves adaptive feature selection and information flow control, ultimately improving the overall performance of multi-task learning. Gating mechanisms primarily dynamically assign weights to features from the shared backbone network. Essentially, it's an attention network that learns a lightweight neural network to dynamically calculate weights. A typical and efficient implementation is the use of a soft attention gate. The advantages of gating mechanisms are: Dynamic adaptability: The weights are not fixed, but dynamically generated based on each input sample. For example, for a plot of land experiencing drought, the gating mechanism will assign high weights to the planting strategy corresponding to the drought state for the yield prediction task, and at the same time assign high weights to the pest resistance-related features for the pest prediction task (because crops under drought stress are more susceptible to pests); Mitigation of negative transfer: It effectively reduces interference between tasks. If a state vector is noise for task 1 but useful for task 2, the gating mechanism will reduce or even turn off its weight for task 1 (set it to 0) without affecting its contribution to task 2; Parameter efficiency: The gating network itself is small, adding only a few parameters, but greatly enhancing the multi-task learning ability of large models.
[0087] In this embodiment, a dynamic optimization algorithm combined with a gating mechanism is used to determine the target planting strategy. The dynamic optimization algorithm, through repeated trials (conducted within the model) and weighing immediate rewards against long-term value, utilizes transition dynamics and reward functions to evaluate the long-term consequences of each action in any state. Ultimately, it determines the optimal action that brings the maximum cumulative expected value for each possible state, thus forming the optimal management strategy. Based on real-time monitoring and accurate prediction, the dynamic optimization decision-making algorithm can intelligently recommend the optimal dosage and timing of water, fertilizer, and pesticides, avoiding overuse or underuse, significantly improving resource utilization efficiency, reducing production inputs, and minimizing negative environmental impacts. The gating mechanism enables adaptive feature selection and information flow control, ultimately improving the overall performance of multi-task learning.
[0088] For a better understanding of the technical solution of this application, please refer to Figure 5A flowchart of a planting optimization method based on a large-scale model is shown. First, meteorological forecast data, environmental temporal characteristics collected by field sensors, and image temporal characteristics acquired by satellite remote sensing are collected for the target planting area. The collected meteorological forecast data, environmental temporal characteristics, and image temporal characteristics are then preprocessed. The preprocessed data is input into a regional adaptability large-scale model, where a dynamic optimization algorithm makes decisions to obtain a target planting strategy. Executing the target planting strategy causes changes in the crop's state, which are fed back to the regional adaptability large-scale model through a double-loop feedback mechanism for adjustment. Furthermore, the image temporal characteristics of crop state changes acquired in real time by satellite remote sensing are also used. This application deeply integrates artificial intelligence large-scale models, the Internet of Things, big data analysis, and agricultural production, realizing intelligent, automated, and unmanned agricultural management, improving production efficiency and agricultural product quality. Simultaneously, by optimizing resource utilization and reducing environmental pollution, it promotes the sustainable development of regional agriculture.
[0089] Corresponding to the aforementioned application function implementation method embodiments, this application also provides a planting optimization system based on a large model, an electronic device, and corresponding embodiments.
[0090] Figure 6 This is a schematic diagram of the structure of a large-model-based planting optimization system 600 shown in an embodiment of this application.
[0091] See Figure 6 The system includes: Input module 610 is used to input the original dataset into the original large model; the original dataset includes at least the environmental temporal features and image temporal features of the target planting area; the original large model includes at least the base large model and the region adapter; The fine-tuning module 620 is used to fine-tune the original large model based on the original dataset and the region adapter to obtain a region-adaptive large model; Prediction module 630 is used to generate prediction data for the target planting area based on the original dataset using a large regional adaptability model; The optimization module 640 is used to perform iterative dynamic optimization based on the predicted data and real-time status data of the target planting area, as well as the preset optimization targets and constraints, and to determine the target planting strategy of the target planting area through a gating mechanism.
[0092] As one possible implementation of this application, the system further includes: The feedback data module is used to execute the target planting strategy and collect feedback data from the target planting area in real time. The feedback data is used to achieve continuous learning of the large-scale regional adaptability model through a double-loop feedback mechanism. The judgment module is used to determine the update frequency and type of the feedback data; The first update module is used to update the status of the target planting area based on the feedback data if the feedback data is high-frequency seasonal data. The second update module is used to update the parameters of the area adapter based on the feedback data if the feedback data is low-frequency seasonal end-of-season data.
[0093] As one possible implementation of this application, the second updating module is also used for: The feedback data is compared with the prediction data of the regionally adaptable large model; If the comparison result exceeds the preset threshold, the parameters of the area adapter are updated.
[0094] As one possible implementation of this application, the region adapter includes an adapter matrix; the fine-tuning module 620 includes: The propagation submodule is used to freeze the original parameters of the base model. The original dataset generates the output data of the original model based on forward propagation. The loss function submodule is used to construct a loss function based on the output data. The parameters of the adapter matrix in the region adapter are adjusted by the loss function to obtain a large-scale model with good region adaptability.
[0095] As one possible implementation of this application, the prediction data includes several prediction tasks, and the optimization module 640 includes: The generation submodule is used to generate several state vectors based on prediction data, real-time state data, and preset optimization objectives and constraints, as well as the transition dynamics when performing prediction tasks under each state vector; The iterative submodule is used to iteratively calculate the expected value corresponding to each state vector based on the transition dynamics and preset optimization objectives and constraints; until the expected value converges, the prediction task corresponding to the maximum expected value is determined as the planting strategy corresponding to the state vector. The dynamic allocation module is used to dynamically allocate the weight of each state vector corresponding to the planting strategy through a gating mechanism in order to determine the target planting strategy.
[0096] As one possible implementation of this application, the iterative submodule is also used for: Set the reward function corresponding to the preset optimization goals and constraints; For each state vector, in the first round of iteration, the expected value corresponding to each state vector is calculated based on the reward function, transition dynamics, and initial expected value. Starting from the second round of iterations, the expected value of the current round is calculated based on the expected value calculated in the previous round.
[0097] As one possible implementation of this application, the system further includes: The weighting module is used to set the first weight, second weight, and third weight for the query vector, key vector, and value vector, respectively. The vector module is used to calculate the query vector based on environmental time features and the first weight, the key vector based on image time features and the second weight, and the value vector based on image time features and the third weight. The fusion module is used to perform multimodal fusion of environmental temporal features and image temporal features based on query vectors, key vectors, and value vectors through a cross-attention mechanism.
[0098] This application provides a large-scale model-based planting optimization system that deeply integrates artificial intelligence large-scale models, the Internet of Things, big data analysis, and agricultural production. This achieves intelligent, automated, and unmanned agricultural management, improving production efficiency and agricultural product quality. Simultaneously, by optimizing resource utilization and reducing environmental pollution, it promotes the sustainable development of regional agriculture. Furthermore, it can generate customized planting plans and management suggestions that are more tailored to the specific regional conditions and refined to the grid or plot level, significantly improving resource utilization efficiency, reducing production inputs, dynamically adjusting planting strategies and management measures, and ensuring the stability of yield and quality.
[0099] Regarding the system in the above embodiments, the specific ways in which each module performs operations have been described in detail in the embodiments related to the method, and will not be elaborated further here.
[0100] Figure 7 This is a schematic diagram of the structure of an electronic device shown in an embodiment of this application.
[0101] See Figure 7 The electronic device 700 includes a memory 710 and a processor 720.
[0102] The processor 720 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. Memory 710 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. ROM may store static data or instructions required by the processor 720 or other modules of the computer. Permanent storage devices may be read-write storage devices. Permanent storage devices may be non-volatile storage devices that retain stored instructions and data even when the computer is powered off. In some embodiments, permanent storage devices use mass storage devices (e.g., magnetic or optical disks, flash memory) as permanent storage devices. In other embodiments, permanent storage devices may be removable storage devices (e.g., floppy disks, optical drives). System memory may be a read-write storage device or a volatile read-write storage device, such as dynamic random access memory. System memory may store some or all of the instructions and data required by the processor during operation. Furthermore, memory 710 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (e.g., DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, memory 710 may include a removable storage device that is readable and / or writable, such as a laser disc (CD), a read-only digital versatile optical disc (e.g., DVD-ROM, dual-layer DVD-ROM), a read-only Blu-ray disc, an ultra-high density optical disc, a flash memory card (e.g., SD card, mini SD card, Micro-SD card, etc.), a magnetic floppy disk, etc. Computer-readable storage media do not contain carrier waves or transient electronic signals transmitted wirelessly or via wired connections.
[0103] The memory 710 stores executable code, which, when processed by the processor 720, can cause the processor 720 to execute part or all of the methods described above.
[0104] Furthermore, the method according to this application can also be implemented as a computer program or computer program product, which includes computer program code instructions for performing some or all of the steps in the method described above.
[0105] Alternatively, this application may be implemented as a computer-readable storage medium (or a non-transitory machine-readable storage medium or a machine-readable storage medium) storing executable code (or computer program or computer instruction code) that, when executed by a processor of an electronic device (or server, etc.), causes the processor to perform part or all of the steps of the methods described above according to this application.
[0106] This application also provides a computer program product, which includes computer instructions that, when executed by a processor, implement the method described above.
[0107] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A large model-based planting optimization method, characterized in that, The method comprises: inputting an original data set into an original large model; the original data set at least comprises environmental time characteristics and image time characteristics of a target planting area; the original large model at least comprises a basic large model and a regional adapter; fine-tuning the original large model based on the original data set and the regional adapter to obtain a regionally adaptive large model; generating prediction data of the target planting area according to the original data set through the regionally adaptive large model; iteratively dynamically optimizing according to the prediction data and real-time state data of the target planting area and a preset optimization target and constraint, and determining a target planting strategy of the target planting area through a gating mechanism.
2. The method of claim 1, wherein, After determining the target planting strategy of the target planting area through the gating mechanism, the method further comprises: executing the target planting strategy and collecting feedback data of the target planting area in real time; the feedback data is used to realize continuous learning of the regionally adaptive large model through a double-loop feedback mechanism; judging the update frequency and type of the feedback data; if the feedback data is high-frequency intra-seasonal data, updating the state of the target planting area according to the feedback data; if the feedback data is low-frequency end-of-season data, updating the parameters of the regional adapter according to the feedback data.
3. The method of claim 2, wherein, If the feedback data is low-frequency end-of-season data, updating the parameters of the regional adapter according to the feedback data comprises: comparing the feedback data with the prediction data of the regionally adaptive large model; if the comparison result exceeds a preset threshold, updating the parameters of the regional adapter.
4. The method of claim 1, wherein, The regional adapter comprises an adapter matrix; fine-tuning the original large model based on the original data set and the regional adapter to obtain a regionally adaptive large model comprises: freezing the original parameters of the basic large model, and generating output data of the original large model based on forward propagation of the original data set; constructing a loss function based on the output data, and adjusting the parameters of the adapter matrix in the regional adapter through the loss function to obtain the regionally adaptive large model.
5. The method of claim 1, wherein, The prediction data comprises a plurality of prediction tasks; iteratively dynamically optimizing according to the prediction data, the real-time state data, and the preset optimization target and constraint, and determining the target planting strategy of the target planting area through the gating mechanism comprises: generating a plurality of state vectors based on the prediction data, the real-time state data, and the preset optimization target and constraint, and a transition state when each state vector executes the prediction task; for each state vector, iteratively calculating an expected value corresponding to the state vector according to the transition state and the preset optimization target and constraint; until the expected value converges, determining a prediction task corresponding to the maximum expected value as the planting strategy corresponding to the state vector; dynamically allocating the weight of each state vector corresponding to the planting strategy through the gating mechanism to determine the target planting strategy.
6. The method of claim 5, wherein, The iteratively calculating an expected value corresponding to the state vector according to the transition state and the preset optimization target and constraint comprises: set a reward function corresponding to the preset optimization target and constraint; for each state vector, in the first round of iteration calculation, the expected value corresponding to each state vector is calculated based on the reward function, the transition state and the initial expected value; starting from the second round of iteration calculation, the expected value of the current round is calculated according to the expected value calculated in the last round.
7. The method of claim 1, wherein, The input of the original data set to the original large model further comprises: respectively setting the first weight, the second weight and the third weight corresponding to the query vector, the key vector and the value vector; calculating the query vector based on the environmental time feature and the first weight, calculating the key vector based on the image time feature and the second weight, and calculating the value vector based on the image time feature and the third weight; based on the query vector, the key vector and the value vector, the environmental time feature and the image time feature are fused through the cross attention mechanism.
8. A large model-based planting optimization system, comprising: The system comprises: an input module for inputting an original data set to an original large model; the original data set at least includes environmental time features and image time features of a target planting area; the original large model at least includes a basic large model and a regional adapter; a fine-tuning module for fine-tuning the original large model based on the original data set and the regional adapter to obtain a regional adaptability large model; a prediction module for generating prediction data of the target planting area according to the original data set through the regional adaptability large model; an optimization module for iterative dynamic optimization according to the prediction data and real-time state data of the target planting area, and preset optimization target and constraint, and determining the target planting strategy of the target planting area through a gating mechanism.
9. An electronic device, comprising: comprise: a processor; and a memory having executable code stored thereon, which, when executed by the processor, causes the processor to perform the method of any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, having executable code stored thereon, which, when executed by the processor of the electronic device, causes the processor to perform the method of any one of claims 1-7.