A plant root recognition and measurement analysis method and device based on deep learning

By using an improved U-Net model and a multi-scale attention mechanism, the problems of robustness in plant root image segmentation and multi-parameter measurement were solved, achieving efficient and accurate root identification and measurement analysis, and improving automation and segmentation accuracy.

CN121033555BActive Publication Date: 2026-03-31BEIJING NORMAL UNIVERSITY
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-29
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing technologies have poor robustness in plant root image segmentation under complex environments, make it difficult to achieve multi-parameter collaborative measurement, have insufficient automation, and traditional methods are inefficient and require a lot of manual intervention.

Method used

An improved U-Net model is adopted, which introduces a convolutional attention module and a lightweight edge assist head. Combined with a multi-scale attention mechanism and an adaptive loss function, root system identification and measurement are performed. Skip connections and skeletonization are used to improve segmentation accuracy and efficiency.

Benefits of technology

It improves root segmentation performance in complex contexts, achieves sub-pixel-level topology analysis, saves manpower, and enhances the accuracy and automation of root morphology parameter measurement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121033555B_ABST
    Figure CN121033555B_ABST
Patent Text Reader

Abstract

The application discloses a kind of plant root system identification and measurement analysis method based on deep learning, obtains root system picture;Root system identification model is constructed, and root system identification model includes U-Net model, convolution attention module is connected in series in the jump connection, and the feature map output in the last stage of decoder up-sampling stage is respectively input to output layer and light edge auxiliary head;Root system total length, root system projection area, average root diameter, root system total surface area and root system total volume are calculated.The application shows excellent segmentation performance in complex background.Convolution attention module is connected in series in the jump connection in encoder-decoder, effectively solve the information loss problem in the identification of root system microstructure in traditional segmentation method.The synergistic effect of channel attention and spatial attention enables the model to adaptively focus on the key areas of the root system, significantly suppressing the influence of soil particles, water reflection and other interference factors.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of ecological information extraction and computer vision technology, and specifically relates to a plant root system recognition and measurement analysis method and device based on deep learning. It is suitable for automatic segmentation and recognition of plant root system images, morphological parameter measurement and analysis, and provides efficient and accurate technical support for plant root system research. BACKGROUND

[0002] Plant root system is the core functional organ for water and nutrient absorption during crop growth and development. Its morphological structure characteristics (including length, diameter, surface area, volume and topological configuration, etc.) have significant correlation with crop physiological metabolism, stress resistance and final yield formation. Traditional root system research methods mainly rely on manual sampling combined with two-dimensional scanning or three-dimensional reconstruction technology, and morphological parameters are extracted through professional analysis software. This method has the following inherent defects. First, the sample preparation process is tedious and destructive; second, the measurement accuracy is significantly affected by the subjective judgment of the operator; and more importantly, when facing large-scale field trials or high-throughput phenotyping demands, the efficiency bottleneck of the traditional method is particularly prominent. With the development of computer vision technology and the breakthrough of artificial intelligence algorithms, image processing-based root system phenotyping technology has become an important research direction in the field of plant phenomics and precision ecological monitoring.

[0003] At the prior art level, the root image analysis method can be roughly divided into two kinds based on traditional image processing method and deep learning method. The first kind of method mainly adopts threshold segmentation, edge detection and region growing and other classic algorithms. Although these methods have low computational complexity, their performance is seriously dependent on the image acquisition quality. When facing complex scenes such as soil particle interference, root overlap and uneven illumination, the segmentation accuracy will decrease significantly. The second kind of method is represented by deep learning models such as fully convolutional network (FCN), U-Net and its variants, which have stronger feature representation ability through multi-level feature extraction and end-to-end training. In particular, the U-Net model with encoder-decoder structure can effectively preserve the spatial detail information of the root system through the skip connection mechanism, and has good segmentation performance. However, there are still several key problems to be solved in the prior art: (1) Segmentation robustness in complex environment. When the root image has low contrast (such as hydroponic roots and culture solution), high noise (such as organic matter interference in soil culture samples) or local occlusion, the segmentation accuracy of existing algorithms will decrease. Especially in the detection of fine roots, the false detection rate and the missed detection rate are generally high. (2) The lack of multi-parameter collaborative measurement system. The current mainstream analysis method focuses on the measurement of single-dimensional parameters (such as total root length or projected area), and lacks the quantitative analysis ability of key phenotype parameters such as three-dimensional topological structure (such as volume) and spatial distribution characteristics (such as root position) of root system. This limitation seriously restricts the in-depth study of the functional and environmental interaction mechanism of root system. (3) Insufficient automation: the existing solutions still need manual intervention in preprocessing and post-processing. SUMMARY

[0004] The purpose of the present application is to solve the above problems existing in the prior art, and to provide a plant root recognition and measurement analysis method and device based on deep learning, which realizes a complete plant root intelligent recognition and measurement analysis method. The purpose is to solve the problems of difficult efficient extraction of root characteristics, separation of segmentation and measurement, adaptive parameter adjustment of background interference, and low recognition accuracy in the root recognition process.

[0005] To achieve the above purpose, the technical scheme of the present application is as follows:

[0006] A plant root recognition and measurement analysis method based on deep learning, comprising the following steps:

[0007] Step 1, obtaining a root image, generating a training set, a validation set and a test set based on the root image;

[0008] Step 2, constructing a root system identification model, the root system identification model comprising a U-Net model, the U-Net model comprising an encoder, a decoder and an output layer, the encoder and the decoder comprising the same number of down-sampling stages and up-sampling stages, the up-sampling stages and the down-sampling stages being connected by a skip connection, the skip connection being concatenated with a convolutional attention module, the convolutional attention module comprising a channel attention sub-module and a spatial attention sub-module connected in series, the feature map output by the last up-sampling stage of the decoder being input to the output layer and a light edge auxiliary head respectively, and constructing a loss function , training the root system identification model based on the training set;

[0009] Step 3, inputting the root system picture to be identified into the root system identification model trained above to obtain a root system identification picture.

[0010] As described above, the channel attention sub-module takes the output feature map of the down-sampling stage of the encoder as the input feature , wherein, is the spatial size, is the number of channels, then the global average pooling and the global maximum pooling are performed on each channel of the input feature to obtain the feature vector and the feature vector , and then the feature vector and the feature vector are input into two layers of fully connected networks with the same shared weight parameters: the first layer of fully connected network compresses the dimension from to , is the reduction ratio, and uses the ReLU activation function for activation; the second layer of fully connected network restores the dimension from to without using the activation function, and the outputs of the two layers of fully connected networks are added and passed through the Sigmoid function to obtain the channel attention weight , the output feature map of the down-sampling stage is multiplied with the channel attention weight channel by channel to obtain the weighted feature .

[0011] As described above, the input object of the spatial attention sub-module is the weighted feature , then the channel dimension average pooling and the channel dimension maximum pooling are performed on the channel dimension, and then the results after the channel dimension average pooling and the channel dimension maximum pooling are spliced along the channel dimension to form a stacked tensor , then a 7x7 deep convolution is used on the stacked tensor Spatial feature extraction is performed, and then a 1×1 point convolution is used to fuse and compress the number of channels from 2 to 1 to obtain the first intermediate feature; dilated convolution is used with a convolution rate of... Depth convolution branches on stacked tensors Feature extraction is performed, and then the number of channels is compressed to 1 using a 1×1 point convolution to obtain the second intermediate feature. The first and second intermediate features are then fused and the spatial attention weights are generated using a sigmoid activation function. The generated spatial attention weights Weighted features Perform element-wise multiplication to obtain the output features. To further obtain features ,in, Let be the weight parameter, and let be the feature output of the convolutional attention module cascaded in the nth skip connection. Features ,feature Output features of the upsampling module in the nth upsampling stage of the decoder The concatenated data is then input into the transposed convolutional module of the nth upsampling stage for reconstruction.

[0012] As described above, the lightweight edge-assist head includes a 1×1 convolutional module and a Sigmoid function.

[0013] loss function as described above Based on the following formula:

[0014] ;

[0015] in: Loss due to foreground and background imbalance. The boundary loss for the root system profile. For edge binary cross-entropy loss, , and All are balanced hyperparameters.

[0016] ;

[0017] in, The predicted label represents the output of the root identification model. Represents the true label, This represents the intersection of the predicted label and the true label. It is the loss mitigation coefficient. and These represent the sum of the total number of pixels for the predicted label and the true label, respectively.

[0018] ;

[0019] in, It is the number of pixels within the boundary range. These are the predicted labels output by the root system identification model. This is the result of a signed distance transformation applied to the true labels of the root system contours.

[0020] ;

[0021] Where BCE is the marginal binary cross-entropy function. This is the predicted edge map obtained from a lightweight edge-assist head. This is a real label.

[0022] As described above, step 3 also includes a root measurement and output step, which includes:

[0023] Step 3.1, Binarization Steps:

[0024] Binarize the root system identification image to obtain a binary root system image;

[0025] Step 3.2, Skeletonization Processing Steps:

[0026] Step 3.2.1: Use the root binary image as the initial skeleton image, and use all foreground pixels in the skeleton image as the candidate pixel deletion set. Set the maximum number of iterations and define the 8-neighborhood of the foreground pixel S. ;

[0027] Step 3.2.2: In each iteration, scan each foreground pixel S in the skeleton image, and determine whether the foreground pixel S is a deletable point based on the following protection constraints:

[0028] Protection constraint 1: In the candidate pixel deletion set, calculate the geodesic distance between the foreground pixel S and the nearest branch point or endpoint, and compare the geodesic distance with the preset geodesic distance threshold: if the geodesic distance is lower than the preset geodesic distance threshold, then add the foreground pixel S to the protection set and do not delete it temporarily.

[0029] Protection constraint 2: If there are foreground pixels in all three non-adjacent directions of foreground pixel S, then foreground pixel S is prohibited from being deleted.

[0030] Protection constraint 3: If a foreground pixel S has only one foreground neighbor pixel, add it to the protection set and prohibit its deletion in this round and subsequent iterations;

[0031] Step 3.2.3: In the current iteration, set the value of all foreground pixels S that are not protected by constraints and are determined to be temporarily not deleted, prohibited from deletion, or prohibited from deletion in this round and subsequent iterations from 255 to 0.

[0032] Step 3.2.4: After completing one iteration, update the skeleton image and check whether any foreground pixels were deleted in this iteration. If the foreground pixels have not changed, or the maximum number of iterations has been reached, proceed to step 3.2.5; if the foreground pixels have changed and the maximum number of iterations has not been reached, update the skeleton image and return to step 3.2.2.

[0033] Step 3.2.5: Output the final skeleton image.

[0034] The root measurement and output steps described above also include:

[0035] Calculate the total root length :

[0036] ;

[0037] in, The number of pixels per centimeter. It is the number of pixels common to the skeleton image;

[0038] Calculate the projected area of ​​the root system :

[0039] ;

[0040] in, The number of pixels per square centimeter. This represents the total number of root system pixels in the binary image of the root system.

[0041] Calculate the average root diameter :

[0042] ;

[0043] Calculate the total surface area of ​​the root system and total root volume :

[0044] ;

[0045] .

[0046] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the above-described method.

[0047] A computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.

[0048] A computer program product includes a computer program that, when executed by a processor, implements the steps of the above-described method.

[0049] Compared with the prior art, the present invention has the following advantages:

[0050] 1. By introducing an attention mechanism into the U-Net model architecture, this method exhibits superior segmentation performance in complex backgrounds. The convolutional attention module is cascaded into the skip connections in the encoder-decoder, effectively addressing the information loss problem in the identification of fine root structures in traditional segmentation methods. The synergistic effect of channel attention and spatial attention enables the model to adaptively focus on key root regions, significantly suppressing the influence of interference factors such as soil particles, moisture reflection, etc.

[0051] 2. A complete root morphology characterization index system was constructed, overcoming the limitations of traditional methods that only measure a single parameter. An 8-neighborhood connection tracing technique was employed to achieve sub-pixel-level accuracy in root topology analysis.

[0052] 3. This invention saves human resources and costs, and greatly improves processing efficiency.

[0053] By integrating the above-mentioned innovative technologies, this invention effectively improves the accuracy and efficiency of segmenting root location and contour, and integrates adaptive and adjustable root trait parameter measurement, providing more reliable and accurate technical support for ecological vegetation root monitoring and root research. Attached Figure Description

[0054] Figure 1 This is a flowchart of the present invention;

[0055] Figure 2 This is a schematic diagram of the root identification model of the present invention;

[0056] Figure 3 The skeleton image is extracted from the root system identification image of the present invention, wherein (a) is a first example of a root system identification image obtained by the method described in Example 1, and (b) is the skeleton image extracted from the first example of a root system identification image by the method described in Example 1.

[0057] Figure 4 The skeleton image is extracted from the root system identification image of the present invention, wherein (a) is a second example of a root system identification image obtained by the method described in Example 1, and (b) is the skeleton image extracted from the second example of the root system identification image by the method described in Example 1;

[0058] Figure 5 The skeleton image is extracted from the root system identification image of the present invention, wherein (a) is a third example of a root system identification image obtained by the method described in Example 1, and (b) is the skeleton image extracted from the third example of the root system identification image by the method described in Example 1;

[0059] Figure 6 This is a schematic diagram of root system image + predicted label + real label, where (a) is a root system image example 1, (b) is the root system image example 1 obtained by using the method described in Example 1, and (c) is the real label corresponding to the root system image example 1.

[0060] Figure 7 This is a schematic diagram of root system image + predicted label + real label, where (a) is root system image example two, (b) root system image example two uses the method described in Example 1 to obtain predicted label, and (c) root system image example two corresponds to real label;

[0061] Figure 8 This is a schematic diagram of root system image + predicted label + real label, where (a) is root system image example three, (b) root system image example three uses the method described in Example 1 to obtain predicted label, and (c) root system image example three corresponds to real label;

[0062] Figure 9 The diagram shows a root system image with a predicted label, where (a) is an example of a root system image, and (b) shows the predicted label obtained using the method described in Example 1 for the root system image example 4.

[0063] Figure 10 The diagram shows a root system image with a predicted label, where (a) is example five of the root system image, and (b) shows the predicted label obtained using the method described in Example 1 for example five of the root system image.

[0064] Figure 11 This is a comparison chart of the segmentation index mIoU values ​​of the improved Unet model (root identification model), the traditional Unet model, the SegNet (GG16) model, and the SegNet (RseNet50) model.

[0065] Figure 12 This is a comparison chart of the F1 scores of the improved Unet model (root identification model), the traditional Unet model, the SegNet (GG16) model, and the SegNet (RseNet50) model of this invention.

[0066] Figure 13 This is a comparison chart showing the accuracy of the improved Unet model (root identification model), the traditional Unet model, the SegNet (GG16) model, and the SegNet (RseNet50) model. Detailed Implementation

[0067] To facilitate understanding and implementation of the present invention by those skilled in the art, the present invention will be further described in detail below with reference to implementation examples. It should be understood that the implementation examples described herein are only for illustration and explanation of the present invention and are not intended to limit the present invention.

[0068] Example 1:

[0069] like Figure 1 As shown, a deep learning-based method for plant root identification and measurement analysis includes the following steps:

[0070] Step 1: Data Collection and Processing

[0071] Step 1.1: Acquire the root images to be identified and measured using the root micro-root canal imaging instrument. Set the imaging parameters and pixel ratio of the instrument in advance to facilitate the measurement of corresponding root characteristics during subsequent input. Before actual identification and measurement, a certain amount of deep learning model training is required to improve recognition accuracy and adaptability. In this embodiment, the root images used are from the open-source image dataset of cotton and peanut roots. This dataset also includes a label image corresponding to each root image, i.e., the root outline.

[0072] Step 1.2: For the collected root system images, a series of tests and noise removal operations are performed to select root system images that can be used for training. The images are then normalized and their sizes are adjusted to ensure that the resolution of all root system images is uniform. Training, validation, and test sets are generated based on the root system images, with a total of 1000 images, which are stored in a folder for later use.

[0073] Step 2: Training the root system identification model

[0074] This step involves inputting root images from the training set into the root recognition model for training. During training, the model continuously adjusts its parameters and adaptively learns important root morphological features and location distributions. The learned important root recognition features are then used for further training. After training, the network is validated using a validation set. The programming language is Python. The network training parameters are as follows: all training uses the Adaptive Moment Estimation with decoupled weight decay (ADAMW) optimizer, with betas of 0.9 and 0.999 respectively, an initial learning rate of 0.0001, and 2000 iterations.

[0075] Step 2.1: Construct a root recognition model. The root recognition model is a U-Net model that incorporates an improved attention mechanism and residual connections.

[0076] Root recognition models include the U-Net model. The U-Net model consists of an encoder and a decoder. U-Net is a convolutional neural network architecture for image segmentation, with a U-shaped structure, such as... Figure 2 The U-Net model consists of an encoder (downsampling part) and a decoder (upsampling part), connected by skip connections. The encoder comprises a series of convolutional and pooling layers, primarily extracting features from the input image and gradually reducing its resolution while increasing the number of feature channels. Each pooling operation halves the image size and doubles the number of feature channels. The decoder consists of a series of deconvolutional (transposed convolutional) and convolutional layers. Its function is to upsample the feature maps extracted by the encoder, restoring the image resolution, and simultaneously fusing feature information from corresponding layers in the encoder through skip connections to improve segmentation accuracy. Skip connections directly connect feature maps of the same resolution from the encoder to the corresponding layers in the decoder, allowing the decoder to obtain richer details and aiding in the recovery of the image's spatial information. Convolution is the core operation for feature extraction in U-Net, and its formula is as follows:

[0077] (1)

[0078] in, It is the first The output feature maps of the convolutional layers are located at... Pixel value at that location, It is the first The input feature maps of the convolutional layers are located at... Pixel value at that location, The Layer convolution kernel at position The weight of the position, It is the first The layer of paranoia and It is the size of the convolution kernel.

[0079] In the U-Net of this method, "one stage" corresponds to one downsampling stage (encoder side) or one upsampling stage (decoder side). The encoder includes multiple downsampling stages, each of which sequentially includes a first convolutional layer Conv (3×3) → a first batch normalization module BN → a first activation layer ReLU → a second convolutional layer Conv (3×3) → a second batch normalization module BN → a second activation layer ReLU → a max pooling layer MaxPool (2×2). Two consecutive 3×3 convolutional layers (including BN + ReLU) together constitute the convolutional submodule of this stage, and then a 2×2 max pooling layer is used to halve the resolution and double the number of channels. The decoder includes multiple upsampling stages. Each upsampling stage sequentially includes an upsampling module (upsampling module is transposed convolution or bilinear upsampling + 1×1 convolution) → first transposed convolutional layer Conv(3×3) → first batch normalization module BN → first activation layer ReLU → second transposed convolutional layer Conv(3×3) → second batch normalization module BN → second activation layer ReLU. After upsampling by the upsampling module in each upsampling stage, the feature map output by the second activation layer of the corresponding downsampling stage of the encoder after attention filtering is concatenated. Then, it is processed by the first transposed convolutional layer, the first batch normalization module, the first activation layer, the second transposed convolutional layer, the second batch normalization module, and the second activation layer of the upsampling stage, and performs two 3×3 convolutions to refine and restore the spatial details.

[0080] Therefore, the “lth convolutional layer (counting from top to bottom)” in formula (1) refers to the specific convolutional operator in a certain stage; a “stage” usually contains two such 3×3 convolutional layers (each equipped with BN+ReLU).

[0081] In this embodiment: The encoder consists of four downsampling stages. Each downsampling stage contains two convolutional sub-modules and one 2×2 max-pooling layer. Each convolutional sub-module includes a 3×3 convolutional layer, a batch normalization module, and a ReLU activation layer. The input feature map of the U-Net model is halved in size and doubled in the number of feature channels layer by layer after passing through each downsampling stage of the encoder (64→128→256→512→1024). After the 3×3 convolutional layer of each convolutional sub-module, a batch normalization module and a ReLU activation function are set sequentially, using the order Conv→BN→ReLU. BN unifies the feature distribution and stabilizes the gradient, while ReLU enhances the non-linear expression. This configuration is used for all 3×3 convolutions of the encoder and decoder. Figure 2 The consistent stage structure helps improve the separability of weak targets such as fine roots, while reducing the risk of overfitting and accelerating convergence.

[0082] In this embodiment, the decoder employs a four-layer upsampling stage. Each upsampling stage sequentially includes an upsampling module and two transposed convolutional modules. Each transposed convolutional module includes a 3×3 transposed convolutional layer, a batch normalization module, and a ReLU activation layer connected in sequence to restore resolution. Each upsampling stage of the decoder is skipped from the corresponding downsampling stage of the encoder. Specifically, the feature map output from the upsampling module of the upsampling stage is concatenated with the feature map output from the second activation layer of the corresponding downsampling stage of the encoder (after attention filtering). The concatenated feature map is then input into the first transposed convolutional module of the upsampling stage. Within each upsampling stage, the upsampling module is followed by two transposed convolutional modules. Each transposed convolutional module includes a 3×3 transposed convolutional layer, a batch normalization module, and a ReLU activation layer connected in sequence. As the feature map passes through each upsampling stage of the decoder, its size doubles layer by layer, while the number of feature channels decreases layer by layer (1024→512→256→128→64).

[0083] Step 2.1.3, Introduction of Improved Attention Mechanism (CBAM) + Residual Connections: This method embeds a Convolutional Block Attention Module (CBAM) into the skip connections of U-Net. The CBAM includes a cascaded Channel Attention Module (CAM) and Spatial Attention Module (SAM). For example, the output feature map of the second convolutional submodule in the first downsampling stage of the encoder is first input to the CBAM, then processed sequentially by the CAM and SAM submodules to generate an attention-weighted feature map, which is then concatenated with the feature map output by the upsampling module in the first upsampling stage of the decoder. The model adopted is a complete solution built around "robust identification of fine roots in complex backgrounds + quantifiable measurement", which is fundamentally different from the conventional U-Net which only widens the channels / makes shallow modifications: (1) Pre-jump attention screening + residual path: Improved CBAM is applied to the encoder features at all jump connections, and residual fidelity is added to significantly suppress the high brightness noise of soil particles / water droplets and retain fine roots. (2) Multi-scale separable spatial attention: DWConv7×7 + holed DWConv branch is introduced in the spatial attention submodule SAM, which is only enabled in the high resolution stage, which is lightweight and effective. (3) Boundary sensitive hybrid loss: The SDF boundary term and lightweight edge auxiliary head are combined to significantly reduce the subsequent measurement errors of root diameter, surface area and volume (the contour fits better). (4) End-to-end measurement coupling friendly: The output provides both region and contour, so that skeletonization and projected area calculation (steps 3.2~3.6) can be directly called, reducing manual intervention.

[0084] The specific operation is as follows: First, a Channel Attention (CAM) submodule is used, taking the output feature map of the encoder's downsampling stage as the input feature, denoted as... ,in For space dimensions, This represents the number of channels. Next, the input features are analyzed separately. Each channel undergoes two pooling operations: Global Average Pooling (GAP) and Global Max Pooling (GMP) to obtain the feature vector. and eigenvectors These two vectors represent the average and maximum response of each channel, respectively. Then the feature vectors... and eigenvectors In a two-layer fully connected MLP network with the same shared weight parameters: the first fully connected layer will transfer the dimension from... Compress to ( To reduce the ratio, the ReLU activation function is used for activation; the second fully connected network reduces the dimension from Restore No activation function is used (linear layer). Two output variables are obtained. Then, the outputs of the two two-layer fully connected MLP networks are summed, and the channel attention weights are obtained using the sigmoid function. : ,in This represents the Sigmoid function. The output features of the first fully connected layer network, This represents the output features of the second fully connected layer. The output feature map from the downsampling stage... With channel attention weights Perform channel-wise multiplication (Hadamard product) to obtain the weighted features. : .

[0085] The Spatial Attention submodule (SAM, with separable convolution and multi-scale) is used to adaptively weight the feature maps in the spatial dimension. The input is the weighted features processed by the Channel Attention module. Then, two compression operations, channel-dimensional average pooling and channel-dimensional max pooling, are performed along the channel dimension. Finally, the results of channel-dimensional average pooling and channel-dimensional max pooling are concatenated along the channel dimension to form a stacked tensor with two feature maps. Stacked tensors It integrates the average and maximum responses across channels at each spatial location, providing a preliminary description of spatial saliency. Then, a 7×7 depthwise convolution (DWConv) is first applied to the stacked tensors. Spatial features are extracted, and then a 1×1 pointwise convolution (PWConv) is used to fuse and compress the number of channels from 2 to 1, obtaining the first intermediate feature. This is followed by a parallel convolution using dilated convolution with a high convolution rate. Depth convolution branches on stacked tensors Feature extraction is performed. Then, a 1×1 point convolution is used to compress the number of channels to 1, obtaining the second intermediate feature. The first and second intermediate features are then fused and processed using a Sigmoid activation function to generate spatial attention weights. The generated spatial attention weights Weighted features Perform element-wise multiplication to obtain the final output features modulated by both spatial and channel attention. : .

[0086] Meanwhile, to avoid over-suppression of weak fine roots, this method introduces a residual channel: The weight parameters (Default 1) It is the final output feature containing residuals. This represents scalar multiplication, i.e. Compared with the original feature map Element-wise multiplication. The residual path ensures that the original clues are preserved even when the attention map is unreliable, improving fine-root continuity and end-point stability.

[0087] In this embodiment, the output feature map of the second convolutional submodule in the l-th downsampling stage of the encoder is processed by the CBAM module and then concatenated with the feature map output by the upsampling module in the l-th upsampling stage of the decoder. This concatenation is then processed sequentially by the two transposed convolutional modules in the l-th upsampling stage. This design enables the model to adaptively enhance the response of the root region, suppress background noise, and improve segmentation robustness in complex environments.

[0088] For the nth skip connection, the output of the last convolutional submodule in the nth downsampling stage of the encoder is obtained by the convolutional attention module CBAM. .feature Output features of the upsampling module in the nth upsampling stage of the decoder The splicing features are obtained after splicing. Then, the spliced ​​features are input into the two transposed convolutional modules of the nth upsampling stage for reconstruction.

[0089] The output features from the first upsampling stage are processed through the output layer (1×1 convolutional layer + Sigmoid activation function) to output a predicted root contour segmentation probability map as the predicted label.

[0090] Step 2.2, Loss Function Design

[0091] This method employs a three-component hybrid loss function, combining foreground / background imbalance loss (Dice Loss), boundary loss (Boundary / Level-set), and edge binary cross-entropy loss (BCE) to address the problem of imbalance between root and background categories and enhance the ability to identify fine roots.

[0092] The formula for Dice Loss, which calculates for foreground-background imbalance, is as follows:

[0093] (2)

[0094] in, This represents the loss due to the imbalance between the foreground (i.e., the root system) and the background. The predicted label represents the output of the root identification model. Represents the true label, This represents the intersection of the predicted label and the true label. This is the loss mitigation coefficient, used to prevent the denominator from being zero. and These represent the sum of the total number of pixels for the predicted label and the actual label, respectively.

[0095] Boundary loss: the true label of the root image Pre-calculate the signed distance transform result SDF, and then calculate the loss difference between the predicted labels and the signed distance transform result SDF:

[0096] (3)

[0097] in, Boundary loss representing the root system profile. It is the number of pixels within the boundary range. These are the predicted labels output by the root system identification model. This is the result of the symbolic distance transformation performed on the true labels of the root system contours, as mentioned above.

[0098] The edge binary cross-entropy loss function processing is performed outside the main segmentation head of the root recognition model's output layer. After the first upsampling stage of the decoder (i.e., the last upsampling stage, which is also the layer before the output layer), the feature map output from the first upsampling stage of the decoder is input not only to the output layer but also to a lightweight convolutional branch (i.e., a lightweight edge auxiliary head). The lightweight convolutional branch receives the feature map output from the first upsampling stage of the decoder and then generates a predicted edge map through the lightweight convolutional branch (in this embodiment, the lightweight convolutional branch uses a 1×1 convolutional module + Sigmoid function). A lightweight convolutional branch (i.e., a lightweight edge-assist head) is specifically designed to learn edge information from the root system image and is trained under supervised supervision using binary cross-entropy loss to improve the main segmentation head's accuracy in recognizing root boundaries. The lightweight edge-assist head produces a predicted edge map. With real labels Perform edge binary cross-entropy loss calculation:

[0099] (4)

[0100] in, Represents the edge binary cross-entropy loss, where BCE is the edge binary cross-entropy function.

[0101] Couple the three different loss functions mentioned above to make the total loss function Defined as:

[0102] (5)

[0103] in, Used to optimize the consistency of the partition boundaries. and The recall rate of small roots can be improved by assigning higher weights to root pixels. , and All are equilibrium hyperparameters; in this embodiment, they are respectively taken as... During training, the "root contour" label is jointly supervised: the main segmentation head learns region filling, and the lightweight edge-assisted head learns accurate boundaries, achieving region-boundary co-optimization.

[0104] Step 2.3, Training and Reasoning Process

[0105] After training is complete, follow these steps:

[0106] Input preprocessing: Scale / normalize the root system image according to training normalization and size (e.g., 512×512); record pixel-physical scale.

[0107] Forward inference: Input the root system image into the trained root system recognition model, and output the predicted root system contour segmentation probability as the predicted label. .

[0108] Thresholding and morphological post-processing: based on predicted labels Generate binary root system images using Otsu's method or a fixed threshold; can perform closing operations and hole filling to reduce noise.

[0109] Output: Output a binary image of the root system, and save it as "root image + predicted label + ground truth label" (e.g., root system image + predicted label + ground truth label). Figure 6 (a), (b), (c) Figure 7 (a), (b), (c) Figure 8 (a), (b), (c)) or a combination of "original root system image + predicted label" (e.g. Figure 9 (a) and (b) Figure 10 (a) and (b) are used directly by the subsequent measurement module (step 3).

[0110] Step 3: Root system measurement and output

[0111] The root system image to be identified is input into the root system recognition model that has been trained above to obtain the root system recognition image. This part further processes the root system recognition image after recognition, and extracts and calculates root morphology indicators including root length, projected area, average root diameter, surface area and volume by means of binarization and skeletonization.

[0112] Step 3.1, Image Binarization

[0113] In root identification images, the roots and background have different grayscale values. A fixed threshold can be set according to actual needs to separate the roots from the background. If the background is relatively uniform and the lighting is stable, a fixed threshold method can be selected; if the background is complex and the lighting is uneven, an adaptive threshold method can be used, which can automatically determine the optimal threshold based on the grayscale distribution of the image, maximizing the inter-class variance, better segmenting the image, and obtaining a binary image of the roots.

[0114] The fixed threshold method sets a fixed grayscale value as the grayscale threshold based on experience or preliminary analysis of the root identification image. For the root identification image, the grayscale value of each pixel in the image is compared with this grayscale threshold. Pixels with grayscale values ​​greater than the threshold are identified as root parts and set to white (usually represented by 255); pixels with grayscale values ​​less than or equal to the threshold are identified as background parts and set to black (usually represented by 0). For example, if the grayscale threshold is 128, then pixels with grayscale values ​​greater than 128 in the root identification image will be classified as roots, and pixels with grayscale values ​​less than or equal to 128 will be classified as background.

[0115] The adaptive thresholding method of this invention is an unsupervised threshold selection method based on the statistical characteristics of image grayscale. Assuming a root identification image consists of a foreground (root system) and a background, the optimal grayscale threshold is found by calculating the inter-class variance of the foreground and background under different grayscale thresholds, thus maximizing the inter-class variance. A larger inter-class variance indicates a better effect in classifying the image into foreground and background, meaning the grayscale threshold effectively distinguishes the roots from the background. Specifically, the calculation process involves iterating through all possible grayscale values ​​as grayscale thresholds, calculating the mean, variance, and other statistical properties of the foreground and background at each grayscale threshold, then calculating the inter-class variance according to the formula, and selecting the grayscale threshold that maximizes the inter-class variance as the optimal grayscale threshold. This method is widely applicable to images with various complex backgrounds and uneven lighting conditions.

[0116] Step 3.2: Skeletonization of Endpoint Preservation Constraints

[0117] The binary root image obtained in step 3.1 is further processed to extract its skeleton structure. To achieve high-precision skeleton extraction while preserving the fine root tips and branch structures, this invention employs an improved iterative thinning algorithm with endpoint preservation constraints. This algorithm is based on the iterative deletion logic of classic thinning algorithms (such as the Zhang-Suen or Guo-Hall algorithms), and introduces multiple constraints to protect endpoints, branch points, and high-curvature regions, preventing excessive erosion that could lead to fine root breakage or topological changes.

[0118] Step 3.2.1: Initialize the skeleton image: Use the root binary image as the initial skeleton image. All foreground pixels in the skeleton image are used as the candidate pixel deletion set. Set the maximum number of iterations to ensure algorithm convergence, and initialize the current iteration number k=0. To avoid accidental deletion of fine branches, define the 8-neighborhood of the foreground pixel S. .

[0119] Step 3.2.2, Iterative Refinement and Constraint Deletion: In each iteration, each foreground pixel S (i.e., root pixel) in the skeleton image is scanned, and the foreground pixel S is determined as a deletable point based on the following protective constraints. To ensure that connectivity is not changed after deletion, a 0→1 transition counting method is used. That is, the 8-neighborhood of the foreground pixel S If the number of transitions from 0 (background pixel) to 1 (foreground pixel) in the surrounding pixel sequence is 1, then the foreground pixel S can be safely deleted. The protection constraints include the following three points:

[0120] Protection Constraints (1) Curvature / Fineness Protection: In the candidate pixel deletion set, calculate the geodesic distance between the foreground pixel S and the nearest branch point or endpoint. Comparison of geodesic distance and preset geodesic distance threshold: If the geodesic distance is lower than the preset geodesic distance threshold (indicating that the point is located in an isolated slender branch or sharp bend), then add the foreground pixel S to the protection set and do not delete it temporarily; or set a higher preset geodesic distance threshold again, and perform the comparison between the geodesic distance and the preset geodesic distance threshold again, until after repeating the setting number of times, if the geodesic distance is still lower than the preset geodesic distance threshold, then add the foreground pixel S to the protection set and do not delete it temporarily. This constraint can effectively suppress false fractures in densely curved areas or extremely slender root segments.

[0121] Protection constraint (2) Multi-branch protection: If there are foreground pixels in three non-adjacent directions of foreground pixel S, then foreground pixel S is regarded as a fork key point and deletion is prohibited.

[0122] Protection constraints (3) Endpoint protection: To avoid deleting the root tip, an endpoint condition is defined. If the foreground pixel S has only one foreground neighbor pixel, then the foreground pixel S is determined to be an endpoint, and it is added to the protection set. It is prohibited from being deleted in this round and subsequent iterations to ensure that the length of the root tip is not shortened.

[0123] Step 3.2.3, Execute deletion and update: In the current iteration, set the value of all foreground pixels S that are not protected by constraints and are determined to not be deleted, prohibited from deletion, or prohibited from deletion in this round and subsequent iterations from 255 (foreground) to 0 (background), thereby deleting them from the skeleton.

[0124] Step 3.2.4 Convergence Judgment: After completing one iteration, update the skeleton image and check whether any foreground pixels were deleted in this iteration. If the foreground pixels have not changed, or the maximum number of iterations has been reached, the algorithm converges, stops iterating, and proceeds to step 3.2.5; if the foreground pixels have changed and the maximum number of iterations has not been reached, update the skeleton image, return to step 3.2.2, and then proceed to the next iteration.

[0125] Step 3.2.5: Output the final skeleton image: After the algorithm converges, the final result is the required skeleton image with a single-pixel width, preserving the original root system topology and key geometric features (especially endpoints and branches). This image is then passed to subsequent steps for calculating root-related metrics.

[0126] Step 3.3: Calculate the total root length

[0127] For a skeleton image, each pixel represents a certain actual distance. By counting the total number of pixels in the skeleton image and combining this with a pre-determined conversion ratio between pixel size and actual size, the total length of the root system can be calculated. The formula is as follows:

[0128] (6)

[0129] in, The number of pixels per centimeter. It is the number of pixels common to the skeleton image.

[0130] Step 3.4: Calculate the projected area of ​​the root system.

[0131] In the binary image of the root system, the total number of pixels belonging to the root system is counted. Since each pixel corresponds to a certain actual area, the total number of pixels is converted into the actual projected area according to a pre-determined calibration coefficient. The formula is as follows:

[0132] (7)

[0133] in, The number of pixels per square centimeter. This represents the total number of root system pixels in the binary image.

[0134] Step 3.5: Calculate the average root diameter

[0135] Average root diameter The root diameter reflects the thickness of the root system and is a key parameter describing its morphological characteristics. The average root diameter is calculated based on the relationship between the root system's projected area and total length. Dividing the projected area by the total length yields an equivalent average diameter, as shown in the following formula:

[0136] (8)

[0137] in, It is the projected area of ​​the root system. It is the total length of the root system.

[0138] Step 3.6: Calculate the total surface area of ​​the root system. and total root volume

[0139] Total root surface area and total root volume are important indicators for measuring root growth and function, helping to understand the root system's ability to absorb water and nutrients, as well as its interaction with the soil environment. The formulas are:

[0140] (9)

[0141] (10)

[0142] in, It is the total surface area of ​​the root system. It is the total volume of the root system. It is the average root diameter. It is the total length.

[0143] Step 3.7, Output Results

[0144] The morphological parameters of the root system are calculated through the above series of operations and then uniformly output to a designated folder for saving. Two types of results are included: root system image + root system identification image (predicted label) + label image, and root system image + root system identification image. Figure 6 Images (a) to (c) demonstrate that the invention is able to accurately identify the location and outline of root systems that closely resemble the soil color. Figure 7 (a) to (c) demonstrate the ability to accurately locate and measure root systems even in environments filled with water droplets and moisture. Figure 8 Tables (a) to (c) show the results of recognition of images in the test set after training. These all demonstrate the practicality and high accuracy of the present invention, which is applicable to different soil environments and can accurately identify and measure different root systems. The output results after measurement are shown in Table 1. If you need to accurately measure and output the corresponding root morphology parameters, you can input the pixel ratio of the image captured by the camera device used. The present invention can measure and calculate the actual root parameters according to the corresponding ratio.

[0145] Table 1 Results Output Table

[0146]

[0147] The file name of root system image 1 is:

[0148] "GT_Cotton_T003_L019_2012.08.06_132304_AMC_DPI150.jpg";

[0149] The file name of root system image 2 is:

[0150] "GT_Cotton_T003_L020_2012.08.06_132310_AMC_DPI150.jpg";

[0151] The file name of root system image 3 is:

[0152] "GT_Cotton_T003_L022_2012.08.06_132316_AMC_DPI150.jpg";

[0153] The file name of root system image 4 is:

[0154] "GT_Peanut_T004_L010_2017.07.13_070413_EED_DPI120.jpg";

[0155] The file name of root system image 5 is:

[0156] "GT_Sunfower_T006_L006_2017.07.05_081550_EED_DPI120.jpg";

[0157] The file name of root system image 6 is:

[0158] "GT_Sunflower_T006_L014_2017.07.05_081622_EED_DPI120.jpg".

[0159] The trained model is tested on a validation dataset, and the results are compared and analyzed with some traditional models, such as... Figures 11-13 As shown, this demonstrates that the present invention has higher accuracy and better recognition performance compared to these methods.

[0160] The segmentation index mIoU values ​​of the improved Unet model (root identification model), the traditional Unet model, the SegNet (GG16) model, and the SegNet (RseNet50) model are 0.856, 0.848, 0.845, and 0.846, respectively.

[0161] The F1 scores of the improved Unet model (root identification model), the traditional Unet model, the SegNet (GG16) model, and the SegNet (RseNet50) model of this invention are 0.925, 0.897, 0.878, and 0.879, respectively.

[0162] The accuracy of the improved Unet model (root identification model), the traditional Unet model, the SegNet (GG16) model, and the SegNet (RseNet50) model are 0.965, 0.946, 0.940, and 0.938, respectively.

[0163] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods.

[0164] Example 2:

[0165] In this embodiment, a computer device is also provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0166] Example 3:

[0167] In this embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps in the above-described method embodiments.

[0168] Example 4:

[0169] In this embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0170] The above are merely preferred embodiments of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principles of the present invention should be considered within the scope of protection of the present invention.

Claims

1. A deep learning-based plant root system identification and measurement analysis method, characterized in that, The method comprises the following steps: Step 1, obtaining root system pictures, generating a training set, a verification set and a test set based on the root system pictures; Step 2, a root system identification model is constructed, the root system identification model comprises a U-Net model, the U-Net model comprises an encoder, a decoder and an output layer, the encoder and the decoder respectively comprise a same number of down-sampling stages and up-sampling stages, the up-sampling stages and the down-sampling stages are connected through a skip connection, a convolution attention module is connected in the skip connection, the convolution attention module comprises a channel attention submodule and a spatial attention submodule connected in series, feature maps output by a last up-sampling stage of the decoder are respectively input to the output layer and a light edge auxiliary head, and a loss function is constructed The root system identification model is trained based on the training set. Step 3, inputting the root system picture to be identified into the root system recognition model trained above to obtain a root system recognition picture, The step 3 further comprises a root system measurement and output step, which comprises: Step 3.1, a binarization step: Binarizing the root system recognition picture to obtain a root system binary picture; Step 3.2, a skeletonization processing step: Step 3.2.1, take the root system binary image as the initial skeleton image, delete all the foreground pixel points in the skeleton image as the candidate pixel point deletion set, set the maximum iteration number, define the 8-neighborhood of the foreground pixel point S ; Step 3.2.2, in each iteration, scanning each foreground pixel point S in the skeleton image, and judging whether the foreground pixel point S is a deletable point according to the following protection constraint conditions: Protection constraint condition 1: in the candidate pixel point deletion set, calculating the geodesic distance between the foreground pixel point S and the nearest branch point or endpoint, and comparing the geodesic distance with a preset geodesic distance threshold value: if the geodesic distance is lower than the preset geodesic distance threshold value, the foreground pixel point S is added to the protection set and is not deleted temporarily; Protection constraint condition 2: if there are foreground pixel points in 3 mutually non-adjacent directions of the foreground pixel point S, the foreground pixel point S is prohibited from being deleted; Protection constraint condition 3: if the foreground pixel point S has only one foreground neighbor pixel point, it is added to the protection set and is prohibited from being deleted in the current iteration and subsequent iterations; Step 3.2.3, in the current iteration, setting the value of all foreground pixel points S which are not determined as not to be deleted, prohibited from being deleted, and prohibited from being deleted in the current iteration and subsequent iterations from 255 to 0; Step 3.2.4, after completing an iteration, updating the skeleton image, checking whether any foreground pixel point is deleted in this iteration, if the foreground pixel points have no change or have reached the maximum iteration number, then entering step 3.2.5; if the foreground pixel points have changed and have not reached the maximum iteration number, then updating the skeleton image and returning to step 3.2.2; Step 3.2.5, outputting the final skeleton image. 2.The plant root recognition and measurement analysis method based on deep learning according to claim 1, wherein, The channel attention sub-module takes the output feature map of the down-sampling stage of the encoder as the input feature wherein, is the spatial size, is the channel number, then the global average pooling and the global maximum pooling are respectively performed on each channel of the input feature to obtain the feature vector and the feature vector , and then the feature vector and the feature vector are respectively input into two layers of fully connected networks with the same shared weight parameters: the first layer of fully connected network compresses the dimension from to , is the reduction ratio, and the ReLU activation function is used for activation; the second layer of fully connected network restores the dimension from to , and no activation function is used, the outputs of the two layers of fully connected networks are added and the channel attention weight is obtained through the Sigmoid function. The output feature map of the down-sampling stage is multiplied with the channel attention weight channel by channel to obtain the weighted feature 3.The plant root recognition and measurement analysis method based on deep learning according to claim 2, wherein, The input object of the spatial attention sub-module is the weighted feature Then, channel dimension average pooling and channel dimension maximum pooling are performed on the channel dimension, and the results after the channel dimension average pooling and the channel dimension maximum pooling are spliced along the channel dimension to form a stacked tensor Then, a 7*7 deep convolution is used on the stacked tensor to extract spatial features, and a 1*1 point convolution is used to fuse and compress the channel number from 2 to 1 to obtain a first intermediate feature; a deep convolution branch with a convolution rate is used to extract features from the stacked tensor , and a 1*1 point convolution is used to compress the channel number to 1 to obtain a second intermediate feature; the first intermediate feature and the second intermediate feature are fused and then input into a Sigmoid activation function to generate a spatial attention weight The generated spatial attention weight is multiplied by the weighted feature to obtain an output feature , and further obtain a feature , wherein is a weight parameter, and the feature output by the convolution attention module in series in the nth jump connection is the feature , the feature , and the output feature of the up-sampling module in the nth up-sampling stage of the decoder are spliced and input into the transpose convolution module in the nth up-sampling stage for reconstruction. 4.The plant root recognition and measurement analysis method based on deep learning according to claim 1, wherein, The light edge auxiliary head comprises a 1x1 convolution module and a Sigmoid function. 5.The plant root recognition and measurement analysis method based on deep learning according to claim 1, wherein, The loss function Based on the following formula: ; wherein: is a foreground-to-background imbalance loss, is a root profile boundary loss, is an edge binary cross-entropy loss, , and are balancing hyperparameters, ; wherein, represents a predicted label output by a root system recognition model, represents a true label, represents an intersection of the predicted label and the true label, is a loss balance coefficient, and respectively represent a sum of pixel total numbers of the predicted label and the true label. ; wherein, is the number of pixels in the boundary range, is the predicted label output by the root recognition model, is the signed distance transform result performed on the true label of the root contour, ; where BCE is a binary cross-entropy function at the edge, a predicted edge map obtained for the lightweight edge assistant head, is the true label. 6.The plant root recognition and measurement analysis method based on deep learning according to claim 1, wherein, The root system measurement and output step further comprises: calculating total root length : ; wherein, is the number of pixels per centimeter, is the number of pixels common to the skeleton images; Calculating root projected area : ; wherein, the number of pixel points per square centimeter, the total number of root pixel points in the root binary image; Calculating average root diameter : ; calculating total root surface area and total root volume : ; 。 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-6 when the computer program is executed by the processor. The processor executes the computer program to realize the steps of the method in any one of claims 1 to 6.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to realize the steps of the method in any one of claims 1 to 6.

9. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to realize the steps of the method in any one of claims 1 to 6. The computer program is executed by the processor to realize the steps of the method in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method for monitoring root system growth of indoor culture plants

    CN107027536A

  • Pinus massoniana seedling root phenotypic parameter extraction system and method based on images

    CN117788395A

  • Three-dimensional seismic fault identification method based on double-attention multi-scale fusion U-Net

    CN120705573A