Soil attribute and crop character prediction and early warning method based on multi-task Transform model guided by soil knowledge

By using a multi-task Transformer model guided by soil knowledge and directly utilizing drone hyperspectral imagery input, the problem of low soil and crop trait prediction accuracy in traditional methods is solved, multi-task prediction and early warning are achieved, and the accuracy of soil management and crop yields are improved.

CN120671896APending Publication Date: 2025-09-19CHINA AGRI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510731975.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-03
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing technologies make it difficult to efficiently and simultaneously predict multiple soil properties and crop traits, and traditional methods fail to fully utilize the relationship between soil and crops, resulting in low prediction accuracy and efficiency.

Method used

The soil knowledge-guided multi-task Transformer model (KGMT) is adopted, which directly uses drone hyperspectral images as input, combines deep learning with multi-task learning, captures the complex relationship between soil and crops, constructs a backbone encoder and multiple task heads, and realizes the simultaneous prediction of multiple soil properties and crop traits.

Benefits of technology

The prediction accuracy and generalization ability of soil properties and crop traits have been significantly improved, which can more accurately identify potential crop growth limitations, provide farmers with early warnings and optimize soil management strategies, and improve crop yields and sustainability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120671896A_ABST
    Figure CN120671896A_ABST
Patent Text Reader

Abstract

The invention discloses a soil attribute and crop character prediction and early warning method based on a multi-task Transformer model guided by soil knowledge, the method provides a KGMT guided by soil knowledge, the KGMT model combines deep learning and multi-task learning, the hyperspectral image of an unmanned aerial vehicle is directly used as input, and the deep learning and the multi-task learning are combined. And complex artificial feature extraction is avoided. The model can predict multiple soil properties and crop traits at the same time, and capture complex mutual relations which are often neglected by a traditional method. The invention develops a set of soil early warning method combining bare soil stage soil properties and growth stage crop properties, realizes early recognition of potential crop growth limitation, provides an active strategy for soil and crop management, and provides an accurate agricultural practice by providing an operable insight of soil-crop interaction and a KGMT model. Soil conditions can be optimized, and crop yield and sustainability can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a soil property and crop trait prediction and early warning method, and in particular to a soil property and crop trait prediction and early warning method based on a multi-task Transformer model guided by soil knowledge. Background Art

[0002] Soil properties encompass a range of inherent physical, chemical, and biological characteristics of soil. These properties not only provide key indicators of soil health but also provide insights into soil fertility and production potential. For example, soil salinity is a key indicator of soluble salt concentration. Excessive salinity can inhibit crop growth, reduce yields, and even lead to soil salinization, threatening sustainable land use and ecological balance. Soil organic matter is another key indicator of soil fertility. Its decomposition releases essential nutrients such as nitrogen, phosphorus, and sulfur for plant growth. Furthermore, other soil properties, such as potassium content, directly influence plant water regulation, enzyme activity, photosynthesis, and starch and protein synthesis. Therefore, obtaining high-precision and high-resolution spatial information on soil properties is crucial for sustainable land use, scientific management, and comprehensive risk assessment.

[0003] In recent years, remote sensing sensors carried by various satellites have provided a powerful means for large-scale, cost-effective monitoring of the soil surface and have been widely used for soil property prediction. These sensors indirectly estimate soil properties by acquiring spectral, textural, and thermal information. Multispectral sensors are the most widely used, typically acquiring information in bands such as blue, green, red, near-infrared, and red-edge. However, multispectral data only contains four to five bands, which can easily lead to ill-posed issues when retrieving soil properties, making it difficult to construct predictive models with good generalization capabilities. Furthermore, satellite-based multispectral imaging often lacks the high spatial resolution required for precision agriculture and soil improvement. Against this backdrop, unmanned aerial vehicles (UAVs) equipped with hyperspectral sensors offer an efficient alternative for soil property mapping. This approach utilizes spectral reflectance across a wide range of wavelengths to achieve high-resolution, repeatable optical observations. Numerous studies have validated the effectiveness of UAV hyperspectral imagery in soil property prediction.

[0004] Using remote sensing data, many researchers have attempted to estimate soil properties using statistical modeling or machine learning regression methods. Common methods, such as multivariate linear regression, random forest regression, and partial least squares regression, typically rely on artificially constructed features as model inputs. These features include spectral reflectance, texture information, and its derivatives. The construction of these artificial features often requires extensive remote sensing domain knowledge and involves the preparation of hundreds or even thousands of features. Furthermore, feature selection is required to improve prediction efficiency, which significantly limits the model's ability to migrate across time and space. Furthermore, traditional machine learning models are typically constructed independently for a single soil property, failing to fully exploit potential correlations between different properties. For example, different soil properties may be affected by the same wavelength band or have overlapping spectral absorption features. Simultaneously considering all soil properties and their spectral information during the inversion process is expected to improve overall prediction accuracy. Furthermore, simultaneously predicting multiple soil properties can significantly improve computational efficiency. Therefore, it is necessary to develop data-driven methods that can simultaneously predict multiple soil properties and effectively exploit their internal correlations.

[0005] Deep learning provides a powerful data-driven approach to addressing these challenges. Unlike traditional machine learning methods, deep learning excels at modeling complex nonlinear relationships and dependencies between input variables. It can simultaneously model multiple soil properties and exploit their shared spectral features and interdependencies. For example, multi-task learning frameworks can leverage shared spectral features to simultaneously predict multiple properties, significantly improving prediction accuracy and computational efficiency. Furthermore, existing research relies on manually constructed features such as spectral reflectance and texture as inputs to deep learning models. Only a limited number of studies have attempted to directly input hyperspectral imagery acquired by drones into deep learning models for soil property prediction. Convolutional neural networks (CNNs) and Transformer-based model architectures can automatically learn hierarchical, highly representative features directly from raw spectral data, avoiding the need for complex manual feature engineering. This capability reduces the reliance on specialized knowledge and extensive feature preparation, facilitating the generalization and scalability of models across diverse scenarios. Despite recent progress, the potential of direct soil property prediction based on drone hyperspectral imagery remains largely untapped and warrants further investigation.

[0006] While soil property prediction is crucial, quantifying soil productivity is equally important. Crop traits, such as leaf area index (LAI), plant height (PH), canopy cover (CC), and aboveground biomass (AGB), are key indicators for understanding the impact of soil properties on crop growth processes. Remote sensing technology, particularly drone-based platforms, has been proven to be an effective method for efficiently and accurately extracting crop traits. Existing studies often overlook the integration of soil information when modeling and predicting crop traits, despite the key role soil plays in shaping plant development and productivity. To address this limitation, incorporating soil knowledge into deep learning frameworks has significant potential. A soil knowledge-guided deep learning framework can synergize soil properties with crop traits, leveraging multimodal data acquired by drones to better capture the interactions between soil and crop growth, thereby providing more accurate and comprehensive predictions.

[0007] Soil property data may not be directly usable by farmers interested in field-scale early warning soil conditions to implement effective and timely improvements. To address this limitation, more direct quantification of how soil properties influence crop growth traits is needed. Previous studies have demonstrated the impact of soil properties on crop yield. However, yield is the result of complex regulatory processes influenced by multiple crop characteristics. Factors such as insufficient canopy cover or poor land cover area (LAI) can significantly impact final yield outcomes. To address these challenges, studying the interactions between soil properties and these key crop characteristics is crucial, as understanding these relationships is key to developing early warning systems and providing actionable guidance for soil improvement efforts. In this context, least squares regression has the potential to quantify the relationships between soil properties and crop characteristics, identifying key soil parameters that strongly influence specific traits, such as LAI, canopy cover, or aboveground biomass. By capturing both linear and nonlinear dependencies, this approach facilitates the development of predictive models that integrate soil and crop data. These models provide valuable insights into the mechanisms of soil-crop interactions and lay the foundation for robust early warning systems, enabling farmers to implement timely and effective interventions to optimize soil conditions and enhance crop performance. Summary of the Invention

[0008] This paper provides a soil property and crop trait prediction and early warning method based on a soil knowledge-guided multi-task Transformer model. This method proposes a soil knowledge-guided multi-task Transformer (KGMT) model. The KGMT model combines deep learning with multi-task learning and directly uses drone hyperspectral imagery as input, avoiding complex manual feature extraction. The model can simultaneously predict multiple soil properties and crop traits, capturing complex interrelationships often overlooked by traditional methods. The Transformer-based architecture enables the model to efficiently process high-dimensional spectral data, improving feature extraction and prediction accuracy. Compared with traditional partial least squares regression (PLSR) and baseline multi-task models, the KGMT model demonstrates superior performance. When predicting soil salinity, alkalinity, and nutrient content, as well as crop leaf area index and aboveground biomass, KGMT achieves higher R² values ​​and lower normalized root mean square error (nRMSE). This improved accuracy and generalization make the model a reliable tool for cross-regional soil and crop condition prediction. This paper develops a soil early warning method that combines soil properties during the bare soil period with crop traits during the growing period, enabling early identification of potential crop growth restrictions and providing proactive strategies for soil and crop management. By providing actionable insights into soil-crop interactions, the KGMT model supports precision agriculture practices, helps optimize soil conditions, and improves crop yields and sustainability.

[0009] The purpose of the present invention is achieved through the following technical solutions: A soil property and crop trait prediction and early warning method based on a multi-task Transformer model guided by soil knowledge includes the following steps: Step 1: Data acquisition: Step 1.1: Field data collection: Step 1.1.1. Collect soil data and conduct chemical analysis at the bare soil stage. The analysis includes two salinization indicators: salt content and alkalinity, and four key soil nutrient indicators: potassium, calcium, sodium, and organic matter content. Step 1.1.2: Collect aboveground biomass (AGB) and leaf area index (LAI) data; Step 1.2: UAV hyperspectral image acquisition and preprocessing: Step 1.2.1: Collect high-resolution RGB images and hyperspectral images with 125 spectral bands; Step 1.2.2: Use Agisoft PhotoScan Professional software to stitch and orthorectify the drone images collected in step 1.2.1. Step 1.2.3: After stitching is complete, segment the image using a 5m x 5m vector file. Step 1.2.4: After segmentation is complete, manually inspect the image to ensure that only cultivated areas are included in subsequent model training; Step 2: Extract plant height and canopy coverage from drone images: Step 2.1, plant height extraction by comparing digital elevation models (DEMs) from early and late flights; Step 2.2: Apply support vector machine (SVM) to filter out non-vegetation pixels and calculate canopy cover from UAV imagery. Step 3: Build a knowledge-guided multi-task prediction model to simultaneously evaluate soil conditions in the bare soil stage and productivity in the crop growth stage: The knowledge-guided multi-task prediction model includes a backbone encoder and multiple task heads, and is divided into two stages: representation learning and prediction. The backbone encoder uses a convolutional neural network (CNN) to extract spatial features. The feature map generated by the CNN is divided into fixed-size blocks and input into the Transformer encoder. The multi-layer self-attention mechanism promotes feature interaction and representation learning. The output feature map is then input into different task heads to generate two different sets of evaluation results: (1) KGMTsoil - soil property prediction at the bare soil stage, including salt content, alkalinity, organic matter content, and potassium, sodium, and calcium concentrations; (2) KGMTcrop - crop property prediction at the crop growth stage, including aboveground biomass (AGB) and leaf area index (LAI). The specific construction steps are as follows: Step 3.1: Build a multi-task prediction model for soil properties: Step 3.1.1. In the first stage, bare soil drone images are used as input data to extract soil salinity, alkalinity, and organic matter content. The input data is processed by a backbone encoder to generate a multi-scale feature representation. In step 3.1.2, the feature maps extracted by the backbone encoder are divided into fixed-size blocks and then input into the Transformer-based feature representation module. The Transformer module captures global context information through a multi-head self-attention mechanism and enhances the feature representation through layer normalization. The Transformer module further integrates feature correlations to generate a high-dimensional representation. Step 3.1.3: The features are passed to task head 1 and task head 2. Task head 1 predicts soil salinity and alkalinity, while task head 2 performs regression analysis on organic matter content and other key nutrients such as potassium (K), sodium (Na), and calcium (Ca). Step 3.2: Build a knowledge-guided crop characteristic prediction model: The second phase aims to predict leaf area index (LAI) and aboveground biomass (AGB) at different crop growth stages by using drone imagery as input. The specific steps are as follows: Step 3.2.1. Introduce the attention feature fusion module: The attention feature fusion module contains two attention mechanisms: channel attention mechanism and spatial attention mechanism. The channel attention mechanism enhances the representation of key channels by learning the relative importance of each feature channel, and the spatial attention mechanism optimizes the spatial representation by capturing spatial patterns in the image. Step 3.2.2: Through the attention feature fusion module, the soil feature map extracted in the first stage is seamlessly integrated into the crop feature representation, thereby enhancing the learning ability of the crop task head; Step 3.2.3, the projection head converts the merged image representation into a vector representation that is more suitable for predicting leaf area index (LAI) and aboveground biomass (AGB); Step 4: Performance evaluation: Step 4.1: In the first stage, five-fold cross-validation was used for training and evaluation to predict soil salinity, alkalinity, and nutrients, including potassium, calcium, sodium, and organic matter. Step 4.2: After the first stage, additional training is performed using all plots with measurement labels to generate encoded features. These feature representations are then used as input in the second stage to guide crop growth prediction. Step 4.3: In the second stage, five-fold cross-validation is used for training and evaluation, with the goal of predicting leaf area index (LAI) and aboveground biomass (AGB) at each crop growth stage. Step 5: Analysis of growth influencing factors and comprehensive land quality assessment: Step 5.1: To further investigate the relationship between soil properties and crop growth, correlation analysis was performed to quantify the relationship between soil factors and crop growth characteristics. Step 5.2: Use the Pearson correlation coefficient to quantify the correlation between two sets of linear variables. Step 5.3: Apply the least squares regression (LSR) model to comprehensively evaluate the joint impact of all soil attributes on crop characteristics and develop a threshold-based soil early warning system for predicting crop performance.

[0010] Compared with the prior art, the present invention has the following advantages: 1. KGMT combines deep learning with a multi-task learning framework to simultaneously predict multiple soil properties and crop growth traits. Unlike traditional methods, KGMT directly uses drone hyperspectral imagery as input, eliminating the need for tedious manual feature extraction. By integrating soil domain knowledge, KGMT significantly improves prediction accuracy and generalization, providing a highly efficient solution for soil and crop growth prediction.

[0011] 2. Data for this invention were collected from two agricultural plots in Bayannur City, Inner Mongolia Autonomous Region, China, using an unmanned aerial vehicle (UAV) equipped with a hyperspectral sensor. The KGMT model outperformed traditional PLSR methods and a baseline multi-task model in predicting six soil properties: alkalinity, salinity, organic matter content, potassium (K), sodium (Na), and calcium (Ca). For example, KGMT achieved R² of 0.57 and 0.59 for alkalinity and salinity predictions, respectively, with normalized root mean square errors (nRMSE) of 0.14 and 0.11. For nutrient prediction, the model achieved R² of 0.57, 0.60, 0.49, and 0.47 for organic matter, potassium, sodium, and calcium, respectively. For crop traits, KGMT achieved R² of 0.75 and 0.82 for leaf area index (LAI) and aboveground biomass (AGB), respectively, and demonstrated superior cross-regional generalization. Overall, KGMT reduces nRMSE by 20% compared to the baseline multi-task model.

[0012] 3. This invention has developed a soil early warning mechanism that combines soil properties during the bare soil period with crop characteristics during the growing season to enable early identification of potential crop growth-limiting factors. By simultaneously monitoring soil characteristics and crop growth indicators, this mechanism provides a forward-looking soil and crop management strategy.

[0013] 4. This invention emphasizes the importance of combining hyperspectral data with domain knowledge, providing a robust solution for the coordinated management of soil and crops, assisting precision agriculture practices, optimizing soil conditions, and promoting sustainable land use. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 The workflow diagram of the soil property and crop trait prediction and early warning method based on the multi-task Transformer model guided by soil knowledge; Figure 2 Overview of the study area and experimental design, (a) location of the experimental area, (b) manual field measurement and destructive sampling process, (c) drone overhead view of experimental plot 1, (d) DJI M350 RTK drone used for aerial data collection, (e) drone overhead view of experimental plot 2; Figure 3For soil property distribution and correlation analysis, (a) ridgeline distribution diagram of six measured soil properties, including organic matter, alkalinity, salinity, potassium (K), sodium (Na), and calcium (Ca), (b) correlation matrix diagram of the six soil properties; Figure 4 This is the workflow of the proposed network for soil and crop productivity assessment. The framework consists of two stages: (a) the KGMTsoil module focuses on learning the representation of soil properties, and (b) the KGMTcrop module integrates soil and crop characteristics through an attention feature fusion module (including channel attention and spatial attention) to predict yield-related traits such as leaf area index (LAI) and aboveground biomass (AGB). Figure 5 For the regression analysis of soil attributes and crop characteristics and the threshold-based soil early warning workflow, soil attributes include organic matter (OM), alkalinity, salinity, potassium (K), sodium (Na) and calcium (Ca), which are measured at the bare soil stage, and crop characteristics include canopy cover (CC), plant height (PH), aboveground biomass (AGB) and leaf area index (LAI), which are collected at the growth stage, SII: soil impact index, Coef: coefficient, Std: standard deviation; Figure 6 The accuracy verification results of the salinity and alkalinity estimation models are shown in the figure on the left, corresponding to alkalinity estimation, and the figure on the right to salinity estimation. Each scatter point represents the pairing relationship between the measured value and the model-estimated value. The black solid line represents the fitted regression line, the red dotted line represents the ideal 1:1 reference line, and the gray shaded area around the fitted line represents the uncertainty range of the model estimation. Figure 7 Figure 3. Scatter plot of soil property prediction based on the knowledge-guided multi-task Transformer (KGMT) and partial least squares regression (PLSR) models. Each scatter point represents the pairing relationship between the measured value and the model prediction value. The black solid line is the fitted regression line, the red dashed line is the ideal 1:1 reference line, and the gray shaded area around the fitted line represents the uncertainty range of the model prediction. Figure 8 The accuracy evaluation of PLSR, MT and KGMT trait prediction models in two experimental fields (F1 and F2) is shown in Figure 2. Error bars represent the standard deviation of the validation results. LAI: leaf area index, AGB: aboveground biomass; Figure 9 Distribution and correlation analysis of crop characteristics in Plots 1 and 2, (a) Distribution of four crop characteristics, including canopy cover (CC), plant height (PH), aboveground biomass (AGB), and leaf area index (LAI), (b) Correlation matrix of crop characteristics; Figure 10is the correlation matrix between soil attributes and crop characteristics (canopy cover (CC), plant height (PH), aboveground biomass (AGB), and leaf area index (LAI)); Figure 11 Figure 3. Spatial early warning distribution of four crop traits predicted based on least squares regression, namely crown cover (CC), plant height (PH), aboveground biomass (AGB), and leaf area index (LAI), shown in (a) Field 1 and (b) Field 2. Different colors represent different warning levels: white indicates no warning, and green, orange, and red correspond to level 1, level 2, and level 3 warnings, respectively. DETAILED DESCRIPTION

[0015] The technical solution of the present invention is further described below with reference to the accompanying drawings, but is not limited thereto. Any modification or equivalent replacement of the technical solution of the present invention that does not depart from the spirit and scope of the technical solution of the present invention should be included in the scope of protection of the present invention.

[0016] The present invention provides a soil property and crop trait prediction and early warning method based on a multi-task Transformer model guided by soil knowledge. The method proposes a deep learning framework based on raw hyperspectral images for simultaneously predicting multiple soil properties; constructs a crop trait prediction model that integrates soil knowledge; and establishes an early warning framework based on soil-crop interaction. Figure 1 The specific steps are as follows: 1. Materials and Methods 1.1 Experimental location and setup The experimental field is located in Bayannur, Inner Mongolia Autonomous Region, China (40°13′–41°41′N, 105°12′–108°02′E), in the central area of ​​the Hetao Plain along the Yellow River. The region has a typical temperate continental climate, with an average annual temperature of approximately 7.6°C, a frost-free period of approximately 130 days, and an annual precipitation of 150 to 250 mm. Precipitation is mainly concentrated from June to August, while annual evaporation exceeds 2000 mm. The soil is characterized by widespread distribution of saline-alkali soil. Due to low terrain, poor drainage and salt accumulation, the soil salt content is high, which significantly restricts plant growth in these areas. The present invention selected two sample plots for field sampling and drone data collection ( Figure 2 Before fieldwork, the two sample plots, measuring 0.31 and 0.36 square kilometers, respectively, were considered highly representative. Within each plot, the area was subdivided into 5-meter by 5-meter subplots to accurately represent soil and crop distribution. During the subdivision process, non-cultivated areas, such as roads and a few buildings, were excluded to ensure representative and accurate data.

[0017] 1.2 Data Acquisition 1.2.1 Field data collection Soil data were collected during the bare soil phase on April 15, 2024. Forty-nine soil samples were collected from Plot 1 and 58 from Plot 2. The sampling process involved randomly selecting sampling points and extracting soil samples from the 0-20 cm depth using standardized methods. These samples were then immediately sent to a specialized laboratory for chemical analysis. The analysis included two salinization indicators: salt content and alkalinity, as well as four key soil nutrient indicators: potassium, calcium, sodium, and organic matter content.

[0018] The aboveground biomass (AGB) and leaf area index (LAI) data were collected on September 10, 2024, when the sunflower was in the late stage of rapid growth and approaching senescence. The growth conditions were relatively stable and suitable for biomass measurement. AGB data were obtained from 30 and 32 sub-plots in the two experimental plots, respectively. After the UAV flight, the heights of the three most representative plants in each sub-plot were measured, and their average height was calculated to represent the plant height of the sub-plot. Subsequently, the plants were harvested and bagged. All vegetation samples were dried at 65°C for 48 hours, after which the dried samples were weighed to determine the final AGB of each sub-plot. To ensure data accuracy and spatial consistency, an intelligent RTK system (CHCNAV-i90, Shanghai, China) was used to perform geometric correction and image registration on the collected images, and the horizontal and vertical root mean square errors were less than 0.02 meters. Soil property distribution and correlation analysis are shown in Figure 2. Figure 3 shown.

[0019] 1.2.2 UAV Hyperspectral Image Acquisition and Preprocessing This study used two types of drone data: high-resolution RGB imagery and hyperspectral imagery with 125 spectral bands. To ensure data quality, all data was collected between 12:00 PM and 2:00 PM, when lighting conditions are stable and the impact of varying solar radiation angles on image quality is minimized. RGB imagery was collected using a DJI Mavic 3E drone equipped with a 20-megapixel RGB camera at an altitude of 50 meters to achieve high spatial resolution and image quality. During flight, both forward and lateral overlap were set to 70%. Hyperspectral data was collected using a DJI Matrice 300 drone equipped with a GaiaSky-mini3-VN lens. Before each flight, the system was calibrated using a standard reflectance calibration plate, converting raw digital values ​​(DN) to hyperspectral reflectance to ensure the accuracy and consistency of the hyperspectral data. The hyperspectral sensor has a spectral range of 450 nm to 950 nm and a resolution of 4 nm. The flight altitude was also set to 50 meters, with forward overlap of 85% and lateral overlap of 75%.

[0020] All drone imagery was stitched and orthorectified using Agisoft PhotoScan Professional (Agisoft LLC, St. Petersburg, Russia). This software seamlessly stitches overlapping drone imagery, producing orthorectified output with high spatial accuracy. After stitching, the imagery was segmented using 5m x 5m vector files. Non-cultivated areas, such as roads and buildings, were excluded during the segmentation process. After segmentation, the imagery was manually inspected to ensure that only cultivated areas were included in subsequent model training.

[0021] 1.3 Extracting plant height and canopy cover from drone images Plant height extraction was achieved by comparing digital elevation models (DEMs) from earlier and later flights. Vegetation segmentation was challenging due to interference from field elements such as irrigation lines. Traditional vegetation index methods often performed poorly. Therefore, a support vector machine (SVM) was applied to filter out non-vegetation pixels and calculate canopy cover from drone imagery. This method demonstrated strong robustness and generalization capabilities, even with limited training data.

[0022] 1.4 Knowledge-guided multi-task prediction model This paper proposes a multi-task learning network architecture to simultaneously evaluate soil conditions at the bare soil stage and crop productivity at the growing stage. Figure 4 As shown in Figure 3, the network structure includes a backbone encoder, multiple task heads, and is divided into two stages: representation learning and prediction. The backbone encoder uses a convolutional neural network (CNN) to extract spatial features and is combined with a Transformer encoder to capture higher-dimensional contextual information. Specifically, the feature map generated by the CNN is divided into fixed-size blocks and input into the Transformer encoder, which promotes feature interaction and representation learning through a multi-layer self-attention mechanism. The output feature map is then input into different task heads to generate two different sets of evaluation results: (1) KGMTsoil - soil property prediction at the bare soil stage, including salt content, alkalinity, organic matter content, and potassium, sodium, and calcium concentrations; (2) KGMTcrop - crop property prediction at the crop growth stage, including aboveground biomass (AGB) and leaf area index (LAI).

[0023] 1.4.1 Multi-task prediction model for soil properties The first stage uses drone imagery of bare soil as input to extract soil salinity, alkalinity, and nutrient properties. This data is processed through a backbone encoder to generate multi-scale feature representations. The backbone encoder consists of multiple convolutional layers: a 1×1 convolution to extract local features, a 3×3 convolution to capture information with a larger receptive field, and a final 1×1 convolution to compress features. The extracted feature map is partitioned into fixed-size blocks and then input into a Transformer-based feature representation module. The Transformer module captures global contextual information through a multi-head self-attention mechanism and enhances feature representations through layer normalization. This Transformer module further integrates feature correlations to generate a high-dimensional representation. The features are then passed to Task Head 1 (salinity and alkalinity representation learning) and Task Head 2 (nutrient representation learning). Task Head 1 predicts soil salinity and alkalinity, while Task Head 2 performs regression analysis on organic matter content and key nutrients such as potassium (K), sodium (Na), and calcium (Ca). These multi-task predictions leverage shared representations to improve prediction accuracy by mining inter-task relationships while providing a comprehensive representation of soil properties. The core of this phase is to construct accurate soil representations to provide prior knowledge for subsequent crop growth predictions.

[0024] Since the prediction of soil properties (such as salinity, alkalinity, potassium, and organic matter) involves continuous values, the mean squared error (MSE) loss function is used at this stage:

[0025] in, represents the soil property prediction loss, is the soil property index, N is the number of samples, and They represent the true value and predicted value of the i-th sample respectively.

[0026] 2.4.2 Knowledge-guided crop characteristic prediction model The second stage aims to predict crop growth stage characteristics using drone imagery as input. Independent encoders extract spatial and spectral feature representations of the crop. This stage involves two prediction tasks: leaf area index (LAI) and aboveground biomass (AGB). To improve the accuracy of crop trait prediction, a cross-stage knowledge guidance mechanism is introduced. This mechanism combines the soil information learned in the first stage to optimize and enhance the feature representation for trait prediction. By establishing a connection between the feature map generated by the soil encoder and the feature representation of the crop growth stage, soil information is used as important prior knowledge for crop growth stage prediction. As a result, this mechanism more effectively captures the complex relationship between crop growth conditions and soil properties, improving the network's feature representation capabilities.

[0027] The attention feature fusion module is the core component of the knowledge-guided mechanism, which can effectively integrate features from different stages. This module contains two attention mechanisms: channel attention and spatial attention. The channel attention mechanism enhances the representation of key channels by learning the relative importance of each feature channel, while the spatial attention mechanism optimizes the spatial representation by capturing spatial patterns in the image. Through the fusion module, the soil feature map extracted in the first stage is seamlessly integrated into the crop feature representation, thereby enhancing the learning ability of the crop task head. To ensure the quality of feature integration, feature consistency loss is introduced to constrain the fusion of soil features in the first stage and crop features in the second stage, thereby improving the effectiveness of cross-stage information sharing:

[0028] in, represents feature alignment loss, P represents the number of samples, and Respectively represent Characteristics of soil and crop maps for each sample.

[0029] The projection head converts the merged image representation into a vector representation more suitable for predicting leaf area index (LAI) and aboveground biomass (AGB). This projection head is implemented using a nonlinear multilayer perceptron (MLP) with a single hidden layer. Previous research has shown that this projection module is crucial for improving the quality of the previous layer's representation. To optimize the model, the present invention also uses the mean squared error (MSE) loss function:

[0030] in, represents the crop trait prediction loss, Indicates crop trait indicators, represents the number of samples, Represents the total number of crop traits.

[0031] 1.5 Performance Evaluation In the first phase, the model was trained and evaluated using five-fold cross-validation. The dataset was randomly divided into five subsets, which were used sequentially as training and validation sets for independent evaluation. The task was to predict soil salinity and nutrients, including potassium, calcium, sodium, and organic matter. To maximize the use of measured soil information, additional training was performed after the first phase using all plots with measurement labels to generate encoded features. These feature representations were then used as input in the second phase to guide crop growth prediction. The second phase was also trained and evaluated using five-fold cross-validation, with the goal of predicting leaf area index (LAI) and aboveground biomass (AGB) across crop growth stages. Model performance was evaluated using metrics such as normalized root mean square error (nRMSE) and coefficient of determination (R²).

[0032] 1.6 Analysis of Growth Influencing Factors and Comprehensive Land Quality Assessment Soil salinization, alkalinity, and nutritional status are key factors affecting crop growth. To further investigate the relationship between soil properties and crop growth, this study conducted correlation analysis to quantify the linear relationships between soil factors and crop growth characteristics, such as leaf area index (LAI) and aboveground biomass (AGB). The Pearson correlation coefficient was used to quantify the correlation between two sets of linear variables, and the t-test was used to assess significance. The formula is as follows:

[0033] in, is the correlation coefficient between variables X and Y, is the number of samples; and Respectively The measurement branches X and Y of the group data, and They are and The mean value of a variable.

[0034] Correlation coefficients provide a preliminary quantification of the relationship between soil properties and crop characteristics. However, these coefficients are limited to one-to-one relationships and cannot account for the coupled effects of multiple soil properties on crop characteristics. Furthermore, correlation coefficients alone are insufficient to establish effective soil-based early warning thresholds to provide practical guidance to agricultural producers. To address these limitations, the present invention applies a least squares regression (LSR) model to comprehensively assess the combined effects of all soil properties on crop characteristics, thereby developing a threshold-based soil early warning system for predicting crop performance ( Figure 5 ).

[0035] Soil property data were collected from two fields (Field 1 and Field 2) during the bare soil phase. Crop property data were collected during the crop growth phase. During the analysis, one field was designated as the training set (Field X), and its soil properties served as independent variables in the LSR model. The resulting regression equation was then used to predict the Soil Impact Index (SII) for the other field (Field Y, serving as the test set). Importantly, for Field Y, the model inputs included only soil properties collected during the bare soil phase, thus enabling early warning of soil conditions before the crop growth phase. Based on the mean and standard deviation of each property in the training set, the predicted values ​​in the test set were categorized into four early warning levels: Level 0 (normal, values ​​greater than the mean minus one standard deviation), Level 1 (mild warning, values ​​between the mean minus one and two standard deviations), Level 2 (moderate warning, values ​​between the mean minus two and three standard deviations), and Level 3 (severe warning, values ​​less than the mean minus three standard deviations). To validate the stability of the model, the analysis was repeated with Fields 1 and 2 alternating between the training and test sets. This method can detect potential soil problems in Field Y at an early stage based on soil properties collected at the bare soil stage, providing actionable guidance for agricultural management.

[0036] 2. Results 2.1 Salinity and alkalinity prediction KGMT leverages the advantages of the Transformer architecture to effectively capture the sequential nature of spectral data and mine deep correlations between bands through a self-attention mechanism. This capability enables it to simultaneously predict soil salinity and alkalinity. Figure 6 The prediction accuracy of the KGMT model was compared with that of the PLSR single-feature prediction model. The KGMT multi-task model outperformed the PLSR single-task model in predicting both target properties. For soil alkalinity, the KGMT model achieved an R² of 0.57 and an nRMSE of 0.14, outperforming the PLSR model's R² of 0.46 (with the same nRMSE), demonstrating that multi-task learning more effectively captures key features in spectral reflectance. Similarly, for salinity, the KGMT model achieved an R² of 0.59 and an nRMSE of 0.11, while the PLSR model achieved an R² of 0.47 and an nRMSE of 0.15. Comparing the scatter plots, the KGMT model's predictions and measurements clustered more closely around the ideal y=x line, particularly for salinity. Notably, the PLSR model exhibited more pronounced deviations in the high ranges of both properties, indicating lower predictive reliability in these regions. Furthermore, the error distributions of the two models for salinity prediction were relatively consistent, while alkalinity predictions exhibited slightly higher variability near extreme values ​​(with more than 9 observations). Overall, the results highlight the advantage of the multi-task approach in capturing shared spectral information, leading to more accurate and robust predictions of both soil properties.

[0037] 2.2 Soil nutrient prediction Figure 7 The performance of the KGMT and PLSR models in predicting four key soil properties (organic matter content, potassium (K), sodium (Na), and calcium (Ca)) is demonstrated. The KGMT model outperformed the PLSR model in predicting all four properties. Specifically, the KGMT model achieved an R² of 0.57 and an nRMSE of 0.14 for organic matter prediction, while the PLSR model achieved an R² of 0.40 and an nRMSE of 0.17. Comparison of the point cloud distribution and the fitted lines clearly reveals the differences in the predictive performance of the two models across different concentration ranges. For example, within the medium organic matter concentration range (measured values ​​between 9 and 12), the predicted points of both models closely align with the 1:1 diagonal line, with narrow confidence intervals, indicating high predictive stability within this range. In the medium-to-high organic matter concentration range (measured values ​​< 9), although the KGMT's error increases, its predictive performance remains relatively stable. In contrast, the PLSR point cloud deviates below the diagonal line, resulting in significant underestimation of the predicted values ​​for most samples, indicating weaker fitting ability in this range.

[0038] Similarly, for potassium, KGMT's R² improved from PLSR's 0.52 to 0.60, and its nRMSE decreased from 0.07 to 0.12, indicating a significant improvement in prediction accuracy. The KGMT point cloud is closer to the diagonal, while the PLSR scatter plot is more dispersed, particularly in the low concentration range (measured values ​​< 0.04), where a large number of high-bias predictions were observed. The KGMT model also demonstrated significant advantages in predicting sodium and calcium, with R² values ​​of 0.49 and 0.47, respectively, compared to PLSR's R² values ​​of 0.47 and 0.46, respectively. Furthermore, KGMT consistently achieved lower nRMSE values ​​for sodium and calcium predictions, highlighting its superior generalization across diverse spectral features. For sodium, KGMT slightly underestimated in the medium to low concentration range (measured values ​​< 0.3), while PLSR exhibited both significant underestimation and overestimation within this range, demonstrating KGMT's superior stability. Both models exhibited similar consistency in point cloud distribution when predicting calcium. In summary, the KGMT model demonstrated superior fitting accuracy and robustness across diverse concentration ranges. Its multi-task learning framework significantly enhanced its ability to capture complex spectral sequence relationships. Although the PLSR model performed reasonably well within the medium concentration range for some attributes, it exhibited large errors at low and high values, and exhibited poorer predictive stability compared to the KGMT. This result further validates the potential of the multi-task learning-based Transformer model for analyzing complex multivariate spectral data.

[0039] 2.3 Crop Characteristics Prediction This paper compares the performance of PLSR, MT and KGMT models in predicting leaf area index (LAI) and aboveground biomass (AGB). Figure 8 ). The PLSR model takes spectral data as input, while the KGMT model incorporates domain-specific soil knowledge through a knowledge-guided architecture. The MT model serves as a baseline, omitting soil knowledge and is a simplified version of KGMT. Model performance varies significantly across experimental fields. In the F1 region, the PLSR model achieved R² values ​​of 0.71 and 0.76 for LAI and AGB, respectively, and nRMSE of 0.14. However, its performance in the F2 region decreased slightly, with R² values ​​of 0.65 and 0.71, and nRMSE of 0.17 and 0.15, respectively, indicating reduced cross-regional stability. In contrast, the MT model exploits inter-feature relationships through multi-task learning and exhibits higher prediction accuracy. In the F1 region, its R² values ​​for LAI and AGB were 0.70 and 0.78, respectively, and the nRMSE was stable between 0.14 and 0.13. Similar trends were observed in the F2 region, with R² values ​​reaching 0.71 and 0.73, highlighting the robustness of the MT model in multi-feature prediction.

[0040] The KGMT model further improved its prediction accuracy and cross-regional generalization capabilities by incorporating soil knowledge into the learning process. In the F1 region, its LAI and AGB R² values ​​were 0.75 and 0.82, respectively; in the F2 region, the R² values ​​reached 0.72 and 0.80. Notably, the KGMT model achieved a 20% lower nRMSE than the MT model and a 27% lower nRMSE than the PLSR model. Furthermore, its lower error variability (as evidenced by a smaller inter-task standard deviation) highlights its superior predictive stability. Overall, the results demonstrate the limitations of the PLSR model in single-trait prediction, while the MT model achieves improved automation and modest improvements in prediction accuracy through multi-task learning. By incorporating soil knowledge into a two-stage learning framework, the KGMT model achieved more accurate and stable predictions across regions, providing a robust approach for crop trait prediction.

[0041] The present invention conducted a preliminary statistical analysis on the crop characteristics extracted from the two fields. Figure 9(a) shows a comparison of data distributions from the two fields. Significant differences were observed in both the mean and distribution clusters of the traits. Specifically, the mean canopy cover for Field 1 was 0.38, while the mean for Field 2 was 0.49. For plant height, the minimum and maximum values ​​were similar between the two fields, but the mean plant height for Field 2 was significantly higher than that for Field 1. Aboveground biomass (AGB) and leaf area index (LAI) showed consistent patterns: the distribution for Field 1 was concentrated around the 25th percentile, while the distribution for Field 2 was more evenly distributed throughout the range. In addition, the variability of the traits appeared to be greater in Field 2, with data points distributed over a wider range. These differences in the distribution of traits may indicate differences in crop performance or environmental factors between the two fields.

[0042] Figure 9 (b) Pearson correlation coefficients between four crop traits in Fields 1 and 2 are shown. Overall, significant correlations were observed between the different traits, particularly between AGB and LAI, with correlation coefficients exceeding 0.6 in both regions. The weakest correlations were between plant height (PH) and canopy cover (CC), with correlation coefficients of -0.13 and -0.19, respectively. Furthermore, trait correlations varied across regions. In Field 1, CC showed strong correlations with both AGB and LAI (r > 0.4). In contrast, these correlations were significantly lower in Field 2 (r = 0.29 and 0.35), suggesting that relationships between traits may be influenced by regional environmental conditions and crop growth status.

[0043] 2.4 Key growth factors and land quality assessment results Correlation analysis revealed significant relationships between soil properties at the bare soil stage and crop characteristics at the growth stage. Figure 10 As shown, organic matter exhibited the strongest positive correlations with crop traits, with correlation coefficients ranging from 0.45 to 0.67, indicating its important role in improving crop performance. In contrast, soil alkalinity and salinity exhibited consistently strong negative correlations with all traits, with correlation coefficients ranging from -0.39 to -0.66, suggesting that these properties may hinder crop development. Among soil attributes, sodium (Na) exhibited the highest negative correlations, particularly with leaf area index (LAI, -0.63) and aboveground biomass (AGB, -0.57), highlighting its potential adverse effects on crop growth. Calcium (Ca) exhibited the weakest correlations overall, with correlation coefficients ranging from -0.11 to -0.26, indicating a relatively small impact. Overall, organic matter emerged as the most influential positive factor, while sodium exerted the greatest negative effect on crop traits. These findings provide initial insights into the interactions between soil attributes and crop growth, highlighting the importance of managing soil sodium and increasing organic matter content for improving crop performance.

[0044] Least squares regression analysis revealed varying degrees of correlation between soil properties and crop traits, with regression coefficients indicating both positive and negative effects. Among the crop traits, canopy cover (CC) had the highest R² value (0.75), followed by leaf area index (LAI, 0.71), aboveground biomass (AGB, 0.67), and plant height (PH, 0.58), indicating a good overall model fit. The corresponding normalized root mean square error (nRMSE) ranged from 0.14 to 0.16, demonstrating reliable prediction accuracy for all traits. Organic matter exhibited the largest positive coefficient of all traits, ranging from 0.22 (PH) to 0.52 (CC), further confirming its key role in improving crop performance. Conversely, salt and sodium exhibited the most significant negative coefficients, particularly for CC (salt, -0.60) and LAI (sodium, -0.25), indicating adverse effects. Alkalinity and potassium had small coefficients, reflecting their limited impact, while calcium showed a modest positive contribution, particularly for pH and LAI (both 0.35). Overall, organic matter was the most significant positive predictor, while salinity exhibited the strongest negative influence. These findings highlight the potential of bare-soil soil property thresholds to predict crop performance and guide soil management practices to optimize crop growth.

[0045] Table 1 Regression coefficients and performance indicators of crop traits based on soil properties

[0046] Note: Coef: regression coefficient of each variable in least squares regression.

[0047] The spatial distribution of soil-based crop trait early warning revealed obvious difference patterns among four traits (crown width index CC, plant height PH, aboveground biomass AGB and leaf area index LAI). Figure 11As shown, each map consists of 5×5 meter grid cells divided into four early warning levels: no warning (white), level one warning (green), level two warning (orange), and level three warning (red). Results from Plot 1 show that, while there are subtle differences in the spatial distribution of warnings for these traits, the overall pattern is highly consistent. The majority of grid cells in all maps fall into the no warning category, indicating that soil conditions in most areas are suitable for crop growth. Level one warnings (green) are significantly more numerous than other levels and dominate the map distribution, primarily clustered in the lower left corner of the study area, reflecting moderate risk. In contrast, level two (orange) and level three warnings (red) are less numerous and significantly clustered in the center-left region and lower left corner, indicating significant soil restrictions in these areas. In Plot 2, spatial early warning maps for the four traits show significant differences. The no warning level accounts for the largest proportion of marked areas. The warning map for crown index (CC) in Plot 2 shows a high number of level two and three warnings, while the warning maps for plant height (PH), aboveground biomass (AGB), and leaf area index (LAI) show a gradual decrease in level two and three warning areas, with more being replaced by level one warnings. Early warning maps for the Leaf Area Index (LAI) show a significant expansion of the Level 1 warning zone, which is now concentrated in specific areas. Despite differences in warning levels, the spatial distribution of warning zones for the four traits remains highly consistent, validating the reliability of this spatial mapping method and its potential application in guiding targeted block-level interventions.

[0048] 3. Discussion 3.1 Comparison of different soil property prediction methods The results show that the knowledge-guided multi-task Transformer (KGMT) model significantly outperforms the traditional partial least squares regression (PLSR) model in predicting soil salinity and key nutrients. For example, in salt prediction, the KGMT model achieved an R² of 0.59 and a normalized root mean square error (nRMSE) of 0.11, which is much higher than the PLSR model's R² of 0.47 and nRMSE of 0.15. This improvement is mainly due to KGMT's ability to capture long-distance inter-band correlations through the Transformer architecture, which is particularly important for analyzing high-dimensional spectral data. Previous studies have pointed out that linear models such as PLSR have difficulty handling nonlinear relationships in spectral data, especially in the prediction of complex traits such as salinity. In contrast, KGMT uses a self-attention mechanism to effectively model nonlinearity, and the predicted values ​​are more closely clustered with the measured values ​​(see Figure 6 、 Figure 7 scatter plot).

[0049] Furthermore, KGMT's multi-task learning framework plays a key role in its superior performance. Traditional single-task models, such as PLSR, treat each target trait as an independent variable and fail to fully exploit shared spectral features between traits. For example, there are significant spectral and chemical correlations between salinity and alkalinity, but PLSR fails to exploit these shared features, limiting its performance. KGMT's multi-task approach allows the model to simultaneously learn both shared and unique features, which not only improves prediction accuracy but also enhances generalization by reducing task-specific overfitting. For example, the R² for sodium content prediction improves from 0.44 for PLSR to 0.50 for KGMT, demonstrating that the model effectively exploits inter-task relationships to compensate for the lack of spectral signal. Furthermore, the self-attention mechanism within KGMT prioritizes the most relevant spectral bands for each task, ensuring that both global and task-specific patterns are captured. This ability to balance shared and specific learning aligns with recent findings on the effectiveness of multi-task learning in multivariate prediction.

[0050] 3.2 Performance of the KGMT model in crop trait estimation Crop trait prediction is a key research area in precision agriculture, but traditional methods such as PLSR have significant limitations when dealing with complex environments and predicting multiple traits. Previous studies have shown that PLSR performs well when predicting highly correlated traits, but its performance declines significantly when the relationships between traits are complex or when there is significant environmental heterogeneity. For example, in the field 2 area with high variability in the present invention, PLSR performance declined significantly (R² dropped to 0.62 and 0.68). This is mainly because PLSR has difficulty effectively capturing the relationships between traits and has poor environmental adaptability. In addition, multi-task learning has been widely used to jointly predict related traits, aiming to improve prediction accuracy. However, existing multi-task models are mostly purely data-driven and fail to effectively incorporate domain knowledge, limiting their generalization ability in complex environments. The KGMT model breaks through the limitations of traditional multi-task learning by embedding soil domain knowledge into the learning process, significantly enhancing the model's adaptability and interpretability.

[0051] The results show that KGMT significantly improves the prediction performance of Plot 1 and Plot 2 compared to PLSR and traditional multi-task (MT) models, with R² reaching 0.79 and 0.82, respectively. The key factors for the improvement include: (1) Soil properties are important factors affecting crop traits, especially in complex environments. By embedding soil information into a multi-task framework, KGMT better captures the potential interactions between soil and crop traits. For example, despite the large variation in traits in Plot 2, KGMT still performs stably, reflecting the role of domain knowledge in improving cross-regional robustness; (2) KGMT's multi-task learning framework fully utilizes the relationship between traits, significantly improving prediction accuracy. For example, leaf area index (LAI) is highly correlated with aboveground biomass (AGB) (r>0.6), providing rich shared information that traditional models fail to fully utilize. KGMT accurately models the intrinsic relationship between traits through a weight sharing mechanism; (3) Compared with the traditional MT model, KGMT's prediction performance in different regions is more consistent, and the verification standard deviation is reduced by 15%. This is due to the feature extraction mechanism guided by soil knowledge, which helps the model adapt to regional environmental differences.

[0052] 3.3 Relationship between soil properties and crop growth Soil properties during the bare soil stage significantly influence crop growth, particularly the contrasting effects of organic matter and sodium content, providing a theoretical basis for soil-crop interactions. Organic matter plays a key role in crop traits such as leaf area index and canopy cover, not only influencing soil nutrient supply but also improving soil aggregate structure and water retention, thereby enhancing root uptake efficiency. Regression analysis results show that organic matter consistently promotes multiple crop traits, with a positive coefficient as high as 0.52, further expanding our understanding of its impact across different growth stages. In contrast, sodium content has a greater negative impact on crop growth, highlighting the threat of salt damage to plant systems. High sodium levels disrupt cellular osmotic pressure and inhibit metabolic activity, fundamentally reducing plant photosynthetic efficiency and biomass accumulation. The negative correlation coefficient between sodium and leaf area index in this study is -0.63, consistent with previous studies showing that salt damage significantly inhibits leaf area expansion. Calcium and potassium have relatively minor effects on crop growth, suggesting a weak role in basic growth functions, but still contribute to overall crop health. These results highlight the role of soil properties in shaping crop traits and provide a basis for exploring the physiological mechanisms behind soil property thresholds.

[0053] 3.4 Practical soil early warning strategies and their application value Regression analysis showed that soil properties during the bare soil period can effectively predict crop growth performance, supporting a theoretical framework for soil management decisions based on precision agriculture. Among various growth indicators, canopy cover (CC) had the highest prediction accuracy (R² = 0.75), which is mainly attributed to the direct impact of soil properties on vegetation cover. Canopy cover, a key crop cover indicator, reflects important physiological processes such as photosynthesis and transpiration and is strongly affected by soil fertility. Early warning results from drone imagery ( Figure 11 ) shows that the warning areas (green, orange, and red) are concentrated in areas with obvious saline land or salt crust patches (the white part in the left picture), indicating that excessive soil salinity is one of the key factors restricting crop growth.

[0054] Despite the differences in soil properties in different regions, the "soil property prediction-crop trait prediction-soil early warning" workflow constructed by the present invention shows good adaptability under diverse soil and climatic conditions, and has become an important tool for guiding precision soil management. From a management perspective, the research results emphasize the key role of improving soil organic matter levels and regulating sodium content in promoting crop growth and enhancing stress resistance. Organic matter can be increased through measures such as intercropping, applying compost, and reducing tillage. These measures not only improve soil fertility, but also enhance the resistance of crops to environmental stress, especially in salinized or degraded soils. The effect is significant. Sodium content management requires more targeted measures, such as applying gypsum to replace sodium ions, breeding salt-tolerant varieties, and optimizing irrigation strategies to reduce salt accumulation in the root zone and reduce the risk of salt damage to crops. In summary, the present invention not only constructs an effective framework for precision soil management, but also proposes targeted measures for key Practical strategies to optimize crop performance by using key soil properties can help promote the resilience and sustainability of agricultural systems.

Claims

1. A soil property and crop trait prediction and early warning method based on a multi-task Transformer model guided by soil knowledge, characterized by The method comprises the following steps: Step 1: Data acquisition; Step 2: Extract plant height and canopy coverage from drone images; Step 3: Construct a knowledge-guided multi-task prediction model for simultaneously evaluating the soil condition in the bare soil stage and the productivity in the crop growth stage. The knowledge-guided multi-task prediction model includes a backbone encoder and multiple task heads, and is divided into two stages: representation learning and prediction, wherein: the backbone encoder uses a convolutional neural network (CNN) to extract spatial features. The feature map generated by the CNN is divided into blocks of fixed size and input into the Transformer encoder. The multi-layer self-attention mechanism promotes feature interaction and representation learning. The output feature map is then input into different task heads to generate two sets of different evaluation results: (1) KGMTsoil - soil property prediction in the bare soil stage, including salt content, alkalinity, organic matter content, and potassium, sodium, and calcium concentrations; (2) KGMTcrop - crop property prediction in the crop growth stage, including aboveground biomass and leaf area index; Step 4: Performance evaluation: Step 4.1: In the first stage, five-fold cross-validation was used for training and evaluation to predict soil salinity, alkalinity, and nutrients, including potassium, calcium, sodium, and organic matter. Step 4.2: After the first stage, additional training is performed using all plots with measurement labels to generate encoded features. These feature representations are then used as input in the second stage to guide crop growth prediction. Step 4.3: In the second stage, five-fold cross validation is used for training and evaluation, with the goal of predicting the leaf area index and aboveground biomass of crops at different growth stages. Step 5: Analysis of growth influencing factors and comprehensive land quality assessment: Step 5.1: To further investigate the relationship between soil properties and crop growth, correlation analysis was performed to quantify the relationship between soil factors and crop growth characteristics. Step 5.2: Use the Pearson correlation coefficient to quantify the correlation between two sets of linear variables; Step 5.3: Apply the least squares regression model to comprehensively evaluate the joint impact of all soil attributes on crop characteristics and develop a threshold-based soil early warning system for predicting crop performance.

2. The soil property and crop trait prediction and early warning method based on the multi-task Transformer model guided by soil knowledge according to claim 1 is characterized in that The specific steps of step 1 are as follows: Step 1.1: Field data collection; Step 1.1.

1. Collect soil data and conduct chemical analysis at the bare soil stage. The analysis includes two salinization indicators: salt content and alkalinity, and four key soil nutrient indicators: potassium, calcium, sodium, and organic matter content. Step 1.1.2, collect aboveground biomass and leaf area index data; Step 1.2: UAV hyperspectral image acquisition and preprocessing: Step 1.2.1: Collect high-resolution RGB images and hyperspectral images with 125 spectral bands; Step 1.2.2: Use Agisoft PhotoScan Professional software to stitch and orthorectify the drone images collected in step 1.2.

1. Step 1.2.3: After stitching is complete, segment the image using a 5m x 5m vector file. Step 1.2.4: After segmentation is complete, manually inspect the image to ensure that only cultivated areas are included in subsequent model training.

3. The soil property and crop trait prediction and early warning method based on the multi-task Transformer model guided by soil knowledge according to claim 1 is characterized in that The specific steps of step 2 are as follows: Step 2.1, plant height extraction by comparing the digital elevation models of early and late flights; Step 2.2: Apply support vector machine to filter out non-vegetation pixels and calculate canopy cover from UAV imagery.

4. The soil property and crop trait prediction and early warning method based on a multi-task Transformer model guided by soil knowledge according to claim 1 is characterized in that The specific construction steps of step 3 are as follows: Step 3.1: Build a multi-task prediction model for soil properties: Step 3.1.1: In the first stage, bare soil drone images are used as input data to extract soil salinity, alkalinity, and organic matter content. The input data is processed by a backbone encoder to generate a multi-scale feature representation. In step 3.1.2, the feature maps extracted by the backbone encoder are divided into fixed-size blocks and then input into the Transformer-based feature representation module. The Transformer module captures global context information through a multi-head self-attention mechanism and enhances the feature representation through layer normalization. The Transformer module further integrates feature correlations to generate a high-dimensional representation. Step 3.1.3: The features are passed to task head 1 and task head 2. Task head 1 predicts soil salinity and alkalinity, and task head 2 performs regression analysis on organic matter content and key nutrients such as potassium, sodium, and calcium. Step 3.2: Build a knowledge-guided crop characteristic prediction model: The second phase aims to predict the leaf area index and aboveground biomass of crops at different growth stages using drone imagery as input. The specific steps are as follows: Step 3.2.

1. Introduce the attention feature fusion module: The attention feature fusion module contains two attention mechanisms: channel attention mechanism and spatial attention mechanism. The channel attention mechanism enhances the representation of key channels by learning the relative importance of each feature channel, and the spatial attention mechanism optimizes the spatial representation by capturing spatial patterns in the image. Step 3.2.2: Through the attention feature fusion module, the soil feature map extracted in the first stage is seamlessly integrated into the crop feature representation, thereby enhancing the learning ability of the crop task head; Step 3.2.3: The projection head converts the merged image representation into a vector representation that is more suitable for predicting leaf area index and aboveground biomass.

5. The soil property and crop trait prediction and early warning method based on a multi-task Transformer model guided by soil knowledge according to claim 4 is characterized in that The first stage uses the mean squared error loss function: in, represents the soil property prediction loss, is the soil property index, N is the number of samples, and They represent the true value and predicted value of the i-th sample respectively.

6. The soil property and crop trait prediction and early warning method based on a multi-task Transformer model guided by soil knowledge according to claim 4 is characterized in that The second stage introduces feature consistency loss to constrain the fusion of soil features in the first stage and crop features in the second stage: in, represents the feature alignment loss, represents the number of samples, and Respectively represent Characteristics of soil and crop maps for each sample.

7. The soil property and crop trait prediction and early warning method based on a multi-task Transformer model guided by soil knowledge according to claim 4 is characterized in that The second stage uses the mean square error MSE loss function: in, represents the crop trait prediction loss, represents the crop trait index, represents the number of samples, Represents the total number of crop traits.

8. The soil property and crop trait prediction and early warning method based on a multi-task Transformer model guided by soil knowledge according to claim 1 is characterized in that The correlation calculation formula is as follows: in, is the correlation coefficient between variables X and Y, is the number of samples; and Respectively The measurement branches X and Y of the group data, and They are and The mean value of a variable.

9. The soil property and crop trait prediction and early warning method based on a multi-task Transformer model guided by soil knowledge according to claim 1 is characterized in that The soil early warning system predicts crop performance based on the following four early warning levels: Level 0: Normal, values ​​greater than the mean minus one standard deviation; Level 1: Mild warning, values ​​between the mean minus one and two standard deviations; Level 2: Moderate warning, values ​​between the mean minus two and three standard deviations; Level 3: Severe warning, values ​​less than the mean minus three standard deviations.