A rice leaf area index inversion method based on a unmanned aerial vehicle
Patent Information
- Application Number
- CN202511778990.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2045-11-28
AI Technical Summary
[0006]为克服相关技术中存在的问题,本发明的目的是提供一种基于无人机的水稻叶面积指数反演方法,该基于无人机的水稻叶面积指数反演方法通过仅利用无人机搭载的常规RGB传感器采集图像,并结合高光谱重建与三维建模技术,从该单一数据源中深度挖掘并融合能够表征水稻冠层的光谱特征、高度特征和纹理特征,构建多维度融合的特征集以驱动机器学习模型进行高精度反演,以克服现有技术中存在依赖昂贵的多光谱或高光谱传感器导致监测成本高昂,或仅利用单一廉价数据源的反演方法精度不足的技术缺陷
本发明提供的一种基于无人机的水稻叶面积指数反演方法,该基于无人机的水稻叶面积指数反演方法仅使用常规的无人机RGB传感器采集数据,构建了一个融合光谱特征、高度特征和纹理特征的多维度输入特征集,将这三类物理意义不同但内在相关的特征共同输入到机器学习模型中,模型能够学习到光谱、垂直结构和空间分布这三者与LAI之间的复杂非线性映射关系。引入高度特征和纹理特征,弥补了RGB光谱信息不足的短板,使得模型能够更全面、更立体地理解水稻的综合长势,从而在不增加硬件成本的前提下,实现了LAI的反演。
Smart Images

Figure CN121883565B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of smart agriculture technology, and in particular to a method for inverting the leaf area index of rice based on unmanned aerial vehicles (UAVs). Background Technology
[0002] Rice is a vital food crop globally, crucial for ensuring world food security. Real-time and accurate monitoring of rice growth is key to achieving precision agriculture management and improving yield and resource utilization efficiency. Leaf Area Index (LAI), the multiple of total leaf area per unit area of land surface, is a core indicator reflecting crop canopy structure, photosynthetic capacity, and growth status. Therefore, rapidly and non-destructively obtaining rice LAI has significant application value in guiding field management activities such as fertilization and irrigation.
[0003] However, traditional LAI measurement methods, such as instrumental measurements or destructive sampling methods (e.g., leaf weight ratio), while highly accurate, have significant drawbacks. These methods are not only labor-intensive and time-consuming, but also typically require destructive sampling of plants, making it impossible to achieve continuous, dynamic monitoring of crops in the same area, and they are also difficult to apply to large-scale agricultural surveys.
[0004] In existing technologies, drones equipped with sensors are used for crop monitoring. These technologies typically employ drones carrying multispectral or hyperspectral sensors to acquire abundant vegetation spectral reflectance data. While these multispectral / hyperspectral remote sensing methods have improved the efficiency and accuracy of LAI monitoring to some extent, the high cost of specialized sensor equipment such as multispectral and hyperspectral cameras, coupled with complex data processing procedures, significantly increases the application threshold and operating costs, hindering their large-scale adoption by agricultural producers.
[0005] Therefore, it is necessary to improve the existing rice leaf area index inversion technology to overcome its shortcomings. Summary of the Invention
[0006] To overcome the problems existing in related technologies, the purpose of this invention is to provide a method for inverting rice leaf area index based on unmanned aerial vehicles (UAVs). This method uses only conventional RGB sensors mounted on UAVs to collect images and combines hyperspectral reconstruction and 3D modeling techniques to deeply mine and fuse spectral features, height features, and texture features that characterize the rice canopy from this single data source. It constructs a multi-dimensional fused feature set to drive a machine learning model for high-precision inversion, thereby overcoming the technical defects of existing technologies that rely on expensive multispectral or hyperspectral sensors, resulting in high monitoring costs, or that inversion methods using only a single inexpensive data source have insufficient accuracy.
[0007] A method for inverting rice leaf area index based on unmanned aerial vehicles (UAVs) includes the following steps: Step S1: Obtain the RGB image of the rice canopy to be tested, the training feature set, and the corresponding measured values of the rice leaf area index; Step S2: Process the RGB image of the rice canopy to be tested to generate a digital orthophoto and a digital land model; Step S3: Based on at least one of the RGB image of the rice canopy to be tested, the digital orthophoto, and the digital land model, generate spectral features of the rice canopy, height features reflecting the vertical structure of the rice canopy, and texture features reflecting the spatial distribution uniformity of the rice canopy; Step S4: Using the training feature set and the corresponding measured values of rice leaf area index, train the machine learning model to obtain the rice leaf area index inversion model. Step S5: Input the spectral features, the height features, and the texture features into a pre-trained rice leaf area index inversion model to obtain the predicted leaf area index value of the rice canopy to be tested.
[0008] Furthermore, step S3 specifically includes: Step S31: Apply a hyperspectral reconstruction algorithm to the RGB image of the rice canopy to be tested, and reconstruct it into hyperspectral image data with multiple continuous narrow bands. Calculate multiple vegetation indices based on the hyperspectral image data as spectral features. Step S32: Based on the digital land surface model, calculate multiple height statistics as the height features; Step S33: Based on the RGB image, calculate multiple texture statistics as the texture features; The hyperspectral reconstruction algorithm is Restormer. GAN The algorithm reconstructs hyperspectral image data with a spectral range of 400nm-850nm and a spectral resolution of 5nm. Traditional RGB image analysis methods are limited to combining the spectral features of three broad bands: red, green, and blue. They cannot calculate the red edge and near-infrared correlation indices, which are more sensitive to vegetation growth. This invention utilizes Restormer... GANThe hyperspectral reconstruction algorithm "upgrades" standard three-channel RGB images to 85 consecutive narrow-band hyperspectral data points within the 400nm-850nm range. This generates key spectral regions, including the red edge (~700-750nm) and near-infrared (>760nm), whose reflectance is highly sensitive to plant leaf cell structure, chlorophyll content, and water status. Based on the reconstructed data, it can calculate powerful vegetation indices such as CIRE and REGDVI, whose correlation with LAI (Latent Area Index) is far higher than that of traditional visible light indices. This "algorithm-for-hardware" approach fundamentally solves the bottleneck of insufficient spectral information from RGB sensors, providing high-quality spectral feature input for subsequent high-precision inversion models.
[0009] Furthermore, the Restormer GAN The algorithm includes: A generator based on the Restormer architecture is used, which models the nonlinear correlation between different spectral bands through a multi-head transpose attention mechanism to map RGB images to hyperspectral images. A multi-scale spectral normalization discriminator is adopted, which has a multi-scale receptive field and employs a dual normalization strategy of spectral normalization and instance normalization. The generator and the discriminator are trained adversarially using a customized hybrid loss function, which balances the spectral accuracy and spatial details of the reconstructed image through differential weights.
[0010] Restormer GANThe algorithm is a Transformer-based Generative Adversarial Network (GAN) for high-dimensional rice hyperspectral image (HSI) reconstruction. This network addresses key limitations of traditional models (such as poor spectral correlation modeling and loss of fine texture information in dense canopy scenes). The framework collaboratively integrates a Restormer-based generator with a multi-scale spectral normalization discriminator (MSND) to construct a closed-loop optimization system for spectral-space feature learning. Unlike traditional Transformers that ignore the nonlinear correlations between rice hyperspectral bands (such as the red-edge band and near-infrared band), the Restormer generator's Multi-Head Transposed Attention (MDTA) mechanism explicitly models spectral dependencies in 85-dimensional space, achieving accurate mapping from RGB images to rice hyperspectral images. The Multi-Scale Spectral Normalization Discriminator (MSND) addresses the shortcomings of traditional PatchGANs (poor adaptability to dense rice canopy shading and sensitivity to light noise). This discriminator employs a 70×70 multi-scale receptive field, dual normalization (spectral normalization + instance normalization), and a Dropout setting of 0.2 (to mitigate mode collapse). The rice-customized hybrid loss function system differs from the general triple loss function framework that uses fixed weights. This system balances spectral accuracy and spatial detail through differentiated weights, meeting the specific needs of rice-related scenarios.
[0011] Furthermore, step S32 specifically includes: Step S321: Based on the digital land model, determine the average elevation of the bare land portion within the area where the rice canopy to be measured is located, and use it as the ground reference elevation; Step S322: Subtract the ground reference elevation from the elevation values of each point in the digital surface model to obtain normalized canopy absolute height data; Step S323: Based on the absolute height data of the canopy, calculate multiple height statistics as the height features.
[0012] The height statistics include the maximum height H. max Mean H mean Standard deviation H sd Skewness H skew Coefficient of variation H cv Normalized value H crr Percentile height feature H 30 -H 99 .
[0013] Simple DSM (Discrete Shaping Method) applications may directly use elevation values or only calculate the average canopy height. These methods are susceptible to uneven ground surfaces and cannot adequately describe the complex vertical structure of the canopy. This invention normalizes the bare ground elevation to obtain the absolute canopy height, and then calculates, based on this, skewness (H... skew A series of advanced statistics, including skewness (H), are included. The normalization step eliminates errors caused by topographic variations, ensuring that height data accurately reflects the plant's growth status and enhancing the method's applicability to different plots. skew Statistics such as height (or height) describe the distribution pattern of canopy height, not just the average value. Therefore, the height feature set extracted in this invention can more comprehensively and three-dimensionally characterize the three-dimensional structure of the canopy. This refined processing makes the height features no longer a single "height" value, but a set of "morphological" descriptors that can reflect the complex internal structure of the canopy, thus providing the model with more discriminative information.
[0014] Furthermore, step S33 specifically includes: Step S331: Calculate the gray-level co-occurrence matrix based on the R, G, and B channels of the RGB image; Step S332: Based on the gray-level co-occurrence matrix, calculate multiple texture statistics as the texture features; The texture statistics include mean, variance, homogeneity, contrast, dissimilarity, energy, angular second moment (Asm), and correlation.
[0015] Most spectral-based remote sensing methods focus on the spectral values of pixels, neglecting the spatial arrangement relationship between pixels and their neighbors, i.e., texture information. This invention systematically calculates eight types of texture statistics, including contrast and second-order moments (energy), for the three channels of RGB images based on the Gray-Level Co-occurrence Matrix (GLCM). GLCM is a mature and powerful texture analysis tool, and its derived features (such as contrast and energy) can effectively quantify the local spatial pattern of an image. In rice canopy images, texture features reflect the spatial uniformity, complexity, and directionality of the distribution of leaves, stems, and shadows. Texture features provide the model with a supplementary information dimension orthogonal to spectral and height information. This helps the model distinguish rice plots that may have similar spectral reflectance and average height but different internal canopy spatial structures (such as leaf aggregation), thereby reducing ambiguity in the inversion and further improving the overall accuracy of the model.
[0016] Furthermore, step S4 specifically includes: Step S41: Obtain a training dataset consisting of multiple sets of training RGB images and their corresponding measured values of rice leaf area index; Step S42: Based on each set of training RGB images in the training dataset, process and extract spectral features, height features, and texture features to obtain a training feature set; Step S43: Perform correlation analysis between the spectral features, height features, and texture features in the training feature set and the corresponding measured values of rice leaf area index, and select the features with higher absolute values of correlation coefficients to form the final input features for training. Step S44: Using the input features and the corresponding measured values of rice leaf area index, a random forest model is used as a machine learning model for training to obtain the rice leaf area index inversion model.
[0017] During or after training, the hyperparameters of the random forest model are tuned using 10-fold cross-validation.
[0018] The selected input features include: Vegetation index characteristics: CIG, CIRE, GDVI, RDVI, REGDVI, REOSAVI, RERDVI, SR, VIOPT; Height characteristics: Skewness H skew Normalized value H crr ; Texture features: Red contrast R Contrast Blue light contrast ratio B Contrast Red light second moment R Energy .
[0019] Simple modeling methods may directly input all extracted features into the model or use a single, fixed dataset partition, which can easily lead to model overfitting and performance evaluation subject to chance. This invention employs a combined strategy of "correlation analysis for feature selection + random forest model + 10-fold cross-validation tuning," and determines an optimal combination of input features. By selecting features through correlation analysis, redundant and weakly correlated variables are eliminated, reducing model complexity and effectively avoiding the curse of dimensionality while improving the model's generalization ability. The random forest model is chosen because it inherently possesses advantages such as resistance to overfitting and the ability to handle high-dimensional data. Hyperparameter tuning using 10-fold cross-validation, through repeated training and validation, fully utilizes all data, avoids random bias caused by a single data partition, makes model performance evaluation more reliable, and yields a more universally applicable parameter combination. This series of rigorous steps ensures that the constructed rice LAI inversion model not only performs excellently on existing datasets but also has stable and reliable predictive capabilities for new and unseen data.
[0020] Furthermore, the step S2 is preceded by: Step S11: Process the digital orthophoto and digital land model, segment the image of each cell according to the ROI, and perform hyperspectral reconstruction on the segmented RGB images to obtain hyperspectral image data, digital land model image data and RGB image data of each cell.
[0021] In large-area remote sensing analysis, without precise region segmentation, pixels from field ridges, ditches, or other non-study areas can be mixed in, severely interfering with feature statistics. This invention addresses this by precisely segmenting the stitched DOM and DSM based on the ROI (such as a shapefile) before feature generation, isolating each rice plot. Each plot represents an independent experimental treatment (e.g., different nitrogen application levels), ensuring consistent rice growth within it. Precise segmentation ensures that all subsequent feature extractions (spectral, height, texture) are strictly confined to a single plot. This eliminates background noise from field ridges, bare soil, etc., guaranteeing that the calculated feature values accurately reflect the actual canopy condition of the plot. This improves the quality of the input data, laying a solid foundation for establishing an accurate quantitative relationship between features and measured LAI values.
[0022] The second objective of this invention is to provide a rice leaf area index inversion device based on unmanned aerial vehicles (UAVs), comprising: The data acquisition module is used to acquire the RGB image of the rice canopy, the training feature set, and the corresponding measured value of the rice leaf area index. The image processing module is used to process the RGB image of the rice canopy to generate digital orthophotos and digital land models. The feature generation module is used to generate spectral features of the rice canopy, height features reflecting the vertical structure of the rice canopy, and texture features reflecting the spatial distribution uniformity of the rice canopy based on at least one of the RGB image of the rice canopy to be tested, the digital orthophoto, and the digital land model. The model training module is used to train a machine learning model using the training feature set and the corresponding measured values of rice leaf area index, and obtain the rice leaf area index inversion model. The index inversion module is used to input the spectral features, the height features, and the texture features into a pre-trained rice leaf area index inversion model to obtain the predicted value of the leaf area index of the rice canopy to be tested.
[0023] A third objective of this invention is to provide an electronic device, including a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the above-described method for inverting the rice leaf area index based on unmanned aerial vehicles is performed.
[0024] The fourth objective of this invention is to provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the above-described method for inverting the rice leaf area index based on unmanned aerial vehicles.
[0025] The beneficial effects of this invention are as follows: This invention provides a method for inverting the leaf area index (LAI) of rice based on unmanned aerial vehicles (UAVs). This method uses only data collected by conventional UAV RGB sensors to construct a multi-dimensional input feature set that integrates spectral, height, and texture features. These three types of features, which have different physical meanings but are intrinsically related, are input into a machine learning model. The model can learn the complex nonlinear mapping relationship between the spectrum, vertical structure, and spatial distribution and LAI. By introducing height and texture features, the shortcomings of insufficient RGB spectral information are compensated for, enabling the model to more comprehensively and three-dimensionally understand the overall growth of rice, thus achieving LAI inversion without increasing hardware costs. Attached Figure Description
[0026] Figure 1 This is a flowchart illustrating a specific implementation method for a method of inverting rice leaf area index based on unmanned aerial vehicles (UAVs) provided in Embodiment 1 of this application. Figure 2 The orthophoto map (DOM) of the rice planting area obtained by stitching together the inversion method provided in Example 1; Figure 3 This is an RGB image of one of the rice planting plots obtained by segmenting the DOM using a shapefile, as provided in Example 1. Figure 4 The regression training and validation diagram is shown for the optimal rice leaf area index inversion model provided in Example 1, where both the predicted and actual values are rice leaf area indices. Figure 5 The Restormer provided in Example 1 GAN Overall framework diagram.
[0027] Figure 6 This is a structural diagram of the generator (Restormer) provided in Example 1; Figure 7 This is a diagram of the internal structure of the Transformer module provided in Example 1; Figure 8 This is a structural diagram of the multiscale spectral normalization discriminator (MSND) provided in Example 1. Detailed Implementation
[0028] Preferred embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While preferred embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that the invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.
[0029] Example 1 like Figures 1 to 8 As shown, this embodiment provides a method for inverting rice leaf area index (LAI) based on unmanned aerial vehicles (UAVs). The core of this method lies in utilizing only a low-cost UAV RGB sensor, and through advanced image processing and machine learning techniques, deeply mining and fusing spectral, altitude, and texture information to achieve high-precision, non-destructive, and rapid inversion of the rice LAI. The method includes the following steps: Step 1: Data Acquisition: Constructing a High-Quality Remote Sensing and Ground Dataset 1. Ground data acquisition: Experimental Design and Location: Data collection was conducted at the experimental base in Zengcheng District, Guangzhou City, Guangdong Province, from August to December 2024 and from April to July 2025. Different nitrogen application levels were set in the experimental fields in 2024, and different planting densities were set in the experimental fields in 2025. Both experiments covered multiple rice varieties to ensure the diversity and representativeness of the dataset. The data collection period covered the key growth stages of rice, including tillering, jointing, booting, and heading stages, to ensure the model's applicability across the main growth stages of rice.
[0030] A precise but destructive method based on specific leaf weight is used to obtain the true ground-level LAI (Layer Area Index). The specific procedure is as follows: Within each experimental plot, three representative rice holes were randomly selected for destructive sampling.
[0031] The plant samples were then derooted and cleaned.
[0032] Take a portion of the leaf as a sample and use a high-precision scanner (such as EPSON Perfection V800) to scan and obtain the leaf area of the sample.
[0033] All samples (including the small sample used for scanning and the remaining leaves) were placed in a constant temperature oven at 105℃ for blanching treatment for 30 minutes to quickly terminate the physiological activities inside the plant; then the oven temperature was adjusted to 80℃ for drying until the samples reached constant weight. Finally, the dry weight of the small sample and the total dry weight of the leaves were obtained by weighing them separately using a high-precision electronic balance.
[0034] Calculate LAI using the following formula:
[0035] The leaf area per unit dry weight (i.e., specific leaf area) is calculated by (small sample leaf area / small sample dry weight), and the total leaf dry weight is (small sample dry weight + (total leaf dry weight - small sample dry weight)). In this embodiment, the number of sampling holes is 3.
[0036] 2. Remote sensing data acquisition: Platforms and Sensors: Use a DJI Matrice 30T drone (or any drone with equivalent configuration and equipped with a standard RGB sensor).
[0037] Flight and environmental parameters: To ensure data quality and consistency, the flight operation was conducted under clear, cloudless weather conditions with minimal wind, between 10:00 and 14:00 Beijing time, when lighting conditions were optimal and stable. The UAV automatically cruised and captured images at a fixed altitude of 20 meters above the ground. To ensure the success rate and accuracy of subsequent image stitching, the forward overlap rate was set to be no less than 80%, and the lateral overlap rate to be no less than 70%. Through this step, a high-resolution, low-distortion raw RGB image sequence covering the entire test area was obtained.
[0038] Choosing this time period (10:00 to 14:00 Beijing time) ensures a high and relatively gradual change in the sun's altitude angle, thereby minimizing shadow effects and uneven lighting caused by changes in the sun's position, and guaranteeing image data quality and consistency between different sorties. Clear, cloudless weather conditions with low wind speeds avoid interference from cloud shadows and image blurring caused by unstable drone flight attitude, laying a solid foundation for subsequent high-precision image stitching, 3D reconstruction, and spectral information extraction.
[0039] Step 2: Image stitching and processing: Generating basic geospatial data products Processing software: Import all RGB images acquired in step S1 into professional photogrammetry software, such as Pix4Dmapper (or alternatives ContextCapture, PhotoScan, etc.).
[0040] Processing flow: The software uses automated processes such as feature point matching and aerial triangulation to stitch images together and reconstruct them in three dimensions.
[0041] Output products: This process ultimately generates two core data products: Digital orthophoto (DOM): A geometrically corrected and mosaicked image with a uniform scale and geographic coordinates. Figure 2 An example of the DOM for the rice planting area generated after splicing is shown.
[0042] Digital Surface Model (DSM): A raster data layer that records elevation information of the land surface (including the top of the vegetation canopy).
[0043] DOM and DSM provide a high-precision base map and elevation information foundation for all subsequent detailed analyses.
[0044] Step 2: Preliminary Steps, Image Segmentation and Hyperspectral Reconstruction Before feature extraction, the data needs to be preprocessed to ensure the accuracy of the analysis units and the richness of the information dimensions.
[0045] Image segmentation: Using geographic information system software (such as ArcGIS or QGIS), load the pre-drawn shapefile (ROI) of the test cell boundaries. Utilize the geometric information and geographic coordinates contained in this ROI file to precisely crop the DOM and DSM generated in step S2. This operation isolates each test cell from the overall image, generating a cell RGB image (e.g., RGB image of the cell corresponding to each ground sampling unit) Figure 3 (as shown) and the cell DSM image, thus eliminating interference from non-target areas such as field ridges and ditches.
[0046] Hyperspectral reconstruction: Apply deep learning-based Restormer to the RGB image of each segmented cell. GAN The hyperspectral reconstruction algorithm, its detailed structure is as follows: Figure 5 As shown, this algorithm is a novel Transformer-based Generative Adversarial Network (GAN) specifically designed for the reconstruction of high-dimensional rice hyperspectral images (HSI). It effectively addresses the limitations of traditional models in spectral correlation modeling and the preservation of fine texture information.
[0047] like Figure 5As shown, the algorithm constructs a general framework of a Generative Adversarial Network (GAN). The generator (Restormer) receives a 128×128×3 RGB image and learns to reconstruct it into a 128×128×85 hyperspectral image (Reconstruct HSI). The discriminator (Discriminator) learns to distinguish between the generator-generated fake hyperspectral images and real hyperspectral images (Real HSI). Backpropagation is performed using reconstruction losses and loss loss to iteratively optimize the generator and discriminator, forming a closed-loop spectral spatial feature learning system.
[0048] The core innovations of this algorithm are specifically reflected in the following aspects: Transformer-based Restormer generator (such as...) Figure 6 and Figure 7 As shown): The generator adopts an encoder-decoder structure similar to U-Net, such as... Figure 6 As shown, features are extracted and recovered step by step through downsampling and upsampling. Its core processing unit is the Transformer Block. (As shown...) Figure 7 The detailed demonstration shows that each Transformer Block integrates a Multi-Dconv HeadTransposed Attention (MDTA) mechanism. This mechanism can explicitly model the nonlinear dependencies between different bands (such as the red-edge and near-infrared bands) across all 85 spectral dimensions, overcoming the shortcomings of traditional models that ignore spectral correlations, thereby achieving accurate mapping from three-channel RGB images to high-precision hyperspectral images of rice.
[0049] Multiscale Spectral Normalization Discriminator (MSND) (e.g.) Figure 8 As shown): To address the problems of poor adaptability and sensitivity to light changes when processing dense rice canopies using traditional PatchGAN discriminators, this invention employs MSND. (See figure) Figure 8As shown, this discriminator consists of multiple cascaded discriminant blocks, possessing a 70×70 multi-scale receptive field. Its key lies in employing a dual normalization strategy of SpectralNorm and InstanceNorm2d, effectively improving the model's robustness to illumination noise. Simultaneously, by adding a Dropout layer (Dropout2D, p=0.2) to the network, the mode collapse problem during GAN training is effectively mitigated, enhancing the model's stability and generalization ability.
[0050] Rice-customized hybrid loss function system (e.g.) Figure 5 As shown in the diagram): During training, the algorithm employed a hybrid loss function system customized for the rice paddy scenario. In subsequent model tuning and evaluation, the root mean square error (RMSE), relative prediction bias (RPD), and coefficient of determination were used. The evaluation is conducted using the following formula:
[0051]
[0052]
[0053] in This is the actual value. This is the predicted value, where n is the number of data points. It is the standard deviation of the actual value.
[0054] The proposed Restormer GAN The loss function system consists of two parts: the generator total loss (L... Generator ) and total discriminant loss (L Discriminator ).
[0055] The generator loss is a triple supervision mechanism for vegetation canopy hyperspectral images (HSI), including reconstruction loss (L... rec Used for spectral value fidelity) and to combat loss (L adv (for global realism) and perceptual loss (L) per (Used to maintain the fine texture of rice canopy). Specifically, L rec Using L1 loss, L adv Using BCEWithLogitsLoss, L per MSE is used, where xi represents the reflectance value of the real rice HSI image, and yi represents the reflectance value of the reconstructed rice HSI image. Generator Through L rec L advand L per The optimization is achieved through a weighted summation, where α, β, and γ represent the weight coefficients of each component. This design effectively strengthens the guiding role of the key loss during model training, ultimately improving the overall reconstruction accuracy of the generator's rice HSI output. The formulas are as follows:
[0056]
[0057]
[0058]
[0059] The discriminator loss employs a multi-channel binary classification adversarial loss suitable for dense rice canopies, including true spectral loss (L... real ) and reconstruction spectral loss (L rec _spec). These two components correspond to the losses in the true spectrum and the reconstructed spectrum, respectively, and are both calculated using BCEWithLogitsLoss, L Discriminator Designed for L real and L rec The average summation of _spec. This dual-channel output design enables fine-grained feature matching for rice-specific local structures (such as overlapping leaf edges and panicle husk texture), thereby enhancing the discriminator's sensitivity to spectral spatial differences in dense rice canopies.
[0060]
[0061] By applying Restormer GAN The algorithm successfully upscaled and reconstructed the RGB images of each cell into hyperspectral image data with multiple consecutive narrow bands. The reconstructed hyperspectral data has a spectral range of 400nm-850nm and a spectral resolution of 5nm, generating a total of 85 bands. This step compensates for the limitations of the RGB sensor hardware through computation, providing rich and high-quality spectral information for subsequent calculations of vegetation indices that are more sensitive to the physiological state of vegetation.
[0062] Step 3: Multi-source feature extraction and feature library construction 1. Spectral feature extraction (vegetation index): Use the 85-band hyperspectral image data reconstructed in the previous step.
[0063] Using Python programming, a large number of vegetation indices composed of different band combinations were calculated by systematically combining each single band within four key spectral regions: green light (530-590nm), red light (630-680nm), red edge (680-760nm), and near-infrared (760-850nm).
[0064] Correlation analysis was performed on all calculated vegetation indices and the measured LAI (Local Area Index) on the ground. Finally, indices calculated from band combinations with high absolute values of correlation coefficients were added to the final feature library.
[0065] The formulas for calculating some key vegetation indices are as follows: Chlorophyll Index (CIG): ; Green light normalized difference vegetation index (GNDVI): ; Red-edged chlorophyll index CIRE: ; Green light difference vegetation index (GDVI): ; Soil Regulation Vegetation Index (RDVI): ; Red-edge green light difference vegetation index REGDVI: ; REOSAVI (Red Edge Soil Optimization and Vegetation Index Adjustment): ; Red-edged Soil Moderating Vegetation Index (RERDVI): ; Ratio vegetation index SR: ; Optimized vegetation index VIOPT: ; Correlation analysis revealed that several vegetation indices calculated based on reconstructed spectra showed significant correlations with LAI (Local Area Index). For example, the correlation coefficient of the chlorophyll index CIRE reached 0.546, while the correlation coefficient of the optimized vegetation index VIOPT was 0.514. All of these indices were selected for inclusion in the feature library.
[0066] 2. High-level feature extraction: Use segmented cell DSM image data.
[0067] In the community's DSM (Digital Standard Model), bare land areas are identified, and their average elevation is calculated as the ground reference elevation.
[0068] Subtract the baseline elevation from all pixel values in the cell's DSM to obtain the normalized absolute canopy height data.
[0069] Based on absolute canopy height data, a total of 24 height statistics reflecting the vertical structure and complexity of the canopy were calculated as height features. These features include: maximum height H max Mean H mean Standard deviation H sd , skewness H skew Coefficient of variation H cv Normalized value H crr Percentile height feature H p (Where p takes values of 30, 40, ..., 99). Where H... i H is the i-th valid height value. p This represents the height corresponding to the percentile p. The specific calculation formulas for each height feature are as follows: Maximum height H max : ; Mean H mean : ; Standard deviation H sd : ; Skewness H skew : ; Coefficient of variation H cv : ; Normalized value H crr : ; Percentile Height H p : ; In the statistics calculated based on normalized canopy height data, several features are closely related to LAI. The normalized value H... crr The correlation coefficient was 0.467, while the skewness H, which describes the height distribution pattern, was... skew It is negatively correlated with LAI, with a correlation coefficient of -0.361.
[0070] 3. Texture feature extraction: Use the segmented original cell RGB image.
[0071] Using the OpenCV library in Python, the R, G, and B channels of an RGB image are processed separately.
[0072] Calculate the gray-level co-occurrence matrix (GLCM) for each channel.
[0073] Eight types of texture statistics are calculated as texture features based on GLCM, including: mean, variance, homogeneity, contrast, dissimilarity, energy, angular second moment (Asm), and correlation.
[0074] Where P(i,j) represents the probability that a pixel with gray level i and a pixel with gray level j appear simultaneously in the gray-level co-occurrence matrix at a given direction and distance; i and j are gray level indices; μ, μx, and μy are the overall mean, row-direction mean, and column-direction mean of the gray levels, respectively; σx and σy are the standard deviations in the row and column directions, respectively. The specific calculation formulas for each texture feature are as follows: Mean (MEA): ; Variance (VAR): ; Homogeneity (HOM): ; Contrast (CON): ; Dissimilarity (DIS): ; Energy / Second Moment (ENE): ; Angular Second Moment (ASM): ; Correlation (COR): ; With three channels, a total of 24 texture feature values were extracted. Through the above steps, a comprehensive, high-dimensional feature library containing three dimensions—spectrum, height, and texture—was constructed, providing comprehensive information input for subsequent modeling.
[0075] Texture features calculated based on the gray-level co-occurrence matrix also revealed important correlations. The contrast ratio of the red channel (R...) Contrast ) and the contrast of the blue channel (B Contrast The energy of the red light channel (Ri) showed a strong positive correlation with LAI, with correlation coefficients as high as 0.720 and 0.739, respectively; while the energy of the red light channel (Ri) showed a strong positive correlation with LAI, with correlation coefficients as high as 0.720 and 0.739, respectively; Energy The correlation coefficient is negative, with a correlation coefficient of -0.534.
[0076] Step 4: Feature Selection and Model Training The constructed feature library was compared with the measured LAI using Pearson correlation analysis. Features with high correlation coefficients were selected as the final input variables for the model. The optimal feature combination selected was: Vegetation index characteristics: CIG, CIRE, GDVI, RDVI, REGDVI, REOSAVI, RERDVI, SR, VIOPT Height characteristics: Skewness H skew Normalized value H crr Texture features: Red contrast R Contrast Blue light contrast ratio B Contrast Red light second moment R Energy The dataset containing the filtered features is randomly divided into a training set and a validation set in a ratio of approximately 6:1.
[0077] Random Forest (RF) regression algorithm was selected as the machine learning model. The RF model can effectively handle high-dimensional data and nonlinear relationships between features, and has good resistance to overfitting.
[0078] The RF model is trained using the training set data.
[0079] Ten-fold cross-validation is used to systematically tune the model's hyperparameters on the training set to reduce random bias caused by a single data partition and to find the optimal parameter combination. Bayesian optimization can be used for tuning.
[0080] The final determined optimal model parameters are: n_estimators=175; max_depth=20; min_samples_split=9; min_samples_leaf=4; max_samples=0.6831895288913382.
[0081] Finally, a fully trained and optimized rice leaf area index inversion model was obtained.
[0082] Step 5: Model Application and Performance Evaluation Using the optimal parameters determined in the previous step, retrain the final rice leaf area index inversion model on the entire dataset.
[0083] After training, use Python's joblib or pickle library to serialize the trained model and save it as a file (e.g., lai_rf_model.joblib).
[0084] In practical applications, for a new rice area to be tested, it is only necessary to collect its RGB image, repeat steps S2 and S3 to complete feature extraction, and then load the saved model file to quickly obtain its leaf area index prediction value.
[0085] The model's predictive performance was evaluated using a reserved validation set. Evaluation metrics included root mean square error (RMSE), relative prediction bias (RPD), and coefficient of determination (R²). 2 ).
[0086] Figure 4 The regression training and validation results of the model are shown. The predicted values and true values are closely distributed around the 1:1 ideal line, indicating that the model has high prediction accuracy. Specific performance metrics show that on the calibration set (training set), the model's coefficient of determination (R²) is [missing information]. 2 c) The coefficient of determination (R²) is 0.848, and the root mean square error of calibration (RMSEC) is 0.704, indicating that the model has a good fit to the training data. On the validation set, the model's prediction determination coefficient (R²) is... 2 The p-value was 0.751, the root mean square error of prediction (RMSEP) was 0.924, and the relative prediction bias (RPD) was 2.012. An RPD greater than 2.0 indicates that the model has excellent predictive ability and stability, and can reliably predict LAI on new data.
[0087] Example 2 This embodiment provides a rice leaf area index (LAI) inversion device based on a drone, which is a hardware or software implementation of the method described in Embodiment 1. This device can automatically process RGB images acquired by the drone and output high-precision rice leaf area index (LAI) prediction results. The device specifically includes the following functional modules: 1. Data Acquisition Module This module is responsible for receiving and managing all the raw data required by this method. Its specific implementation can be a software module integrating a data input interface and a storage unit. It consists of two main parts: The remote sensing data interface is used to receive RGB image sequences exported from the storage device (such as an SD card) of a drone (such as the DJI Matrice 30T drone mentioned in Example 1). This interface can parse the image's metadata, such as shooting time and GPS coordinates.
[0088] The ground data input interface is used to input and manage ground-based measured data. During the model training phase, operators use this interface to input the measured LAI values (obtained via the specific leaf weight method) for each test cell, as well as the shapefile vector files of the cell boundaries. Data can be entered manually or imported in batches as files (such as CSV or TXT).
[0089] 2. Image Processing Module This module receives raw RGB image sequences from the data acquisition module and processes them into geospatial data products suitable for analysis. It integrates professional photogrammetry and geographic information processing algorithms, with the following specific functions: The image stitching and 3D reconstruction unit calls a software core algorithm similar to Pix4Dmapper or ContextCapture to perform feature point matching and aerial triangulation on the input RGB image sequence, automatically generating a digital orthophoto (DOM) and a digital surface model (DSM) covering the entire study area.
[0090] The image segmentation unit receives the DOM, DSM, and shapefile vector files provided by the data acquisition module. This unit utilizes the geoprocessing capabilities of ArcGIS or QGIS to precisely crop the DOM and DSM based on the shapefiles, generating independent RGB image tiles and DSM elevation data tiles for each experimental plot.
[0091] 3. Feature Generation Module This module is the core computing unit of this device, responsible for extracting multi-dimensional feature information from the processed image data. It consists of three parallel sub-modules: The spectral feature submodule applies a preset Restormer to the RGB image of each cell segmented by the image processing module. GAN The hyperspectral reconstruction model reconstructs the data into an 85-band hyperspectral data cube with a spectral resolution of 5 nm and a range of 400 nm to 850 nm. Subsequently, this submodule automatically calculates a series of vegetation indices, including CIRE, GDVI, and RDVI1, based on a preset formula library, forming a spectral feature set.
[0092] The height feature submodule processes the DSM data for each cell. First, it identifies bare land within the area using an algorithm and calculates its average elevation as a baseline. Then, it normalizes the DSM data to obtain the absolute canopy height. Finally, it calculates the skewness H... skew Normalized value H crr The set of 24 height statistics constitutes the height feature set.
[0093] The texture feature submodule calculates the gray-level co-occurrence matrix (GLCM) for the R, G, and B channels of the RGB image of each cell using an algorithm based on the OpenCV library. Based on the GLCM, this submodule further calculates the red contrast ratio R... Contrast Blue light contrast ratio B Contrast Red light second moment R Energy The 24 texture statistics, including those mentioned above, constitute the texture feature set.
[0094] 4. Model Training Module This module is used to build and optimize LAI inversion models, and it typically runs in the background or offline.
[0095] It receives training dataset features (spectrum, height, texture) extracted by the feature generation module and corresponding measured LAI values provided by the data acquisition module.
[0096] Analyze data using professional data analysis software such as SPSS, and manually filter feature combinations.
[0097] The random forest regression algorithm is used to train the model using the selected features and the measured LAI values. This module integrates tuning strategies such as 10-fold cross-validation and Bayesian optimization (Grid Search) to automatically find the optimal hyperparameter combination (such as n_estimators=175, max_depth=20, etc.).
[0098] Generate a fully trained and optimized final model file that can be used directly for prediction (e.g., the lai_rf_model.joblib file saved in joblib format).
[0099] 5. Exponential Inversion Module This module is the final application of the device, responsible for predicting the LAI (Label Area Index) of new and unknown rice fields to be tested.
[0100] Input the RGB image of the region to be tested.
[0101] The image processing module and feature generation module are invoked to complete the stitching, segmentation, and full feature extraction process of the RGB image of the region to be tested.
[0102] Load the lai_rf_model.joblib model file, which was pre-generated and saved by the model training module, from internal memory.
[0103] The extracted features (spectrum, height, texture) of the region to be tested are used as input and fed into the loaded model for calculation.
[0104] Output the predicted leaf area index (LAI) values for the rice fields to be tested. The output can be a single numerical value (representing the average LAI of the plot) or a spatial distribution map of LAI, which visually shows the changes in LAI in the field.
[0105] Example 3 This embodiment provides an electronic device, including a processor and a memory. The memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, the rice leaf area index inversion method based on UAV of Embodiment 1 is run.
[0106] Example 4 This embodiment provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, it runs the rice leaf area index inversion method based on UAV as described in Embodiment 1.
[0107] Unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of this application. Any specific values in all examples shown and discussed herein should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values. It should be noted that similar reference numerals and letters in the following figures denote similar items; therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0108] Furthermore, it should be noted that the use of terms such as "first" and "second" is merely for ease of distinction, and unless otherwise stated, these terms have no special meaning and therefore should not be construed as limiting the scope of protection of this application.
[0109] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for inverting rice leaf area index based on unmanned aerial vehicles (UAVs), characterized in that, Includes the following steps: Step S1: Obtain the RGB image of the rice canopy to be tested, the training feature set, and the corresponding measured values of the rice leaf area index; Step S2: Process the RGB image of the rice canopy to be tested to generate a digital orthophoto and a digital land model; Step S3: Based on at least one of the RGB image of the rice canopy to be tested, the digital orthophoto, and the digital land model, generate spectral features of the rice canopy, height features reflecting the vertical structure of the rice canopy, and texture features reflecting the spatial distribution uniformity of the rice canopy; Step S4: Using the training feature set and the corresponding measured values of rice leaf area index, train the machine learning model to obtain the rice leaf area index inversion model. Step S5: Input the spectral features, the height features, and the texture features into a pre-trained rice leaf area index inversion model to obtain the predicted leaf area index value of the rice canopy to be tested. Step S3 specifically includes: Step S31: Apply a hyperspectral reconstruction algorithm to the RGB image of the rice canopy to be tested, and reconstruct it into hyperspectral image data with multiple continuous narrow bands. Calculate multiple vegetation indices based on the hyperspectral image data as spectral features. Step S32: Based on the digital land surface model, calculate multiple height statistics as the height features; Step S33: Based on the RGB image, calculate multiple texture statistics as the texture features; The hyperspectral reconstruction algorithm is Restormer GAN The spectral range of the reconstructed hyperspectral image data is 400nm-850nm, and the spectral resolution is 5nm.
2. The method for inverting rice leaf area index based on unmanned aerial vehicles according to claim 1, characterized in that, The Restormer GAN The algorithm includes: A generator based on the Restormer architecture is used, which models the nonlinear correlation between different spectral bands through a multi-head transpose attention mechanism to map RGB images to hyperspectral images. A multi-scale spectral normalization discriminator is adopted, which has a multi-scale receptive field and employs a dual normalization strategy of spectral normalization and instance normalization. The generator and the discriminator are trained adversarially using a customized hybrid loss function, which balances the spectral accuracy and spatial details of the reconstructed image through differential weights.
3. The method for inverting rice leaf area index based on unmanned aerial vehicles according to claim 1, characterized in that, Step S32 specifically includes: Step S321: Based on the digital land model, determine the average elevation of the bare land portion within the area where the rice canopy to be measured is located, and use it as the ground reference elevation; Step S322: Subtract the ground reference elevation from the elevation values of each point in the digital surface model to obtain normalized canopy absolute height data; Step S323: Based on the absolute height data of the canopy, calculate multiple height statistics as the height features; The height statistics include the maximum height H. max Mean H mean Standard deviation H sd Skewness H skew Coefficient of variation H cv Normalized value H crr Percentile height feature H 30 -H 99 .
4. The method for inverting rice leaf area index based on unmanned aerial vehicles according to claim 1, characterized in that, Step S33 specifically includes: Step S331: Calculate the gray-level co-occurrence matrix based on the R, G, and B channels of the RGB image; Step S332: Based on the gray-level co-occurrence matrix, calculate multiple texture statistics as the texture features; The texture statistics include mean, variance, homogeneity, contrast, dissimilarity, energy, angular second moment (ASM), and correlation.
5. The method for inverting rice leaf area index based on unmanned aerial vehicles according to claim 1, characterized in that, Step S4 specifically includes: Step S41: Obtain a training dataset consisting of multiple sets of training RGB images and their corresponding measured values of rice leaf area index; Step S42: Based on each set of training RGB images in the training dataset, process and extract spectral features, height features, and texture features to obtain a training feature set; Step S43: Perform correlation analysis between the spectral features, height features, and texture features in the training feature set and the corresponding measured values of rice leaf area index, and select the features with higher absolute values of correlation coefficients to form the final input features for training. Step S43: Using the input features and the corresponding measured values of rice leaf area index, a random forest model is used as a machine learning model for training to obtain a rice leaf area index inversion model. Among them, during or after training, the hyperparameters of the random forest model are tuned using the ten-fold cross-validation method. The selected input features include: Vegetation index characteristics: CIG, CIRE, GDVI, RDVI, REGDVI, REOSAVI, RERDVI, SR, VIOPT; Height characteristics: Skewness H skew Normalized value H crr ; Texture features: Red contrast R Contrast Blue light contrast ratio B Contrast Red light second moment R Energy .
6. The method for inverting rice leaf area index based on unmanned aerial vehicles according to claim 1, characterized in that, Before step S2, the following is also included: Step S11: Process the digital orthophoto and digital land model, segment the image of each cell according to the ROI, and perform hyperspectral reconstruction on the segmented RGB images to obtain hyperspectral image data, digital land model image data and RGB image data of each cell.
7. A rice leaf area index inversion device based on unmanned aerial vehicles, characterized in that, include: The data acquisition module is used to acquire the RGB image of the rice canopy, the training feature set, and the corresponding measured value of the rice leaf area index. The image processing module is used to process the RGB image of the rice canopy to generate digital orthophotos and digital land models. A feature generation module is used to generate spectral features of the rice canopy, height features reflecting the vertical structure of the rice canopy, and texture features reflecting the spatial uniformity of the rice canopy, based on at least one of the RGB image of the rice canopy to be tested, the digital orthophoto, and the digital land model. Specifically, the feature generation module is used to: apply a hyperspectral reconstruction algorithm to the RGB image of the rice canopy to be tested, reconstructing it into hyperspectral image data with multiple continuous narrow bands; calculate multiple vegetation indices based on the hyperspectral image data as spectral features; wherein the hyperspectral reconstruction algorithm is the RestormerGAN algorithm, the spectral range of the reconstructed hyperspectral image data is 400nm-850nm, and the spectral resolution is 5nm; calculate multiple height statistics based on the digital land model as the height features; and calculate multiple texture statistics based on the RGB image as the texture features. The model training module is used to train a machine learning model using the training feature set and the corresponding measured values of rice leaf area index, and obtain the rice leaf area index inversion model. The index inversion module is used to input the spectral features, the height features, and the texture features into a pre-trained rice leaf area index inversion model to obtain the predicted value of the leaf area index of the rice canopy to be tested.
8. An electronic device, characterized in that, It includes a processor and a memory, the memory storing computer-readable instructions, which, when executed by the processor, run the UAV-based rice leaf area index inversion method as described in any one of claims 1-5.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it runs the rice leaf area index inversion method based on any one of claims 1-5.