Corn leaf area index estimation method and system based on improved CNN

Through the improved convolutional neural network, the Triplet attention mechanism is introduced into the residual network, and the cumbersome and destructive problems of traditional corn leaf area index estimation methods are solved, and the rapid and accurate corn leaf area index prediction is achieved, which meets the high Frequency monitoring requirements.

CN119068040APending Publication Date: 2024-12-03HENAN AGRICULTURAL UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411060010.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-05
Publication Date
2024-12-03

AI Technical Summary

Technical Problem

The traditional leaf area index estimation method is complicated and complicated, requiring multiple sampling and causing damage to crops, which cannot meet the needs of large corn planting range and high monitoring frequency.

Method used

The improved convolutional neural network (CNN) is used to add the Triplet attention mechanism module to the residual network, and the network framework is re-arranged to build a corn breeding period recognition model, and predict the corn leaf area index through training models.

Benefits of technology

It realizes fast, accurate and lightweight corn leaf area index prediction, reduces network complexity, improves calculation speed, reduces crop damage, and meets the needs of high-frequency monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119068040A_ABST
    Figure CN119068040A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of crop prediction, and provides a corn leaf area index estimation method and system based on an improved CNN. In the method, an output layer and a feature extraction module of a residual network are improved respectively, a Triplet attention mechanism module is added in the residual network, the residual network is rearranged, and an obtained corn growth period identification model is trained according to a sample image. And predicting the corn leaf area index according to the corn growth period image. Therefore, on the basis of the residual network, an output structure is improved, a regression task is adapted, a Triplet attention mechanism module is introduced to realize feature fusion and a self-attention mechanism, and the corn growth period identification accuracy is improved; by improving and rearranging the network, the complexity of the network is reduced, the calculation speed of the model is improved, the corn leaf area index can be better predicted, and the method has the characteristics of rapid and accurate identification and light weight.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of crop prediction, and in particular to a corn leaf area index estimation method and system based on an improved CNN. Background Art

[0002] Leaf area index (LAI) is an important agronomic indicator that reflects the size of crop populations. It can measure the size and photosynthetic capacity of crop photosynthetic sources. In agricultural production activities, by measuring and recording changes in leaf area index, the growth status of crops can be obtained, which provides a basis for scientific cultivation management. At the same time, leaf area index is closely related to crop yield calculation. Accurately obtaining leaf area index can improve the accuracy of yield estimation. Therefore, timely and accurate acquisition of leaf area index is crucial in crop growth monitoring.

[0003] Traditional leaf area index estimation requires personnel to use instruments to perform multiple sampling measurements. The operation process is cumbersome and complicated, and the selected samples must be representative, otherwise they cannot reflect the actual growth conditions. At the same time, the sampling operation will damage the crops. However, corn grows fast, and there are few agricultural personnel with professional knowledge and measuring instruments, which cannot meet the current requirements of large corn planting areas and high monitoring frequencies.

[0004] Therefore, there is an urgent need to provide a technical solution to the above-mentioned deficiencies in the prior art. Summary of the invention

[0005] The purpose of this application is to provide a corn leaf area index estimation method and system based on improved CNN to solve or alleviate the problems existing in the above-mentioned prior art.

[0006] In order to achieve the above objectives, this application provides the following technical solutions:

[0007] The present application provides a corn leaf area index estimation method based on improved CNN, comprising: step S101, respectively improving the output layer and feature extraction module of the residual network in the convolutional neural network, adding a Triplet attention mechanism module to the residual network, and re-arranging the network framework of the residual network to obtain a corn growth period recognition model; step S102, training the corn growth period recognition model according to sample images of corn at different growth periods obtained; step S103, predicting the corn leaf area index based on the trained corn growth period recognition model and the acquired corn growth period images.

[0008] Preferably, in step S101, the output layer of the residual network in the convolutional neural network is improved, including: changing the single-layer linear full connection in the output layer of the residual network to a three-layer linear connection, and using ReLU as an activation function between linear layers.

[0009] Preferably, in step S101, the feature extraction module of the residual network in the convolutional neural network is improved, including: changing the 1×1 convolution layer at the head of the residual network to a 7×7 convolution layer.

[0010] Preferably, in step S101, the feature extraction module of the residual network in the convolutional neural network is improved, and also includes: changing the 1×1 convolution layer at the head of the residual network to a 7×7 convolution layer, and connecting a 1×1 convolution layer in parallel to the input of the residual network, and performing an Add operation with the output of the 1×1 convolution layer at the tail of the residual network.

[0011] Preferably, in step S101, the Triplet attention mechanism module includes a multi-head self-attention mechanism module, a multi-layer perceptron module and a shifted multi-head self-attention mechanism module; the multi-head self-attention mechanism module, the multi-layer perceptron module and the shifted multi-head self-attention mechanism module are connected in parallel and have the same input features; and the output features of the multi-head self-attention mechanism module, the multi-layer perceptron module and the shifted multi-head self-attention mechanism module are pooled;

[0012] The multi-head self-attention mechanism module includes a channel pooling layer and a 7×7 convolutional layer connected in sequence, and performs an Add operation on the input features and the output of the 7×7 convolutional layer;

[0013] In the multi-layer perceptron module, the input features are rotated along the width and channel dimensions in turn by the permute function, the dimensions of the rotated features are adjusted from C dimensions to two dimensions by the Z-Pool, a convolution operation is performed on the features adjusted to two dimensions by a 7×7 convolution layer, an Add operation is performed on the input features and the output of the 7×7 convolution layer, and the output of the Add operation is restored and rotated by the permute function;

[0014] In the offset multi-head self-attention mechanism module, the input features are rotated along the height and channel dimensions in turn through the permute function, the dimensions of the rotated features are adjusted from C dimensions to two dimensions through Z-Pool, a 7×7 convolutional layer is used to perform a convolution operation on the features adjusted to two dimensions, and after the Add operation is performed on the input features and the output of the 7×7 convolutional layer, the output of the Add operation is restored and rotated through the permute function.

[0015] Preferably, in step S101, the network framework of the residual network is re-arranged, including: connecting a fully connected module to the input layer of the residual network, and fusing the output of the fully connected module with the output of the Triplet attention mechanism module in the pooling layer of the residual network; wherein the fully connected module is connected in parallel to a 7×7 convolutional layer connected to the input layer of the residual network, including two fully connected layers connected in series.

[0016] Preferably, in step S102, sample images of corn at different growth stages are obtained, and expansion and saturation enhancement processing are performed; the sample images after expansion and saturation enhancement processing are used to train the corn growth period recognition model, and in each training iteration of the corn growth period recognition model, the images in the training data set of the sample images are subjected to saturation enhancement processing.

[0017] Preferably, the method further comprises: improving the loss function of the corn growth period identification model; wherein the loss function of the corn growth period identification model is:

[0018]

[0019] Wherein, x is the predicted value output by the corn growth period identification model.

[0020] Preferably, it also includes: changing the input end of the residual network, introducing One-hot encoding into the residual network, encoding the growth period information of corn, and then putting it into the last average pooling layer of the residual network, and using a linear layer to fuse the encoded growth period information with the input sample image.

[0021] The embodiment of the present application also provides a corn leaf area index estimation system based on an improved CNN, comprising: a network improvement unit, configured to improve the output layer of the residual network in the convolutional neural network, add a Triplet attention mechanism module to the residual network, and re-arrange the network framework of the residual network to obtain a corn growth period recognition model; a model training unit, configured to train the corn growth period recognition model according to sample images obtained in different growth periods; an index prediction unit, configured to predict the corn leaf area index based on the trained corn growth period recognition model and the acquired corn growth period images.

[0022] Beneficial effects:

[0023] In the corn leaf area index estimation method based on improved CNN provided in the embodiment of the present application, the output layer and feature extraction module of the residual network in the convolutional neural network are improved respectively, a Triplet attention mechanism module is added to the residual network, and the network framework of the residual network is re-arranged to obtain a corn growth period recognition model, and the corn growth period recognition model is trained according to the sample images of the corn growth period obtained; finally, based on the trained corn growth period recognition model, the corn leaf area index is predicted according to the obtained corn growth period images.

[0024] Therefore, on the basis of the residual network of the convolutional neural network, the output structure is improved for adapting regression tasks, and the Triplet attention mechanism module is introduced to realize feature fusion and self-attention mechanism to improve the accuracy of corn growth period recognition; by improving and re-arranging the convolutional neural network, not only the network complexity is reduced, but also the calculation speed of the model is improved, which can better predict the corn leaf area index, and has the characteristics of fast, accurate and lightweight recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. Among them:

[0026] Figure 1 A schematic diagram of a flow chart of a corn leaf area index estimation method based on an improved CNN according to some embodiments of the present application;

[0027] Figure 2 A schematic diagram of an improved output layer of a residual network provided according to some embodiments of the present application;

[0028] Figure 3 A schematic diagram of a structure of an improved feature extraction module of a residual network provided according to some embodiments of the present application;

[0029] Figure 4 Another structural schematic diagram of an improved feature extraction module of a residual network provided in some embodiments of the present application;

[0030] Figure 5 A schematic diagram of the structure of a Triplet attention mechanism module provided according to some embodiments of the present application;

[0031] Figure 6 A schematic diagram of the structure of a corn growth period identification model provided according to some embodiments of the present application;

[0032] Figure 7A schematic diagram of the distribution of predicted values ​​and true values ​​of the original ResNet model provided according to some embodiments of the present application;

[0033] Figure 8 A schematic diagram of the distribution of predicted values ​​and true values ​​of the improved ResNet-Reform model provided according to some embodiments of the present application;

[0034] Fig. 9 A schematic diagram of the distribution of predicted values ​​and true values ​​of the ResNet-Attention model after the attention mechanism is introduced according to some embodiments of the present application;

[0035] Fig.10 A schematic diagram of the change of MAE when training a model using different loss functions according to some embodiments of the present application.

[0036] Fig.11 This is a schematic diagram of the structure of a corn leaf area index estimation system based on an improved CNN according to some embodiments of the present application. DETAILED DESCRIPTION

[0037] The present application will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments. Each example is provided by way of explanation of the present application and does not limit the present application. In fact, it will be clear to those skilled in the art that modifications and variations may be made in the present application without departing from the scope or spirit of the present application. For example, a feature shown or described as a part of an embodiment may be used in another embodiment to produce yet another embodiment. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the embodiments of the present invention should belong to the scope of protection of the embodiments of the present invention.

[0038] The background of field images in real environments is relatively complex. The current use of traditional machine learning for leaf area index estimation often requires the use of remote sensing and drone platforms to obtain spectral data of images, then perform feature extraction and feature selection on the images, and finally use machine learning methods to establish the relationship between vegetation features and LAI to complete LAI estimation. However, the current machine learning model relies on complex feature extraction engineering, and still requires a lot of feature selection and feature extraction, and the recognition accuracy cannot meet the needs of real-time corn LAI estimation.

[0039] Based on this, this application proposes a corn leaf area index estimation method based on improved CNN. Resnet50 is used as the benchmark model, the network output layer is improved, the Triplet module is introduced into the model, feature fusion is strengthened and the self-attention mechanism is implemented to improve the model accuracy; the network framework of the residual network (ResNet) is rearranged, and a lightweight model LAINet is proposed. At the same time, the loss function is improved during the training process to make the model converge quickly. Finally, the model is applied to corn digital image recognition to realize the use of images for leaf area index estimation, in order to replace some manual observation tasks and provide effective support for crop phenological characteristics monitoring.

[0040] like Figures 1 to 6 As shown, the corn leaf area index estimation method based on improved CNN includes:

[0041] Step S101, improving the output layer of the residual network in the convolutional neural network, adding a Triplet attention mechanism module to the residual network, and re-arranging the network framework of the residual network to obtain a corn growth period recognition model.

[0042] Convolutional Neural Network (CNN) is a neural network framework in deep learning. It extracts local features by sliding convolution kernels on input data, so that the network can automatically learn features at different levels, from low-level features such as edges and lines to high-level features such as object shapes and textures. In other words, the convolution layer of CNN performs local perception convolution operations on the input data through scientific filters (weight matrices), automatically capturing low-level visual features such as edges, textures, and colors, and gradually extracting more advanced and abstract feature representations as the network depth increases. CNN also includes redization layers to reduce data latitude, reduce the amount of calculation, and maintain spatial invariance, as well as fully connected layers to map the extracted features to the output space of classification or regression tasks.

[0043] The residual block of the residual network (ResNet) contains at least two convolutional layers, and the input skips these convolutional layers through skip connections and is directly added to the output of the block, so that the network can focus on learning the residual mapping between input and output, that is, the difference between output and output.

[0044] In this application, in order to solve the problems of complex corn background images in field environments and low recognition accuracy, large model size, and low processing efficiency caused by large image size, the neural network structure was improved in three aspects: lightweight, feature fusion, and network structure adjustment.

[0045] In CNN, the original ResNet network is used for classification tasks, while estimating LAI is a regression task. Therefore, the output layer of the ResNet network of CNN is changed, the original single-layer linear full connection is changed to a 3-layer linear connection, and ReLU is used as the activation function in the linear layer.

[0046] At the same time, the ResNet network is built on the ImageNet 1K dataset, and the resolution of the input image is 224 pixels × 224 pixels, while the original resolution of the corn dataset is much higher than the resolution of the ImageNet public dataset. In order to better learn the features of high-resolution corn images, the ResNet network feature extraction module ResNet Block (residual block) is improved. Specifically, the 1×1 convolution layer at the head of the ResNet network is changed to a 7×7 convolution layer. Alternatively, the 1×1 convolution layer at the head of the ResNet network is changed to a 7×7 convolution layer, and a 1×1 convolution layer is connected in parallel to the input of the ResNet network, and an Add operation is performed with the output of the 1×1 convolution layer at the tail of the ResNet network. These two improved ResNet Block modules are used interchangeably to enhance feature fusion between network layers.

[0047] The residual network of CNN lacks the implementation of attention mechanism. The Triplet attention mechanism module is added to the improved ResNet network structure to realize the fusion of multi-scale features. After the Triplet attention mechanism module is connected to the 4-layer convolution, the model can fuse multi-scale features and realize the self-attention mechanism, thereby improving the model accuracy.

[0048] The Triplet attention mechanism module includes a multi-head self-attention mechanism module, a multi-layer perceptron module and a shifted multi-head self-attention mechanism module. The multi-head self-attention mechanism module, the multi-layer perceptron module and the shifted multi-head self-attention mechanism module are connected in parallel and have the same input features, and the output features of the multi-head self-attention mechanism module, the multi-layer perceptron module and the shifted multi-head self-attention mechanism module are pooled.

[0049] The multi-head self-attention mechanism module includes a channel pooling layer and a 7×7 convolutional layer connected in sequence, and performs an Add operation on the input features and the output of the 7×7 convolutional layer. In the multi-layer perceptron module, the input features are rotated along the width and channel dimensions in sequence through the permute function, the dimension of the rotated features is adjusted from C dimensions to two dimensions through Z-Pool, and the features that are resized to two dimensions are convolved through a 7×7 convolutional layer. After the input features and the output of the 7×7 convolutional layer are Added, the output of the Add operation is restored and rotated through the permute function. Here, the C-dimensional Tensor is reduced to two dimensions through the Z-Pool layer, and the average pooling features and the maximum pooling features on the C dimension are connected, so that the layer can retain the rich representation of the actual tensor while reducing the depth to further make it computationally lighter.

[0050] In the Triplet attention mechanism module, three branch structures (multi-head self-attention mechanism module, multi-layer perceptron module and offset multi-head self-attention mechanism module) are used to capture cross-dimensional interactions and calculate attention weights. For the input tensor, the dependency between dimensions is established through rotation operations and residual transformations. Compared with the SE module and CBAM module, the Triplet attention mechanism module can encode inter-channel and spatial information with only a small number of parameters, and has the characteristics of high performance and light weight.

[0051] After adding the Triplet attention mechanism module to the residual network, the network framework of the residual network is reorganized. Specifically, a fully connected module is connected to the input layer of the residual network, and the output of the fully connected module is fused with the output of the Triplet attention mechanism module in the pooling layer (AvgPool) of the residual network. The fully connected module includes two fully connected layers (Linear) connected in series; and a 7×7 convolutional layer connected to the fully connected module and the input layer of the residual network is connected in parallel.

[0052] Corn crops grow fast and their plant height changes significantly. In the trumpet stage, the leaves of corn plants overlap more, and due to the image shooting angle, some leaves are blocked, resulting in small features, which leads to a certain deviation between the effective leaf area index and the true leaf area index. The input end of the ResNet model with improved network structure is changed so that it can accept growth period information and image data at the same time. The growth period information is transmitted to the network model using One-hot encoding.

[0053] In order to introduce One-hot coding into the network, the structure of the network is changed. The network input data contains image data and One-hot coded growth period data, which are split at input. The growth period coding information is placed after the final average pooling layer of the network and fused using a linear layer.

[0054] Commonly used loss functions for regression tasks are L1Loss, L2Loss, and SmoothL1Loss, where L1Loss is the mean absolute error (MAE) loss and L2Loss is the mean square error (MSE) loss. L1Loss is more robust than L2Loss. L1 is not very sensitive to outliers, and its derivative to the loss value is a constant. In the later stages of training, when the loss value is small, if the learning rate remains unchanged, the loss function will fluctuate around the stable value, and it will be difficult to converge to a higher accuracy. L2Loss will have an amplification effect on outliers. Because L2 squares the error, when the error is greater than 1, the error will be amplified a lot. The error of the model using L2Loss will be more sensitive to outliers than the model using L1Loss. If a sample is an outlier, the model needs to be adjusted to accommodate a single outlier, which will sacrifice many other normal samples. When the gradient descent method is used to solve the problem, the gradient is very large, and L2Loss may also cause a gradient explosion.

[0055] Therefore, in this application, the loss function of the corn growth period identification model is improved. Specifically, the loss function of the corn growth period identification model is:

[0056]

[0057] Where x is the predicted value output by the corn growth period identification model.

[0058] In the task of estimating corn LAI, the maximum and minimum LAI values ​​are generally no more than 5, and the difference between the predicted value and the true value needs to be controlled within a reasonable range. For this reason, the function selected when the error is greater than 5 will further amplify the overall error, so as to facilitate the adjustment of model parameters and reduce the extreme case of excessive LAI value.

[0059] Step S102: training a corn growth period recognition model based on the acquired sample images of corn at different growth periods.

[0060] In this application, sample images of corn at different growth stages (including jointing stage, small bell mouth stage, and large bell mouth stage) are obtained and expanded and saturation enhanced. Then, the growth stage sample images after expansion and saturation enhancement are used to train the corn growth stage recognition model, and in each training iteration of the corn growth stage recognition model, the images in the training data set of the sample images are subjected to saturation enhancement.

[0061] Specifically, corn canopy images are collected and annotated with growth period information to construct a corn growth period dataset (a collection of sample images). The image size in the corn growth period dataset is adjusted to 448 pixels × 448 pixels and divided into a training dataset and a validation dataset in a ratio of 7:3.

[0062] After the training data set and the validation data set are divided, image enhancement is performed. The purpose of enhancement after the data set is to avoid overlap between the original images of the training data set and the validation data set, making the validation data set cleaner. At the same time, in order to improve the generalization of the model, random saturation enhancement and random contrast enhancement are performed on the images in the data reader to ensure that the images in each round of training are not exactly the same.

[0063] For the images in the training data set, in order to further improve the robustness of the model, the images are enhanced, including data enhancement techniques such as random flipping, random scaling, and random noise to increase the diversity of the data set and improve the generalization ability of the model, so as to promote better simulation of changes and uncertainties in actual scenes during the training process. In each training iteration, the enhancement function will enhance the input image to increase data diversity and thus improve the generalization ability of the model.

[0064] Step S103: Based on the trained corn growth stage recognition model and the acquired corn growth stage images, the corn leaf area index is predicted.

[0065] The corn growth period recognition model is trained to predict the corn leaf area index, and the accuracy of the model is measured by accuracy, precision, recall and F1 score. Specifically, according to the formula:

[0066]

[0067] Among them, TP means that the sample predicted to be positive is actually a positive sample; TN means that the sample predicted to be negative is actually a negative sample; FP means that the sample predicted to be positive is actually a negative sample; FN means that the sample predicted to be negative is actually a positive sample.

[0068] The LAI estimation task belongs to the regression task. In this application, the regression task evaluation indicators: mean absolute error, mean square error, root mean square error and determination coefficient are used as the evaluation indicators of LAI estimation. Among them, the mean absolute error (MAE) is the average of the absolute difference between the predicted value and the true value, which is used to measure the average error between the predicted value and the true value; the mean square error (MSE) is the average of the square of the difference between the predicted value and the true value, which is used to measure the average variance between the predicted value and the true value; the root mean square error (RMSE) is the square root of the MSE, which is used to measure the standard deviation of the average error between the predicted value and the true value; the coefficient of determination (R2) is used to measure the explanatory power of the prediction model for the target variable, that is, the variance ratio between the predicted value and the true value. Its value range is from 0 to 1. The closer it is to 1, the better the prediction model's ability to explain the target variable.

[0069] Specifically, according to the formula:

[0070]

[0071] Determine the evaluation index for LAI estimation. Where n is the total number of images involved in calculating the evaluation index, y i is the actual value, is the predicted value (i.e., LAI estimated value), is the mean value of the dependent variable.

[0072] In a specific example, the improved ResNet model and the original ResNet model were trained on the training set of the corn LAI dataset, and then tested on the validation set of the corn LAI dataset. The predicted LAI value on the validation set was compared with the true value. Figure 7 , Figure 8 As shown in the figure, the distribution of the predicted values ​​and actual values ​​of the original ResNet model is mostly not close to the blue diagonal line, indicating that the model fit is poor. The improved ResNet model (ResNet-Reform) has been greatly improved compared to the original model, and the distribution of most predicted values ​​and actual values ​​is closer to the blue diagonal line. To further analyze the improvement brought by the model improvement, various regression evaluation indicators are calculated based on the predicted values ​​and the true values, as shown in Table 1.

[0073] Table 1 Accuracy comparison between improved ResNet and original ResNet

[0074]

[0075] ResNet R before improvement 2 The R of the improved ResNet model (ResNet-Reform) is only 0.22, which is almost incapable of completing the LAI estimation task. 2 It was increased to 0.54, and other evaluation indicators were also better than the original model. This is because the original ResNet is used for classification tasks, and its output fully connected layer is also designed for classification tasks. Even if the output layer is set to 1, it can give the model a certain regression analysis ability, but because the single linear layer directly maps all features to 1, a lot of information is lost, and the various features of the image cannot be effectively utilized. After adding an additional linear layer, the connection between image features and LAI can be captured. At the same time, the three-layer linear layer has both linear analysis capabilities and certain nonlinear analysis capabilities, which can map some hidden nonlinear relationships, and ultimately improve the model's fitting ability.

[0076] In this application, after adding the attention mechanism module, the various errors of the model (ResNet-Attention) have been effectively reduced. The changes in the accuracy of the model after the introduction of the attention mechanism are shown in Table 2.

[0077] Table 2 Changes in model accuracy after the introduction of the attention mechanism

[0078]

[0079] It can be seen that after the introduction of the attention mechanism, the MSE is reduced to 0.15, the MAE is reduced to 0.24, and the determination coefficient reaches 0.57. All evaluation indicators have been improved to a certain extent. After the introduction of the attention mechanism, the specific distribution of the predicted value and the true value is as follows Fig. 9 As shown, compared with before the introduction of the reproductive period, the accuracy of some estimates has been greatly improved, and the distribution is closer to the diagonal line.

[0080] The corn growth period data is encoded using One-hot encoding. Compared with not using the growth period, the R of the model (ResNet-Stage) is 2 It was increased by 0.15. The introduction of growth period information can effectively improve the evaluation indicators of the model, as shown in Table 3.

[0081] Table 3 Changes in model accuracy after the introduction of growth period data

[0082]

[0083] It can be seen that the ResNet-Stage model after introducing the growth period data can achieve better results than the original model ResNet. The MAE value is reduced from 0.23 to 0.19, and the R2 is increased from 0.54 to 0.69.

[0084] Compared with the loss functions L1Loss, L2Loss, and SmoothL1Loss, the average absolute error of ResNet (ResNet-Reform) with an improved network structure on the training set is used to verify the loss function of this application, such as Fig.10 As shown, it can be seen that the convergence speed of the MAE value after the improved loss function is faster than that of L1Loss, L2Loss and SmoothL1Loss. At the same time, compared with L1Loss and SmoothL1Loss, it avoids the sudden increase of MAE during training. The training results of different loss functions are shown in Table 4.

[0085] Table 4 Effects of different loss functions on the model

[0086]

[0087] It can be seen that the difference in RMSE using different loss functions is almost insignificant, and the evaluation indicator with the largest change is MAE. Using LAILoss as the loss function, the MAE value is 0.19, which is 0.03, 0.04, and 0.04 lower than L1Loss, L2Loss, and SmoothL1, respectively. MAE reflects the mean absolute error. Fig.10 It can be concluded that the use of the LAI loss function can suppress the maximum results produced at the beginning, speed up the convergence of the network, and effectively reduce the mean absolute error.

[0088] In order to explore the effects of improving network structure, adding attention mechanism, integrating growth period information and improving loss function on the performance of the final model, an ablation test was conducted on the corn LAI dataset. Adjusting the structure is a basic improvement, and other improvements are made on the basis of adjusting the structure. The results are shown in Table 5.

[0089] Table 5 Ablation test results

[0090]

[0091]

[0092] As can be seen from Table 5, for the ResNet-Reform model R 2 The most influential factors are the integration of growth period information, the improvement of loss function and the addition of attention mechanism. Compared with ResNet-Reform, R 2The results were improved by 0.15, 0.05 and 0.03 respectively. The reason why the integration of growth period information has the greatest improvement on the model accuracy is that the relationship between images and LAI in different growth periods is different. Introducing growth period information through One-hot encoding can fit the characteristic changes between images of different growth periods and leaf area index to a certain extent.

[0093] The LAI estimation results at different growth stages are shown in Table 6. The fitting degree is the highest in the small bell mouth period, with an RMSE of only 0.10 and R 2 The estimation accuracy is the lowest during the large bell mouth period, with MSE, MAE, and RMSE being 0.11, 0.19, and 0.34, respectively. 2 It is only 0.64. Table 6 is as follows:

[0094] Table 6 Evaluation indicators of models under different growth periods

[0095]

[0096] Through analysis, it can be seen that after improving the output layer in the ResNet network, the accuracy of LAI estimation is greatly improved. Compared with before the improvement, its R 2 From 0.22 to 0.58. After improving the network output layer and adding the attention mechanism, its R 2 After integrating the growth period information, its R2 increased from 0.54 to 0.58. After improving the loss function, its R2 increased from 0.22 to 0.58.

[0097] Comprehensively comparing various improvements, adding attention mechanism, integrating growth period information, and improving loss function have improved the original R 2 The improvement was 0.03, 0.15, and 0.05, among which the integration of growth period information brought the greatest improvement. 2 Directly increased from 0.54 to 0.69.

[0098] like Fig.11 As shown, the present application also provides a corn leaf area index estimation system based on an improved CNN, comprising:

[0099] The network improvement unit 1101 is configured to improve the output layer of the residual network in the convolutional neural network, add a Triplet attention mechanism module to the residual network, and rearrange the network framework of the residual network to obtain a corn growth period recognition model;

[0100] The model training unit 1102 is configured to train a corn growth period recognition model based on sample images of different growth periods obtained;

[0101] The index prediction unit 1103 is configured to predict the corn leaf area index based on the trained corn growth period recognition model and the acquired corn growth period images.

[0102] The present application implements the provided corn leaf area index estimation system based on improved CNN, which can realize the steps and processes of the corn leaf area index estimation method based on improved CNN in any of the above-mentioned embodiments and achieve the same technical effects, which will not be described one by one here.

[0103] In the description of the present invention, it is to be understood that the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" etc. mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0104] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A corn leaf area index estimation method based on improved CNN, characterized in that: include: Step S101, respectively improving the output layer and feature extraction module of the residual network in the convolutional neural network, adding a Triplet attention mechanism module to the residual network, and rearranging the network framework of the residual network to obtain a corn growth period recognition model; Step S102: training the corn growth period recognition model according to the acquired sample images of corn at different growth periods; Step S103: Based on the trained corn growth stage recognition model, the corn leaf area index is predicted according to the acquired corn growth stage images.

2. The corn leaf area index estimation method based on improved CNN according to claim 1, characterized in that: In step S101, the improving the output layer of the residual network in the convolutional neural network includes: The single-layer linear full connection in the output layer of the residual network is changed to a three-layer linear connection, and ReLU is used as the activation function between the linear layers.

3. The corn leaf area index estimation method based on improved CNN according to claim 1, characterized in that: In step S101, the feature extraction module of the residual network in the convolutional neural network is improved, including: The 1×1 convolution layer in the head of the residual network is changed to a 7×7 convolution layer.

4. The corn leaf area index estimation method based on improved CNN according to claim 1, characterized in that: In step S101, the feature extraction module of the residual network in the convolutional neural network is improved, and further includes: The 1×1 convolution layer at the head of the residual network is changed to a 7×7 convolution layer, and a 1×1 convolution layer is connected in parallel to the input of the residual network, and an Add operation is performed with the output of the 1×1 convolution layer at the tail of the residual network.

5. The corn leaf area index estimation method based on improved CNN according to claim 1, characterized in that: In step S101, the Triplet attention mechanism module includes a multi-head self-attention mechanism module, a multi-layer perceptron module and a shifted multi-head self-attention mechanism module; The multi-head self-attention mechanism module, the multi-layer perceptron module, and the offset multi-head self-attention mechanism module are connected in parallel and have the same input features; and the output features of the multi-head self-attention mechanism module, the multi-layer perceptron module, and the offset multi-head self-attention mechanism module are pooled; The multi-head self-attention mechanism module includes a channel pooling layer and a 7×7 convolutional layer connected in sequence, and performs an Add operation on the input features and the output of the 7×7 convolutional layer; In the multi-layer perceptron module, the input features are rotated along the width and channel dimensions in turn by the permute function, the dimensions of the rotated features are adjusted from C dimensions to two dimensions by the Z-Pool, a convolution operation is performed on the features adjusted to two dimensions by a 7×7 convolution layer, an Add operation is performed on the input features and the output of the 7×7 convolution layer, and the output of the Add operation is restored and rotated by the permute function; In the offset multi-head self-attention mechanism module, the input features are rotated along the height and channel dimensions in turn through the permute function, the dimensions of the rotated features are adjusted from C dimensions to two dimensions through Z-Pool, a 7×7 convolutional layer is used to perform a convolution operation on the features adjusted to two dimensions, and after the Add operation is performed on the input features and the output of the 7×7 convolutional layer, the output of the Add operation is restored and rotated through the permute function.

6. The corn leaf area index estimation method based on improved CNN according to claim 1, characterized in that: In step S101, the network framework of the residual network is rearranged, including: A fully connected module is connected to the input layer of the residual network, and the output of the fully connected module is fused with the output of the Triplet attention mechanism module in the pooling layer of the residual network; wherein the fully connected module is connected in parallel with a 7×7 convolutional layer connected to the input layer of the residual network, including two fully connected layers in series.

7. The corn leaf area index estimation method based on improved CNN according to claim 1, characterized in that: In step S102, Obtain sample images of corn at different growth stages, and perform expansion and saturation enhancement processing; The sample images after expansion and saturation enhancement are used to train the corn growth period recognition model, and in each training iteration of the corn growth period recognition model, the images in the training data set of the sample images are subjected to saturation enhancement.

8. The corn leaf area index estimation method based on improved CNN according to claim 1, characterized in that: Also includes: Improving the loss function of the corn growth period identification model; Among them, the loss function of the corn growth period identification model is: Wherein, x is the predicted value output by the corn growth period identification model.

9. The corn leaf area index estimation method based on improved CNN according to claim 1, characterized in that: Also includes: The input end of the residual network is changed, and One-hot encoding is introduced into the residual network to encode the growth period information of corn, and then put it into the last average pooling layer of the residual network, and a linear layer is used to fuse the encoded growth period information with the input sample image.

10. A corn leaf area index estimation system based on improved CNN, characterized in that: include: A network improvement unit is configured to improve the output layer of the residual network in the convolutional neural network, add a Triplet attention mechanism module to the residual network, and rearrange the network framework of the residual network to obtain a corn growth period recognition model; A model training unit, configured to train the corn growth period recognition model according to the acquired sample images of different growth periods; The index prediction unit is configured to predict the corn leaf area index based on the trained corn growth period recognition model and the acquired corn growth period images.

Citation Information

Cited By

  • Leaf area index estimation method and system based on dynamic feature weighting

    CN120510204A