Unmanned aerial vehicle cotton canopy nitrogen diagnosis and detection method based on machine learning
By introducing the method of cumulative effective accumulated temperature and light canopy extraction index, the problems of light angle and canopy structure interference in cotton nitrogen monitoring have been solved, realizing high-precision nitrogen diagnosis and cross-environmental adaptive detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHIHEZI UNIVERSITY
- Filing Date
- 2026-01-14
- Publication Date
- 2026-06-02
AI Technical Summary
Existing technologies for monitoring nitrogen in cotton suffer from high interference noise caused by the influence of light angle and canopy structure, and lack a time-series dynamic normalization mechanism, resulting in insufficient model robustness and generalization ability, making it difficult to accurately characterize crop growth momentum under different environments.
By introducing the cumulative effective accumulated temperature between adjacent growth nodes as a normalization factor, and combining static features and growth dynamic features to construct a high-dimensional feature dataset, a nitrogen detection model is established using the random forest algorithm. Furthermore, by extracting the index from the illumination canopy to generate a binary mask to remove interference noise, a high-precision nitrogen diagnosis method is constructed.
It effectively eliminates interference noise such as soil background and shadows, improves the purity and signal-to-noise ratio of multispectral reflectance, and enhances the accuracy of nitrogen diagnosis and the universality of the model across time and regions.
Smart Images

Figure CN122135240A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of nitrogen measurement using remote sensing spectral images, specifically a machine learning-based method for diagnosing and detecting nitrogen levels in cotton canopies using unmanned aerial vehicles (UAVs). Background Technology
[0002] Nitrogen is a key nutrient element that determines yield and quality during cotton growth and development, and its content level directly affects photosynthetic efficiency and the intensity of physiological metabolism in the plant. Traditional cotton nitrogen nutrient diagnosis mainly relies on manual field sampling and laboratory chemical analysis, such as the Kjeldahl method. Although this method has high measurement accuracy, it suffers from drawbacks such as destructive sampling, poor timeliness, and difficulty in achieving continuous monitoring over large areas, failing to meet the practical needs of modern large-scale cotton field precision management. With the deep integration of smart agriculture and digital technology, non-contact monitoring technologies, represented by low-altitude remote sensing by drones, have developed rapidly. Utilizing drones equipped with multispectral sensors to acquire crop canopy spectral information and combining it with machine learning algorithms to construct inversion models has become the mainstream technical approach for achieving non-destructive, rapid, and large-scale diagnosis of cotton nitrogen nutrition.
[0003] In the prior art, Chinese invention patent CN114839150A discloses a method for monitoring nitrogen concentration in cotton leaves using multi-angle spectral combination. This method collects spectral reflectance information of cotton leaves at different shooting angles and constructs a multi-angle blue-green edge area vegetation index using sensitive bands in the blue and green edge regions. This technical solution attempts to utilize the anisotropic characteristics of the crop canopy, enriching the feature dimensions by fusing spectral information from different observation angles, and combining partial least squares regression or random forest algorithms to establish an estimation model, aiming to solve the problem of insufficient canopy structure information obtained from a single vertical observation angle, thereby improving the stability of nitrogen concentration estimation.
[0004] However, the aforementioned existing technologies still have significant limitations in practical field applications. First, while multi-angle observation increases data dimensionality, it is essentially still processing mixed pixels. In complex field environments, influenced by illumination angles and canopy structure, images inevitably contain high levels of interference noise such as soil background, bottom stems, and canopy shadows. Existing methods lack pixel-level specific extraction mechanisms for the illuminated canopy, resulting in the extraction of non-leaf component interference signals mixed in with the spectral mean, thus reducing the signal-to-noise ratio. Second, cotton growth and development is a dynamic biological process driven by environmental heat. Most existing monitoring models rely solely on static spectral characteristics at a single moment, ignoring the differences in growth rates due to the cumulative effect of temperature at different growth stages. This static model, lacking a temporal dynamic normalization mechanism, struggles to accurately represent the true physiological growth momentum of crops when facing monitoring scenarios with different years, different sowing dates, or large climate fluctuations, leading to insufficient robustness and generalization ability of the model.
[0005] The information disclosed in the background section is only intended to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0006] The purpose of this invention is to provide a machine learning-based method for diagnosing nitrogen levels in cotton canopy using unmanned aerial vehicles (UAVs), in order to solve the problems mentioned in the background section.
[0007] To achieve the above objectives, the present invention provides the following technical solution: A machine learning-based drone-based method for diagnosing nitrogen levels in cotton canopies includes the following steps: Step 1: Set up experimental fields and manually collect a preset number of cotton canopy leaves at different growth nodes in each experimental field. Test the multispectral image data and corresponding true values of nitrogen content of each collected cotton canopy leaf in the laboratory. Step 2: Calculate static features based on multispectral image data, introduce the cumulative effective accumulated temperature between adjacent growth nodes as a normalization factor, calculate the accumulated temperature normalized dynamic rate of static features and generate growth dynamic features, and construct a high-dimensional feature dataset by combining growth dynamic features and static features. Step 3: Using the random forest algorithm, a nitrogen detection model is trained with the high-dimensional feature dataset as input and the true value of nitrogen content as the target. The mapping relationship between the high-dimensional feature dataset and the true value of nitrogen content is established through decision tree ensemble learning. After training, the performance of the nitrogen detection model is evaluated. Once the performance evaluation requirements are met, the nitrogen detection model is considered to have completed training. Step 4: Divide the cotton field under test into leaf areas and acquire UAV multispectral images. Use the UAV multispectral images to construct the light canopy extraction index and generate a binary mask. Then, filter the UAV multispectral images corresponding to the growth nodes, count the effective multispectral image data retained after filtering, and calculate the mean effective multispectral reflectance of each growth node to form the multispectral image data of each grid. Step 2 is reused to process multispectral image data and generate a high-dimensional feature dataset to be tested. Step 5: Input the high-dimensional feature dataset to be tested into the trained nitrogen detection model, calculate the nitrogen detection value, compare the nitrogen detection value with the standard threshold range of the current growth node, and output the diagnostic result based on the comparison result.
[0008] Furthermore, experimental fields were set up according to environmental conditions preset by staff, and the following operations were performed multiple times within preset growth time points, based on the cotton growth pattern: At different growth stages in each experimental field, a predetermined number of cotton canopy leaves were randomly collected manually. All cotton canopy leaves were measured using a spectrometer to obtain the spectral reflectance values of each cotton canopy leaf in the blue, green, red, red-edge, and near-infrared bands, generating multispectral image data for each cotton canopy leaf. The nitrogen content of each cotton canopy leaf was determined in the laboratory using the Kjeldahl method.
[0009] Furthermore, static characteristics of each canopy leaf were calculated based on multispectral image data. These static characteristics included the red edge normalized difference vegetation index obtained using the NDRE formula, the red edge chlorophyll index obtained using the Cl red edge formula, the green light normalized difference vegetation index obtained using the GNDVI formula, the red edge ratio vegetation index obtained using the RERVI formula, and near-infrared reflectance.
[0010] Furthermore, by introducing meteorological monitoring data, the cumulative effective accumulated temperature between adjacent observation periods is calculated, and the calculated cumulative effective accumulated temperature is used as a normalization factor to calculate the corresponding rate of change of each static feature at different adjacent growth nodes to obtain the growth dynamic features. Principles of constructing growth dynamic features: in, Indicates the first The first growth node period, the first The first leaf The normalized dynamic rate of accumulated temperature for each static characteristic parameter Indicates the first The first growth node period, the first The first leaf One static feature parameter, Indicates the first The growth node period, i.e. the first growth node period The previous adjacent growth node period of the th growth node period, the th growth node period The first leaf One static feature parameter, This indicates the result obtained using the standard agronomic calculation formula. From the first growth node period to the first The cumulative effective accumulated temperature at each growth node stage; Based on the normalized dynamic rate of accumulated temperature for each static feature parameter, growth dynamic features are generated, and a high-dimensional feature dataset is constructed by combining the growth dynamic features and static features.
[0011] Furthermore, using the random forest algorithm, the true value of nitrogen content for each leaf and the high-dimensional feature dataset for each leaf are bound together and divided into training and testing sets. The specific ratio is determined by relevant personnel according to their needs. Based on the training set, a number of sub-sample sets are generated using a Bagging strategy. A regression decision tree is independently constructed on each sub-sample set. During the splitting process of the tree nodes, some features are randomly selected to find the optimal split point. The independent deceleration detection values of all decision trees are arithmetically averaged to generate the final nitrogen detection value and obtain the trained nitrogen detection model.
[0012] Furthermore, the performance of the trained nitrogen detection model is evaluated using a test set; The coefficient of determination for the final nitrogen detection value is constructed based on the squared form of the Pearson correlation coefficient. The construction principle is as follows: in, The coefficient of determination represents the nitrogen detection value. This indicates the number of validation samples in the test set. This represents the nitrogen detection value of the z-th canopy leaf in the test set calculated by the nitrogen detection model. This represents the true value of nitrogen content in the z-th canopy leaf of the test set. This represents the average nitrogen detection value of all canopy leaves in the test set calculated by the nitrogen detection model. This represents the average of the true nitrogen content values for all canopy leaves in the test set; The difference between the nitrogen detection value of the z-th canopy leaf in the test set calculated by the nitrogen detection model and the true value of the nitrogen content of the z-th canopy leaf in the test set is obtained by squaring the calculated difference and then taking the square root of the mean based on the number of canopy leaves in the test set. When the determination coefficient of the nitrogen detection value is greater than or equal to the preset goodness-of-fit threshold and the root mean square error is less than or equal to the preset error tolerance threshold, the performance evaluation requirements are met and the nitrogen detection model training is completed. Otherwise, it is determined that the performance evaluation requirements are not met, and the number of subsample sets and decision trees needs to be readjusted, the ratio of training set to test set needs to be changed, and the amount of training set data needs to be increased.
[0013] Furthermore, after the nitrogen detection model is trained, the cotton field to be tested is divided into grids and the UAV multispectral images of the grids are acquired. The UAV multispectral images include the spectral reflectance values of the blue light band, green light band, red light band, red edge band and near-infrared band of each pixel in each grid. The light canopy extraction index of the corresponding pixel is constructed using the UAV multispectral images of each pixel in each grid. Principle of constructing light canopy extraction index: in, Indicates coordinates Illumination canopy extraction index of pixels at that location Represents the x-coordinate of a pixel. Represents the ordinate of a pixel. Indicates coordinates The spectral reflectance of the pixel in the near-infrared band at that location. Indicates coordinates Spectral reflectance of the red-edge band of the pixel at that location. Indicates the spectral reflectance in the red light band. Indicates the spectral reflectance in the green light band. Indicates coordinates The spectral reflectance of the pixel in the blue light band at that location. This represents a pre-defined regularized minima to prevent the denominator from being zero.
[0014] Furthermore, in the coordinates The illumination canopy extraction index of the pixel at a given location is compared with the segmentation threshold. If the coordinates are... If the illumination canopy extraction index of a pixel at a given location is greater than or equal to the segmentation threshold, then the coordinates will be... The pixel mask value at a certain location is set to 1. If the coordinates are... If the illumination canopy extraction index of a pixel at a given location is less than the segmentation threshold, then the coordinates will be... The pixel mask value at the location is set to 0. After traversing all pixels in each grid, the binary mask of the current grid is obtained. The segmentation threshold is automatically calculated by using the Otsu method to perform histogram statistics on the SIC values of all pixels in the current grid. The multispectral image data is filtered using a binarized mask for each grid to obtain effective multispectral image data of the cotton canopy with light intensity after removing soil, shaded bottom stems, and shaded leaves. The cumulative total value and number of pixels of the effective multispectral image data of the canopy with light intensity retained by the binarized mask in each grid are counted. The average effective multispectral reflectance is calculated based on the cumulative total value and number of pixels of the effective multispectral image data of the canopy with light intensity in each grid. Step 3 is reused to process multispectral image data and generate a high-dimensional feature dataset to be tested.
[0015] Furthermore, the high-dimensional feature dataset to be tested is input into the trained nitrogen detection model to calculate the nitrogen detection value for each grid cell. The nitrogen detection value of each grid cell to be tested is compared with the standard threshold range of the current growth node, and a diagnostic status code for each grid cell to be tested is generated. Diagnostic status code generation principle: in, Indicates the first Diagnostic status codes for each grid cell to be tested. Indicates the first The nitrogen detection value of each grid cell to be tested. Indicates the preset in the first The standard lower limit threshold for nitrogen content in cotton at each growth stage. Indicates the preset in the first Standard upper limit threshold for nitrogen content in cotton at each growth stage; If the first If the diagnostic status code of the nth grid to be tested is 0, it indicates that the nth grid is... If the nitrogen content of the cotton in the first grid to be tested is within a reasonable range, then... If the diagnostic status code of the nth grid to be tested is 1, then it indicates that the nth grid is... The nitrogen content of the cotton in the first grid to be tested is in an excess state. If the nitrogen content of the cotton in the second grid is in an excess state, then... If the diagnostic status code of the nth grid to be tested is -1, then it indicates that the nth grid is... The cotton in the test grid is in a state of nitrogen deficiency.
[0016] Compared with the prior art, the beneficial effects of the present invention are: This invention constructs a canopy illumination extraction index based on multispectral image data, and generates a binarized mask based on this index to finely filter the original image, retaining only the effective multispectral image data of the canopy within the area covered by the binarized mask to calculate the mean effective multispectral reflectance. This technique effectively overcomes the shortcomings of existing technologies in handling mixed pixels in complex field environments, and the difficulty in removing high-interference noise such as soil background, bottom stems, and shadows. Through the physical isolation effect of the binarized mask, this invention can specifically extract the light-reflected leaf signal that truly reflects the physiological state of cotton from multispectral image data containing complex backgrounds, eliminating environmental noise interference from non-canopy effective leaf components, thereby improving the purity and signal-to-noise ratio of the obtained mean effective multispectral reflectance, and providing a high-quality data foundation for accurate diagnosis of nitrogen content. This invention also introduces the cumulative effective accumulated temperature between adjacent growth nodes as a normalization factor to calculate the normalized dynamic rate of accumulated temperature for static features and generate dynamic growth features, upgrading traditional static single-time-point monitoring to dynamic monitoring that includes growth momentum. Addressing the problem in existing technologies that ignore the impact of accumulated temperature on crop growth rates, leading to poor model adaptability in different years or sowing periods, this invention uses the normalized dynamic rate of effective accumulated temperature to quantify the nitrogen accumulation rate driven by unit effective heat, converting the physical time dimension into a physiological time dimension that fits the crop growth mechanism, eliminating the interference of growth rate differences caused by temperature fluctuations on diagnostic results. By combining dynamic and static growth features to construct a high-dimensional feature dataset, the detection model can simultaneously capture the current nutrient stock and recent growth potential of cotton, improving the universality and detection accuracy of the nitrogen diagnostic model in cross-time and cross-regional monitoring. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of the overall method flow of the present invention; Figure 2 This is a schematic diagram of the high-dimensional feature dataset construction process in this invention. Detailed Implementation
[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.
[0019] It should be noted that, unless otherwise defined, the technical or scientific terms used in this invention should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0020] Example: Please see Figure 1 and Figure 2 The present invention provides a technical solution: A machine learning-based drone-based method for diagnosing nitrogen levels in cotton canopies includes the following steps: Step 1: Set up experimental fields and manually collect a preset number of cotton canopy leaves at different growth nodes in each experimental field. Measure the multispectral image data and corresponding true values of nitrogen content for each collected cotton canopy leaf in the laboratory. In this embodiment, the experimental field is divided into leaf sections according to a spatial resolution preset by the staff, and the following operations are performed multiple times within a preset growth time node based on the cotton growth pattern: The drone was used to acquire multispectral image data of each leaf covering the entire experimental field according to the preset route, including the spectral reflectance values of all pixels in each leaf after radiometric calibration in the blue, green, red, red edge, and near-infrared bands. The cotton canopy of each leaf was randomly sampled and the nitrogen content was measured in the laboratory. The average value was calculated to obtain the true value of nitrogen content for the corresponding leaf. The experimental field was set up with four nitrogen fertilizer gradient treatments: no nitrogen (N0), nitrogen (120 kg·hm²) and nitrogen (N0). - ² N1, nitrogen application 240 kg·hm - ² N2, nitrogen application 360 kg·hm -For N3², three replicate regions were set up for each nitrogen fertilizer gradient, for a total of 12 regions arranged in randomized blocks. Except for nitrogen fertilizer, other management measures were kept consistent. Based on the cotton growth pattern, the seedling stage, budding stage, flowering and boll opening stage, and boll opening stage were selected as preset growth time nodes. At each time node, the following operations were performed multiple times: In each experimental field, a preset number of cotton canopy leaves were randomly collected manually. The collected leaves had to be intact leaves free from pests and damage. In the laboratory, a spectrometer was used to measure the multispectral image data of each collected cotton canopy leaf, thereby obtaining high-quality raw multispectral image data of the cotton field. This multispectral image data contains key bands that can reflect the crop's chlorophyll content, cell structure, and biomass information, specifically including the spectral reflectance values of the blue, green, red, red-edge, and near-infrared bands in each leaf. The reason for collecting multispectral data instead of ordinary RGB images is that changes in nitrogen content cause subtle alterations in pigments and cell structure within the leaves, resulting in a more significant spectral response in the red-edge and near-infrared bands, providing richer feature information for nitrogen concentration retrieval. Simultaneously, the Kjeldahl method was used to determine the nitrogen content of each cotton canopy leaf, obtaining the true value for that leaf and providing high-precision supervisory labels for subsequent machine learning model training.
[0021] Step 2: Calculate static features based on multispectral image data, introduce the cumulative effective accumulated temperature between adjacent growth nodes as a normalization factor, calculate the accumulated temperature normalized dynamic rate of static features and generate growth dynamic features, and construct a high-dimensional feature dataset by combining growth dynamic features and static features. In this embodiment, the static characteristics of each canopy leaf are calculated based on multispectral image data. The static characteristics include the red edge normalized difference vegetation index obtained by using the NDRE calculation formula, the red edge chlorophyll index obtained by using the Cl red edge calculation formula, the green light normalized difference vegetation index obtained by using the GNDVI calculation formula, the red edge ratio vegetation index obtained by using the RERVI calculation formula, and the near-infrared band reflectance. This method selects five spectral parameters strongly correlated with crop nitrogen concentration as core features: First, the red-edge normalized difference vegetation index is calculated, utilizing its resistance to saturation under high nitrogen levels to accurately characterize the nitrogen accumulation status in the cotton canopy. Second, the red-edge chlorophyll index is calculated; since chlorophyll content is the most direct indicator of nitrogen level, the red-edge chlorophyll index quantifies leaf pigment concentration specifically in the red-edge band, thus directly reflecting nitrogen content. Third, the green light normalized difference vegetation index is calculated, introducing the green light band, which is sensitive to nitrogen supply, to assess changes in photosynthetic intensity caused by nitrogen differences. Fourth, the red-edge ratio vegetation index is calculated, using ratio calculations to amplify spectral differences in the red-edge region to capture stress signals caused by early trace nitrogen deficits. Finally, near-infrared reflectance is directly obtained to characterize the population biomass base, which is closely related to total nitrogen. These five static feature parameters are cross-validated from different spectral dimensions, collectively forming a multidimensional stock feature space reflecting the nitrogen content level of cotton at the current observation time.
[0022] By introducing meteorological monitoring data, the cumulative effective accumulated temperature between adjacent observation periods is calculated, and the calculated cumulative effective accumulated temperature is used as a normalization factor to calculate the corresponding rate of change of each static feature at different adjacent growth nodes, thus obtaining the growth dynamic feature. Principles of constructing growth dynamic features: in, Indicates the first The first growth node period, the first The first leaf The normalized dynamic rate of accumulated temperature for each static characteristic parameter Indicates the first The first growth node period, the first The first leaf One static feature parameter, Indicates the first The growth node period, i.e. the first growth node period The previous adjacent growth node period of the th growth node period, the th growth node period The first leaf One static feature parameter, This indicates the result obtained using the standard agronomic calculation formula. From the first growth node period to the first The cumulative effective accumulated temperature at each growth node stage; Based on the normalized dynamic rate of accumulated temperature for each static feature parameter obtained from the calculation, growth dynamic features are generated, and a high-dimensional feature dataset is constructed by combining the growth dynamic features and static features. However, considering that cotton growth is a continuous dynamic process driven by environmental heat, relying solely on static characteristics at a single moment cannot distinguish whether slow growth is due to nitrogen deficiency or developmental stagnation due to low temperatures. Therefore, dynamic indicators must be introduced to characterize the crop's growth potential. To this end, this method further introduces the cumulative effective accumulated temperature between adjacent growth nodes as a normalization factor in the time dimension, calculating the normalized dynamic rate of accumulated temperature for static characteristics and generating dynamic growth characteristics. By constructing a formula for calculating the rate of nitrogen change based on heat, the intrinsic relationship between crop growth and environmental heat is deeply explored. The normalized dynamic rate of accumulated temperature calculated by the formula serves as the dependent variable, specifically reflecting the rate of change of static characteristic indicators representing nitrogen content under unit effective heat. Its technical advantage lies in eliminating the interference of temperature in the time dimension and accurately quantifying the physiological absorption trend of nitrogen by the crop. From the perspective of variable relationships, the numerator of the formula represents the absolute increment of cotton nitrogen characteristic indicators between two observation nodes, which is positively correlated with the normalized dynamic rate of accumulated temperature. That is, under the same heat conditions, the greater the increase in nitrogen indicators, the higher the crop's nitrogen absorption and assimilation efficiency. The denominator of the formula represents the total environmental heat received during the period. As a normalization factor, it is negatively correlated with the accumulated temperature normalized dynamic rate. Its core function is to eliminate the non-physiological interference of environmental temperature fluctuations on nitrogen absorption rate. For example, in years with low temperatures and little sunshine, although the absolute increase in nitrogen is small, the dynamic rate after accumulated temperature correction can still remain normal, thus avoiding misjudgment as nitrogen deficiency. The necessity of this step lies in its ability to fill the gap in traditional static spectral monitoring, which cannot detect nitrogen absorption rate. By combining the above five static features characterizing nitrogen content with five corresponding growth dynamic features, a high-dimensional feature dataset containing current nitrogen levels and recent nitrogen absorption efficiency is constructed. This achieves a leap from static observation to dynamic diagnosis, significantly eliminating the interference caused by interannual climate differences and ensuring that the model can accurately identify the true nitrogen nutrition status of the cotton canopy under different climatic conditions.
[0023] Step 3: Using the random forest algorithm, a nitrogen detection model is trained with the high-dimensional feature dataset as input and the true value of nitrogen content as the target. The mapping relationship between the high-dimensional feature dataset and the true value of nitrogen content is established through decision tree ensemble learning. After training, the performance of the nitrogen detection model is evaluated. Once the performance evaluation requirements are met, the nitrogen detection model is considered to have completed training. In this embodiment, the random forest algorithm is used to bind the true value of nitrogen content of each leaf and the high-dimensional feature dataset of each leaf and divide them into training set and test set. The specific ratio is determined by relevant personnel according to their needs. Based on the training set, a number of subsample sets are generated by relevant personnel using the Bagging strategy. A regression decision tree is independently constructed on each subsample set. During the node splitting process of the tree, some features are randomly selected to find the optimal split point. The independent deceleration detection values of all decision trees are arithmetically averaged to generate the final nitrogen detection value and obtain the trained nitrogen detection model. The number of subsample sets and decision trees is set to 200, and the random seed is set to 42. In this method, to construct a mathematical model capable of accurately inverting the nitrogen nutrient status of cotton from complex multidimensional spectral and growth characteristics, a random forest algorithm is used. The true nitrogen content of each leaf obtained in step 1 is used as the target label, and the high-dimensional feature dataset of each leaf constructed in step 2 is used as the input feature for binding. The datasets are then divided into training and testing sets according to a preset ratio. Given the extremely complex nonlinear mapping relationship between cotton canopy spectral response, temporal growth dynamics, and nitrogen content, and the fact that field environmental data is often accompanied by noise interference, traditional linear regression models are ill-suited for such high-dimensional inversion tasks. Therefore, this embodiment uses the highly adaptable random forest algorithm for modeling, which is a necessary choice for constructing a high-precision nitrogen detection model. The Random Forest algorithm uses ensemble learning to build a regression model based on multiple decision trees. During training, Random Forest employs a bootstrapping method to select multiple subsets of samples from the original dataset using sampling with replacement. Each subset is the same size as the original training set. A regression decision tree is built on each subset. To improve model diversity during tree construction, each split doesn't use all features; instead, it randomly selects a subset of features for splitting. The predicted value of each tree is the average of the leaf nodes' values. By arithmetically averaging the predicted values from all decision trees, the final nitrogen detection value is obtained, resulting in the initial nitrogen detection model. In this embodiment, to optimize model performance, several key hyperparameters need to be adjusted during training. The number of trees is the most important parameter, typically set to 200 to ensure model stability and reduce prediction variance. The maximum tree depth determines tree complexity, usually set to 20 to avoid overfitting. To control the tree splitting process, the minimum number of splits and the minimum number of leaf node samples can also be adjusted. These parameter choices help avoid overfitting and ensure the model's generalization ability. This algorithm, through an ensemble learning mechanism, significantly reduces the variance of the nitrogen detection model by averaging the votes of a large number of decision trees. This effectively suppresses the risk of overfitting due to anomalies in a single feature, thus reasonably ensuring the generalization ability and stability of the nitrogen detection model when facing data from different plots and different periods. Furthermore, because a single decision tree is trained based on only a subset of sample data and features, it is prone to overfitting to specific noisy data, leading to high variance and instability in the detection results. By averaging the detection results of a large number of independent decision trees, the law of large numbers in statistics can be used to smooth out random detection errors and anomalies in individual trees, reducing the overall variance of the nitrogen detection model. This ensemble strategy effectively combines weak learners into strong learners, ensuring that the final output nitrogen detection value has higher accuracy, stability, and generalization ability, thereby adapting to the complex monitoring needs of different plots and growth stages.
[0024] The performance of the trained nitrogen detection model was evaluated using a test set; The coefficient of determination for the final nitrogen detection value is constructed based on the squared form of the Pearson correlation coefficient. The construction principle is as follows: in, The coefficient of determination represents the nitrogen detection value. This indicates the number of validation samples in the test set. This represents the nitrogen detection value of the z-th canopy leaf in the test set calculated by the nitrogen detection model. This represents the true value of nitrogen content in the z-th canopy leaf of the test set. This represents the average nitrogen detection value of all canopy leaves in the test set calculated by the nitrogen detection model. This represents the average of the true nitrogen content values for all canopy leaves in the test set; The difference between the nitrogen detection value of the z-th canopy leaf in the test set calculated by the nitrogen detection model and the true value of the nitrogen content of the z-th canopy leaf in the test set is obtained by squaring the calculated difference and then taking the square root of the mean based on the number of canopy leaves in the test set. When the determination coefficient of the nitrogen detection value is greater than or equal to the preset goodness-of-fit threshold and the root mean square error is less than or equal to the preset error tolerance threshold, the performance evaluation requirements are met and the nitrogen detection model training is completed. Otherwise, it is determined that the performance evaluation requirements are not met, and the number of subsample sets and decision trees needs to be readjusted, the ratio of training set to test set needs to be changed, and the amount of training set data needs to be increased. After the nitrogen detection model is trained, to ensure its reliability for practical applications, this method requires rigorous performance evaluation using an independent test set. The evaluation process begins by calculating the coefficient of determination (COD) of the nitrogen detection values. The COD specifically reflects the model's ability to explain the variability of the validation data, providing a standardized evaluation dimension to intuitively measure the consistency between the detected values and the true values. From a variable relationship perspective, the numerator of the formula represents the square of the covariance between the detected nitrogen value and the true nitrogen content. This independent variable reflects the degree of synchronous fluctuation between the two and is positively correlated with the dependent variable. That is, the closer the nitrogen change trend detected by the model is to the true trend, the larger the covariance, and the closer the calculated COD of the nitrogen detection value is to 1. This indicates that the nitrogen detection model has superior fitting performance and can accurately capture the data's changing patterns. Next, the root mean square error (RMSE) between the nitrogen detection value calculated by the nitrogen detection model and the true nitrogen content value in the test set is calculated. This specifically reflects the average physical distance between the nitrogen detection value and the true nitrogen content value, and its technical effect is to directly provide the error boundary of the detection accuracy. From the perspective of variable relationships, the independent variable inside the formula is the sum of squares of the detection deviations, which is negatively correlated with the dependent variable. That is, the greater the deviation between the detection value and the true value, the larger the calculated RMSE, indicating that the detection accuracy of the nitrogen detection model is lower.
[0025] The performance of the nitrogen detection model is evaluated by combining the coefficient of determination of the nitrogen detection value and the root mean square error between the nitrogen detection value and the true nitrogen content. The model is considered to meet the performance evaluation requirements and training ends only when the coefficient of determination is greater than or equal to a preset goodness-of-fit threshold and the root mean square error is less than or equal to a preset error tolerance threshold. Otherwise, a model reconstruction mechanism is triggered, such as adjusting the number of subsamples and decision trees or increasing the training data. This dual evaluation mechanism comprehensively assesses the nitrogen detection model from two dimensions: trend consistency and absolute error value. This avoids misdiagnosis caused by underfitting or overfitting, ensuring that the final nitrogen detection model has statistically validated high accuracy and reliability, providing a solid technical guarantee for subsequent precision fertilization decisions in field operations.
[0026] Step 4: Divide the cotton field to be tested into grids and acquire UAV multispectral images. Use the UAV multispectral images to construct the light canopy extraction index and generate a binarized mask. Then, filter the UAV multispectral images corresponding to the growth nodes, count the effective multispectral image data retained after filtering, and calculate the average effective multispectral reflectance of each growth node to form the multispectral image data of each grid. In this embodiment, after the nitrogen detection model is trained, the cotton field to be tested is divided into grids and the UAV multispectral images of the grids are acquired. The UAV multispectral images include the spectral reflectance values of the blue light band, green light band, red light band, red edge band and near-infrared band of each pixel in each grid. The light canopy extraction index of the corresponding pixel is constructed using the UAV multispectral images of each pixel in each grid. Principle of constructing light canopy extraction index: in, Indicates coordinates Illumination canopy extraction index of pixels at that location Represents the x-coordinate of a pixel. Represents the ordinate of a pixel. Indicates coordinates The spectral reflectance of the pixel in the near-infrared band at that location. Indicates coordinates Spectral reflectance of the red-edge band of the pixel at that location. Indicates the spectral reflectance in the red light band. Indicates the spectral reflectance in the green light band. Indicates coordinates The spectral reflectance of the pixel in the blue light band at that location. This represents a pre-defined regularized minima to prevent the denominator from being zero. In this method, the cotton field to be tested is physically gridded according to the spatial resolution preset by the staff. The reason for gridding is that analyzing the entire field as a unit would lead to large errors and mask local differences, while analyzing individual plants would result in excessive computational load and difficulty in localization. UAV multispectral imagery is specifically achieved by using a UAV equipped with a multispectral camera between 11:00 and 14:00 on a clear, cloudless day with wind speeds less than 3 m / s and a solar altitude angle greater than 45°, according to a preset flight path and altitude. This minimizes the impact of environmental irradiance variations on ground reflection signals, thereby obtaining high-quality raw multispectral imagery of the cotton field. Due to the complex canopy structure in cotton fields, the raw UAV multispectral images contain a large number of non-target signals, especially the bare soil background, bottom stems, and shadowed areas formed by mutual shading of leaves. These interfering pixels severely reduce the accuracy of nitrogen inversion. To accurately extract unshaded cotton canopy pixels from complex mixed pixels using multispectral image data, this method constructs a canopy illumination extraction index for each pixel within each grid. Specific band combinations are used to target and extract "sufficiently lit, unshaded cotton canopies," quantifying the confidence that the current pixel belongs to a lit cotton canopy. Specifically, since healthy lit cotton canopies exhibit significantly high reflectivity in the near-infrared and red-edge bands, the spectral reflectivity of the near-infrared and red-edge bands in the formula's numerator is logarithmically enhanced as a positive correlation term to non-linearly amplify the vegetation signal. Conversely, considering the high reflectivity of the soil background in the red band, while green vegetation has relatively low red and green reflectivity due to chlorophyll absorption, the spectral reflectivity of the red and green bands in the formula's numerator is subtracted as a soil-independent term, effectively suppressing interference from the bare soil background. Furthermore, because the bottom stems and shaded areas in the field exhibit specific scattering characteristics in the blue light band that differ from those of the light-covered cotton canopy, such as the relatively high spectral reflectance of the bottom stems and shaded areas due to Rayleigh scattering, incorporating the blue light band into the denominator of the calculation can increase the numerical difference between the light-covered cotton canopy and the bottom stems and shaded areas. This design allows the light canopy extraction index to accurately identify and suppress non-ideal pixels that, although belonging to the cotton plant, are in the shade, thereby distinguishing between the bottom stems and the shaded parts of the canopy, and increasing the confidence level of the non-shaded cotton canopy parts in the well-lit areas.
[0027] In coordinates The illumination canopy extraction index of the pixel at a given location is compared with the segmentation threshold. If the coordinates are... If the illumination canopy extraction index of a pixel at a given location is greater than or equal to the segmentation threshold, then the coordinates will be... The pixel mask value at a certain location is set to 1. If the coordinates are... If the illumination canopy extraction index of a pixel at a given location is less than the segmentation threshold, then the coordinates will be... The pixel mask value at the location is set to 0. After traversing all pixels in each grid, the binary mask of the current grid is obtained. The segmentation threshold is automatically calculated by using the Otsu method to perform histogram statistics on the SIC values of all pixels in the current grid. The multispectral image data is filtered using a binarized mask for each grid to obtain effective multispectral image data of the cotton canopy with light intensity after removing soil, shaded bottom stems, and shaded leaves. The cumulative total value and number of pixels of the effective multispectral image data of the canopy with light intensity retained by the binarized mask in each grid are counted. The average effective multispectral reflectance is calculated based on the cumulative total value and number of pixels of the effective multispectral image data of the canopy with light intensity in each grid. Step 3 is reused to process multispectral image data and generate a high-dimensional feature dataset to be tested. Based on the calculated illumination canopy extraction index, this method further employs the Otsu method to automatically calculate the segmentation threshold, and then applies it to the coordinate system. The process compares the light canopy extraction index with the segmentation threshold: when the light canopy extraction index is greater than or equal to the segmentation threshold, the pixel is determined to be a well-lit effective canopy, and the mask is set to 1; otherwise, it is determined to be a stem, shadow, or background, and the mask is set to 0, thus generating a binarized mask for the current grid. The original multispectral image data is rigorously screened using this binarized mask, only counting the cumulative total value and number of pixels of the effective multispectral image data of the light canopy within the area preserved by the binarized mask, and then calculating the mean effective multispectral reflectance. This process achieves pixel-level fine purification, ensuring that the subsequent input mean effective multispectral reflectance comes entirely from the well-lit, actively growing cotton canopy, fundamentally eliminating noise interference from shadows and stems. By statistically smoothing out individual random noise, the final mean effective multispectral reflectance can robustly represent the central tendency and overall physiological state of the crop population within each grid, maintaining strict consistency with the spatial resolution of the ground-based grid, and ensuring that the mean effective multispectral reflectance maintains the same spatial resolution as the true nitrogen content value.
[0028] Step 5: Input the high-dimensional feature dataset to be tested into the trained nitrogen detection model, calculate the nitrogen detection value, compare the nitrogen detection value with the standard threshold range of the current growth node, and output the diagnostic result based on the comparison result.
[0029] In this embodiment, the high-dimensional feature dataset to be tested is input into the trained nitrogen detection model to calculate the nitrogen detection value for each grid to be tested. The nitrogen detection value of each grid cell to be tested is compared with the standard threshold range of the current growth node, and a diagnostic status code for each grid cell to be tested is generated. Diagnostic status code generation principle: in, Indicates the first Diagnostic status codes for each grid cell to be tested. Indicates the first The nitrogen detection value of each grid cell to be tested. Indicates the preset in the first The standard lower limit threshold for nitrogen content in cotton at each growth stage. Indicates the preset in the first Standard upper limit threshold for nitrogen content in cotton at each growth stage; If the first If the diagnostic status code of the nth grid to be tested is 0, it indicates that the nth grid is... If the nitrogen content of the cotton in the first grid to be tested is within a reasonable range, then... If the diagnostic status code of the nth grid to be tested is 1, then it indicates that the nth grid is... The nitrogen content of the cotton in the first grid to be tested is in an excess state. If the nitrogen content of the cotton in the second grid is in an excess state, then... If the diagnostic status code of the nth grid to be tested is -1, then it indicates that the nth grid is... The cotton in the test grid is in a state of nitrogen deficiency.
[0030] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation. The high-dimensional feature dataset generated through the preceding steps is input into the trained nitrogen detection model to calculate the nitrogen detection value for each grid cell. However, this nitrogen detection value only represents the physical value of the crop's nitrogen concentration at the current moment. To transform it into decision-making information that can directly guide field management, it is necessary to dynamically evaluate it in conjunction with the specific growth and development stages of cotton. Because cotton's physiological nitrogen requirements differ significantly at different growth stages such as seedling, budding, flowering and boll-forming, and boll-opening stages, the same nitrogen content may indicate excess at the seedling stage (when fertilizer demand is low) and deficiency at the flowering and boll-forming stage (when fertilizer demand is high). Therefore, establishing a dynamic threshold determination mechanism based on specific growth stages is highly reasonable and necessary for achieving scientific diagnosis. In specific implementation, the first... The nitrogen detection values of each grid cell are compared with the preset lower and upper limits of cotton nitrogen content at the current growth stage. If the nitrogen detection value is between the lower and upper limits, a diagnostic status code of 0 is generated, indicating that the nitrogen nutrition status of cotton in this area is reasonable and no intervention is needed. If the nitrogen detection value is higher than the upper limit, a diagnostic status code of 1 is generated, indicating nitrogen excess and the need to control fertilization. If the nitrogen detection value is lower than the lower limit, a diagnostic status code of -1 is generated, indicating nitrogen deficiency and the need for timely topdressing. This step, by outputting standardized diagnostic status codes, effectively transforms the complex remote sensing inversion results into intuitive and actionable agronomic diagnostic conclusions, helping growers quickly identify the spatial distribution of nitrogen surplus and deficit in the field, and providing the final scientific basis for achieving refined variable fertilization management.
[0031] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented in software, the above embodiments can be implemented, in whole or in part, as a computer program product. Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution.
[0032] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0033] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A machine learning-based method for diagnosing nitrogen levels in cotton canopy using unmanned aerial vehicles (UAVs), characterized in that, The specific steps include: Step 1: Set up experimental fields and manually collect a preset number of cotton canopy leaves at different growth nodes in each experimental field. Measure the multispectral image data and corresponding true values of nitrogen content for each collected cotton canopy leaf in the laboratory. Step 2: Calculate static features based on multispectral image data, introduce the cumulative effective accumulated temperature between adjacent growth nodes as a normalization factor, calculate the accumulated temperature normalized dynamic rate of static features and generate growth dynamic features, and construct a high-dimensional feature dataset by combining growth dynamic features and static features. Step 3: Using the random forest algorithm, a nitrogen detection model is trained with the high-dimensional feature dataset as input and the true value of nitrogen content as the target. The mapping relationship between the high-dimensional feature dataset and the true value of nitrogen content is established through decision tree ensemble learning. After training, the performance of the nitrogen detection model is evaluated. Once the performance evaluation requirements are met, the nitrogen detection model is considered to have completed training. Step 4: Divide the cotton field under test into leaf areas and acquire UAV multispectral images. Use the UAV multispectral images to construct the light canopy extraction index and generate a binary mask. Then, filter the UAV multispectral images corresponding to the growth nodes, count the effective multispectral image data retained after filtering, and calculate the mean effective multispectral reflectance of each growth node to form the multispectral image data of each grid. Step 2 is reused to process multispectral image data and generate a high-dimensional feature dataset to be tested. Step 5: Input the high-dimensional feature dataset to be tested into the trained nitrogen detection model, calculate the nitrogen detection value, compare the nitrogen detection value with the standard threshold range of the current growth node, and output the diagnostic result based on the comparison result.
2. The machine learning-based UAV method for diagnosing and detecting nitrogen levels in cotton canopies, as described in claim 1, is characterized in that: The experimental field was set up according to the environmental conditions preset by the staff, and the following operations were performed multiple times within the preset growth time nodes, based on the cotton growth pattern: At different growth stages in each experimental field, a predetermined number of cotton canopy leaves were randomly collected manually. All cotton canopy leaves were measured using a spectrometer to obtain the spectral reflectance values of each cotton canopy leaf in the blue, green, red, red-edge, and near-infrared bands, generating multispectral image data for each cotton canopy leaf. The nitrogen content of each cotton canopy leaf was determined in the laboratory using the Kjeldahl method.
3. The machine learning-based UAV method for diagnosing and detecting nitrogen levels in cotton canopies, as described in claim 2, is characterized in that: Static characteristics of each canopy leaf were calculated based on multispectral image data. These static characteristics included the red edge normalized difference vegetation index (NDRE) calculated using the NDRE formula, the red edge chlorophyll index calculated using the Cl red edge formula, the green light normalized difference vegetation index calculated using the GNDVI formula, the red edge ratio vegetation index calculated using the RERVI formula, and near-infrared reflectance.
4. The machine learning-based UAV method for diagnosing and detecting nitrogen levels in cotton canopies, as described in claim 3, is characterized in that: By introducing meteorological monitoring data, the cumulative effective accumulated temperature between adjacent observation periods is calculated, and the calculated cumulative effective accumulated temperature is used as a normalization factor to calculate the corresponding rate of change of each static feature at different adjacent growth nodes, thus obtaining the growth dynamic feature. Principles of constructing growth dynamic features: in, Indicates the first The first growth node period, the first The first leaf The normalized dynamic rate of accumulated temperature for each static characteristic parameter Indicates the first The first growth node period, the first The first leaf One static feature parameter, Indicates the first The growth node period, i.e. the first growth node period The previous adjacent growth node period of the th growth node period, the th growth node period The first leaf One static feature parameter, This indicates the result obtained using the standard agronomic calculation formula. From the first growth node to the first The cumulative effective accumulated temperature at each growth node stage; Based on the normalized dynamic rate of accumulated temperature for each static feature parameter, growth dynamic features are generated, and a high-dimensional feature dataset is constructed by combining the growth dynamic features and static features.
5. The machine learning-based UAV method for diagnosing and detecting nitrogen levels in cotton canopies, as described in claim 4, is characterized in that: Using the random forest algorithm, the true nitrogen content of each leaf and the high-dimensional feature dataset of each leaf are bound together and divided into training and testing sets. The specific ratio is determined by relevant staff according to their needs. Based on the training set, a number of sub-sample sets are generated by relevant staff using a Bagging strategy. A regression decision tree is independently constructed on each sub-sample set. During the splitting process of the tree nodes, some features are randomly selected to find the optimal split point. The independent deceleration detection values of all decision trees are arithmetically averaged to generate the final nitrogen detection value and obtain the trained nitrogen detection model.
6. The machine learning-based UAV method for diagnosing and detecting nitrogen levels in cotton canopies, as described in claim 5, is characterized in that: The performance of the trained nitrogen detection model was evaluated using a test set; The coefficient of determination for the final nitrogen detection value is constructed based on the squared form of the Pearson correlation coefficient. The construction principle is as follows: in, The coefficient of determination represents the nitrogen detection value. This indicates the number of validation samples in the test set. This represents the nitrogen detection value of the z-th canopy leaf in the test set calculated by the nitrogen detection model. This represents the true value of nitrogen content in the z-th canopy leaf of the test set. This represents the average nitrogen detection value of all canopy leaves in the test set calculated by the nitrogen detection model. This represents the average of the true nitrogen content values for all canopy leaves in the test set; The difference between the nitrogen detection value of the z-th canopy leaf in the test set calculated by the nitrogen detection model and the true value of the nitrogen content of the z-th canopy leaf in the test set is obtained by squaring the calculated difference and then taking the square root of the mean based on the number of canopy leaves in the test set. When the determination coefficient of the nitrogen detection value is greater than or equal to the preset goodness-of-fit threshold and the root mean square error is less than or equal to the preset error tolerance threshold, the performance evaluation requirements are met and the nitrogen detection model training is completed. Otherwise, it is determined that the performance evaluation requirements are not met, and the number of subsample sets and decision trees needs to be readjusted, the ratio of training set to test set needs to be changed, and the amount of training set data needs to be increased.
7. The machine learning-based UAV method for diagnosing and detecting nitrogen levels in cotton canopies, as described in claim 1, is characterized in that: After the nitrogen detection model is trained, the cotton field to be tested is divided into grids and the UAV multispectral images of the grids are acquired. The UAV multispectral images include the spectral reflectance values of the blue, green, red, red edge, and near-infrared bands of each pixel in each grid. The light canopy extraction index of the corresponding pixel is constructed using the UAV multispectral images of each pixel in each grid. Principle of constructing light canopy extraction index: in, Indicates coordinates Illumination canopy extraction index of pixels at that location Represents the x-coordinate of a pixel. Represents the ordinate of a pixel. Indicates coordinates The spectral reflectance of the pixel in the near-infrared band at that location. Indicates coordinates Spectral reflectance of the red-edge band of the pixel at that location. Indicates the spectral reflectance in the red light band. Indicates the spectral reflectance in the green light band. Indicates coordinates The spectral reflectance of the pixel in the blue light band at that location. This represents a pre-defined regularized minima to prevent the denominator from being zero.
8. The machine learning-based UAV method for diagnosing and detecting nitrogen levels in cotton canopies, as described in claim 7, is characterized in that: In coordinates The illumination canopy extraction index of the pixel at a given location is compared with the segmentation threshold. If the coordinates are... If the illumination canopy extraction index of a pixel at a given location is greater than or equal to the segmentation threshold, then the coordinates will be... The pixel mask value at a certain location is set to 1. If the coordinates are... If the illumination canopy extraction index of a pixel at a given location is less than the segmentation threshold, then the coordinates will be... The pixel mask value at the location is set to 0. After traversing all pixels in each grid, the binary mask of the current grid is obtained. The segmentation threshold is automatically calculated by using the Otsu method to perform histogram statistics on the SIC values of all pixels in the current grid. The multispectral image data is filtered using a binarized mask for each grid to obtain effective multispectral image data of the cotton canopy with light intensity after removing soil, shaded bottom stems, and shaded leaves. The cumulative total value and number of pixels of the effective multispectral image data of the canopy with light intensity retained by the binarized mask in each grid are counted. The average effective multispectral reflectance is calculated based on the cumulative total value and number of pixels of the effective multispectral image data of the canopy with light intensity in each grid. Step 3 is reused to process multispectral image data and generate a high-dimensional feature dataset to be tested.
9. The machine learning-based UAV method for diagnosing and detecting nitrogen levels in cotton canopies, as described in claim 8, is characterized in that: Input the high-dimensional feature dataset to be tested into the trained nitrogen detection model, and calculate the nitrogen detection value for each grid cell to be tested; The nitrogen detection value of each grid cell to be tested is compared with the standard threshold range of the current growth node, and a diagnostic status code for each grid cell to be tested is generated. Diagnostic status code generation principle: in, Indicates the first Diagnostic status codes for each grid cell to be tested. Indicates the first The nitrogen detection value of each grid cell to be tested. Indicates the preset in the first The standard lower limit threshold for nitrogen content in cotton at each growth stage. Indicates the preset in the first Standard upper limit threshold for nitrogen content in cotton at each growth stage; If the first If the diagnostic status code of the nth grid to be tested is 0, it indicates that the nth grid is... If the nitrogen content of the cotton in the first grid to be tested is within a reasonable range, then... If the diagnostic status code of the nth grid to be tested is 1, then it indicates that the nth grid is... The nitrogen content of the cotton in the first grid to be tested is in an excess state. If the nitrogen content of the cotton in the second grid is in an excess state, then... If the diagnostic status code of the nth grid to be tested is -1, then it indicates that the nth grid is... The cotton in the test grid is in a state of nitrogen deficiency.