Full-scale lung image segmentation algorithm based on hybrid connection

By introducing dense scale connections of same-layer features and sparse jump connections of different-layer features into the lung image segmentation algorithm, the problems of low lung image segmentation accuracy and edge feature loss are solved, achieving higher segmentation accuracy and better features. Fusion effect.

CN118747804AActive Publication Date: 2024-10-08NANTONG INST OF TECH

Patent Information

Application Number
CN202410967147.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2024-10-08
Estimated Expiration
2044-07-18

AI Technical Summary

Technical Problem

When existing lung image segmentation technology processes images that are blocked by the front background and rich in edge features, the segmentation accuracy is low and edge features are prone to loss. Moreover, the traditional method lacks internal block connections, resulting in the loss of complex features and the disappearance of deep network gradients. problem.

Method used

A full-scale lung image segmentation algorithm based on hybrid connections is used to build a hybrid-connected full-scale segmentation model through dense scale connections of features on the same layer and sparse jump connections of features on different layers. It is combined with ConvModule, C2f, DarknetBottlenet and SPPF modules to perform Feature extraction and fusion to prevent feature loss and gradient disappearance.

Benefits of technology

It improves lung image segmentation accuracy, prevents the loss of edge features, enhances semantic information, reduces gradient attenuation in deep network structures, and achieves higher segmentation accuracy and better feature fusion effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118747804A_ABST
    Figure CN118747804A_ABST
Patent Text Reader

Abstract

The invention discloses a full-scale lung image segmentation algorithm based on hybrid connection. The algorithm comprises the following steps: constructing a lung image feature extraction module by adopting a ConvModule module, a C2f module, a DarknetBottlenet module and an SPPF module; constructing a same-layer feature dense scale connection module for connecting the scale features on the same layer; constructing a different-layer feature sparse jump connection module for fusing feature data of different layers in a jump connection mode; through dense scale connection of the same-layer feature dense scale connection module and sparse jump connection of the different-layer feature sparse jump connection module, a full-scale segmentation model of hybrid connection is constructed; training the hybrid connection full-scale segmentation model according to a training set and a test set generated by the image data of the lung; and obtaining a lung image segmentation result by adopting the trained full-scale segmentation model. The lung image segmentation precision is improved, the loss of complex features and gradient disappearance of a deep network are prevented, and the loss of edge features is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of lung image segmentation, and in particular to a full-scale lung image segmentation algorithm based on hybrid connection. Background Art

[0002] Lung images are blocked by the foreground background and contain rich edge features. Therefore, the segmentation accuracy is low and there is a problem of edge feature loss in the process of lung image segmentation. Feature fusion is a technology used in the process of digital image processing to prevent image features from losing features or gradient disappearance. The purpose of feature fusion is to merge the features extracted from the image into a feature that is more discriminative than the input feature. Low-level features have higher resolution and contain more position and detail information, but because they have passed fewer convolutions, they have lower semantics and more noise. High-level features have stronger semantic information, but their resolution is very low and their perception of details is poor. In the process of image processing, feature fusion is used to improve the performance of detection and segmentation. Feature pyramid is an important technology for feature fusion. In the feature pyramid network, the purpose of multi-scale feature fusion is to extract features of different resolutions from the backbone network. The traditional feature pyramid adopts a top-down path to fuse multi-scale features from the 3rd to the 7th layers. Considering the limitation of unidirectional information flow, PANet adds a bottom-up path aggregation network, but the computational cost is higher; in addition, BiFPN removes nodes with only one input edge and adds additional edges from the original input at the same level; however, previous methods only focus on feature fusion and lack internal block connections. Summary of the invention

[0003] Purpose of the invention: In order to overcome the shortcomings of the prior art, the present invention provides a full-scale lung image segmentation algorithm based on hybrid connection, including dense scale connection of features in the same layer, sparse jump connection of features in different layers and feature fusion of surrounding full scale, so as to improve the accuracy of lung image segmentation, avoid the loss of edge features, prevent the loss of complex features and the disappearance of gradients of deep networks.

[0004] Technical solution: To achieve the above purpose, the present invention provides a full-scale lung image segmentation algorithm based on hybrid connection, comprising the following steps:

[0005] S1. ConvModule, C2f, DarknetBottlenet and SPPF modules are used to construct a lung image feature extraction module.

[0006] S2, constructing a dense scale connection module for the same-layer features that connects the scale features on the same layer;

[0007] S3, constructing a heterogeneous feature sparse skip connection module that fuses feature data of different layers in a skip connection manner;

[0008] S4, constructing a hybrid connection full-scale segmentation model through dense scale connection of the same-layer feature dense scale connection module and sparse skip connection of the different-layer feature sparse skip connection module;

[0009] S5. Train the hybrid connected full-scale segmentation model based on the training set and test set generated by the lung image data; and use the trained full-scale segmentation model to obtain a lung image segmentation result map.

[0010] Furthermore, in step S1, the network structure of the lung image feature extraction module is composed of a ConvModule module, a ConvModule module, a C2f module, a ConvModule module, a C2f module, a ConvModule module, a C2f module, a ConvModule module, a C2f module and a SPPF module connected in sequence.

[0011] Furthermore, the ConvModule module is composed of a Conv2d layer, a BatchNorm2d layer and a SiLU layer; the C2f module is composed of a ConvModule layer, a Split layer, a DarknetBottlenet layer and a Concat layer; the DarknetBottlenet module is composed of a ConvModule layer and a Concat layer; and the SPPF module is composed of a ConvModule layer, a MaxPool2d layer and a Concat layer.

[0012] Furthermore, in step S2, the same-layer feature dense scale connection module connects all scale features on the same layer through dense scale connection; including connecting the k-th feature All the previous features are concatenated, and after the concatenation is completed, the convolution operation is performed through the Conv function; the calculation process is as follows:

[0013]

[0014] Among them, the Concat() function refers to the connection of the feature matrices of the same scale above, and the Conv() function represents the convolution operation.

[0015] express All feature matrices of the previous layer.

[0016] Further, in step S3, the feature data of different layers are connected by sparse jump connection in the heterogeneous feature sparse jump connection module; including splicing the input features of different layers by using the exponential form of the input layer with a base of 2 and a depth of 1 according to the Concat function, and performing a convolution operation through the Conv function after the splicing is completed; the calculation process is as follows:

[0017]

[0018] Among them, l-2 n ≥ 0, relative to the dense skip connection with a depth of l, the time complexity of the sparse skip connection is O(l·log 2 l).

[0019] Furthermore, in step S4, the hybrid connected full-scale segmentation model uses dense scale connections and sparse skip connections to output feature P′ k is composed of i-1 layer features P i-1 Downsampling through the maximum pooling function, i-layer feature P i 、i+1 layer feature P i+1 Upsampling and same-layer features P′ through bilinear interpolation function i-1 The calculation process is as follows:

[0020] P′ k =Concat(Maxpooling(Conv(P i-1 )), Conv(P i ), Bilinear(Conv(P i+1 )), Conv(P i-1 ))

[0021] Among them, i>1, Maxpooling represents the maximum pooling function, Bilinear represents the bilinear difference function, Concat represents the feature matrix connection, and Conv represents the convolution operation.

[0022] Furthermore, in step S5, a hybrid-connected full-scale segmentation model is trained according to the generated training set and test set; the training set is input into the hybrid-connected full-scale segmentation model, the TaskAligedAssigner positive sample allocation strategy is used, and the Distribution Focal Loss function is introduced as the loss function to calculate the loss value between the predicted label vector and the true label vector; the network parameters are iteratively updated using the gradient descent method until the network converges with the loss function, thereby obtaining a trained hybrid-connected full-scale segmentation network model.

[0023] Furthermore, the calculation process of the Distribution Focal Loss function is as follows:

[0024] DFL(y i ,y i +1) = -(i+1-y)log(y i )-(yi)log(y i +1)

[0025] Among them, y is the actual label and satisfies

[0026] Beneficial effects: The full-scale lung image segmentation algorithm based on hybrid connection of the present invention constructs a same-layer feature dense scale connection module to fuse features of different scales in the same layer, expands the field of view of the model, strengthens semantic information, and prevents the loss of complex features; constructs a different-layer feature coefficient jump connection module to fuse features of different layers, strengthens the connection between internal blocks, and prevents gradient attenuation in deep network structures; makes full use of multi-layer scale feature data to solve the problems of complex feature loss and deep network gradient disappearance, improves the segmentation accuracy of lung images, and prevents the loss of edge features. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 The flowchart of the full-scale lung image segmentation algorithm based on hybrid connection;

[0028] Figure 2 This is a network structure diagram of the full-scale lung image segmentation algorithm based on hybrid connection;

[0029] Figure 3 It is a dense scale connection structure diagram;

[0030] Figure 4 It is a sparse skip connection structure diagram;

[0031] Figure 5 It is a hybrid connection structure diagram;

[0032] Figure 6 Schematic diagram of full-scale feature fusion;

[0033] Figure 7 It is a heat map of different algorithms and the algorithm of the present invention on the same data set;

[0034] Figure 8 The figure shows the comparison of segmentation effects using different algorithms and the algorithm of the present invention. DETAILED DESCRIPTION

[0035] The present invention will be further described below in conjunction with the accompanying drawings.

[0036] like Figure 1As shown, a full-scale lung image segmentation algorithm based on hybrid connection includes the following steps:

[0037] S1. ConvModule, C2f, DarknetBottlenet and SPPF modules are used to construct a lung image feature extraction module.

[0038] S2, constructing a dense scale connection module for the same-layer features that connects the scale features on the same layer;

[0039] S3, constructing a heterogeneous feature sparse skip connection module that fuses feature data of different layers in a skip connection manner;

[0040] S4, constructing a hybrid connection full-scale segmentation model through dense scale connection of the same-layer feature dense scale connection module and sparse skip connection of the different-layer feature sparse skip connection module;

[0041] S5. Train the hybrid connected full-scale segmentation model based on the training set and test set generated by the lung image data; segment the lung image data using the trained full-scale segmentation model to obtain a lung image segmentation result map.

[0042] like Figure 2 As shown, in step S1, the network structure of the lung image feature extraction module is composed of a ConvModule module, a ConvModule module, a C2f module, a ConvModule module, a C2f module, a ConvModule module, a C2f module, a ConvModule module, a C2f module and a SPPF module connected in sequence.

[0043] like Figure 2 As shown, the ConvModule module is composed of a Conv2d layer, a BatchNorm2d layer and a SiLU layer; the ConvModule module is usually a convolution module defined in a deep learning framework, which integrates components such as convolution operations, normalization operations, such as batch normalization and activation functions, so as to more efficiently build and train convolutional neural networks (CNNs). The Conv2d layer is a two-dimensional convolution layer, which is one of the most commonly used operations in convolutional neural networks (CNNs), especially in the fields of computer vision and image processing; the BatchNorm2d layer is a layer in deep learning, mainly used for batch normalization operations, and is particularly suitable for two-dimensional data, such as image data; the SiLU layer Sigmoid Linear Unit, also known as the Swish function, is an activation function widely used in the field of deep learning.

[0044] The C2f module consists of a ConvModule layer, a Split layer, a DarknetBottlenet layer and a Concat layer; the C2f module is an important component in the YOLO (You Only Look Once) algorithm series, and has been significantly applied in particular in YOLOv8. The module aims to improve the accuracy and efficiency of target detection through a series of complex structures and operations; the Split layer performs a Split operation, which is to split the input feature map into multiple parts along a certain dimension (such as the channel dimension). In the C2f module, the Split operation is usually used to split the output feature map of the initial convolutional layer into two parts for subsequent different processing paths; the main function of the Concat layer is to splice feature maps from different layers or different data sources according to the specified dimension.

[0045] The DarknetBottlenet module is composed of a ConvModule layer and a Concat layer; the DarknetBottlenet module is similar to a residual module, but has a specific structure and function. In Darknet or more broadly in deep learning, especially in convolutional neural networks (CNNs), the Bottlenet module aims to improve the efficiency and accuracy of the network by reducing the number of channels, that is, reducing the number of parameters and then increasing the number of channels. The SPPF module is composed of a ConvModule layer, a MaxPool2d layer, and a Concat layer; the SPPF module is a fast spatial pyramid pooling layer, which performs pooling operations at different scales and splices feature maps of different scales together, thereby enriching the semantic features of the feature maps; the MaxPool2d layer performs a maximum pooling operation on the feature image.

[0046] like Figure 3 As shown, in step S2, the same-layer feature dense scale connection module connects all scale features on the same layer through dense scale connection; the same-layer feature dense scale connection module can fuse features of different scales on the same layer, that is, expand the receptive field of the model, strengthen semantic information, and prevent the loss of complex features; including according to the Concat function, the k-th feature All the previous features are concatenated, and after the concatenation is completed, the convolution operation is performed through the Conv function; for each scale feature of the k layer No.1 th Layer reception scale characteristics The calculation process of all previous layer feature matrices is as follows:

[0047]

[0048] Among them, the Concat() function refers to the connection of the feature matrices of the same scale above, and the Conv() function represents a 3×3 convolution operation. express All feature matrices of the previous layer.

[0049] like Figure 4 As shown, in step S3, the feature data of different layers are connected by sparse jump connection in the heterogeneous feature sparse jump connection module; the heterogeneous feature sparse jump connection module can fuse the features of different layers by means of jump connection, strengthen the connection between internal blocks, and prevent the gradient attenuation problem in the deep network structure; including splicing the input features of different layers by using the exponential form with the input layer as the base 2 and the depth as l according to the Concat function, and performing convolution operation through the Conv function after the splicing is completed; in the k layer, the lth th The maximum number of layers that can obtain log 2 l+1 front-layer feature matrices, the input layer is in exponential form with base 2 and depth l; the calculation process is as follows:

[0050]

[0051] Among them, l-2 n ≥ 0, relative to the dense skip connection with a depth of l, the time complexity of the sparse skip connection is O(l·log 2 l); therefore, sparse skip connections are between 1 and 1+log 2 lForward propagation only adds a short distance in all layers, so this method is suitable for very deep network structures.

[0052] like Figure 5-6 As shown, in step S4, the hybrid connected full-scale segmentation model fuses the same-layer features and different-layer features through the surrounding feature data. The full-scale segmentation model is a way of fusing the surrounding features. The hybrid connected full-scale segmentation model uses dense scale connections and sparse skip connections to output the feature P′ k is composed of i-1 layer features P i-1 Downsampling through the maximum pooling function, i-layer feature P i 、i+1 layer feature P i+1 Upsampling and same-layer features P′ through bilinear interpolation function i-1 The calculation process is as follows:

[0053] P′ k =Concat(Maxpooling(Conv(P i-1 )), Conv(P i ), Bilinear(Conv(P i+1 )), Conv(Pi-1 ))

[0054] Among them, i>1, Maxpooling represents the maximum pooling function, Bilinear represents the bilinear difference function, Concat represents the feature matrix connection, and Conv represents the 3×3 convolution operation.

[0055] In the step S5, the image size, angle and dimension are adjusted according to the X-ray image data of the lungs, and the image is rotated according to the number of images, and the number of images is increased by transformation to keep the positive and negative samples balanced; finally, the lung image data is randomly divided into a training set and a test set according to a ratio of 7:3. The hybrid connection full-scale segmentation model is trained according to the generated training set and test set; the training set is input into the hybrid connection full-scale segmentation model, the TaskAligedAssigner positive sample allocation strategy is used, and the Distribution Focal Loss function is introduced as the loss function to calculate the loss value between the predicted label vector and the true label vector; the network parameters are iteratively updated using the gradient descent method until the network is converged by the loss function, and the trained hybrid connection full-scale segmentation network model is obtained. The trained hybrid connection full-scale segmentation network model is tested using a test set, and the test lung image segmentation effect diagram can be obtained, and the performance of the full-scale segmentation network model based on the hybrid connection of the present invention is analyzed and measured by evaluation indicators such as precision Precision, recall rate Recall, mean average accuracy mAP and floating point operation number GFLOPs.

[0056] The calculation process of the Distribution Focal Loss function is as follows:

[0057] DFL(y i ,y i +1) = -(i+1-y)log(y i )-(yi)log(y i +1)

[0058] Among them, y is the actual label and satisfies

[0059] Example

[0060] First, the X-ray image data of the lungs is obtained, and the image size, angle, dimension and other aspects are adjusted for preprocessing; the lung image feature extraction module is used to extract the features of the preprocessed image; the scale features on the same layer are connected through the dense scale connection module of the same layer features, and all scale features before a certain feature are spliced ​​and fused; the input features of different layers are spliced ​​through the sparse jump connection module of the different layer features, and the features of different layers are fused; the full-scale segmentation model fuses the same layer features and the different layer features to output the feature P′ k ; Based on the output feature P′ k Finally, the lung image segmentation result map is obtained.

[0061] like Figure 7 As shown, the heat maps of different algorithms and the algorithm of the present invention on the same data set are displayed. Through comparative analysis, the algorithm of the present invention has more obvious lung image segmentation and more convergent features on the thermal effect map compared with other algorithms, thus proving the superiority of the present invention.

[0062] The algorithm of this scheme, the Mask R-CNN algorithm and the Yolov8 algorithm simultaneously segment the same lung image dataset to obtain different lung image segmentation result images; the performance of different algorithms is analyzed based on different lung image segmentation result images through evaluation indicators such as precision, recall, average accuracy mAP@0.5, average accuracy mAP@0.5-0.95 and floating point operation number GFLOPs, as shown in Table 1 below.

[0063] Table 1 Comparative experiments on instance segmentation methods

[0064]

[0065] It can be seen from Table 1 that the algorithm of the present invention is higher than the Mask R-CNN algorithm and the Yolov8 algorithm in terms of precision, recall, average accuracy mAP@0.5 and average accuracy mAP@0.5-0.95; and the number of floating-point operations GFLOPs of the algorithm of the present invention is lower than that of the Mask R-CNN algorithm and the Yolov8 algorithm; the algorithm of the present invention has the best performance effect in each evaluation index, thus proving the superiority of the present invention.

[0066] like Figure 8 As shown, the example segmentation effect diagrams of different algorithms and the algorithm of the present invention on the data set are displayed. Through comparative analysis, compared with other algorithms, the algorithm of the present invention has higher lung image segmentation confidence and better segmentation effect in the example segmentation process, which can also prove the superiority of the present invention.

[0067] The above is only a description of the preferred embodiments of the present invention. Ordinary technicians in this technical field can make several modifications and optimizations based on the above disclosure without departing from the above basic principles. These improvements and optimizations should be regarded as the understood protection scope of the present invention.

Claims

1. A full-scale lung image segmentation algorithm based on hybrid connection, Features: The following steps are involved: S1. ConvModule, C2f, DarknetBottlenet and SPPF modules are used to construct a lung image feature extraction module. S2, constructing a dense scale connection module for the same-layer features that connects the scale features on the same layer; S3, constructing a heterogeneous feature sparse skip connection module that fuses feature data of different layers in a skip connection manner; S4, constructing a hybrid connection full-scale segmentation model through dense scale connection of the same-layer feature dense scale connection module and sparse skip connection of the different-layer feature sparse skip connection module; S5. Train the hybrid connected full-scale segmentation model based on the training set and test set generated by the lung image data; and use the trained full-scale segmentation model to obtain a lung image segmentation result map.

2. The full-scale lung image segmentation algorithm based on hybrid connection according to claim 1, Features: In step S1, the network structure of the lung image feature extraction module is composed of a ConvModule module, a ConvModule module, a C2f module, a ConvModule module, a C2f module, a ConvModule module, a C2f module, a ConvModule module, a C2f module and a SPPF module connected in sequence.

3. The full-scale lung image segmentation algorithm based on hybrid connection according to claim 2, Features: The ConvModule module is composed of a Conv2d layer, a BatchNorm2d layer and a SiLU layer; the C2f module is composed of a ConvModule layer, a Split layer, a DarknetBottlenet layer and a Concat layer; the DarknetBottlenet module is composed of a ConvModule layer and a Concat layer; the SPPF module is composed of a ConvModule layer, a MaxPool2d layer and a Concat layer.

4. The full-scale lung image segmentation algorithm based on hybrid connection according to claim 1, Features: In step S2, all scale features on the same layer are connected by dense scale connection in the same layer feature dense scale connection module; Including concat function to k layer l feature All the previous features are concatenated, and after the concatenation is completed, the convolution operation is performed through the Conv function; the calculation process is as follows: Among them, the Concat() function refers to the connection of the feature matrices of the same scale above, and the Conv() function represents the convolution operation. express All feature matrices of the previous layer.

5. The full-scale lung image segmentation algorithm based on hybrid connection according to claim 1, Features: In step S3, the feature data of different layers are connected by sparse jump connection in the heterogeneous feature sparse jump connection module; the input features of different layers are spliced ​​by using the exponential form of the input layer with a base of 2 and a depth of 1 according to the Concat function, and after the splicing is completed, the convolution operation is performed by the Conv function; the calculation process is as follows: Among them, l-2 n ≥ 0, relative to the dense skip connection with depth l, the time complexity of sparse skip connection is o(l·log 2 l).

6. The full-scale lung image segmentation algorithm based on hybrid connection according to claim 1, Features: In step S4, the hybrid connected full-scale segmentation model uses dense scale connections and sparse skip connections to output feature P′ k is composed of i-1 layer features P i-1 Downsampling through the maximum pooling function, i-layer feature P i 、i+1 layer feature P i+1 Upsampling and same-layer features P′ through bilinear interpolation function i-1 The calculation process is as follows: P′ k =Concat(Maxpooling(Conv(P i-1 )),Conv(P i ),Bilinear(Conv(P i+1 )),Conv(P i-1 )) Among them, i>1, Maxpooling represents the maximum pooling function, Bilinear represents the bilinear difference function, Concat represents the feature matrix connection, and Conv represents the convolution operation.

7. The full-scale lung image segmentation algorithm based on hybrid connection according to claim 1, Features: In the step S5, a hybrid connected full-scale segmentation model is trained according to the generated training set and test set; the training set is input into the hybrid connected full-scale segmentation model, the TaskAligedAssigner positive sample allocation strategy is used, and the Distribution Focal Loss function is introduced as the loss function to calculate the loss value between the predicted label vector and the true label vector; The gradient descent method is used to iteratively update the network parameters until the network loss function converges, and a trained hybrid connected full-scale segmentation network model is obtained.

8. The full-scale lung image segmentation algorithm based on hybrid connection according to claim 7, Features: The calculation process of the Distribution Focal Loss function is as follows: DFL(and i ,and i +1)=-(i+1-y)log(y i )-(yi)log(y i +1) Among them, y is the actual label and satisfies

Citation Information

Patent Citations

  • Weld defect detection method based on improved YOLOX

    CN114240821A

  • Multi-target tracking and behavior statistics method for health-preserving pigs in group

    CN115830490A

  • CXR image classification method and system based on residual convolution and multi-head self-attention

    CN115995015A

  • Power lithium battery pole welding quality detection method based on YOLOv7

    CN116452569A

  • Deep learning-based tomato disease and insect pest detection and identification method

    CN116630803A

Cited By

  • Separable multi-scale feature fusion method for image small target detection

    CN120747689A