A farmland fertilization method and device based on multi-task learning

By employing multi-task learning and decision landscape analysis, this study addresses the lack of multi-dimensional decision information and regional adaptability issues in farmland fertilization. It provides optimal fertilization strategies and transitional solutions that balance economic and environmental benefits, thereby increasing the success rate of fertilization strategy promotion.

CN123138596APending Publication Date: 2026-11-20CHINA AGRI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611584555.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-14
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Existing methods for recommending fertilization for farmland cannot simultaneously obtain multi-dimensional decision-making information, lack a unified quantitative decision-making framework for economic and environmental benefits, and fail to take into account the difficulty of farmers' relocation and regional adaptability, leading to resistance to fertilization strategies in actual promotion.

Method used

A multi-task learning approach is adopted to train a soft parameter shared neural network model by collecting historical farmland data, generate a decision landscape, identify the topological structure, provide the global optimal solution, the ruggedness of the fitness landscape and the strategy evolution path, and output the best fertilization strategy and transition strategy by combining the fitness function and comprehensive benefit calculation.

Benefits of technology

It enables the acquisition of multi-dimensional decision-making information for farmland fertilization strategies, improves the success rate of strategy promotion, takes into account both economic and environmental benefits, adapts to the heterogeneity of different agricultural regions, and provides feasible migration paths and hierarchical promotion strategies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123138596A_ABST
    Figure CN123138596A_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of agricultural information management, and provides a farmland fertilization method and device based on multi-task learning, which comprises the following steps: S1, collecting historical data of farmland organic fertilizer fertilization; S2, using the historical data collected in S1 to form a prediction model for training a multi-task neural network model; S3, collecting real-time data, inputting the real-time data into the prediction model to obtain prediction data, converting the prediction data into a decision landscape, and identifying the topological structure of the landscape to obtain decision data, wherein the decision data comprises a global optimal solution, ruggedness of fitness landscape, and strategy evolution path; and S4, obtaining a final promotion strategy and current strategy analysis data according to the decision data obtained in S3. The application has the beneficial effect that the prediction data is converted into decision data to obtain decision data, the difficulty of the farmers in migrating from the current strategy to the optimal strategy can be evaluated through the decision data, and a transition strategy and a hierarchical promotion strategy are provided, thereby improving the success rate of strategy promotion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of agricultural fertilization technology, and in particular relates to a farmland fertilization method and device based on multi-task learning. Background Technology

[0002] Precision fertilization is an important technical means to achieve green and sustainable agricultural development. The partial substitution of chemical fertilizers with organic fertilizers has been widely proven to improve soil structure and increase soil organic matter content while maintaining crop yields, and to reduce nitrogen loss and non-point source pollution caused by excessive application of chemical fertilizers. However, how to scientifically determine the organic fertilizer return rate and nitrogen fertilizer application amount, while taking into account both economic and environmental benefits, has always been the core challenge of farmland nutrient management.

[0003] The existing recommended methods for farmland fertilization have the following main shortcomings:

[0004] First, traditional fertilization recommendation models are mostly single-task learning architectures, which can only output a single indicator, such as crop yield or single form of nitrogen loss, in a single inference. They cannot simultaneously obtain multi-dimensional decision-making information such as yield prediction, multiple forms of nitrogen loss (ammonia volatilization, nitrous oxide emissions, nitrogen leaching) and environmental risk level. If multiple indicators need to be predicted, multiple independent models need to be trained, which not only increases computational costs but also severs the intrinsic connection between the prediction tasks, preventing the models from using shared knowledge between tasks to improve generalization ability. Second, existing fertilization recommendation methods are mostly single-objective optimization-oriented, either pursuing maximum yield while ignoring environmental costs or setting emission limits without quantifying economic losses. They lack a decision-making framework that unifies economic benefits and external environmental costs, making it difficult to achieve a true balance between economic and ecological benefits. Third, existing technologies usually output a single optimal fertilization strategy as the recommendation result, but do not consider the practical feasibility of farmers migrating from current practices to theoretically optimal strategies. my country's agricultural production has significant regional heterogeneity, with different regions differing greatly in natural conditions, economic development levels, farmers' technical acceptance capabilities, and risk preferences. A mathematically optimal fertilization scheme may encounter resistance in actual promotion due to excessive migration difficulty, and existing technologies lack systematic analysis tools for strategy migration paths, migration difficulty, and regional adaptability. Summary of the Invention

[0005] In view of this, the present invention aims to propose a farmland fertilization method and apparatus based on multi-task learning, in order to solve at least one of the above-mentioned technical problems.

[0006] To achieve the above objectives, the technical solution of the present invention is implemented as follows:

[0007] The first aspect of this invention provides a farmland fertilization method based on multi-task learning, comprising the following steps:

[0008] S1. Collect historical data on organic fertilizer application in farmland;

[0009] S2. Use the historical data collected in S1 to form a prediction model for the trained multi-task neural network model;

[0010] S3. Collect real-time data and input it into the prediction model to obtain prediction data. Transform the prediction data into a decision landscape and identify the topological structure of the landscape to obtain decision data. The decision data includes the global optimal solution, the ruggedness of the fitness landscape, and the strategy evolution path.

[0011] S4. Based on the decision data obtained in S3, obtain the final promotion strategy and current strategy analysis data.

[0012] Furthermore, S1 includes the following steps:

[0013] S11. Collect historical data on organic fertilizer application in farmland;

[0014] The historical data includes meteorological data, soil data, and management measures data;

[0015] Meteorological data includes daily maximum and minimum temperatures, rainfall, wind speed, relative humidity, and sunshine duration.

[0016] Soil data includes soil organic carbon, total nitrogen, pH, bulk density, and clay content.

[0017] Management data include crop yield, crop type, nitrogen fertilizer application rate, organic matter return rate, and nitrogen loss.

[0018] S12. Use an outlier detection algorithm to remove outlier data;

[0019] S13. Perform interpolation to fill missing values ​​in historical data;

[0020] S14. Normalize all numerical data.

[0021] Furthermore, S2 includes the following steps:

[0022] S21. Divide the historical data collected in S1 into a training set and a validation set;

[0023] S22. Construct a soft parameter sharing neural network model, using farmland features as model input and crop yield and nitrogen loss as model output. Use the training set from S21 to train the soft parameter sharing neural network model to form a prediction model.

[0024] Furthermore, S3 includes the following steps:

[0025] S31. Under the condition that the soil data and crop varieties remain unchanged, generate discrete grid points of nitrogen fertilizer application rate and organic matter index with a preset step size. Input the discrete grid points into the prediction model to obtain the corresponding prediction data.

[0026] S32. Use the fitness function to convert the predicted output in the predicted data of S31 into economic benefits and the predicted nitrogen loss into environmental costs, and quantify them into fitness values.

[0027] The discrete grid points obtained from S33 and S31 and the fitness values ​​obtained from S32 are stored as a two-dimensional matrix, and a continuous representation of the fitness landscape is obtained through interpolation.

[0028] S34. Perform mathematical analysis on the fitness landscape to identify the following feature points:

[0029] Local optimal solution, global optimal solution, saddle point, ridgeline;

[0030] S35. Calculate the ruggedness of the fitness landscape, the strategy evolution path, and the shoulder coefficient.

[0031] Furthermore, the formula for calculating the fitness value in S32 is as follows: ;

[0032] Where N is the nitrogen fertilizer application rate, R is the organic fertilizer substitution rate calculated through the organic fertilizer return rate, with a value range of [0,1], Y(N,R) is the predicted yield, L(N,R) is the total nitrogen loss, and P... y C is a parameter for crop prices. n C is a parameter for nitrogen fertilizer cost. e This represents the environmental penalty coefficient.

[0033] Furthermore, in step S34, the local optimal solution and the global optimal solution are obtained through comprehensive benefit calculation;

[0034] The formula for calculating comprehensive benefits is as follows: ;

[0035] in, To represent the overall benefit of the current fertilization strategy, r is the organic fertilizer return rate, N is the nitrogen fertilizer application rate; Y(r,N) is the predicted crop yield, R S (r,N) represents the comprehensive soil fertility index, and L(r,N) represents the total nitrogen loss; w Y w R w L The weights are respectively: yield, soil fertility, and environmental benefits.

[0036] Furthermore, the optimal fertilization strategy is obtained from the globally optimal solution obtained through S3 in S4.

[0037] The transition fertilization strategy is obtained from the local optimal solution obtained through S3 in S4.

[0038] Current strategy analysis data includes:

[0039] The potential profit margin of the current strategy is output by comparing the fitness gap between the current strategy and the optimal fertilization strategy or the transitional fertilization strategy.

[0040] The difficulty of changing the current strategy is calculated by taking the fitness of the current strategy, the fitness of the local optimum, and the fitness of the global optimum. The corresponding shoulder coefficient is the difficulty of changing the current strategy.

[0041] The strength of regional policy recommendations is graded based on the difficulty of changing the current strategy.

[0042] A second aspect of the present invention provides a farmland fertilization device based on multi-task learning, comprising:

[0043] The data acquisition module is configured to collect historical and real-time data on organic fertilizer application in farmland.

[0044] The prediction module is configured to use historical data to form a prediction model for the trained multi-task neural network model.

[0045] Real-time data is input into the prediction model to obtain prediction data, the prediction data is transformed into a decision landscape, and the topological structure of the landscape is identified to obtain decision data. The decision data includes the global optimal solution, the ruggedness of the fitness landscape, the strategy evolution path, and the shoulder coefficient.

[0046] The analysis module is configured to obtain the optimal fertilization strategy and current strategy analysis data based on the decision data.

[0047] A third aspect of the present invention provides a server including at least one processor and a memory communicatively connected to the processor, the memory storing instructions executable by the at least one processor, the instructions being executed by the processor to cause the at least one processor to perform the method as described in the first aspect.

[0048] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method described in the first aspect.

[0049] Compared with existing technologies, the farmland fertilization method and apparatus based on multi-task learning described in this invention have the following beneficial effects:

[0050] The present invention discloses a farmland fertilization method based on multi-task learning, which transforms prediction data into decision data by converting it into a decision landscape. The decision data can be used to assess the difficulty for farmers to migrate from the current strategy to the optimal strategy, and provide transition strategies and tiered promotion strategies, thereby improving the success rate of strategy promotion. Attached Figure Description

[0051] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:

[0052] Figure 1 This is a schematic diagram of the fertilization method described in an embodiment of the present invention. Detailed Implementation

[0053] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other.

[0054] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more.

[0055] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.

[0056] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0057] Example 1:

[0058] like Figure 1As shown, a farmland fertilization method based on multi-task learning includes the following steps:

[0059] S1. Collect historical data on organic fertilizer application in farmland;

[0060] S1 includes the following steps:

[0061] S11. Collect historical data on organic fertilizer application in farmland;

[0062] The historical data includes meteorological data, soil data, and management measures data;

[0063] Meteorological data includes daily maximum and minimum temperatures, rainfall, wind speed, relative humidity, and sunshine duration.

[0064] Soil data includes soil organic carbon, total nitrogen, pH, bulk density, and clay content.

[0065] Management data include crop yield, crop type, nitrogen fertilizer application rate, organic matter return rate, and nitrogen loss.

[0066] Training with multi-source data breaks the limitations of a single data source, incorporating climate conditions, soil background properties, and human management measures into the model, providing a rich feature space for subsequent multi-task learning and improving the comprehensiveness and accuracy of predictions.

[0067] S12. Use an outlier detection algorithm to remove outlier data;

[0068] Outlier data can be removed using, but is not limited to, existing methods such as box plots and Z-scores.

[0069] Improve data quality and eliminate the interference of abnormal data such as sensor errors and recording errors on model training to prevent the model's prediction accuracy from being compromised.

[0070] S13. Perform interpolation to fill missing values ​​in historical data;

[0071] Employ, but not limited to, existing mean filling, median filling, or interpolation filling based on random forest.

[0072] To ensure data integrity and avoid information waste caused by directly discarding samples due to missing values, random forest interpolation can capture the non-linear relationship between features, making the filling results more reasonable.

[0073] S14. Normalize all numerical data.

[0074] We employ, but are not limited to, the existing Min-Max normalization method, to map historical data to the [0, 1] interval, eliminating dimensional differences. We uniformly map features of different magnitudes (such as temperature, rainfall, organic carbon content, etc.) to the same scale, avoiding the dominance of features with larger values ​​in the gradient update process, thereby accelerating model convergence and improving training stability.

[0075] S2. Use the historical data collected in S1 to form a prediction model for the trained multi-task neural network model;

[0076] S2 includes the following steps:

[0077] S21. Divide the historical data collected in S1 into a training set and a validation set;

[0078] Specifically, the measured data of crop-related parameters in the same region are divided into a training set and a validation set.

[0079] S22. Construct a soft parameter sharing neural network model, using farmland features as model input and crop yield and nitrogen loss as model output. Use the training set from S21 to train the soft parameter sharing neural network model to form a prediction model.

[0080] Nitrogen loss includes three forms: nitrous oxide, ammonia volatilization, and nitrogen leaching.

[0081] Soft parameter sharing neural network model architectures include:

[0082] 1. Low-level shared feature extraction network:

[0083] The structure of the underlying shared feature extraction network is as follows: Linear (input dimension → 256) → SiLU activation → LayerNorm → Dropout (0.4) → Linear (256 → 128) → SiLU activation → LayerNorm → Dropout (0.3);

[0084] It achieves efficient feature reuse, using only two fully connected layers to mine high-dimensional correlation features from multi-source data, such as the coupling effect of soil organic matter and nitrogen input on yield. The SiLU activation function is selected to give the network smooth and non-monotonic expressive power, and the combination of LayerNorm and Dropout effectively suppresses overfitting. Overall, it is lighter and more robust than traditional DNN or CNN.

[0085] 2. Task Adapter:

[0086] Number: 4 (corresponding to 4 target variables: Yield, N1, N2, N3);

[0087] Structure: Linear(128→64)→SiLU activation→LayerNorm, providing dedicated feature transformation for each task to solve the problem of "multi-task feature conflict" (such as yield prediction needing to focus on nutrient use efficiency, and environmental assessment needing to focus on nitrogen leaching).

[0088] Output layer: Each task corresponds to an independent Linear (64→1), initialized with a normal distribution of std=0.1 (to avoid excessively large initial outputs that could lead to training instability), and outputs the predicted values ​​for each task.

[0089] Soft parameter sharing: Unlike hard sharing (completely sharing all layers), it balances feature reuse and task specificity by using a shared encoder in conjunction with an independent adapter, thereby improving the accuracy of multi-task collaborative reasoning.

[0090] Lightweight design: The encoder has only 2 fully connected layers and the adapter has only 1 fully connected layer, balancing training efficiency and deployment feasibility, making it suitable for edge computing devices in farmland scenarios.

[0091] The soft parameter sharing mechanism, compared to the hard sharing scheme where all tasks fully reuse all network layers, provides a dedicated feature transformation space for each task with an independent adapter. This effectively solves the feature conflict problem between two types of tasks: yield prediction, which needs to focus on nutrient utilization efficiency, and environmental assessment, which needs to focus on nitrogen leaching. It achieves a balance between feature reuse and task specificity.

[0092] 3. Training layer: Adaptive weighted loss and regularization optimization;

[0093] The corresponding training process in the `AutoWeightedMSELoss` class and `main` function in the code implements the engineering implementation of "model training and optimization":

[0094] Adaptive weighted loss function;

[0095] Core logic: The joint loss function is a weighted sum of the losses of each sub-task; the weights do not need to be manually set, but are adaptively adjusted through the variance of the target variable.

[0096] Calculation formula: weights = 1.0 / (task_var + eps) (task_var is the variance of the objective variable for each task);

[0097] Physical meaning: Tasks with small variance (small data fluctuations and high prediction difficulty) are given greater weight, while tasks with large variance (large data fluctuations and low prediction difficulty) are given less weight, which solves the problem of "multi-task priority imbalance" (such as environmental risk indicators with few samples but high importance).

[0098] Loss calculation: weighted_loss=(preds-targets)²*weights*mask. The mask is used to ignore samples with missing target variables, ensuring the effectiveness of the loss calculation.

[0099] Tasks with lower variance imply less data fluctuation and higher prediction difficulty, thus automatically receiving greater weight; tasks with higher variance are less predictable and their weights are automatically reduced. This solves the problem of task priority imbalance in multi-task learning, eliminating the need for manual trial and error in setting the weights of each subtask. Simultaneously, a masking mechanism ignores samples with missing target variables, ensuring the effectiveness of loss calculation.

[0100] Training optimization strategies;

[0101] Optimizer: AdamW (Adam with weight decay), weight decay coefficient 1e-4, suppresses overfitting (corresponding to "regularization processing").

[0102] Learning rate scheduling: ReduceLROnPlateau (plateau strategy), the learning rate is halved when the validation loss does not decrease for 5 consecutive epochs, balancing training speed and convergence accuracy.

[0103] Early stopping mechanism: The best_val_loss is used to record the optimal model. When the validation loss does not decrease for 15 consecutive epochs (patience=15), training is stopped to avoid overfitting.

[0104] Gradient clipping: clip_grad_norm_(model.parameters(), 1.0) prevents gradient explosion and ensures training stability.

[0105] It provides multiple protections against overfitting and ensures training stability. AdamW's weight decay suppresses parameter inflation, the plateau scheduler automatically reduces the learning rate when validation loss stagnates to avoid training oscillations, the early stopping mechanism terminates the model in time after convergence to save computational resources, and gradient pruning prevents gradient explosion.

[0106] Dataset partitioning and loading;

[0107] The data split ratio is 70% for training and 30% for testing (test_size=0.3). The train_test_split method is used to maintain the consistency of data distribution.

[0108] Data loading: Features, target variables, and masks are encapsulated in the MultiTaskDataset class, and DataLoader loads them in batches (batch_size=64) to improve training efficiency.

[0109] 4. Decision-making level: Multi-task reasoning and optimal return-to-field rate output;

[0110] This is achieved through model inference, indicator evaluation, and result inverse normalization.

[0111] Multi-task collaborative reasoning process;

[0112] Input: Real-time multi-source data of farmland to be decided.

[0113] Model inference: Call model(X) to output the standardized predicted values ​​of the four target variables (Yield, NH3, N2O, NO3).

[0114] Denormalization: Standardized predicted values ​​are converted into real physical values ​​(such as yield kg / acre, nitrogen content mg / kg) through target_scalers to ensure that the decision results can be directly applied.

[0115] Logic for selecting the optimal return-to-field rate;

[0116] Constraints, based on the "Comprehensive Benefit Evaluation Standard":

[0117] Production constraint: Yield_pred ≥ target production;

[0118] Soil fertility constraint: Rs (organic substitution rate);

[0119] Environmental constraints: NH3, N2O, and NO3 are within a suitable range, which is associated with greenhouse gas emissions and environmental pollution, and the quantitative achievement of "low environmental risk level".

[0120] Screening process: Iterate through possible organic fertilizer return rates and nitrogen application rates, substitute each return rate into the model, screen the combination that satisfies all constraints and has the best overall benefits, output the numerical value and confidence interval, and calculate the variance by predicting the model.

[0121] The model update mechanism is as follows:

[0122] Incremental training: Regularly collect new farmland practice data, such as actual return-to-field rate, corresponding yield, soil indicators, and environmental monitoring data. After processing, incrementally train the existing model to continuously optimize parameters and improve decision-making accuracy.

[0123] Model saving: After training is completed, the model parameters, feature normalizers, target variable normalizers, feature names, etc. are encapsulated and saved to support subsequent loading, inference and updates.

[0124] A joint loss function is used, and the loss function is as follows:

[0125] Loss=w1×Loss1+w2×Loss2+w3×Loss3+w4×Loss4;

[0126] Loss1 represents the mean squared error loss of the soil fertility prediction subtask, Loss2 represents the mean squared error loss of the crop yield prediction subtask, Loss3 represents the mean squared error (MSE) loss of the continuous value regression task for nitrogen loss (NH3, N2O, nitrogen leaching), and Loss4 represents the environmental risk level classification task (discretely divided by nitrogen loss threshold). w1, w2, w3, and w4 are the subtask weights, initially set to 1:1:1:1, and adaptively adjusted based on validation set performance.

[0127] Model training: Use stochastic gradient descent (SGD) or adaptive moment estimation (Adam) optimizers, set appropriate learning rates (0.001-0.01) and number of iterations (100-500 rounds), to train the multi-task learning model;

[0128] Regularization and tuning: Dropout layers and L2 regularization are used to suppress model overfitting. Hyperparameters such as the number of network layers, number of neurons, and learning rate are tuned through grid search or Bayesian optimization until the overall performance of the model on the validation set (such as decision accuracy and generalization error) reaches the optimal level.

[0129] In some embodiments, real-time multi-source data of the farmland to be decided (after preprocessing in S1) is input into the prediction model, and the prediction model outputs the comprehensive soil fertility index, predicted crop yield, continuous nitrogen loss value and environmental risk level corresponding to different return rates.

[0130] The comprehensive benefits are calculated based on the soil fertility index, predicted crop yield, continuous nitrogen loss, and environmental risk level. The calculation formula is as follows: ;

[0131] in, To represent the overall benefit of the current fertilization strategy, r is the organic fertilizer return rate, N is the nitrogen fertilizer application rate; Y(r,N) is the predicted crop yield, R S (r,N) represents the comprehensive soil fertility index, and L(r,N) represents the total nitrogen loss; w Y w R w L The weights are respectively: yield, soil fertility, and environmental benefits.

[0132] Based on the comprehensive benefit evaluation criteria, the optimal organic fertilizer return rate was selected as the final promotion strategy without changing the amount of nitrogen fertilizer applied. The comprehensive benefit evaluation criteria are as follows: the yield is not lower than the target yield, the improvement in soil fertility is not lower than the preset threshold, the total nitrogen loss does not exceed the safety threshold, and the environmental risk level is low.

[0133] In other embodiments, the comprehensive benefits are calculated based on the comprehensive soil fertility index, predicted crop yield, continuous nitrogen loss value and environmental risk level. The range of organic fertilizer return rate and nitrogen fertilizer application amount is calculated based on the comprehensive benefit evaluation standard, and then proceeds to step S3 and serves as the range of nitrogen fertilizer application amount composite organic matter index in S31.

[0134] S3. Collect real-time data and input it into the prediction model to obtain prediction data. Transform the prediction data into a decision landscape and identify the topological structure of the landscape to obtain decision data. The decision data includes the global optimal solution, the ruggedness of the fitness landscape, and the strategy evolution path.

[0135] S3 includes the following steps:

[0136] S31. Under the condition that the soil data and crop varieties remain unchanged, generate discrete grid points of nitrogen fertilizer application rate and organic matter index with a preset step size. Input the discrete grid points into the prediction model to obtain the corresponding prediction data.

[0137] Specifically, with fixed crop type and other soil properties, discrete grid points (Ni, Rj) are generated within the search ranges [Nmin, Nmax] for nitrogen fertilizer application rate N and [Rmin, Rmax] for organic matter index R, with a preset step size. Each grid point is input into a pre-trained multi-task learning model to obtain the corresponding predicted values ​​Y(Ni, Rj), N1(Ni, Rj), N2(Ni, Rj), and N3(Ni, Rj), forming a discrete representation of the four-dimensional response surface. This achieves full coverage of the decision space. By exhaustively traversing all feasible combinations of nitrogen fertilizer application rate and organic substitution rate, a complete mapping relationship from strategy to consequence is constructed, without overlooking any potential optimal solutions.

[0138] S32. Use the fitness function to convert the predicted output in the predicted data of S31 into economic benefits and the predicted nitrogen loss into environmental costs, and quantify them into fitness values.

[0139] The formula for calculating the fitness value in S32 is as follows: ;

[0140] in, For applicability, N is the nitrogen fertilizer application rate, R is the organic fertilizer substitution rate calculated through the organic fertilizer return rate, with a value range of [0,1], Y(N,R) is the predicted yield, with a value range of [0,1], L(N,R) is the total nitrogen loss, L=N1+N2+N3, P y C sets crop price parameters based on crop type and market price. n The cost parameters for nitrogen fertilizer are set based on fertilizer market prices, C. eThis is an environmental penalty coefficient used to quantify the environmental loss caused by a unit of nitrogen loss; it is a configurable parameter. It achieves unified quantification of multiple objectives, unifying the three heterogeneous objectives—economic benefits represented by crop yield, nitrogen fertilizer input costs, and environmental costs caused by nitrogen loss—into a single monetized fitness index, allowing for direct comparison of the merits of different fertilization strategies.

[0141] The discrete grid points obtained from S33 and S31, along with the fitness values ​​obtained from S32, are stored as a two-dimensional matrix. A continuous representation of the fitness landscape is obtained through interpolation. The discrete points are then fitted to a continuous surface using interpolation, resulting in a continuous representation of the fitness landscape. This visualizes the fitness landscape, transitioning from discrete sampling to a continuous surface representation. Decision-makers can observe trends in fitness values ​​in a continuous space and discover fine structures that might be missed by the discrete grid.

[0142] S34. Perform mathematical analysis on the fitness landscape to identify the following feature points:

[0143] Local optimal solution, global optimal solution, saddle point, ridgeline;

[0144] Specifically, the local optimum is a point where the gradient is zero and the Hessian matrix is ​​negative definite. Precise location is achieved using a grid scan combined with Newton's method. The global optimum is the point with the maximum fitness value on the landscape: (N,R) = argmaxF(N,R). A saddle point is a point where the gradient is zero and the Hessian matrix is ​​indeterminate, i.e., a critical point where one direction is a local maximum and the other a local minimum. A ridgeline is a connected region where the first derivative is zero and the second derivative is negative.

[0145] In step S34, the local optimal solution and the global optimal solution are obtained through comprehensive benefit calculation.

[0146] The formula for calculating comprehensive benefits is as follows: ;

[0147] in, To represent the overall benefit of the current fertilization strategy, r is the organic fertilizer return rate, N is the nitrogen fertilizer application rate; Y(r,N) is the predicted crop yield, R S (r,N) represents the comprehensive soil fertility index, and L(r,N) represents the total nitrogen loss; w Y w R w L The weights are respectively: yield, soil fertility, and environmental benefits.

[0148] Extracting topological features of the fitness landscape: not only finding the best strategy, but also revealing the structural information of the landscape. Saddle points indicate the bottleneck locations of strategy migration, and ridge lines indicate feasible migration paths, providing a topological basis for the design of subsequent promotion strategies.

[0149] S35. Calculate the ruggedness of the fitness landscape, the strategy evolution path, and the shoulder coefficient.

[0150] The ruggedness of fitness landscapes is quantified using the following formula:

[0151] Roughness = E[| |²]-|E[ ]|².

[0152] in The gradient of the fitness landscape is E[·], which is the mathematical expectation in the decision space. The closer the ruggedness is to 0, the smoother the landscape is. The larger the value, the more rugged the landscape is and the existence of multiple local optima.

[0153] By quantifying the complexity of the fitness landscape, a higher ruggedness indicates the existence of more local optima, making farmers prone to suboptimal strategies and unable to naturally move towards the optimal solution; a lower ruggedness indicates a smoother strategy space, making it easier to migrate from any starting point to the optimal solution. This indicator provides a quantitative basis for judging the necessity and strength of policy intervention.

[0154] The simulated evolution path is as follows:

[0155] The diffusion process of management strategies among farmer groups is simulated using replicon dynamics equations:

[0156] dP(s) / dt=P(s)×[F(s)-F];

[0157] Where s=(N,R) is the specific management strategy, P(s) is the proportion of farmers adopting strategy s, F(s) is the fitness of strategy s, and F is the average fitness of the population.

[0158] The policy evolution path is solved by numerical integration:

[0159] s(t+Δt)=s(t)+α× (s(t))×Δt+ε·ξ(t);

[0160] Where α is the learning rate parameter, ε is the random perturbation intensity, and ξ(t) is Gaussian white noise.

[0161] Predicting the natural propagation process of strategies among farmers, identifying which areas can gradually approach the optimal solution through natural evolution, and which areas require additional policy support, provides a dynamic basis for differentiated promotion strategies.

[0162] S4. Based on the decision data obtained in S3, obtain the final promotion strategy and current strategy analysis data.

[0163] The optimal fertilization strategy is obtained from the global optimal solution obtained through S3 in S4.

[0164] Achieving Pareto optimality among yield, soil fertility, and environmental impact allows for a single decision that simultaneously considers both economic and ecological benefits.

[0165] The transition fertilization strategy is obtained from the local optimal solution obtained through S3 in S4.

[0166] When it is too difficult to migrate directly to the global optimum, a local optimum is provided as a transitional solution to lower the adoption threshold for farmers. This allows strategy improvements to be implemented in stages, avoiding the failure of promotion due to directly requiring farmers to overcome excessively large technical gaps.

[0167] Calculate the shoulder coefficient as the transitional migration difficulty for the current strategy and the transitional fertilization strategy;

[0168] Calculate the shoulder arch coefficient as the optimal migration difficulty by calculating the current strategy and the optimal fertilization strategy;

[0169] If the optimal migration difficulty is less than 1.2 times the transition migration difficulty, then the optimal fertilization strategy is selected as the final promotion strategy.

[0170] If the optimal migration difficulty is not less than 1.2 times the transitional migration difficulty, and the migration difficulty calculated by the transitional fertilization strategy and the optimal fertilization strategy is less than 0.5 times the transitional migration difficulty, then the transitional fertilization strategy is selected as the final promotion strategy.

[0171] If the optimal migration difficulty is not less than 1.2 times the transitional migration difficulty, and the migration difficulty calculated by the transitional fertilization strategy and the optimal fertilization strategy is not less than 0.5 times the transitional migration difficulty, then the optimal fertilization strategy is selected as the final promotion strategy.

[0172] By assessing the difficulty of migration, it's crucial to determine whether a one-step approach or a phased approach is appropriate. This helps avoid forcibly promoting strategies that are difficult to implement, which could lead to farmer resistance and ultimately improve the success rate of promotion.

[0173] Current strategy analysis data includes:

[0174] The potential profit margin of the current strategy is output by comparing the fitness gap between the current strategy and the optimal fertilization strategy or the transitional fertilization strategy.

[0175] The difficulty of changing the current strategy is calculated by taking the fitness of the current strategy, the fitness of the local optimum, and the fitness of the global optimum. The corresponding shoulder coefficient is the difficulty of changing the current strategy.

[0176] The strength of regional policy recommendations is graded based on the difficulty of changing the current strategy.

[0177] Based on the shoulder coefficient map, regions with high strategy transfer difficulty and requiring key intervention are identified, along with the policy recommendation intensity levels for each region. These regions are divided into four categories: strong intervention, medium intervention, weak intervention, and natural evolution, each corresponding to different promotion strategies. This approach adapts to the regional heterogeneity of agricultural production in my country, overcomes the shortcomings of existing "one-size-fits-all" recommendations, and provides a scientific basis for the promotion of precision agriculture tailored to local conditions.

[0178] The formula for calculating the shoulder coefficient is as follows:

[0179] Ridge=(F_saddle-F_local) / (F_global-F_local);

[0180] Where F_global is the fitness of the target optimal solution, F_local is the fitness of the current policy, F_saddle is the fitness of the saddle point connecting the two, and Ridge takes values ​​in the range [0,1]. The closer the value is to 1, the greater the difficulty of the transfer.

[0181] A farmland fertilization device based on multi-task learning includes:

[0182] The data acquisition module is configured to collect historical and real-time data on organic fertilizer application in farmland.

[0183] The prediction module is configured to use historical data to form a prediction model for the trained multi-task neural network model.

[0184] Real-time data is input into the prediction model to obtain prediction data, the prediction data is transformed into a decision landscape, and the topological structure of the landscape is identified to obtain decision data. The decision data includes the global optimal solution, the ruggedness of the fitness landscape, the strategy evolution path, and the shoulder coefficient.

[0185] The analysis module is configured to obtain the optimal fertilization strategy and current strategy analysis data based on the decision data.

[0186] The beneficial effects of this plan are:

[0187] The soft parameter sharing architecture enables crop yield prediction and prediction of three forms of nitrogen loss to share underlying feature representations. At the same time, each task retains its own specificity through an independent adapter. Four key indicators can be output simultaneously in one inference, and the prediction accuracy of each subtask is effectively improved through knowledge transfer between tasks.

[0188] The fitness function quantifies economic benefits and environmental costs into a single indicator, transforming fertilization decisions from the traditional one-sided pursuit of maximizing yield to a comprehensive optimization of yield, soil fertility, and environmental risk, which aligns with the policy orientation and practical needs of green and sustainable agricultural development.

[0189] The solution not only outputs the mathematically optimal fertilization strategy, but also uses analytical tools such as the shoulder coefficient, strategy evolution path, and landscape ruggedness to assess the practical feasibility of farmers migrating from the current strategy to the optimal strategy, and provides transitional solutions and tiered promotion strategies, effectively solving the practical dilemma of the unreachability of the optimal solution in traditional optimization methods.

[0190] The shoulder coefficient map and the framework for dividing the four types of intervention areas fully respect the significant differences in natural conditions, economic development levels, and farmers' acceptance capacity among different agricultural production areas in my country. This avoids a nationally unified fertilizer recommendation standard and provides a scientific decision-making tool for implementing policies tailored to specific counties and townships.

[0191] A series of analytical tools, such as continuous surface representation of fitness landscape, ruggedness analysis, evolutionary path simulation, and shoulder coefficient, transform the output of the neural network black box model into an understandable, traceable, and visualized decision landscape, thereby enhancing the trust and willingness of agricultural technicians and farmers to adopt recommended strategies.

[0192] Example 2:

[0193] A server includes at least one processor and a memory communicatively connected to the processor, the memory storing instructions executable by the at least one processor to cause the at least one processor to perform the method as described in Embodiment 1.

[0194] Example 3:

[0195] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in Embodiment 1.

[0196] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention, and they should all be covered within the scope of the claims and specification of the present invention.

[0197] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A farmland fertilization method based on multi-task learning, characterized in that, Includes the following steps: S1. Collect historical data on organic fertilizer application in farmland; S2. Use the historical data collected in S1 to form a prediction model for the trained multi-task neural network model; S3. Collect real-time data and input it into the prediction model to obtain prediction data. Transform the prediction data into a decision landscape and identify the topological structure of the landscape to obtain decision data. The decision data includes the global optimal solution, the ruggedness of the fitness landscape, and the strategy evolution path. S4. Based on the decision data obtained in S3, obtain the final promotion strategy and current strategy analysis data.

2. The farmland fertilization method based on multi-task learning according to claim 1, characterized in that, S1 includes the following steps: S11. Collect historical data on organic fertilizer application in farmland; The historical data includes meteorological data, soil data, and management measures data; Meteorological data includes daily maximum and minimum temperatures, rainfall, wind speed, relative humidity, and sunshine duration. Soil data includes soil organic carbon, total nitrogen, pH, bulk density, and clay content. Management data include crop yield, crop type, nitrogen fertilizer application rate, organic matter return rate, and nitrogen loss. S12. Use an outlier detection algorithm to remove outlier data; S13. Perform interpolation to fill missing values ​​in historical data; S14. Normalize all numerical data.

3. The farmland fertilization method based on multi-task learning according to claim 1, characterized in that, S2 includes the following steps: S21. Divide the historical data collected in S1 into a training set and a validation set; S22. Construct a soft parameter sharing neural network model, using farmland features as model input and crop yield and nitrogen loss as model output. Use the training set from S21 to train the soft parameter sharing neural network model to form a prediction model.

4. The farmland fertilization method based on multi-task learning according to claim 1, characterized in that, S3 includes the following steps: S31. Under the condition that the soil data and crop varieties remain unchanged, generate discrete grid points of nitrogen fertilizer application rate and organic matter index with a preset step size. Input the discrete grid points into the prediction model to obtain the corresponding prediction data. S32. Use the fitness function to convert the predicted output in the predicted data of S31 into economic benefits and the predicted nitrogen loss into environmental costs, and quantify them into fitness values. The discrete grid points obtained from S33 and S31 and the fitness values ​​obtained from S32 are stored as a two-dimensional matrix, and a continuous representation of the fitness landscape is obtained through interpolation. S34. Perform mathematical analysis on the fitness landscape to identify the following feature points: Local optimal solution, global optimal solution, saddle point, ridgeline; S35. Calculate the ruggedness of the fitness landscape, the strategy evolution path, and the shoulder coefficient.

5. The farmland fertilization method based on multi-task learning according to claim 4, characterized in that, The formula for calculating the fitness value in S32 is as follows: ; Where N is the nitrogen fertilizer application rate, R is the organic fertilizer substitution rate calculated through the organic fertilizer return rate, with a value range of [0,1], Y(N,R) is the predicted yield, L(N,R) is the total nitrogen loss, and P... y C is a parameter for crop prices. n C is a parameter for nitrogen fertilizer cost. e This represents the environmental penalty coefficient.

6. The farmland fertilization method based on multi-task learning according to claim 4, characterized in that: In step S34, the local optimal solution and the global optimal solution are obtained through comprehensive benefit calculation. The formula for calculating comprehensive benefits is as follows: ; in, To represent the overall benefit of the current fertilization strategy, r is the organic fertilizer return rate, N is the nitrogen fertilizer application rate; Y(r,N) is the predicted crop yield, R S (r,N) represents the comprehensive soil fertility index, and L(r,N) represents the total nitrogen loss; w Y w R w L The weights are respectively: yield, soil fertility, and environmental benefits.

7. The farmland fertilization method based on multi-task learning according to claim 1, characterized in that: The optimal fertilization strategy is obtained from the global optimal solution obtained through S3 in S4. The transition fertilization strategy is obtained from the local optimal solution obtained through S3 in S4. Current strategy analysis data includes: The potential profit margin of the current strategy is output by comparing the fitness gap between the current strategy and the optimal fertilization strategy or the transitional fertilization strategy. The difficulty of changing the current strategy is calculated by taking the fitness of the current strategy, the fitness of the local optimum, and the fitness of the global optimum. The corresponding shoulder coefficient is the difficulty of changing the current strategy. The strength of regional policy recommendations is graded based on the difficulty of changing the current strategy.

8. A farmland fertilization device based on multi-task learning, characterized in that, include: The data acquisition module is configured to collect historical and real-time data on organic fertilizer application in farmland. The prediction module is configured to use historical data to form a prediction model for the trained multi-task neural network model. Real-time data is input into the prediction model to obtain prediction data, the prediction data is transformed into a decision landscape, and the topological structure of the landscape is identified to obtain decision data. The decision data includes the global optimal solution, the ruggedness of the fitness landscape, the strategy evolution path, and the shoulder coefficient. The analysis module is configured to obtain the optimal fertilization strategy and current strategy analysis data based on the decision data.

9. A server, characterized in that: The method includes at least one processor and a memory communicatively connected to the processor, the memory storing instructions executable by the at least one processor, the instructions being executed by the processor to cause the at least one processor to perform the method as described in any one of claims 1-7.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, it implements the method described in any one of claims 1-7.