An Adaptive Construction Method for Crop Spectral Inversion Model

By constructing a three-dimensional physiologically constrained feasible domain and a water-nitrogen co-state sub-model based on field measurement data, the consistency and accuracy problems of crop water and nitrogen spectral inversion in existing technologies have been solved, and high-precision inversion has been achieved in complex farmland environments.

CN121279149BActive Publication Date: 2026-03-06NANJING HYDRAULIC RES INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511844056.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-09
Publication Date
2026-03-06
Estimated Expiration
2045-12-09

AI Technical Summary

Technical Problem

Existing crop water and nitrogen spectral inversion methods face challenges when dealing with complex farmland environments, including a lack of physical consistency due to the disconnect between crop physiological mechanisms and data models, as well as inversion distortion caused by water and nitrogen coupling effects.

Method used

A three-dimensional physiological constraint feasible domain based on the coupling law between field measured data and crop physiology is constructed. A physically consistent training sample set that integrates virtual samples and measured data is generated and classified into independent water-nitrogen synergistic state categories. A spectral feature sub-model is trained for each state category, and the pixel state is determined by the pre-configured model for inversion.

Benefits of technology

It improves the accuracy and robustness of crop water and nitrogen inversion, solves the problems of model generalization and physical consistency under small sample conditions, and decouples the complex effects of water and nitrogen interactive stress on the spectrum.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121279149B_ABST
    Figure CN121279149B_ABST
Patent Text Reader

Abstract

This invention discloses an adaptive construction method for crop spectral inversion models, comprising: analyzing the coupling law between measured field water, nitrogen, and dry matter data and crop physiology; constructing a feasible region of water, nitrogen, and dry matter physiological constraints in a three-dimensional state space; generating virtual samples; fusing virtual samples with measured water, nitrogen, and dry matter data to construct a physically consistent training sample set; constructing water-nitrogen co-state categories based on the combination of water and nitrogen levels, and independently determining the spectral feature subspace; training and generating parameter-independent water-nitrogen co-state sub-models; determining the target water-nitrogen co-state category, routing to the corresponding water-nitrogen co-state sub-model, and calculating the real-time inversion results of pixel water and nitrogen. This invention solves the model generalization and physical consistency problems under small sample conditions through physiological mechanism constraints, and decouples the complex influence of water-nitrogen interactive stress on the spectrum through a state classification mechanism, thereby improving the accuracy and robustness of crop water and nitrogen inversion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of agricultural remote sensing technology, and in particular, it is an adaptive construction method for crop spectral inversion models. Background Technology

[0002] Precise monitoring of crop water and nitrogen status is crucial for implementing precision agriculture, ensuring food security, and achieving reduced fertilizer application while increasing efficiency. Remote sensing technology, with its advantages of large-area, non-destructive, and rapid acquisition of surface information, has become an important tool for crop growth monitoring. By analyzing crop canopy spectral information and retrieving physicochemical parameters such as crop water content, nitrogen content, and biomass, it is possible to promptly diagnose crop growth stress conditions and provide scientific data support for farmland irrigation and fertilization decisions, thus possessing significant agricultural application value.

[0003] Existing methods for crop water and nitrogen spectral inversion are mainly divided into statistical regression methods and physical radiative transfer model methods. Statistical methods utilize algorithms such as partial least squares regression, support vector machines, or neural networks to establish the mapping relationship between spectral bands and single physicochemical parameters. Physical model methods, such as PROSAIL, invert parameters by simulating the interaction process between photons and the canopy, using lookup tables or cost function minimization. These methods are usually based on ground-based measured samples or general physical laws, assuming a relatively stable correlation between crop spectral response and single variables, and are widely used in agricultural monitoring at different scales.

[0004] However, existing technologies still face severe challenges in dealing with complex farmland environments, mainly manifested in the lack of physical consistency caused by the disconnect between crop physiological mechanisms and data models, and inversion distortion under the water-nitrogen coupling effect. Summary of the Invention

[0005] The purpose of this invention is to provide an adaptive construction method for crop spectral inversion models to solve the aforementioned problems in the existing technology.

[0006] Technical solution: An adaptive construction method for crop spectral inversion models, comprising:

[0007] The coupling law between measured water, nitrogen and dry matter data in the field and crop physiology is obtained and analyzed. A feasible region of physiological constraints on water, nitrogen and dry matter is constructed in a three-dimensional state space composed of water content, nitrogen content and dry matter, and virtual samples are generated within it. These virtual samples are then fused with measured water, nitrogen and dry matter data to construct a physically consistent training sample set.

[0008] Based on the combination of moisture and nitrogen levels in the physically consistent training sample set, water-nitrogen co-state categories are constructed, and spectral feature subspaces are independently determined for each water-nitrogen co-state category to train and generate parameter-independent water-nitrogen co-state sub-models.

[0009] Using a pre-configured pixel water-nitrogen co-state classification model, based on the standardized crop spectral data and observation condition feature sequence of the pixel to be inverted, the target water-nitrogen co-state category of the pixel is determined, and the pixel is routed to the corresponding water-nitrogen co-state sub-model to calculate the real-time inversion result of the pixel water-nitrogen.

[0010] Beneficial effects: This invention solves the problems of model generalization and physical consistency under small sample conditions by constraining physiological mechanisms, and decouples the complex effects of water and nitrogen interaction stress on the spectrum through state classification mechanism, thereby improving the accuracy and robustness of crop water and nitrogen inversion. Attached Figure Description

[0011] Figure 1 A flowchart illustrating the steps of an adaptive construction method for a crop spectral inversion model provided in this application embodiment.

[0012] Figure 2 A flowchart illustrating the steps for constructing a physically consistent training sample set as provided in this application embodiment.

[0013] Figure 3 A flowchart illustrating the steps for constructing a feasible physiological constraint domain for water and nitrogen dry matter, as provided in this application embodiment.

[0014] Figure 4 A flowchart illustrating the steps for constructing an initial spectral inversion model provided in this application embodiment. Detailed Implementation

[0015] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0016] It should be noted that the terms include and have, and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or device.

[0017] The study found that existing pure data-driven models often ignore the inherent biological constraints between crop water content, nitrogen content, and dry matter, such as the dilution effect. This leads to predictive values ​​that violate physiological common sense in areas with scarce samples, such as high water content under extremely low biomass. The physical interpretability and generalization ability of the models are poor. At the same time, existing global unified modeling strategies are difficult to cope with the complex spectral responses generated by water-nitrogen interactions. For example, under different synergistic stress conditions such as low water and high nitrogen and high water and low nitrogen, the crop's sensitive spectral bands will drift. A single model cannot adaptively capture these local feature changes, resulting in a decrease in inversion accuracy under variable water and nitrogen combination stress.

[0018] like Figure 1 As shown, an adaptive construction method for crop spectral inversion models is proposed, including the following steps:

[0019] The coupling law between measured water, nitrogen, and dry matter data in the field and crop physiology is obtained and analyzed. A feasible region constrained by water, nitrogen, and dry matter physiology is constructed in a three-dimensional state space composed of water content, nitrogen content, and dry matter. Virtual samples are generated within the feasible region constrained by water, nitrogen, and dry matter physiology. The virtual samples are then fused with measured water, nitrogen, and dry matter data to construct a physically consistent training sample set.

[0020] In other words, by analyzing field-measured water, nitrogen, and dry matter data and crop physiological patterns, a three-dimensional physiological constraint feasible domain containing water content, nitrogen content, and dry matter is constructed. Virtual samples are then generated within this domain and fused with the measured data to construct a physically consistent training sample set.

[0021] In this embodiment, field-measured water, nitrogen, and dry matter data refer to the actual ground values ​​obtained through destructive sampling or field sensors, including but not limited to crop water content per unit area, percentage of nitrogen content in plants, and biomass, i.e., dry matter. Crop physiological coupling refers to the inherent biological constraints between various physicochemical parameters during crop growth. Specifically, constructing a feasible region of water, nitrogen, and dry matter physiological constraints means defining a closed geometric region in a three-dimensional Euclidean space with water content, nitrogen content, and dry matter as coordinate axes. Any combination of coordinates within this region conforms to the natural growth patterns of the target crop. For example, a crop cannot have extremely high water content at extremely low biomass, nor can it maintain extremely high nitrogen uptake under severe water shortage. By defining this feasible region, data combinations that violate physical principles can be effectively eliminated. Generating virtual samples refers to generating new data points through numerical simulation within a state space region lacking measured data to fill sample gaps. To ensure that these virtual data are physically reasonable, the physicochemical parameter labels of each generated sample must strictly lie within the aforementioned feasible region. By fusing scarce real-world data with a large amount of virtual data, a physically consistent training sample set is formed. This sample set contains both the noise characteristics of the real environment and covers the complete physiological state space, thus solving the problem of poor generalization ability of traditional pure data-driven models in extreme or low-sample regions.

[0022] Based on the combination of moisture and nitrogen levels in the physically consistent training sample set, water-nitrogen co-state categories are constructed, and spectral feature subspaces are independently determined for each water-nitrogen co-state category to train and generate parameter-independent water-nitrogen co-state sub-models.

[0023] Alternatively, based on the sample distribution, several water-nitrogen co-state categories are defined, and a dedicated spectral feature subspace is determined for each state, and a co-state sub-model with independent parameters is trained.

[0024] In this embodiment, the water-nitrogen synergistic state category is a high-level semantic classification of crop growth status. Specifically, water and nitrogen are no longer treated as isolated variables, but are discretized into different levels based on their distribution in the training sample set, such as water deficit / adequate and nitrogen deficit / adequate, and then combined. For example, water deficit and nitrogen adequate can be defined as a predetermined synergistic state. The spectral response mechanism of the crop differs for each state. For example, under water stress, the reflectance change in the short-wave infrared band is more sensitive; while under nitrogen stress, the shift in the red-edge band is more significant. For example, for each state, a feature optimization algorithm, such as correlation analysis or recursive feature elimination, is used to select the most sensitive band combination from the full-band spectrum, constructing a spectral feature subspace specific to that state. Based on this, an independent sub-model, such as an expert model, is trained for each state. These sub-models have independent weight parameters and focus on fitting the spectral-physicochemical parameter mapping relationship under predetermined physiological states, avoiding the averaging effect of a single global model when dealing with complex heterogeneous data.

[0025] Using a pre-configured pixel water-nitrogen co-state classification model, based on the standardized crop spectral data and observation condition feature sequence of the pixel to be inverted, the target water-nitrogen co-state category of the pixel is determined, and the pixel is routed to the corresponding water-nitrogen co-state sub-model to calculate the real-time inversion result of the pixel water-nitrogen.

[0026] Alternatively, in the inversion stage, the state of a pixel is determined by combining the characteristics of the observation conditions with the classification model, and the pixel is dynamically routed to the corresponding sub-model to solve the inversion result.

[0027] Specifically, the inversion process is structured as a two-stage workflow: classification followed by regression. A pre-trained classifier, namely a pixel-level water-nitrogen co-state classification model, is used to classify the input pixels. It's important to note that this classification process relies not only on spectral data but also on observational condition features such as solar altitude angle and observation angle, as different observational geometries significantly affect spectral morphology and thus state determination. Once the target water-nitrogen co-state category of a pixel is determined, the system automatically activates the corresponding dedicated sub-model. The pixel's spectral data is mapped into the feature subspace of that sub-model, extracting only relevant bands and inputting them into the sub-model for calculation. The resulting real-time water-nitrogen inversion result is a numerical vector containing crop water content, nitrogen content, and dry matter content. This ensures that each pixel is processed by the model best suited to its current state, improving inversion accuracy.

[0028] like Figure 2 As shown, in one possible embodiment, constructing a physically consistent training sample set includes:

[0029] Field measured water, nitrogen, and dry matter data are spatiotemporally matched with corresponding standardized crop spectral data to construct an initial real sample set. Using the initial real sample set as seed data, controlled perturbations are applied to the spectral dimensions to generate candidate virtual spectral curves.

[0030] In this embodiment, spatiotemporal matching involves associating the physicochemical data of ground sampling points with corresponding pixels in remote sensing images based on GPS coordinates and sampling time. An initial set of real samples is constructed as seed data to generate the spectral portion of the virtual samples. Specifically, to simulate spectral variations in nature and maintain the physical correlation between bands, the controlled perturbation does not simply add independent Gaussian white noise, but instead employs a colored noise generation strategy based on the covariance matrix: calculating the covariance matrix σ between each band in the initial set of real samples; generating a random noise vector following a multivariate normal distribution N(0, σ). This noise vector is then superimposed onto the real spectral curve at a certain scaling factor, for example, 0.01 to 0.05, to obtain the candidate virtual spectral curve. The virtual spectrum generated in this way retains the waveform characteristics unique to vegetation spectra, including red valleys, red edges, and near-infrared plateaus, avoiding spectral distortion caused by noise injection.

[0031] For each candidate virtual spectral curve, within the three-dimensional boundary defined by the physiological constraints of water, nitrogen, and dry matter, the water content, nitrogen content, and dry matter content values ​​that satisfy physiological consistency are optimized and matched as compliant water, nitrogen, and dry matter labels, and combined with the candidate virtual spectral curves to generate a physically constrained virtual sample set.

[0032] Specifically, since the virtual spectrum is generated based on perturbations of the real spectrum, its corresponding physicochemical parameter labels should also be near the real labels. To determine the specific label values, a neighborhood search + boundary projection strategy can be used. In the initial real sample set, find the k real samples that are closest to the virtual spectrum in Euclidean distance (e.g., k=5), and calculate the weighted average of the labels of these real samples as the initial estimated label T. init =(W init N init B init ), where W init N represents the initial moisture content of the crop. init B represents the initial nitrogen content of the crop. init This represents the initial dry matter mass of the crop. Check the initial estimated label T. init Whether it lies within the feasible region. If the initial estimated label T init Within the feasible region, it is directly used as the label for the virtual spectrum. If the initial estimated label T init Outside the feasible region, the distance T from the initial estimated label is calculated at the boundary of the feasible region. init The nearest point T projectedThis is used as a compliance label. This ensures that all generated virtual samples, regardless of spectral variations, strictly adhere to crop physiological principles in their physicochemical parameter combinations, preventing physical logic errors caused by data augmentation.

[0033] Based on the sparsity of the initial real sample set in the spatial distribution of water, nitrogen, and dry matter, dynamic fusion weights are configured for the physically constrained virtual sample set and the initial real sample set. Resampling and merging operations are performed to generate a physically consistent training sample set that covers the extended water-nitrogen combination space.

[0034] In this embodiment, to avoid the model being dominated by a large number of virtual samples during training, or ignoring rare real samples, a density-based weighting strategy is adopted. Specifically, the three-dimensional state space is divided into several voxel grids. The number of real samples in each grid is counted. For grids with dense real samples, the sampling weight of virtual samples in that grid is reduced or they are directly removed; for grids with sparse or empty real samples, such as extremely arid or high-nitrogen regions, the weight of virtual samples is increased so that they can fill the distribution gaps. For example, a target sample density D can be set. target Based on the current true density D of each grid real Calculate the number of virtual samples that need to be added. Combine the weighted real samples with the selected virtual samples to form a physically consistent training sample set.

[0035] According to one aspect of this application, the crop physiological coupling law includes critical nitrogen concentration curve data, empirical relationships between water state and nitrogen absorption, and empirical relationships between leaf water content and dry matter; furthermore, such as Figure 3 As shown, the feasible region for constructing physiological constraints on water, nitrogen, and dry matter includes:

[0036] By analyzing the empirical relationship between leaf water content and dry matter, and eliminating physically impossible regions that do not conform to the laws of biomass accumulation on a two-dimensional plane composed of water content and dry matter, the permissible baseline range of water content variation with dry matter is delineated.

[0037] In this embodiment, based on extensive agronomic experimental data, a negative correlation or predetermined allometric growth relationship exists between leaf water content and dry matter mass, thus constructing the foundation for the feasible region. Specifically, as crop dry matter mass accumulates, i.e., maturity increases, plant water content typically decreases gradually. The physically impossible region refers to data areas that violate this rule. For example, when dry matter mass is extremely low, such as during the seedling stage, water content cannot be extremely low unless the seedling dies; when dry matter mass is extremely high, such as during maturity, water content cannot be maintained at an extremely high level. By fitting a scatter plot of water content-dry matter mass from the measured data, the upper boundary curve W can be obtained. up (B) and the lower boundary curve W low(B), where B represents dry matter mass. The area enclosed by these two curves is the allowable baseline range. Any data point falling outside this range will be considered a physical anomaly and will be removed, for example, data points with high biomass and 95% water content will be removed.

[0038] The critical nitrogen concentration curve data were discretized and analyzed to determine the theoretical upper limit of nitrogen concentration under different dry matter levels. Based on the empirical relationship between moisture state and nitrogen absorption coupling, the inhibition coefficient of nitrogen absorption under different moisture deficit levels was calculated. The inhibition coefficient was used to dynamically scale the theoretical upper limit of nitrogen concentration to construct the allowable range of nitrogen content under different moisture contents and dry matter conditions. The intersection of the allowable range of nitrogen content under moisture conditions and the allowable baseline range was obtained in three-dimensional space to form a closed feasible region of physiological constraints on water and nitrogen dry matter.

[0039] Specifically, the critical nitrogen concentration curve is usually described by the Lemaire equation, which is mathematically expressed as Nc = A*W. -B Where Nc is the critical nitrogen concentration (%), W is the aboveground dry matter of the crop (t / ha), and A and B are predetermined constants for the crop; for example, for wheat, A is approximately 5.35 and B is approximately 0.44. This curve defines the maximum nitrogen uptake capacity under conditions of sufficient water and nutrients. However, in reality, water deficit inhibits nitrogen uptake. Therefore, an inhibition coefficient k can be introduced, which is the ratio of water content W... leaf The function, denoted as k = f(W) leaf For example, the function can be a piecewise linear function: when the water content is within a suitable range, k=1; when the water content is below a certain stress threshold, k decreases linearly with the water content, for example, to 0.6. The corrected upper limit of nitrogen N max_limit Calculated as N max_limit = Nc*k. The physiological lower limit of nitrogen binding, N. min This allows us to obtain the permissible nitrogen range [N] at a predetermined dry matter mass and moisture content. min N max_limit ]; where the physiological lower limit N min Typically, this is a structural nitrogen content, such as 0.5%. Combining the above-mentioned base range with the nitrogen allowable range in three-dimensional space forms a closed space resembling a cone or an irregular polyhedron, which is the physiologically constrained feasible region of water and nitrogen dry matter.

[0040] like Figure 4 As shown, in a further embodiment, an initial spectral inversion model is constructed based on a physically consistent training sample set, specifically as follows:

[0041] A multi-output model structure is constructed to support the simultaneous prediction of crop water content, crop nitrogen content, and crop dry matter, and a hybrid loss function is configured that includes a basic prediction error term and a physiological constraint regularization term.

[0042] In this embodiment, the multi-output model structure can employ a deep neural network (DNN) or a one-dimensional convolutional neural network (1D-CNN). The network's output layer contains three neurons, corresponding to water content, nitrogen content, and dry matter mass, respectively. To ensure the model not only fits the data but also adheres to physiological principles, a hybrid loss function L is constructed. total It consists of two parts: L total =L MSE +λ* L phy ; where L MSE This is the basic prediction error term, which can be expressed as mean squared error, used to measure the distance between the predicted value and the true label; L phy λ is the physiological constraint regularization term, used to punish predictions that violate physiological laws; λ is the balance coefficient, for example, taking values ​​from 0.1 to 1.0, used to adjust the strength of physical constraints.

[0043] During the model training iteration, the spatial position of the model's predicted output value relative to the feasible region of physiological constraints of water, nitrogen, and dry matter is detected in real time. For the model's predicted output value that falls outside the feasible region of physiological constraints of water, nitrogen, and dry matter, the Euclidean distance of the model's predicted output value from the boundary is calculated using the physiological constraint regularization term and a gradient penalty is applied to force the model parameters to converge toward the physiologically feasible region.

[0044] Specifically, for each sample in the training batch, the model outputs a prediction vector P. pred = (W pred N pred B pred The system calls the feasible region determination function in real time. If the predicted vector P... pred If it is located within the feasible region, then the physiological constraint regularization term L phy = 0, the model is only affected by the basic prediction error term L MSE Driven by. If the prediction vector P pred Located outside the feasible region, the system will compute the prediction vector P. pred The shortest Euclidean distance D to the boundary of the feasible region boundary At this point, L is defined. phy = D boundary 2 Through the backpropagation algorithm, the regularization term generates a gradient pointing towards the feasible region, forcing the network to adjust its weights so that the next prediction is more likely to fall within the feasible region. For example, if the model predicts an unreasonable combination of low dry matter and high water content, the regularization term will generate a large loss value, forcing the model to lower the predicted water content or increase the predicted dry matter until it falls within a reasonable range.

[0045] With the goal of minimizing the mixed loss function, the parameters of the multi-output model structure are optimized using a physically consistent training sample set to generate the initial spectral inversion model parameter set.

[0046] In this embodiment, stochastic gradient descent (SGD) or the Adam optimizer can be used to train the model. The input data is spectral data from a physically consistent training sample set, and the target output is the corresponding physicochemical parameter labels. The training process continues for several epochs until the mixture loss function on the validation set no longer decreases significantly. The final model parameters are the initial spectral inversion model parameter set. Because this model has been exposed to virtual samples covering the entire physiological space during the training phase and is subject to strong physical constraints, it can output prediction results that conform to agronomic common sense when faced with unseen test data, exhibiting strong robustness.

[0047] In one possible implementation, a spectral feature subspace is independently determined for each water-nitrogen co-state category, including:

[0048] Based on the distribution characteristics of water content and nitrogen content in the physically consistent training sample set, a grading threshold is set to discretize and generate water and nitrogen grades. The water and nitrogen grades are then orthogonally combined on a two-dimensional plane to define the water-nitrogen synergistic state category with clear agronomic diagnostic significance.

[0049] In this embodiment, to transform continuous physicochemical parameters into identifiable discrete states, the probability density distributions of crop water content and nitrogen content in a physically consistent training sample set are statistically analyzed. A water threshold W is set. th and nitrogen threshold N th For example, 2.0%. Based on these two thresholds, the sample space is divided into four quadrants, defining four typical water-nitrogen co-existence states: State I is a doubly deficient state, with a water content of... <W th And nitrogen <N th State II indicates that the crop is simultaneously suffering from severe water and nutrient stress; State II is a nitrogen-deficient state with a water content ≥ W th And nitrogen <N th State III represents adequate irrigation but insufficient fertilization; State III is a water deficit state with a water content of <W th And nitrogen ≥ N th State IV indicates sufficient fertilization but limited water supply; State IV represents a suitable state with a water content ≥ W. th And nitrogen ≥ N thThis indicates that the crop is growing well. In some alternative implementations, more thresholds can be introduced to construct a 3x3 or more complex 4x4 state matrix to meet the needs of more refined farmland management. This embodiment reduces the complex regression problem to targeted sub-problems, with each state corresponding to a predetermined physiological response mechanism.

[0050] For each water-nitrogen co-state category, a corresponding subset of state samples is extracted from the physically consistent training sample set. The response sensitivity of each spectral band in the state sample subset to water content and nitrogen content is analyzed. Based on the response sensitivity, feature filtering is performed to remove redundant and low-correlation bands for each water-nitrogen co-state category, constructing a spectral feature subspace configuration. This limits the input dimension for subsequent sub-model training and inversion.

[0051] Specifically, the spectral response characteristics of crops differ for each of the aforementioned states. For example, in state III, i.e., water deficit, stomatal closure leads to increased leaf temperature and decreased water content. At this state, the reflectance in the short-wave infrared (SWIR) band (e.g., 1400-2500 nm) changes most drastically, while the visible light band may show little change. Conversely, in state II, i.e., nitrogen deficit, decreased chlorophyll content causes a blue shift at the red edge (approximately 680-760 nm), while the short-wave infrared band may remain relatively stable. Therefore, for a subset of samples belonging to a predetermined state, the Pearson correlation coefficient or mutual information index between the full-band spectrum and water content and nitrogen content is calculated. A sensitivity threshold R is set. min For example, a value of 0.6 retains bands with correlation higher than this threshold and removes noisy bands. For instance, for state III, its specific spectral feature subspace configuration might include {Band} SWIR1 Band SWIR2 Band NIR}; and for state II, its feature subspace may be configured as {Band Red Band RedEdge Band NIR}, where Band SWIR1 This is the first sensitive band in the shortwave infrared region, typically located around 1400-1600 nm. SWIR2 This is the second sensitive band in the shortwave infrared region, typically located between 1900-2500 nm. NIR It is in the near-infrared band, typically located between 760-1100nm. Red It is in the red light band, typically located at 620-680nm. RedEdge It is located in the red-edge band, approximately 680-760nm. This allows the sub-model to focus only on the physical signals most relevant to its task, reducing interference from irrelevant features.

[0052] In a further possible implementation, a water-nitrogen co-state sub-model is trained, including:

[0053] Using the initial spectral inversion model parameter set as a common parameter base, the input layer connection structure is masked using spectral feature subspace configuration, instantiating an independent sub-model architecture for each water-nitrogen synergistic state category. A subset of state samples corresponding to the current water-nitrogen synergistic state category is extracted from the physically consistent training sample set. Under the premise of preserving the physical constraint characteristics in the common parameter base, the sub-model architecture is fine-tuned locally using the subset of state samples. The fine-tuning operation is completed by traversing all water-nitrogen synergistic state categories, generating a set of water-nitrogen synergistic state sub-models containing differentiated response weights for different water-nitrogen combinations.

[0054] In this embodiment, the idea of ​​transfer learning is used to construct sub-models. The pre-trained initial spectral inversion model is copied as the starting point for all sub-models, i.e., a common parameter basis, ensuring that all sub-models inherit the basic physical constraints. For state k, based on its feature subspace configuration, the connection weights corresponding to non-sensitive bands in the input layer are frozen or pruned, retaining only the input channels of sensitive bands. The sub-model is retrained using a subset of samples belonging to state k. During fine-tuning, a small learning rate, such as 10% of the initial learning rate, can be used for a small number of iterative updates. In this way, sub-model k, while retaining global physical laws, quickly adapts to the local data distribution characteristics of that state, forming a specialized model. The system will save a set of sub-models {Model...} I Model II Model III Model IV}, which correspond to four different states of water and nitrogen.

[0055] In another possible implementation, the instantaneous inversion results of pixel water and nitrogen are obtained, including:

[0056] Spectral features and corresponding observation condition parameters from the physically consistent training sample set are extracted as input features, and their respective water-nitrogen co-state categories are used as supervision labels to train and construct a pixel water-nitrogen co-state classification model that can respond to observation geometric changes. The standardized crop spectral data to be inverted and the observation condition feature sequence of the pixel at the moment of imaging are jointly input into the pixel water-nitrogen co-state classification model to predict the current state of the pixel as the target water-nitrogen co-state category.

[0057] In this embodiment, to accurately select the sub-model, the state of the pixel must first be identified. A classifier, such as a random forest, support vector machine, or lightweight neural network, can be trained as the classification model. It is worth emphasizing that the input of this model includes not only spectral data but also observational condition features, such as solar altitude angle (SZA), observational angle (VZA), and relative azimuth angle (RAA). Because the same crop physiological state may exhibit drastically different spectral characteristics under different lighting and observational geometry (BRDF effect), introducing observational conditions can help the classifier distinguish between spectral differences caused by physiological changes and those caused by geometric conditions. Furthermore, to address the ambiguity at state boundaries, a cost-sensitive loss function is preferred during training. Specifically, considering the risk of missed disasters, such as the cost of misclassifying water shortage as adequate is much higher than a false alarm, the classification error penalty weight for double-deficient and water-deficient states is set to twice that of adequate states. During the inference phase, the data of the pixel to be inverted is input, and the classification model outputs a probability vector P = [p I p II p III p IV The value indicates the confidence level of the cell belonging to each state.

[0058] In the set of sub-models for water-nitrogen synergy, activate the sub-model that uniquely matches the target water-nitrogen synergy category, and extract feature vectors from standardized crop spectral data based on the spectral feature subspace configuration corresponding to the sub-model. Input the sub-model to solve and output the real-time inversion results of water and nitrogen in pixels.

[0059] In this embodiment, the category with the highest probability is selected as the target state based on the probability vector. For example, if P = [0.1, 0.8, 0.05, 0.05], then it is determined to be state II, i.e., a nitrogen-deficient state. The system then activates the sub-model Model. II And according to the feature subspace configuration of state II, only {Band} is extracted from the full-band spectrum. Red Band RedEdge Band NIR} forms the feature vector, which is then input into the Model. II Calculations are performed. In some preferred embodiments, to avoid discontinuous results caused by state transitions, when there are two similar high-probability values ​​in the probability vector, such as p... I =0.45, p II =0.44, a soft routing strategy can be adopted: activate two sub-models at the same time, calculate the inversion results separately, and perform a weighted average of the results with probability values ​​to obtain the final real-time inversion results of pixel water and nitrogen.

[0060] In one embodiment of this application, the acquisition of standardized crop spectral data and observation condition characteristic sequences includes:

[0061] By jointly analyzing the flight platform attitude and time information data and topographic data corresponding to the pre-stored raw crop remote sensing spectral data, the solar altitude angle, solar azimuth angle, sensor viewpoint and ground slope are calculated pixel by pixel to construct an observation condition feature sequence describing the geometric illumination state at the moment of imaging.

[0062] Specifically, to quantify the imaging geometry of each pixel, fine geometric calculations are required. For each pixel i, based on the timestamp t in the flight log... i and latitude and longitude (Lat i Lon i The solar zenith angle θ is calculated using a solar position algorithm. s And the solar azimuth Φ s Simultaneously, by combining the attitude angle of the UAV or satellite and the position of the pixel on the sensor's focal plane, the sensor's observed zenith angle θ is calculated. v and the observed azimuth angle Φ v The attitude angles include roll, pitch, and yaw. Furthermore, digital elevation model (DEM) data is used to calculate the ground slope and aspect at each pixel. An observation condition feature vector V is constructed for each pixel. obs_i = [θ s θ v Δ Φ [slope], where Δ Φ The relative azimuth angle is given. The observation condition feature vector fully describes the geometric path of photons interacting with the canopy, and is the basis for subsequent clustering and correction.

[0063] Joint clustering is performed on the observation condition feature sequences within the same cruise. Pixels with similar illumination and observation geometry are grouped into predetermined observation condition clusters. The cluster with sufficient sample quantity and minimal geometric distortion is selected as the reference benchmark, and reference observation condition parameters are extracted.

[0064] In this embodiment, since a single aerial photography operation often spans a long period of time or a large area, the observation conditions may change. K-Means or DBSCAN clustering algorithms are used to analyze the feature vector V of all image pixels. obs Clustering is performed to obtain K observation condition clusters {C1, C2, ..., C...} K For example, pixels on a sunny slope might cluster into one group, while pixels on a shady slope might cluster into another. From these clusters, a reference cluster C is selected. ref For example, the selection criteria include: the sample size accounts for more than 10% of the total pixels; the average observed zenith angle is the smallest, close to vertical observation; and the average slope is the smallest, close to flat ground. The central feature vector of this reference cluster is calculated as a reference observation condition parameter, denoted as V. refAll subsequent spectral corrections will be performed to transform the data from other clusters to V. ref The target is defined under the conditions represented.

[0065] Establish a spectral response mapping relationship from each observation condition cluster to the reference observation condition parameters, uniformly transform the original crop remote sensing spectral data to the reference standard, eliminate spectral differences caused by non-physiological factors, and generate standardized crop spectral data.

[0066] In a preferred implementation, generating standardized crop spectral data includes:

[0067] The spectral brightness distribution and inter-band correlation within each observation condition cluster are statistically analyzed to generate intra-cluster spectral statistical characteristics. The statistical distribution differences between the intra-cluster spectral statistical characteristics and the reference cluster represented by the reference observation condition parameters are quantified. Based on the statistical distribution differences, a spectral correction function that can compensate for changes in illumination intensity and geometric observation offset is fitted.

[0068] For example, a correction function is constructed using a statistical moment matching method. For any non-reference cluster C... k The mean reflectance μ of the wavelength in band b is statistically analyzed. k_b Sum of standard deviations ∑ k_b Similarly, the statistical reference cluster C ref The mean μ in band b ref_b Sum of standard deviations ∑ ref_b Construct a linear transformation function as the spectral correction function: R corr = (R raw -μ k_b ) * (∑ ref_b / ∑ k_b )+μ ref_b , where R raw This represents the original spectral reflectance value. The spectral correction function represents data centralizing and standardizing the current cluster to match the distribution shape of the reference cluster, then shifting it to the brightness level of the reference cluster. It adaptively eliminates systematic spectral biases caused by differences in slope orientation or illumination intensity without requiring complex radiative transfer model parameters.

[0069] Simultaneously, cloud shadows and geometric anomaly samples that deviate from the distribution pattern within the cluster are identified and marked; a pixel-by-pixel radiometric transformation is performed on the original crop remote sensing spectral data belonging to the cluster under the observation conditions using a spectral correction function, and smoothing correction is applied to cloud shadows and geometric anomaly samples to obtain standardized crop spectral data under a unified radiometric scale.

[0070] In this embodiment, anomaly detection is required before applying the correction function. For cluster C k A pixel in the spectrum whose average brightness across the entire band is less than the cluster mean μ kIf a certain percentage, such as 60%, is considered an anomaly in cloud shadow, then it is deemed abnormal; if the combination of slope and observation angle exceeds a threshold, such as slope + θ, then it is considered an anomaly. v A value greater than 60 degrees is considered a geometric anomaly. For normal pixels, the linear formula of the spectral correction function is applied directly for correction. For pixels marked as anomalous, this formula is not used directly; instead, spatial neighborhood interpolation is employed to fill or smooth the outliers using the corrected values ​​of surrounding normal pixels, preventing the outliers from corrupting subsequent inversion results.

[0071] In a further embodiment, the method also includes establishing spatiotemporal index data of crop pixels that supports cross-temporal tracking, specifically:

[0072] The process involves reading spatial distribution data of crop plots, discretizing farmland areas into predetermined physical pixels based on plot boundaries and sensor resolution, and assigning a unique spatial index identifier to each physical pixel. Timestamp information in the observation condition feature sequence is analyzed to establish a mapping table between observation dates and spatial index identifiers, forming a pixel-level time list. Using the spatial index identifier and the pixel-level time list as a composite primary key, each spectral record in the standardized crop spectral data is bound to a defined physical spatial location and observation time, constructing crop pixel spatiotemporal index data. This supports precise spatial matching between field-measured water, nitrogen, and dry matter data and spectral data.

[0073] In this embodiment, to achieve full lifecycle management of data, a three-dimensional indexing system of physical plots-pixels-time is established. Specifically, based on the crop plot vector boundaries in the Geographic Information System (GIS), farmland is divided into fixed grids, and each grid center is assigned a globally unique spatial index identifier, such as a geohash code or row and column number ID_row_col. Regardless of the time of remote sensing image acquisition, all standardized spectral data is resampled and aligned to these fixed physical pixels using geographic coordinates. Next, a database index table is created using ID_row_col as the primary key and the observation date Date as the secondary key. Each record is in the form of {Key: ID_101_205, Time: 2025-06-15, Data: Spectra_Standardized}, where ID_101_205 represents the pixel in row 101 and column 205; Spectra_Standardized is the standardized crop spectral data. It not only supports the accurate matching of measured data and spectral data, but also provides underlying data architecture support for the system to output the final yield distribution map or diagnostic report by plot.

[0074] In one possible embodiment, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the crop spectral inversion model adaptive construction method as described in any of the above embodiments.

[0075] Alternatively, the device may be described as including one or more processors, memory, and a bus system connecting the components.

[0076] In this embodiment, the electronic device can be a high-performance graphics workstation, a server cluster deployed in the cloud, or an embedded computing unit integrated into a UAV ground station. The processor can be a central processing unit (CPU), a graphics processing unit (GPU), an application-specific integrated circuit (ASIC), or a field-programmable gate array (FPGA). Considering the high computational requirements of virtual sample generation and deep network training, a GPU equipped with a unified computing architecture (CUDA) core is preferably used for parallel computing acceleration. The memory includes volatile memory, such as random access memory (RAM); and non-volatile memory, such as hard disk drives (HDDs), solid-state drives (SSDs), or flash memory. The memory stores computer-readable instructions, and when these instructions are executed by the processor, the electronic device will sequentially execute all the steps described in the above embodiments according to a timing sequence.

[0077] Configure input / output interfaces and communication modules to acquire multi-source heterogeneous data and distribute inversion results.

[0078] In this embodiment, the electronic device connects to an external data source via a high-speed network interface, which can be a gigabit Ethernet port or a 5G module. Specifically, the device reads raw crop remote sensing spectral data, flight platform attitude data, and terrain geographic data stored in the remote sensing database through the interface. After completing standardization processing, sample construction, model training, and route inversion, the processor sends the final pixel water and nitrogen inversion results to the farmland management system or display terminal through the output interface. Furthermore, a computer-readable storage medium, such as an optical disc, USB flash drive, or cloud storage, is provided, on which a computer program is stored. When executed by a computer, this program implements the methods described in any of the above embodiments.

[0079] According to one aspect of this application, it also includes generating a nitrogen surplus / deficit spatial distribution map and a precision irrigation prescription map, specifically:

[0080] Based on the crop nitrogen content and dry matter obtained from the inversion, the crop nitrogen nutrition index is calculated, and a nitrogen surplus / deficit spatial distribution map is generated.

[0081] In this embodiment, the nitrogen nutrient index is a standard for assessing the nitrogen surplus or deficit status of crops. The measured nitrogen content (N) of each pixel is used as the metric.act (%) and dry matter W act (t / ha), combined with the critical nitrogen concentration curve formula Nc = A*W act -B Calculate the critical nitrogen concentration Nc for this pixel. Calculate the nitrogen nutrient index NNI = N act / Nc. When NNI < 1, it indicates that the crop is in a nitrogen deficit state, and the smaller the value, the more severe the deficit; when NNI > 1, it indicates nitrogen excess, which may lead to excessive vegetative growth, delayed maturity, or environmental pollution. The system generates a pseudo-color map based on the NNI value of each pixel, visually displaying the areas in the farmland that need topdressing, i.e., areas with NNI < 0.9, and areas where fertilization needs to be controlled.

[0082] Based on the crop water content obtained from the inversion, combined with the field water holding capacity and crop water requirement patterns, the water deficit index or relative water content index is calculated to generate a precision irrigation prescription map.

[0083] Specifically, using crop moisture content W leaf Based on the saturated water content W of the crop at its current growth stage sat Calculate the relative water content RWC = W leaf / W sat Alternatively, a simplified water deficit index, CWSI, can be constructed. proxy = 1 - RWC. The system sets the irrigation threshold T. irri For example, the Water Deficiency Index (CWSI) proxy > 0.3. For all pixels in the entire farmland, areas where the index exceeds the threshold are selected, and the recommended irrigation amount V is calculated based on the degree of deficit. irri = (W sat - W leaf *Biomass factor Biomass factor This is a crop biomass regulator. The final output is an electronic prescription map containing geographic coordinates and recommended irrigation amounts, which can be directly imported into intelligent fertigation systems for variable-rate operations.

[0084] In one embodiment of this application, constructing a physically consistent training sample set can also be achieved by: taking standardized crop spectral data and crop pixel spatiotemporal index data as input, and reading measured field crop moisture content, measured field crop nitrogen content, and measured field crop dry matter content data from a field trial database; spatially matching the field sampling point locations with the corresponding pixels in the crop pixel spatiotemporal index data based on the plot number and geographic coordinates; performing time matching or time difference threshold matching between the field measurement time and the observation date in the crop pixel spatiotemporal index data according to the sampling date; extracting spectral curves from the standardized crop spectral data that are consistent with the field sampling points in both space and time; and organizing the matched spectral curves with the corresponding measured moisture content, measured nitrogen content, and measured dry matter content into a sample triplet set to construct an initial real sample set data containing spectral and water, nitrogen, and dry matter measurement labels. Using pre-stored critical nitrogen concentration curve data from the crop physiology knowledge base as input, the functional relationship between critical nitrogen concentration and crop dry matter is analyzed. The continuous representation is discretized within typical dry matter ranges to obtain a series of critical nitrogen concentration values ​​corresponding to dry matter levels, forming discretized critical nitrogen concentration function data. Simultaneously, combined with the dry matter distribution in the initial real sample set data, the critical nitrogen concentration curve is interpolated or extrapolated within the sample coverage range to control its boundary, ensuring that the subsequent feasible domain construction is consistent with the dry matter range of the real samples. Using the initial real sample set data and empirical relationship data between leaf water content and dry matter from the crop physiology knowledge base as input, based on the observation points of water content and dry matter in the real samples and the trends given by the empirical relationship, the dominant trend between water content and dry matter is fitted to obtain a set of empirical model parameters describing the range of water content variation with dry matter, forming water content-dry matter relationship model parameter data. Based on this model, the allowable upper and lower limits of water content at each typical dry matter level are calculated, forming allowable water content range data.

[0085] Using initial real sample data, empirical data on the coupling relationship between water state and nitrogen absorption in the crop physiology knowledge base, and discretized critical nitrogen concentration function data as inputs, water state levels are classified according to different water content levels, such as severe water deficit, mild water deficit, adequate water, and excess water. For the dry matter level of each water state, the adjustment coefficient of nitrogen absorption capacity is calculated using the empirical data on the coupling relationship between water state and nitrogen absorption. Then, based on the discretized critical nitrogen concentration function data, the critical nitrogen concentration curve is scaled or shifted to obtain the upper and lower limits of nitrogen content under different water states, forming data on the allowable range of nitrogen content under water conditions indexed by water state and dry matter. Using the parameters of the moisture content-dry matter relationship model, the allowable moisture content range, the allowable nitrogen content range under moisture conditions, and the initial real sample set as input, a feasible zone is delineated on the dry matter axis and the moisture content axis in a three-dimensional coordinate system with moisture content, nitrogen content, and dry matter as the three coordinate axes. The allowable moisture content range is used to define the upper and lower boundaries of nitrogen content within the feasible zone based on the allowable nitrogen content range under moisture conditions. This results in a set of boundary surfaces representing physically feasible combinations of water and nitrogen dry matter in three-dimensional space, forming the boundary data of the three-dimensional feasible domain of water and nitrogen dry matter. At the same time, the point cloud in the initial real sample set is used as a reference to locally adjust the boundary surfaces to avoid unreasonable extrapolation in areas with sparse samples. Using the three-dimensional feasible domain boundary data of water, nitrogen, and dry matter as input, the boundary of the three-dimensional feasible domain is discretized into a numerical representation that facilitates quick determination of whether a certain combination of water content, nitrogen content, and dry matter is within the feasible domain by using regular grids, polyhedral approximations, or piecewise functions. This constructs feasible domain data of water, nitrogen, and dry matter physiological constraints that supports inputting any ternary combination and returning the feasibility judgment and the nearest boundary distance.

[0086] Using initial real sample data as input, the noise level, variability, and inter-band correlation of reflectance in each band of the real samples are statistically analyzed to determine the range of spectral variations caused by conventional instrument noise and natural fluctuations. Based on this, an upper limit for the perturbation amplitude is defined for each band, and a joint perturbation covariance is established according to the physical correlation between bands, forming spectral perturbation parameter configuration data indexed by band. Using the initial real sample data and spectral perturbation parameter configuration data as input, samples are stratified from the real sample set according to water and nitrogen combinations. For each extracted sample, multiple local perturbations are applied in the spectral space according to the spectral perturbation parameter configuration data, generating multiple slightly different spectral curves. During the generation process, the continuity of the spectrum and the trend of vegetation indices are maintained, for example, by controlling the change in the red edge position to be consistent with the direction of nitrogen content change. All perturbation samples are aggregated to form candidate virtual spectral sample data. Using candidate virtual spectral sample data, initial real sample set data, and feasible region data of water, nitrogen, and dry matter physiological constraints as input, for each candidate virtual spectral sample, several neighboring real samples with the most similar spectral shapes are searched in the initial real sample set data. The distribution of water content, nitrogen content, and dry matter label of these neighboring samples is statistically analyzed to obtain an initial label estimate. The initial estimate is adjusted using the feasible region data of water, nitrogen, and dry matter physiological constraints. When a label combination falls outside the feasible region, the corresponding water content, nitrogen content, or dry matter is corrected by searching for the closest feasible combination near the boundary of the feasible region. After the above operations, a set of water, nitrogen, and dry matter labels that are inside the feasible region and consistent with the statistical characteristics of neighboring real samples are assigned to each candidate virtual spectral sample, forming the initial version of virtual sample data with candidate water, nitrogen, and dry matter labels. Using the initial version of virtual sample data with candidate water, nitrogen, and dry matter labels and the feasible region data of water, nitrogen, and dry matter physiological constraints as input, the feasible region query function is called again for each virtual sample's label combination to check whether it is located within the feasible region and whether the distance from the boundary is not less than a preset safety threshold, so as to avoid a large number of virtual samples clustering near the boundary and causing instability. The spectral characteristics of each virtual sample and its corresponding label are substituted into a simple statistical model or an existing coarse inversion model for consistency check, and those virtual samples that are within the feasible region but whose spectral-label relationship obviously conflicts with the statistical law of real samples are eliminated. Virtual samples that meet the feasible region constraints and spectral-label consistency requirements are retained to form qualified virtual sample data.Using qualified virtual sample data and initial real sample set data as input, the distribution of real samples and qualified virtual samples is jointly statistically analyzed in three dimensions: moisture, nitrogen, and dry matter. This analysis examines the extent to which virtual samples supplement real sample sparse areas and whether there is a significant bias in the overall sample distribution. Based on the statistical results, the retention ratio of virtual samples can be appropriately increased in extremely sparse areas, while the number of virtual samples can be limited in real sample dense areas to prevent virtual samples from excessively interfering with existing information. After adjustment, qualified virtual samples are stored in a unified format with a field structure consistent with real samples, forming a physically constrained virtual sample set data that can be directly used for training, and generating virtual sample distribution statistics describing its distribution.

[0087] Using initial real sample set data, physically constrained virtual sample set data, and virtual sample distribution statistics as input, the sample space is divided into several hierarchical units based on intervals for water content, nitrogen content, and dry matter content. The number, mean, and variance of real and virtual samples within each unit are statistically analyzed to obtain training sample hierarchical statistics reflecting the differences in the distribution of real and virtual samples. Using the training sample hierarchical statistics as input, for each water-nitrogen-dry matter hierarchical unit, based on the ratio of real to virtual samples and the confidence level of real samples, the maximum weight ratio of virtual samples and the priority weight of real samples in that unit are set, forming real-virtual sample weight configuration data. In units where real samples are severely insufficient or even missing, the weight of virtual samples is appropriately increased, but a total upper limit is still set to avoid an extremely small number of real samples being completely overwhelmed. Using initial real sample set data, physically constrained virtual sample set data, and real / virtual sample weight configuration data as input, for each level unit, real and virtual samples are weighted and sampled according to the weight configuration. For units with very few samples, virtual samples can be repeatedly sampled; for units with too many samples, downsampling can be performed, ensuring a reasonable sample quantity structure for each level unit in the final training set. After completion, the resampled real and virtual samples are merged into a unified format of weighted sampling training sample data. Using the weighted sampling training sample data and the feasible region data of water, nitrogen, and dry matter physiological constraints as input, the feasible region judgment function is called again for the combination of water content, nitrogen content, and dry matter mass of each sample to exclude out-of-bounds samples or numerically abnormal samples that may have been introduced during the resampling process. Simultaneously, the overall sample distribution is checked to ensure that the number of samples under different water and nitrogen states matches the expected management scenario. After consistency checks, all samples are organized into a physically consistent training sample set according to a unified field structure. Using a physically consistent training sample set as input, the quality of the training set is evaluated from three dimensions: sample quantity distribution, label coverage, and spectral-label correlation. This generates physically consistent training sample quality evaluation data that reflects sample representativeness, noise level, and potential bias.

[0088] Using physically consistent training sample sets and physically consistent training sample quality evaluation data as input, and based on the training sample size, the number of feature dimensions, and the correlation between water content, nitrogen content, and dry matter mass, various candidate schemes for multi-output inversion model structures are constructed. These include configurations such as shared feature extraction layers, bifurcation output layers, and joint output layer constraints, forming a candidate set of multi-output inversion model structures. When the sample quality is high and the sample quantity is large, more complex models are allowed to be selected; when the sample size is limited, the model depth and parameter scale are restricted. Using the feasible region data of water, nitrogen, and dry matter physiological constraints as input, a physical constraint regularization term is constructed on the basis of the conventional regression loss function to penalize the model output deviating from the feasible region: when the water content, nitrogen content, and dry matter mass predicted by the model fall outside the feasible region, an additional loss is applied to the distance between them and the boundary of the feasible region; at the same time, a constraint term that maintains the smoothness of the internal ratio of water, nitrogen, and dry matter can be added, so that the model tends to output combinations that satisfy physiological laws, forming the configuration data of the physical constraint loss function. Using a physically consistent training sample set, a candidate set of multi-output inversion model structures, and physical constraint loss function configuration data as input, cross-validation and grid search or Bayesian optimization methods are employed to systematically train and evaluate different candidate model structures and their hyperparameters. Hyperparameters include learning rate, regularization coefficient, and network depth. During training, a loss function containing physical constraint regularization terms is used for each model structure to ensure that the model parameters fit the training data while the output predicted values ​​fall as close as possible to the feasible region defined by the physiological constraints of water, nitrogen, and dry matter. After training, a set of candidate model parameters and corresponding performance indicators are obtained, forming a candidate initial spectral inversion model parameter set. Using the candidate initial spectral inversion model parameter set and the physical consistency training sample quality evaluation data as input, the performance of each candidate model under different moisture and nitrogen states is comprehensively evaluated by calculating the prediction error, physical constraint violation rate, and output stability index on the independent validation set. At the same time, combined with the sample quality evaluation results, models with excessively low validation errors but severe instability in the low-quality sample range are considered as potentially overfitting and are eliminated. The model structure and parameters with the best overall performance in terms of accuracy, physical rationality, and robustness are selected as the initial spectral inversion model parameter set, and initial model performance evaluation data describing its performance are formed.

[0089] In another embodiment of this application, generating a parameter-independent water-nitrogen co-state sub-model can also be achieved by: using a physically consistent training sample set as input, and based on crop water and nitrogen management experience, combined with the statistical distribution of water and nitrogen content in the samples, initially determining the boundary points for classifying water and nitrogen state levels. For example, water content can be divided into severe deficit, mild deficit, adequate water supply, and excessive water supply, and nitrogen content can be divided into severe deficit, adequate nitrogen supply, and excessive nitrogen supply, forming water level classification rule data and nitrogen level classification rule data containing multiple candidate thresholds. Using the water level classification rule data, nitrogen level classification rule data, and the physically consistent training sample set as input, the water and nitrogen level boundary points are adjusted by detecting the sample quantity distribution and physiological significance within each level interval, so that the sample quantity within each level interval meets the minimum sample number requirement, while avoiding overly fine segmentation of obviously physiologically similar states; if necessary, adjacent levels can be merged or the boundary positions adjusted to obtain the final water and nitrogen level threshold data considering data distribution and agronomic significance. Using the final threshold data for water and nitrogen levels as input, water and nitrogen levels are combined in a two-dimensional space to form several water-nitrogen co-state categories with agricultural management significance, such as low water and low nitrogen state, low water and adequate nitrogen state, adequate water and adequate nitrogen state, and high water and low nitrogen state. Combinations with very few samples can be merged with similar states to ensure sufficient samples for modeling within each category. The state name, corresponding water level range, and nitrogen level range are organized into structured water-nitrogen co-state category definition data. Using the physically consistent training sample set and the water-nitrogen co-state category definition data as input, the water content and nitrogen content of each training sample are matched with the water and nitrogen ranges in the state definition, assigning a unique water-nitrogen co-state label to each sample, forming water-nitrogen state-labeled training sample data with a state labeling field. Simultaneously, the number of samples in each state category is statistically analyzed to obtain water-nitrogen state category distribution statistics, which are used to evaluate the sample balance of different states during subsequent feature subspace selection and sub-model training.

[0090] Using water and nitrogen state labeling training sample data as input, for each water and nitrogen co-state category, correlation analysis is performed on the sample spectra within that category with the corresponding water content, nitrogen content, and dry matter labels. The correlation coefficients and univariate regression goodness of fit between each band and commonly used vegetation indices and the labels are calculated, forming state-specific spectral correlation analysis data organized by state category. Using the water and nitrogen state labeling training sample data and state-specific spectral correlation analysis data as input, for each water and nitrogen co-state category, the importance of each band and vegetation index is comprehensively evaluated using a tree model, embedded feature selection method, or simplified multi-output model, considering their contribution to the joint prediction of water content, nitrogen content, and dry matter, resulting in state-specific feature importance score data organized by state category and feature index. Using the state-specific spectral correlation analysis data and state-specific feature importance score data as input, based on the common indicators of correlation and importance, several core bands and vegetation indices are selected for each water and nitrogen co-state category, while features with low correlation or small contribution to prediction are removed, constructing the most sensitive set of spectral features for that state, forming the initial version of the water and nitrogen state feature subspace configuration data. Using the initial version of the water-nitrogen state feature subspace configuration data and the statistical data on the distribution of water-nitrogen state categories as input, the feature subspaces of different water-nitrogen co-occurrence state categories are compared to check whether there are serious overlaps in some state subspaces or excessive numbers of features in some state subspaces. Under the premise of ensuring that necessary differences are retained between each state subspace and reflecting the differences in water-nitrogen interaction mechanisms, some overlapping features can be shared or the number of redundant features can be reduced to obtain water-nitrogen state feature subspace configuration data that balances differences and complexity, and generate feature subspace redundancy analysis data describing the degree of overlap and redundancy.

[0091] Using the initial spectral inversion model parameter set and feature subspace redundancy analysis data as input, this study analyzes the feature extraction layer structures and parameters that can be shared among different water-nitrogen co-occurrence states in the initial model, such as low-level spectral convolutions or nearly fully connected layers. Based on the redundancy analysis results, these shared structures and corresponding parameters are extracted to form a shared model structure and basic parameter data that can be reused in each state sub-model, providing a unified starting point for subsequent state fine-tuning. Using the water-nitrogen state labeled training sample data and water-nitrogen state feature subspace configuration data as input, for each water-nitrogen co-occurrence state category, a subset of samples belonging to that state is extracted from the labeled training samples. Based on the corresponding feature subspace, the bands and vegetation indices of that state are selected from the spectral data to form water-nitrogen state training subset data organized by state category. Using shared model structure and basic parameter data, water and nitrogen state training subset data, and physical constraint loss function configuration data as input, for each water and nitrogen co-state category, the shared model structure and basic parameters are replicated, and its input layer is restricted to the spectral feature subspace of that state. The model is then retrained and its parameters are fine-tuned using the training subset of that state. During training, a loss function including a physiological constraint regularization term is still used to ensure that the water content, nitrogen content, and dry matter composition output by each state sub-model in that state still fall within the feasible region of water and nitrogen dry matter physiological constraints. After training, a set of water and nitrogen state sub-model parameter data corresponding to each state category is obtained. Using water and nitrogen state training subset data, water and nitrogen state labeled training sample data, and water and nitrogen state sub-model parameter data as input, for each state sub-model, the prediction error and physical constraint violation rate are evaluated on samples from the current state and other states, respectively. The accuracy improvement of each sub-model within the current state and the performance degradation in other states are statistically analyzed to form water and nitrogen state sub-model performance evaluation data. Using the water-nitrogen state sub-model parameter data and water-nitrogen state sub-model performance evaluation data as input, sub-models with insufficient accuracy improvement or excessive physical constraint violation rate within the current state are eliminated according to a pre-set performance threshold. For the sub-models that pass the screening, their water-nitrogen co-state category, applicable feature subspace, and parameter version are recorded, and they are organized into a set of water-nitrogen co-state sub-models for runtime invocation. At the same time, the performance indicators and training information of each sub-model are recorded to form water-nitrogen co-state sub-model registration and version information data.

[0092] Using water and nitrogen state labeling training sample data, standardized crop spectral data, observation condition feature sequences, and crop pixel spatiotemporal index data as input, the spectral and observation condition features corresponding to each labeled sample are extracted through spatial location and temporal indexing, forming state recognition training sample data containing spectral, observation condition, and water and nitrogen co-state labels. Using the state recognition training sample data and water and nitrogen state feature subspace configuration data as input, a state classification model structure is constructed based on the complexity of the state recognition task and the number of available training samples. This includes an input configuration scheme based on a combination of spectral features, observation condition features, and some water and nitrogen sensitive features, forming state classification model structure configuration data and state recognition feature combination configuration data. During the construction process, indicators sensitive to changes in water and nitrogen state in each state feature subspace are fully utilized to enhance the sensitivity of the classification model to actual changes in water and nitrogen. Using state recognition training sample data, state classification model structure configuration data, and state recognition feature combination configuration data as inputs, a multi-classification training method is employed to train a pixel-based water-nitrogen co-state classification model. During training, easily confused state pairs, such as low water and suitable nitrogen versus suitable water and low nitrogen, are given special attention. The confusion rate of the model in key states is reduced by adjusting the weights of the loss function or introducing targeted features. After training, a preliminary version of the candidate pixel-based water-nitrogen co-state classification model is obtained, and the confusion matrix of each state pair is calculated to form confusion state handling rule data. Using the preliminary version of the pixel-based water-nitrogen co-state classification model, confusion state handling rule data, and observation condition feature sequences as inputs, the stability of the state classification model is evaluated under independent validation samples and different combinations of observation conditions. The state recognition performance under extreme observation conditions is analyzed. Based on the confusion state handling rules, the discrimination thresholds for predetermined state pairs are adjusted or post-processing strategies are introduced, such as smoothing low-confidence predictions from neighboring time intervals, resulting in a pixel-based water-nitrogen co-state classification model with good robustness under different observation conditions. Using standardized crop spectral data, observation condition feature sequences, and a pixel water-nitrogen co-state classification model as input, for each pixel on each observation date, its corresponding spectral features and observation condition features are input into the classification model for inference, resulting in the prediction result of the water-nitrogen co-state category and the corresponding confidence level for that pixel. Based on the confidence level and confusion rules, the prediction results are post-processed as necessary to generate pixel water-nitrogen co-state prediction label data organized by pixel index and time index.

[0093] Using standardized crop spectral data, a set of water-nitrogen co-state sub-models, and pixel water-nitrogen co-state prediction label data as input, for each crop pixel on each observation date, a sub-model corresponding to the state category is selected based on the pixel water-nitrogen co-state prediction label data. A feature subspace matching the state is extracted from the standardized crop spectral data, and these features are input into the matching state sub-model for inference to obtain the predicted values ​​of crop water content, crop nitrogen content, and crop dry matter for that pixel on the current observation date. The prediction results of all pixels on the same observation date are reorganized according to spatial location to form the pixel water-nitrogen real-time inversion result field for that date. For multiple observation dates, the above process is repeated to obtain pixel water-nitrogen real-time inversion result fields for multiple dates.

[0094] This invention addresses the poor generalization ability caused by lack of physical consistency and sample scarcity by employing a deep fusion of mechanism and data. By constructing a feasible region of physiological constraints on water, nitrogen, and dry matter based on the critical nitrogen concentration curve and the water-biomass relationship, biological laws are transformed into mathematical geometric boundaries. In implementation, this feasible region is used to generate a large number of virtual samples that conform to physiological logic to fill data gaps. Furthermore, a physical constraint regularization term is introduced into the loss function of the model training. This forces the parameter weights learned by the model to follow crop growth patterns, ensuring that even in extreme areas not covered by measured data, the model's output combination of water content, nitrogen, and dry matter remains physically reasonable, thus solving the problem of logical fallacies easily generated by purely data-driven models. In addition, to address the inversion distortion and low global model accuracy caused by the water-nitrogen coupling effect, a hybrid expert strategy is adopted. By defining discrete water-nitrogen co-states, the complex nonlinear regression problem is decomposed into several local sub-problems. The spectral sensitivity under different states is analyzed, and a unique feature subspace and sub-model are customized for each state. Dynamic routing is then performed using a genotyping model that incorporates observational condition features. By decoupling features, the model can focus on the dominant spectral signal under a predetermined stress state, eliminating signal interference between different stress mechanisms and solving the problem that a single global model cannot adapt to complex and variable water and nitrogen combination stresses.

[0095] The preferred embodiments of the present invention have been described in detail above. However, the present invention is not limited to the specific details in the above embodiments. Within the scope of the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all fall within the protection scope of the present invention.

Claims

1. A method for constructing a crop spectral inversion model adaptively, characterized in that, The method comprises the following steps: acquiring field measured water-nitrogen-dry matter data and crop physiological coupling rules, and analyzing the data, constructing a water-nitrogen-dry matter physiological constraint feasible region in a three-dimensional state space of water content, nitrogen content and dry matter quality, and generating virtual samples in the feasible region, and fusing the virtual samples with the measured water-nitrogen-dry matter data to construct a physically consistent training sample set; based on the water level and nitrogen level combination in the physically consistent training sample set, constructing a water-nitrogen synergistic state category, and independently determining a spectral feature subspace for each water-nitrogen synergistic state category, and training a water-nitrogen synergistic state sub-model with independent parameters; using a pre-configured pixel water-nitrogen synergistic state classification model, determining the target water-nitrogen synergistic state category to which the pixel belongs according to the pre-stored normalized crop spectral data and observation condition feature sequence of the pixel to be inverted, and routing the pixel to the corresponding water-nitrogen synergistic state sub-model to obtain the pixel water-nitrogen immediate inversion result of the pixel; wherein the crop physiological coupling rules comprise critical nitrogen concentration curve data, water state and nitrogen absorption coupling empirical relationship, and leaf water content and dry matter empirical relationship; the water-nitrogen-dry matter physiological constraint feasible region is constructed by: analyzing the empirical relationship between leaf water content and dry matter, eliminating the physically impossible region that does not comply with the biomass accumulation rule in the two-dimensional plane of water content and dry matter, and determining the allowed base range of water content with dry matter; The critical nitrogen concentration curve data are discretely analyzed to determine the theoretical upper limit of nitrogen concentration at different dry matter levels, and the inhibition coefficient k of nitrogen absorption by different water deficit levels is calculated according to the coupling empirical relationship between water status and nitrogen absorption; k = f(W leaf ), W leaf is the water content; when the water content is in the appropriate interval, k = 1; when the water content is lower than a certain stress threshold, k decreases linearly with the water content; The upper limit of the theoretical nitrogen concentration N is determined by using an inhibition coefficient max_limit Dynamic scaling is performed, the allowed range of nitrogen content under different water content and dry matter quality conditions is constructed, and the intersection of the allowed range and the allowed substrate range in three-dimensional space is calculated to form a closed water-nitrogen-dry matter physiological constraint feasible region; N max_limit = Nc*k; Nc is the critical nitrogen concentration, Nc = A*W -B , W is the dry matter mass of the above-ground parts of the crop, and A and B are predetermined constants for the crop.

2. The method of claim 1, wherein, the physically consistent training sample set is constructed by: performing space-time matching on the field measured water-nitrogen-dry matter data and the corresponding normalized crop spectral data to construct an initial real sample set, and using the initial real sample set as seed data to generate candidate virtual spectral curves by applying controlled disturbance to the spectral dimension; for each candidate virtual spectral curve, the water content, nitrogen content and dry matter quality values that meet the physiological consistency are matched by optimization search within the three-dimensional boundary defined by the water-nitrogen-dry matter physiological constraint feasible region, which are used as the compliant water-nitrogen-dry matter label to generate a physically constrained virtual sample set in combination with the candidate virtual spectral curve; according to the sparsity of the initial real sample set in the water-nitrogen-dry matter space, the physically constrained virtual sample set and the initial real sample set are configured with dynamic fusion weights, and resampling and merging operations are performed to generate a physically consistent training sample set covering an extended water-nitrogen combination space.

3. The method of claim 1, wherein, It also includes constructing an initial spectral inversion model based on the physically consistent training sample set, specifically: constructing a multi-output model structure that can simultaneously predict crop water content, crop nitrogen content and crop dry matter quality, and configuring a hybrid loss function that includes a basic prediction error term and a physiological constraint regularization term; during the model training iteration process, the spatial position of the model prediction output value relative to the water-nitrogen-dry matter physiological constraint feasible region is detected in real time, and for the model prediction output value falling outside the water-nitrogen-dry matter physiological constraint feasible region, the Euclidean distance of the output value from the boundary is calculated using the physiological constraint regularization term and a gradient penalty is applied to force the model parameters to converge to the physiological feasible region; the multi-output model structure is parameter optimized using the physically consistent training sample set to minimize the hybrid loss function, and an initial spectral inversion model parameter set is generated.

4. The method of claim 3, wherein, The spectral feature subspace is determined independently for each water-nitrogen coordination state category, including: According to the distribution characteristics of water content and nitrogen content in the physically consistent training sample set, the hierarchical threshold is set to discretize the water content level and nitrogen content level, and the two levels are orthogonally combined on a two-dimensional plane to define the water-nitrogen coordination state category with clear agricultural diagnosis significance; For each water-nitrogen coordination state category, the corresponding state sample subset is extracted from the physically consistent training sample set, and the response sensitivity of each spectral band to water content and nitrogen content is analyzed; Based on the response sensitivity, feature selection is performed to eliminate redundant and low-correlation bands for each water-nitrogen coordination state category, and a spectral feature subspace configuration is constructed.

5. The method of claim 4, wherein, The water-nitrogen coordination state sub-model is trained, including: Using the initial spectral inversion model parameter set as the public parameter base, the spectral feature subspace configuration is used to mask the input layer connection structure, and an independent sub-model architecture is instantiated for each water-nitrogen coordination state category; From the physically consistent training sample set, the state sample subset corresponding to the current water-nitrogen coordination state category is extracted, and the local parameter fine-tuning of the sub-model architecture is performed based on the state sample subset, with the physical constraint characteristics in the public parameter base as the premise; Iterate through all water-nitrogen coordination state categories to complete the fine-tuning operation, and generate a set of water-nitrogen coordination state sub-models with different response weights for different water-nitrogen combinations.

6. The method of claim 5, wherein, The pixel water-nitrogen instantaneous inversion result is obtained, including: Extract the spectral features and corresponding observation condition parameters in the physically consistent training sample set as input features, and the water-nitrogen coordination state category to which they belong as the supervision label, to train and build a pixel water-nitrogen coordination state classification model that can respond to observation geometry changes; The normalized crop spectral data to be inverted and the observation condition feature sequence of the pixel at the imaging moment are jointly input into the pixel water-nitrogen coordination state classification model to predict the determined state of the pixel, which is the target water-nitrogen coordination state category; Activate the sub-model that uniquely matches the target water-nitrogen coordination state category in the water-nitrogen coordination state sub-model set, and extract the feature vector from the normalized crop spectral data according to the corresponding spectral feature subspace configuration, and input it into the sub-model to calculate the pixel water-nitrogen instantaneous inversion result.

7. The method of claim 1, wherein, The acquisition of normalized crop spectral data and observation condition feature sequence includes: Jointly analyze the pre-stored original crop remote sensing spectral data corresponding to the flight platform attitude and time information data and the terrain geographic data, and calculate the solar elevation angle, solar azimuth angle, sensor view angle and ground slope for each pixel to construct the observation condition feature sequence describing the geometric illumination state at the imaging moment; Joint clustering is performed on the observation condition feature sequences within the same flight, and pixels with similar illumination and observation geometry are merged into a predetermined observation condition cluster. The cluster with sufficient sample quantity and minimum geometric distortion is determined as the reference benchmark, and the reference observation condition parameter is extracted; A spectral response mapping relationship from each observation condition cluster to the reference observation condition parameter is established to transform the original crop remote sensing spectral data to the reference benchmark, eliminate the spectral differences caused by non-physiological factors, and generate the normalized crop spectral data.

8. The method of claim 7, wherein, The standardized crop spectrum data is generated, including: Statistics of spectral brightness distribution and inter-band correlation within each observation condition cluster are performed to generate intra-cluster spectral statistical features and quantify the statistical distribution difference between the features and the reference cluster represented by the reference observation condition parameters; A spectral correction function capable of compensating for changes in illumination intensity and geometric observation offset is fitted based on the statistical distribution difference, and cloud shadows and geometric abnormal samples deviating from the distribution rules within the cluster are identified and marked; The original crop remote sensing spectrum data belonging to the observation condition cluster is subjected to per-pixel radiation transformation using the spectral correction function, and cloud shadows and geometric abnormal samples are subjected to smoothing correction to obtain standardized crop spectrum data in a unified radiation scale.

9. The method of claim 7, wherein, It also includes establishing crop pixel spatio-temporal index data supporting cross-time phase tracking, specifically: Crop field spatial distribution data is read, and farmland areas are discretized into predetermined physical pixels according to field boundaries and sensor resolution, and each physical pixel is assigned a unique spatial index identifier; Timestamp information in the observation condition feature sequence is analyzed to establish a mapping table of observation dates and spatial index identifiers, forming a pixel-level time list; Each spectral record in the standardized crop spectrum data is bound to a specific physical spatial location and observation time using the spatial index identifier and the pixel-level time list as a composite primary key, and crop pixel spatio-temporal index data is constructed.