Method and device for segmenting lung vessels in ct images, terminal device and medium

The lung vessel segmentation model, which combines depthwise separable convolution and the Swing Transformer module, solves the problem of time-consuming and labor-intensive methods in traditional approaches, achieves efficient lung vessel segmentation, and improves segmentation accuracy.

CN116740081BActive Publication Date: 2026-04-28HEBEI NORMAL UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HEBEI NORMAL UNIV
Filing Date
2023-07-31
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Traditional methods for segmenting pulmonary vessels require extensive human-computer interaction to improve accuracy when dealing with the dense network of blood vessels in the lungs, which is time-consuming and inefficient.

Method used

A lung vessel segmentation model combining a depthwise separable convolutional module and a Swing Transformer module is adopted. By acquiring local and global feature information, and fusing the multi-dimensional feature calibration module and residual module in the decoding stage, a sequence-to-sequence image segmentation network is formed, thereby improving the segmentation accuracy.

Benefits of technology

It can improve the segmentation accuracy of small branches of pulmonary blood vessels without requiring extensive human-computer interaction, saving time and increasing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116740081B_ABST
    Figure CN116740081B_ABST
Patent Text Reader

Abstract

The application is suitable for the technical field of image processing, and provides a lung blood vessel segmentation method and device in a CT image, a terminal equipment and a medium. The method comprises the following steps: acquiring a lung CT image to be segmented, and inputting the lung CT image to a pre-trained lung blood vessel segmentation model to output a segmentation result of lung blood vessels in the lung CT image; the lung blood vessel segmentation model comprises an encoder and a decoder; the encoder comprises a depth separable convolution module and a Swin Transformer module, and the two modules are respectively used for acquiring local feature information and global feature information of the lung CT image to be segmented; the decoder comprises a residual module, a multi-dimensional feature calibration module, an up-sampling path and a channel splicing module; the residual module, the multi-dimensional feature calibration module, the up-sampling path and the channel splicing module are used for fusing the local feature information and the global feature information. The application can improve the segmentation accuracy of small branches of lung blood vessels.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing technology, and in particular relates to a method, device, terminal equipment and medium for segmenting pulmonary vessels in CT images. Background Technology

[0002] The lungs contain abundant vascular tissue, and the segmentation and visualization of this tissue are crucial for computer-aided diagnosis of lung diseases. Therefore, research on key technologies for computer-aided surgical systems focused on pulmonary vascular segmentation is of great significance.

[0003] Traditional lung vessel segmentation methods extract features from lung CT scans, assign an objective function to each CT image, and then use optimization algorithms such as gradient descent to obtain the optimal model parameters. However, when dealing with the dense network of blood vessels in the lungs, these traditional methods rely heavily on human-computer interaction to improve accuracy, making them extremely time-consuming. Summary of the Invention

[0004] To overcome the problems existing in related technologies, this application provides a method, device, terminal equipment and medium for segmenting pulmonary vessels in CT images, which can improve the segmentation accuracy of small branches of pulmonary vessels.

[0005] This application is achieved through the following technical solution:

[0006] In a first aspect, embodiments of this application provide a method for segmenting pulmonary vessels in CT images, including:

[0007] Obtain the lung CT image to be segmented;

[0008] The lung CT image to be segmented is input into a pre-trained lung vessel segmentation model, which outputs the segmentation results of the lung vessels in the lung CT image. The lung vessel segmentation model includes an encoder and a decoder. The encoder includes a depthwise separable convolution module and a Swin Transformer module. The depthwise separable convolution module is used to obtain local feature information of the lung CT image to be segmented, and the Swin Transformer module is used to obtain global feature information of the lung CT image to be segmented. The decoder includes a residual module, a multi-dimensional feature calibration module, an upsampling path, and a channel stitching module. The residual module, multi-dimensional feature calibration module, upsampling path, and channel stitching module are used to fuse local and global feature information.

[0009] In one possible implementation of the first aspect, the lung CT image to be segmented is input to a depth-separable convolutional module, and the depth-separable convolutional module outputs a second intermediate feature map; the second intermediate feature map represents the local feature information of the lung CT image to be segmented.

[0010] The second intermediate feature map is input into the Swing Transformer module, and the Swing Transformer module outputs the third intermediate feature map, the fourth intermediate feature map, and the bottom feature map; the third intermediate feature map, the fourth intermediate feature map, and the bottom feature map represent the global feature information of the lung CT image.

[0011] In one possible implementation of the first aspect, the depth-separable convolutional module includes a Conv1 convolutional layer, a Conv2 convolutional layer, and a Conv3 convolutional layer; after the lung CT image is processed by the Conv1 convolutional layer, the Conv2 convolutional layer, and the Conv3 convolutional layer in sequence, a second intermediate feature map is output.

[0012] The Swin Transformer module includes a first Swin Transformer module, a second Swin Transformer module, and a third Swin Transformer module;

[0013] After the second intermediate feature map is mapped to a 1D sequence, it is input into the first Swing Transformer module and outputs the third intermediate feature map; the third intermediate feature map is input into the second Swing Transformer module and outputs the fourth intermediate feature map; the third intermediate feature map is input into the third Swing Transformer module and outputs the bottom layer feature map.

[0014] In one possible implementation of the first aspect, the first Swing Transformer module includes a first Blocks and a first Merging; the first Blocks include, in sequence, a first Layer Normlization layer, a first regular window partitioning multi-head self-attention (W-MSA) layer, a second Layer Normlization layer, a first fully connected (Multi-Layer Perception, MLP) layer, a first Linear Normlization layer, a first moving window partitioning multi-head self-attention (Shifted Windows Multi-Head Self-Attention, SW-MSA) layer, a third Layer Normlization layer, and a second fully connected layer; the first Blocks outputs an unmerged third intermediate feature map; the unmerged third intermediate feature map is input to the first Merging, and the first Merging outputs the third intermediate feature map.

[0015] The second Swing Transformer module includes a second Blocks and a second Merging. The second Blocks consist of a fourth Layer Normization layer, a second W-MSA layer, a fifth Layer Normization layer, a third fully connected layer, a second Linear Normization layer, a second SW-MSA layer, a sixth Layer Normization layer, and a fourth fully connected layer, arranged sequentially. The second Blocks outputs an unmerged fourth intermediate feature map. The unmerged fourth intermediate feature map is input into the second Merging, and the second Merging outputs the fourth intermediate feature map.

[0016] The third Swing Transformer module includes the third Blocks and the third Merging. The third Blocks consists of the seventh Layer Normization layer, the third W-MSA layer, the eighth Layer Normization layer, the fifth fully connected layer, the third Linear Normization layer, the third SW-MSA layer, the ninth Layer Normization layer, and the sixth fully connected layer, arranged sequentially. The third Blocks outputs unmerged low-level feature maps. The unmerged low-level feature maps are input into the third Merging, and the third Merging outputs low-level feature maps.

[0017] In one possible implementation of the first aspect, the residual module includes a first residual module, a second residual module, a third residual module, and a fourth residual module; the multi-dimensional feature calibration module includes a first multi-dimensional feature calibration module, a second multi-dimensional feature calibration module, a third multi-dimensional feature calibration module, a fourth multi-dimensional feature calibration module, and a fifth multi-dimensional feature calibration module; the upsampling path includes a first upsampling path, a second upsampling path, a third upsampling path, and a fourth upsampling path; and the channel stitching module includes a first channel stitching module, a second channel stitching module, a third channel stitching module, and a fourth channel stitching module.

[0018] The bottom-level feature map is input into the fifth multi-dimensional feature calibration module, which outputs the fifth target feature map; the fifth target feature map is then input into the fourth channel stitching module.

[0019] The fourth intermediate feature map is input to the fourth residual module, the fourth residual module outputs the fourth feature map, the fourth feature map is input to the fourth channel stitching module through the fourth upsampling path; the fourth channel stitching module stitches the fifth target feature map and the fourth feature map and outputs the fourth stitched feature map; the fourth stitched feature map is input to the fourth multi-dimensional feature calibration module, the fourth multi-dimensional feature calibration module outputs the fourth target feature map;

[0020] The third intermediate feature map is input to the third residual module, the third residual module outputs the third feature map, the third feature map is input to the third channel stitching module through the third upsampling path; the third channel stitching module stitches the fourth target feature map and the third feature map together and outputs the third stitched feature map; the third stitched feature map is input to the third multi-dimensional feature calibration module, the third multi-dimensional feature calibration module outputs the third target feature map;

[0021] The second intermediate feature map is input to the second residual module, the second residual module outputs the second feature map, and the second feature map is input to the second channel stitching module through the second upsampling path; the second channel stitching module stitches the third target feature map and the second feature map together and outputs the second stitched feature map; the second stitched feature map is input to the second multi-dimensional feature calibration module, and the second multi-dimensional feature calibration module outputs the second target feature map;

[0022] The first intermediate feature map is input to the first residual module, and the first residual module outputs the first feature map; the first intermediate feature map is a lung CT image; the first feature map is input to the first channel stitching module through the first upsampling path; the first channel stitching module stitches the second target feature map and the first feature map together and outputs the first stitched feature map; the first stitched feature map is input to the first multi-dimensional feature calibration module, and the first multi-dimensional feature calibration module outputs the first target feature map; the first target feature map is processed by the Head function to obtain the segmentation result of the lung vessels.

[0023] In one possible implementation of the first aspect, the first multi-dimensional feature calibration module, the second multi-dimensional feature calibration module, the third multi-dimensional feature calibration module, the fourth multi-dimensional feature calibration module, and the fifth multi-dimensional feature calibration module have the same structure;

[0024] Each multi-dimensional feature calibration module includes a channel reconstruction unit and a calibration unit. The channel reconstruction unit integrates a spatial feature map along the three axes of depth, height, and width, based on the feature map input to each multi-dimensional feature calibration module, and performs channel reconstruction on the spatial feature map to output a channel-reconstructed feature map. The calibration unit performs element-wise multiplication on the spliced ​​feature map and the channel-reconstructed feature map input to each multi-dimensional feature calibration module to generate the corresponding target feature map.

[0025] In one possible implementation of the first aspect, before inputting the lung CT image into a pre-trained lung vessel segmentation model and outputting the lung vessel segmentation result of the lung CT image, the lung vessel segmentation method in the CT image further includes:

[0026] Obtain a sample set of lung CT images;

[0027] Obtain the gold standard for pulmonary vessel segmentation;

[0028] Calculate the loss between the predicted segmentation result obtained by training a pre-built pulmonary vessel segmentation model for each lung CT image sample in the lung CT image sample set and the gold standard for pulmonary vessel segmentation; loss Loss The expression is:

[0029]

[0030] in, The Dess loss term represents the difference between the gold standard and the predicted segmentation result. The cross-entropy loss term is the difference between the gold standard and the predicted segmentation result. The constraint weights for the Des loss term, These are the constraint weights for the cross-entropy loss term;

[0031] Based on the loss between the predicted segmentation result and the gold standard for lung vessel segmentation, the network parameters of the lung vessel segmentation model are updated, and after a preset number of iterations, the training of the lung vessel segmentation model is terminated, resulting in a well-trained lung vessel segmentation model.

[0032] Secondly, embodiments of this application provide a lung vessel segmentation device in CT images, comprising:

[0033] Image acquisition module, used to acquire lung CT images to be segmented;

[0034] The image segmentation module is used to input lung CT images into a pre-trained lung vessel segmentation model and output the segmentation results of lung vessels in the lung CT images. The lung vessel segmentation model includes an encoder and a decoder. The encoder includes a depthwise separable convolution module and a Swin Transformer module. The depthwise separable convolution module is used to obtain local feature information of the lung CT image to be segmented, and the Swin Transformer module is used to obtain global feature information of the lung CT image. The decoder includes a residual module, a multi-dimensional feature calibration module, an upsampling path, and a channel stitching module. The residual module, multi-dimensional feature calibration module, upsampling path, and channel stitching module are used to fuse local and global feature information.

[0035] Thirdly, embodiments of this application provide a terminal device, including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the computer program, it implements the lung vessel segmentation method in CT images as described in any of the first aspects.

[0036] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements a method for segmenting pulmonary vessels in CT images as described in any of the first aspects.

[0037] The beneficial effects of the embodiments in this application compared with the prior art are:

[0038] In this embodiment, a pre-constructed lung vessel segmentation model is used. During the encoding stage, local feature information is obtained using depthwise separable convolution, and global feature information is obtained using the Swing Transformer module. The combination of depthwise separable convolution and Swing Transformer module strengthens the correlation between global spatial information and local detail information. During the decoding stage, a multi-dimensional feature calibration module combined with a residual module is integrated into the overall network of the lung vessel segmentation model to form a sequence-to-sequence image segmentation network. This enhances the detection of tubular structures in the lungs and improves the segmentation accuracy of small branches of lung vessels without requiring extensive human-computer interaction. This results in more accurate lung vascular plexuses, saves time, and improves efficiency.

[0039] It is understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here.

[0040] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this specification. Attached Figure Description

[0041] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0042] Figure 1 This is a schematic flowchart of a method for segmenting pulmonary vessels in CT images provided in an embodiment of this application;

[0043] Figure 2 This is a schematic diagram of the structure of a lung vessel segmentation model provided in an embodiment of this application;

[0044] Figure 3 This is a schematic diagram of the structure of the first Blocks provided in an embodiment of this application;

[0045] Figure 4 This is a schematic diagram of the operation of a multi-dimensional feature calibration module provided in an embodiment of this application;

[0046] Figure 5 This is a schematic diagram of the segmentation results of pulmonary vessels obtained by various methods provided in an embodiment of this application;

[0047] Figure 6This is a schematic diagram of the structure of a lung vessel segmentation device in a CT image provided in an embodiment of this application;

[0048] Figure 7 This is a schematic diagram of the structure of a terminal device provided in an embodiment of this application. Detailed Implementation

[0049] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0050] It should be understood that, when used in this application specification, the term "comprising" indicates the presence of the described feature, integral, step, operation, element, and / or component, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components, and / or collections thereof.

[0051] It should also be understood that the term “and / or” as used in this application specification means any combination of one or more of the associated listed items, as well as all possible combinations, and includes such combinations.

[0052] As used in this application specification, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be interpreted, depending on the context, as "once determined," "in response to determination," "once [the described condition or event] is detected," or "in response to detection of [the described condition or event]."

[0053] Furthermore, in the description of this application, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0054] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0055] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0056] Figure 1 This is a schematic flowchart of a method for segmenting pulmonary vessels in CT images according to an embodiment of this application, with reference to... Figure 1 The detailed description of the lung vessel segmentation method in this CT image is as follows:

[0057] Step 101: Obtain the lung CT image to be segmented.

[0058] For example, preliminary preprocessing of the three-dimensional CT data of lung CT images is performed by adjusting window width and window level, resampling, and extracting lung parenchyma.

[0059] For example, the above preprocessing process may include: firstly, iterating through all three-dimensional CT data of the three-dimensional lung CT images, adjusting the window width to 1800, adjusting the window level to -500, resampling all CT images, and setting the slice spacing size to [value missing]. To ensure consistent spacing between slices, lung parenchyma masks are extracted from all 3D CT data to achieve lung parenchyma pre-segmentation and eliminate interference from outside the lung region. The preprocessed 3D lung CT images are stored in NumPy arrays in NIFTI format to obtain the lung CT images to be segmented.

[0060] Before segmentation, the lung parenchyma mask is extracted using the above-mentioned lung parenchyma pre-segmentation method, providing reliable prior knowledge for the subsequent lung vessel segmentation model, thereby improving the segmentation accuracy of lung vessels.

[0061] Step 102: Input the lung CT image to be segmented into a pre-trained lung vessel segmentation model and output the segmentation result of the lung vessels in the lung CT image. The lung vessel segmentation model includes an encoder and a decoder. The encoder includes a depthwise separable convolution module and a Swin Transformer module. The depthwise separable convolution module is used to obtain local feature information of the lung CT image to be segmented, and the Swin Transformer module is used to obtain global feature information of the lung CT image to be segmented. The decoder includes a residual module, a multi-dimensional feature calibration module, an upsampling path, and a channel stitching module. The residual module, the multi-dimensional feature calibration module, the upsampling path, and the channel stitching module are used to fuse local feature information and global feature information.

[0062] By using a pre-built lung vessel segmentation model, and in the encoding stage, depthwise separable convolution is used to obtain local feature information, while the Swing Transformer module is used to obtain global feature information. The combination of depthwise separable convolution and Swing Transformer module enhances the correlation between global spatial information and local detail information. In the decoding stage, a multi-dimensional feature calibration module combined with a residual module is integrated into the overall network of the lung vessel segmentation model to form a sequence-to-sequence image segmentation network. This enhances the detection of tubular structures in the lungs, improves the segmentation accuracy of small branches of lung vessels without requiring extensive human-computer interaction, obtains more accurate lung vascular plexuses, and saves time and improves efficiency.

[0063] For a clearer understanding of the technical solution of this application, please refer to [link / reference]. Figure 2 The detailed structure of the lung vessel segmentation model is as follows:

[0064] For example, in the encoder section, the lung CT image to be segmented is input to the depth-separable convolution module, and the depth-separable convolution module outputs a second intermediate feature map; the second intermediate feature map represents the local feature information of the lung CT image to be segmented. For ease of description, in the decoder section, the lung CT image to be segmented is referred to as the first intermediate feature map B1.

[0065] After the second intermediate feature map is mapped to a 1D sequence, it is input into the Swin Transformer module. The Swin Transformer module outputs the third intermediate feature map B3, the fourth intermediate feature map B4, and the bottom feature map B5. The third intermediate feature map B3, the fourth intermediate feature map B4, and the bottom feature map B5 represent the global feature information of the lung CT image to be segmented.

[0066] For example, the depth-separable convolutional module includes a Conv1 convolutional layer, a Conv2 convolutional layer, and a Conv3 convolutional layer; the lung CT image to be segmented is processed sequentially through the Conv1 convolutional layer, the Conv2 convolutional layer, and the Conv3 convolutional layer to output a second intermediate feature map B2.

[0067] For example, the lung CT image to be segmented is sequentially downsampled through three depthwise separable convolutional layers. These three layers include a first Conv convolutional layer, a second Conv convolutional layer, and a third Conv convolutional layer. The first Conv convolutional layer includes a Conv1 convolutional layer and a Conv1_1 convolutional layer; the second Conv convolutional layer includes a Conv2 convolutional layer and a Conv2_1 convolutional layer; and the third Conv convolutional layer includes a Conv3 convolutional layer and a Conv3_1 convolutional layer. During the downsampling process, the number of channels increases, the resolution decreases, and the final output of the second intermediate feature map B2 is as follows:

[0068] A lung CT image of size H×W×D is input into a Conv1 convolutional layer for Conv1 convolution operation: the lung CT image is convolved once with a 3×3×3 convolution, the number of channels is 24, the stride is 1, and the padding is 1; where padding of 1 means that the image is surrounded by 0 pixels.

[0069] Next, a Conv1_1 convolution operation is performed, consisting of a 3×3×3 convolution with 24 channels, a stride of 1, and 0 padding. Then, average pooling is performed with a stride of 2 and 0 padding. Finally, the ReLU activation function is applied. Note that 0 padding indicates that no pixel padding is applied around the image.

[0070] Then perform a Conv2 convolution operation, a 3×3×3 convolution with 48 channels, a stride of 1, and padding of 1.

[0071] Next, perform a Conv2_1 convolution operation, a 3×3×3 convolution with 48 channels, a stride of 1, and padding of 0. Then, perform average pooling with a stride of 2 and padding of 0. Finally, perform the ReLU activation function.

[0072] Then perform a Conv3 convolution operation, a 3×3×3 convolution with 96 channels, a stride of 1, and padding of 1.

[0073] Next, perform a Conv3_1 convolution operation, a 3×3×3 convolution with 96 channels, a stride of 1, and 0 padding. Then, perform average pooling with a stride of 2 and 0 padding. Finally, apply the ReLU activation function, and the output size is... The second intermediate feature map B2.

[0074] The second intermediate feature map B2 is subjected to a patch partitioning operation and a linear embedding operation, mapping the output feature map into a 1D sequence. This 1D mapping allows the second intermediate feature map B2 to be input into the Swing Transformer module.

[0075] The Swin Transformer module includes a first Swin Transformer module, a second Swin Transformer module, and a third Swin Transformer module.

[0076] After the second intermediate feature map B2 is mapped to a 1D sequence, it is input into the first Swing Transformer module and outputs the third intermediate feature map B3; the third intermediate feature map B3 is input into the second Swing Transformer module and outputs the fourth intermediate feature map B4; the third intermediate feature map B3 is input into the third Swing Transformer module and outputs the bottom feature map B5.

[0077] For example, the first Swin Transformer module includes a first Blocks and a first Merging; Figure 2 In this context, Blocks1 and Merging1 represent the first Blocks and the first Merging layer, respectively. The first Blocks includes the following layers set sequentially: the first Layer Normization layer, the first W-MSA layer, the second Layer Normization layer, the first MLP layer, the first Linear Normization layer, the first SW-MSA layer, the third Layer Normization layer, and the second MLP layer, as follows: Figure 3 As shown. In Figure 3 In this diagram, Layer Norm1 represents the first Layer Normization layer, Layer Norm2 represents the second Layer Normization layer, Layer Norm3 represents the third Layer Normization layer, W-MSA1 represents the first W-MSA layer, MLP1 represents the first MLP layer, MLP2 represents the second MLP layer, SW-MSA1 represents the first SW-MSA layer, and Linear Norm1 represents the first Linear Normization layer. Since the first, second, and third blocks have the same structure, only their labels differ, Figure 3 If only the first block is shown, the structures of the second and third blocks are already clear, and will not be repeated here. Figure 3 middle, This indicates that the input feature map is concatenated channel by channel, and the concatenated feature map is output. The first Blocks outputs the unmerged third intermediate feature map B3; the unmerged third intermediate feature map is input into the first Merging operation, and the output is the third intermediate feature map B3. Through the Merging operation, the matrices of adjacent windows of the unmerged third intermediate feature map are combined into one, and adjacent patches are concatenated channel by channel, with 192 channels. The final output size is [size missing]. The third intermediate feature map B3.

[0078] The second Swing Transformer module includes the second Blocks and the second Merging; Figure 2 In this code, Blocks2 and Merging2 represent the second Blocks and the second Merging, respectively. The second Blocks consist of the following layers arranged sequentially: the fourth Layer Normization layer, the second W-MSA layer, the fifth Layer Normization layer, the third MLP layer, the second Linear Normization layer, the second SW-MSA layer, the sixth Layer Normization layer, and the fourth MLP layer. The second Blocks outputs a fourth intermediate feature map B4. The unmerged fourth intermediate feature map is input into the second Merging layer, which outputs another fourth intermediate feature map, B4. Through the Merging operation, adjacent patches are concatenated along channels, resulting in 384 channels. The final output size is [size missing]. The fourth intermediate feature map B4.

[0079] The third Swing Transformer module includes the third Blocks and the third Merging; Figure 2 In this code, Blocks3 and Merging3 represent the third Blocks and the third Merging, respectively. The third Blocks consist of the following layers arranged sequentially: the seventh Layer Normization layer, the third W-MSA layer, the eighth Layer Normization layer, the fifth MLP layer, the third Linear Normization layer, the third SW-MSA layer, the ninth Layer Normization layer, and the sixth MLP layer. The third Blocks outputs the bottom feature map B5. The unmerged bottom feature map is input into the third Merging layer, which outputs the bottom feature map B5. Through the Merging operation, adjacent patches are concatenated along channels, resulting in 768 channels. The final output size is [size missing]. The underlying feature map B5.

[0080] For example, the encoding stage uses three layers of depthwise separable convolutional layers and three stages of the SwinTransformer module to fuse global spatial information and local detail information, thereby enhancing the ability to extract tubular information.

[0081] For example, in the decoder section, five decoding paths can be set. The jump connection from the encoding section to the decoding section is implemented through residuals. Therefore, in this embodiment, the encoder and decoder are connected through residual modules. The residual modules include a first residual module Res1, a second residual module Res2, a third residual module Res3, and a fourth residual module Res4; the multi-dimensional feature calibration modules include a first multi-dimensional feature calibration module FR1, a second multi-dimensional feature calibration module FR2, a third multi-dimensional feature calibration module FR3, a fourth multi-dimensional feature calibration module FR4, and a fifth multi-dimensional feature calibration module FR5; the upsampling paths include a first upsampling path UP1, a second upsampling path UP2, a third upsampling path UP3, and a fourth upsampling path UP4; the channel splicing modules include a first channel splicing module Con1, a second channel splicing module Con2, a third channel splicing module Con3, and a fourth channel splicing module Con4.

[0082] For example, the above upsampling paths all achieve increased channels and resolution through deconvolution.

[0083] The bottom feature map B5 is input to the fifth multi-dimensional feature calibration module FR5, and the fifth multi-dimensional feature calibration module FR5 outputs the fifth target feature map E5; the fifth target feature map E5 is input to the fourth channel stitching module Con4.

[0084] The fourth intermediate feature map B4 is input to the fourth residual module Res4. The fourth residual module Res4 outputs the fourth feature map C4. The fourth feature map C4 is input to the fourth channel stitching module Con4 through the fourth upsampling path UP4. The fourth channel stitching module Con4 stitches the fifth target feature map E5 and the fourth feature map C4 and outputs the fourth stitched feature map D4. The fourth stitched feature map D4 is input to the fourth multi-dimensional feature calibration module FR4. The fourth multi-dimensional feature calibration module FR4 outputs the fourth target feature map E4.

[0085] The third intermediate feature map B3 is input to the third residual module Res3, which outputs the third feature map C3. The third feature map C3 is then input to the third channel stitching module Con3 via the third upsampling path UP3. The third channel stitching module Con3 stitches the fourth target feature map E4 and the third feature map C3 together and outputs the third stitched feature map D3. The third stitched feature map D3 is input to the third multi-dimensional feature calibration module FR3, which outputs the third target feature map E3.

[0086] The second intermediate feature map B2 is input to the second residual module Res2, and the second residual module Res2 outputs the second feature map C2. The second feature map C2 is input to the second channel stitching module Con2 through the second upsampling path UP2. The second channel stitching module Con2 stitches the third target feature map E3 and the second feature map C2 together and outputs the second stitched feature map D2. The second stitched feature map D2 is input to the second multi-dimensional feature calibration module FR2, and the second multi-dimensional feature calibration module FR2 outputs the second target feature map E2.

[0087] The first intermediate feature map B1 is input to the first residual module Res1, and the first residual module Res1 outputs the first feature map C1; the first intermediate feature map B1 is a lung CT image; the first feature map C1 is input to the first channel stitching module Con1 through the first upsampling path UP1; the first channel stitching module Con1 stitches the second target feature map E2 and the first feature map C1 and outputs the first stitched feature map D1; the first stitched feature map D1 is input to the first multi-dimensional feature calibration module FR1, and the first multi-dimensional feature calibration module FR1 outputs the first target feature map E1; the first target feature map E1 is processed by the Head function to obtain the segmentation result of the lung vessels.

[0088] For example, to reduce feature loss due to downsampling, a residual module and a multi-dimensional feature calibration module are used in the depthwise separable convolution and each SwinTransformer stage. The residual module concatenates the feature map of the corresponding resolution output of the encoding path of the same layer with the feature map of the corresponding layer in the decoding stage along the channel dimension, preserving the original image features in the encoding stage to enhance the detailed features of the tubular structure and reduce information loss. The channel concatenation module obtains the final deformation field by fusing features at different scales. The multi-dimensional feature calibration module adaptively adjusts the weights of blood vessels and non-blood vessels to further supplement and calibrate the tubular information.

[0089] For example, the first multi-dimensional feature calibration module FR1, the second multi-dimensional feature calibration module FR2, the third multi-dimensional feature calibration module FR3, the fourth multi-dimensional feature calibration module FR4, and the fifth multi-dimensional feature calibration module FR5 have the same structure.

[0090] Each multi-dimensional feature calibration module includes a channel reconstruction unit and a calibration unit. The channel reconstruction unit integrates a spatial feature map along the three axes of depth, height, and width, based on the feature map input to each multi-dimensional feature calibration module, and performs channel reconstruction on the spatial feature map to output a channel-reconstructed feature map. The calibration unit performs element-wise multiplication on the spliced ​​feature map and the channel-reconstructed feature map input to each multi-dimensional feature calibration module to generate the corresponding target feature map.

[0091] For example, such as Figure 4 As shown, a multi-dimensional feature calibration module is embedded in the decoder to further supplement and calibrate the tubular structure feature information. Represents the height of the feature map. The width of the feature map. Represents the depth of the feature map. This represents the number of channels in the input feature map.

[0092] The input is the first Activation features of layer decoding path For FR1, the first concatenated feature map D1 is used as the activation feature. The input is fed into FR1; for FR2, the second concatenated feature map D2 is used as the activation feature. The input is fed into FR2; for FR3, the third concatenated feature map D3 is used as the activation feature. The input is fed into FR3; for FR4, the fourth concatenated feature map D4 is used as the activation feature. The input is fed into FR4; for FR5, the bottom feature map B5 is used as the activation feature. Enter it into FR5. First, via... A spatial feature map highlighting important regions is integrated along three axes: depth, height, and width. Next, a channel reconstruction operation is performed on the spatial feature map to obtain a channel-reconstructed feature representation. Finally, by and Performing element-wise multiplication produces a recalibrated feature representation. .in r This represents the channel compression factor.

[0093] Compared to adaptive or global pooling operations, channel reconstruction of spatial feature maps involves spatially distinguishing between bronchioles and terminal small vessels and thick bronchioles and vessels. Therefore, a spatial integration method is proposed. The relatively important regions of the tubular structure are preserved, and the calculation is defined as follows:

[0094]

[0095] in, Indicates to Perform spatial integration. Indicates the pair along the depth. Perform spatial integration. Indicates the height along the pair Perform spatial integration. Indicates the pair along the width. Perform spatial integration. represent Broadcast operations in the library; Represents the height of the feature map. The width of the feature map. Represents the depth of the feature map. The number of channels in the input feature map; To limit two of them to j and k A four-dimensional array; To limit two of them to i and k A four-dimensional array, To limit two of them to i and j A four-dimensional array; , and The learnable parameters represent the depth of each feature slice. i Height is j and width are k Weight combinations in dimensions i =1, 2, ..., , j =1, 2, ..., , k =1, 2, ..., After obtaining the combined weights, we plan to apply activation techniques to model the inter-channel dependencies on the compressed spatial graph. The specific steps are as follows:

[0096]

[0097] in, , They represent two respectively 3D convolution kernels, Represents convolution; combining weights and After the convolution kernel is calculated, the number of channels is reduced to ,and After the convolution kernel is calculated, the number of channels is restored to [previous value]. ;ratio r It is the compression factor that determines the degree of reduction; for Activation function for Activation function. Given the activated convolutional features. and channel combination representation Recalibrated features Defined as follows:

[0098]

[0099] in, This represents element-wise multiplication.

[0100] For example, the E1, E2, E3, E4, and E5 output by each multi-dimensional feature calibration module are all recalibrated features. .

[0101] The intermediate feature maps B1, B2, B3, and B4, and the bottom feature map B5 from the encoding stage are input into the decoder for the decoding stage. In the decoding stage, the vascular features are further recalibrated using a multi-dimensional feature calibration module, outputting the target feature map. Specifically, the channel reconstruction unit performs weighted combination along each spatial dimension to better utilize features learned from the neural network, ensuring the relative priority of activated regions of lung tubular structures and strengthening the representation learning of tubular objects. The calibration unit then performs element-wise multiplication of the spliced ​​feature map from each multi-dimensional feature calibration module and the channel reconstruction feature map, thereby better segmenting intrapulmonary tubular structures, solving the problem of discontinuous segmentation of lung tubular structures, and further improving the accuracy of lung tubular structure information acquisition. The aforementioned multi-dimensional feature calibration module improves the efficiency of the network in extracting image feature information and integrates image spatial information.

[0102] The final first target feature map is processed by the Head function, that is, after... Convolution yields the final segmentation result of the pulmonary blood vessels.

[0103] In one embodiment, before inputting the lung CT image into a pre-trained lung vessel segmentation model and outputting the lung vessel segmentation result of the lung CT image, the lung vessel segmentation method in the CT image further includes:

[0104] Based on the structure of the above-mentioned lung vessel segmentation model, the lung vessel segmentation model is trained. This embodiment is implemented on a computer with a CPU of Xeon(R) W-2255 3.70GHz, a graphics card of NVIDIA Geforce RTX 3090, and 64GB of memory. The implementation method is Python, and the deep learning framework is PyTorch.

[0105] Step 201: Obtain a sample set of lung CT images.

[0106] For example, preliminary preprocessing of the 3D CT data in the training set, validation set, and test set is performed by adjusting the window width and window level, resampling, and extracting lung parenchyma.

[0107] For 3D lung CT images, firstly, all CT data are traversed, with the window width adjusted to 1800 and the window level adjusted to -500. All CT data are then resampled to a spacing size of [missing value]. To ensure consistent spacing between slices, lung parenchyma masks were extracted from all CT data to eliminate interference outside the lung area. The preprocessed 3D CT medical images were then stored in NumPy arrays in NIFTI format.

[0108] Step 202: Obtain the gold standard for pulmonary vessel segmentation.

[0109] Step 203: Calculate the loss between the predicted segmentation result obtained by training a pre-built pulmonary vessel segmentation model for each lung CT image sample in the lung CT image sample set and the gold standard for pulmonary vessel segmentation; loss Loss The expression is:

[0110]

[0111] in, The Dess loss represents the difference between the gold standard and the predicted segmentation result. The cross-entropy loss is between the gold standard and the predicted segmentation result. The constraint weights for the Des loss term, The constraint weights are the cross-entropy loss term.

[0112] For example, to prevent distortion such as distal breakage during pulmonary vessel segmentation, Descein loss is used. and cross-entropy loss The resulting hybrid loss function serves as the loss function to guide the backpropagation of the network and optimize the parameters of the lung vessel segmentation model.

[0113] The Desce loss function is defined as follows:

[0114]

[0115] in, For real labels, To predict the segmentation result. To prevent the denominator from being 0, Smooth Take 1×e -5 .

[0116] The function definition of cross-entropy loss is as follows:

[0117]

[0118] in, For real labels, To predict the segmentation results.

[0119] Step 204, based on the loss between the predicted segmentation result and the gold standard for lung vessel segmentation. LossThe network parameters of the lung vessel segmentation model are updated, and after a preset number of iterations, the training of the lung vessel segmentation model is terminated, resulting in a trained lung vessel segmentation model.

[0120] For example, by calculating the loss function between the predicted image and the gold standard, and updating the network parameters using the gradient derivative of backpropagation, the network model training can be terminated after 800 iterations, and the parameters of the lung vessel segmentation model can be saved.

[0121] For example, by continuously adjusting and optimizing the pulmonary vessel segmentation network model using training data, the saved network model can be quickly used in clinical diagnosis to segment pulmonary vessels in 3D lung CT medical images. This provides physicians with preliminary, rapid, and accurate visual diagnostic references, facilitating subsequent surgical treatment or evaluation.

[0122] Next, multiple sets of lung CT image data were selected, and the lung vessel segmentation model was evaluated using the Dice coefficient and the intersection-over-union ratio (Iou) as evaluation criteria. Specifically:

[0123] A set of randomly selected lung CT images was used as the test dataset. After preprocessing, the lung CT images were fed into the lung vessel segmentation model to predict the segmentation results. The Dice coefficient and Intersection over Union (IoU) ratio are used as evaluation criteria to evaluate the segmentation network, where the Dice coefficient is defined as:

[0124]

[0125] in, These are the gold standards for pulmonary vascular disease. To predict the segmentation result, the Dice coefficient score for the completely overlapping region between the two images was 1. The Dice coefficient explicitly measures the consistency between two medical anatomical regions, thus reflecting the quality of the segmentation. yes and The intersection between them and They represent and The number of voxels in the three-dimensional spatial domain, where the coefficient of the numerator is 2 because there is double counting in the denominator. and Common elements between them.

[0126] IoU is defined as:

[0127]

[0128] , The images show the gold standard and predicted segmentation results for pulmonary vessels, respectively. The cross-union ratio (CUNR) for completely overlapping regions in the two images is 1. The CUNR explicitly measures the consistency between two medical anatomical regions, thus reflecting the quality of segmentation. yes and The intersection between them yes and The union of the two.

[0129] The network model is evaluated using the Dice coefficient and IoU as evaluation criteria, and the segmentation results output by this method are judged to achieve the goal of visualizing the segmentation results of pulmonary blood vessels.

[0130] This application provides the following comparative experiment in one embodiment: Experimental data used in this comparative experiment:

[0131] 1. The VESSEL12 lung dataset provides 20 sets of CT and CTA images, as well as expert-annotated private pulmonary vascular data. Each original image has a resolution of 512×512×512. Due to experimental limitations, these images were preprocessed. In the actual experimental data, each image size is 128*128*128, with the training, validation, and test sets in a 6:2:2 ratio.

[0132] 2. The ATM22 lung dataset, derived from the Airway Tree Modeling Challenge 2022 (ATM22) held by MICCAI, contains 299 CT scans. Due to experimental limitations, we standardized the processing of the provided CT dataset, including window width, window level, resampling, removal of the bed slab, and cropping. The ratio of training, validation, and test sets is 269:10:20. Private vascular annotations were performed on this dataset.

[0133] The results of the comparative experiment are shown in Table 1.

[0134] Table 1. Dice coefficients and IoU obtained based on the VESSEL12 lung dataset and the ATM22 lung dataset.

[0135]

[0136] The lung vessel segmentation method in CT images provided in this application exhibits excellent performance in terms of Dice coefficient and IoU for segmenting lung vessels, and as well as... Figure 5 The segmentation results of the lung vessels obtained by various methods are shown. The segmentation results obtained in this application are more accurate than those obtained by Vnet, UNETR, Swin UNETR, etc., while ensuring the effectiveness and feasibility of the lung vessel segmentation model in this application.

[0137] As can be seen, the lung vessel segmentation method in CT images proposed in this application, in the encoding stage, utilizes a combination of depthwise separable convolution and Swing Transformer to enhance the correlation between global spatial information and local detail information. In the decoding stage, a multi-dimensional feature calibration module combined with a residual module is designed and integrated into the overall network to form a sequence-to-sequence image segmentation network, which enhances the detection of tubular structures in the lungs, improves the segmentation accuracy of small branches of lung vessels, and obtains more accurate lung vascular plexuses. It has advantages such as speed, accuracy, and suitability for practical applications.

[0138] It should be understood that the sequence number of each step does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0139] Corresponding to the lung vessel segmentation method in CT images in the above embodiment, Figure 6 A structural block diagram of a lung vessel segmentation device in a CT image provided in an embodiment of this application is shown. For ease of explanation, only the parts related to the embodiment of this application are shown.

[0140] See Figure 6 The pulmonary vessel segmentation device in the CT image in this embodiment may include an image acquisition module 201 and an image segmentation module 202.

[0141] The image acquisition module 201 is used to acquire the lung CT image to be segmented.

[0142] Image segmentation module 202 is used to input lung CT images into a pre-trained lung vessel segmentation model and output the segmentation results of lung vessels in the lung CT images. The lung vessel segmentation model includes an encoder and a decoder. The encoder includes a depthwise separable convolution module and a Swin Transformer module. The depthwise separable convolution module is used to obtain local feature information of the lung CT image to be segmented, and the Swin Transformer module is used to obtain global feature information of the lung CT image. The decoder includes a residual module, a multi-dimensional feature calibration module, an upsampling path, and a channel stitching module. The residual module, the multi-dimensional feature calibration module, the upsampling path, and the channel stitching module are used to fuse local feature information and global feature information.

[0143] It should be noted that the information interaction and execution process between the above-mentioned devices are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.

[0144] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0145] This application also provides a terminal device, see [link to relevant documentation] Figure 7 The terminal device 300 may include at least one processor 310 and a memory 320, wherein the memory 320 stores a computer program that can run on the at least one processor 310, and the processor 310 executes the computer program to implement the steps in any of the above-described method embodiments, for example... Figure 1 Steps 101 to 102 in the illustrated embodiment. Alternatively, when the processor 310 executes the computer program, it implements the functions of each module / unit in the above-described device embodiments, for example... Figure 6 The functions of modules 201 to 202 are shown.

[0146] For example, a computer program may be divided into one or more modules / units, one or more of which are stored in memory 320 and executed by processor 310 to complete this application. The one or more modules / units may be a series of computer program segments capable of performing a specific function, which are used to describe the execution process of the computer program in terminal device 300.

[0147] Those skilled in the art will understand that Figure 7 This is merely an example of a terminal device and does not constitute a limitation on the terminal device. It may include more or fewer components than shown, or combine certain components, or different components, such as input / output devices, network access devices, buses, etc.

[0148] The processor 310 can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.

[0149] The memory 320 can be an internal storage unit of the terminal device or an external storage device, such as a plug-in hard drive, a smart media card (SMC), a secure digital (SD) card, or a flash card. The memory 320 is used to store the computer program and other programs and data required by the terminal device. The memory 320 can also be used to temporarily store data that has been output or will be output.

[0150] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0151] The lung vessel segmentation method in CT images provided in this application embodiment can be applied to terminal devices such as computers, tablets, laptops, netbooks, and personal digital assistants (PDAs). This application embodiment does not impose any restrictions on the specific type of terminal device.

[0152] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in the various embodiments of the above-described method for segmenting pulmonary vessels in CT images.

[0153] This application provides a computer program product that, when run on a mobile terminal, enables the mobile terminal to implement the steps in the various embodiments of the above-described CT image lung vessel segmentation method.

[0154] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to a photographing device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks.

[0155] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0156] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0157] In the embodiments provided in this application, it should be understood that the disclosed apparatus / network devices and methods can be implemented in other ways. For example, the apparatus / network device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0158] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0159] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for segmenting pulmonary vessels in CT images, characterized in that, include: Obtain the lung CT image to be segmented; The lung CT image to be segmented is input into a pre-trained lung vessel segmentation model, which outputs the segmentation result of the lung vessels in the lung CT image. The lung vessel segmentation model includes an encoder and a decoder. The encoder includes a depthwise separable convolution module and a Swin Transformer module. The depthwise separable convolution module is used to obtain local feature information of the lung CT image to be segmented, and the Swin Transformer module is used to obtain global feature information of the lung CT image to be segmented. The decoder includes a residual module, a multi-dimensional feature calibration module, an upsampling path, and a channel stitching module. The residual module, the multi-dimensional feature calibration module, the upsampling path, and the channel stitching module are used to fuse the local feature information and the global feature information. The multi-dimensional feature calibration module is used to adaptively adjust the weights of blood vessels and non-blood vessels, and to supplement and calibrate tubular information. Each multi-dimensional feature calibration module includes a channel reconstruction unit and a calibration unit. The channel reconstruction unit integrates a spatial feature map along the depth, height, and width axes based on the feature map input to each multi-dimensional feature calibration module, and performs channel reconstruction on the spatial feature map to output a channel-reconstructed feature map. The calibration unit performs element-wise multiplication on the spliced ​​feature map input to each multi-dimensional feature calibration module and the channel-reconstructed feature map to generate a corresponding target feature map. The channel reconstruction operation is used to spatially distinguish between bronchioles, terminal small blood vessels, thick bronchioles, and blood vessels in the spatial feature map. Specifically, for each input multi-dimensional feature calibration module, a spatial feature map with preset requirements is integrated along the three axes of depth, height, and width. The spatial feature map is then subjected to channel recombination operation, and the important regions of the tubular structure are preserved through spatial integration. The definition of spatial integral calculation is as follows: in, For the first m Activation characteristics of the layer decoding path; Indicates to Perform spatial integration. Indicates the pair along the depth. Perform spatial integration. Indicates the height along the pair Perform spatial integration. Indicates the pair along the width. Perform spatial integration; represent Broadcast operations in the library; The height represents the feature map. The width of the feature map is represented by Width. Depth represents the depth of the feature map. The number of channels in the input feature map; To limit two of them to j and k A four-dimensional array; To limit two of them to i and k A four-dimensional array, To limit two of them to i and j A four-dimensional array; , and The learnable parameters represent the depth of each feature slice. i Height is j and width are k Weight combinations in dimensions i =1, 2, ..., , j =1, 2, ..., , k =1, 2, ..., .

2. The method for segmenting pulmonary vessels in CT images as described in claim 1, characterized in that, The lung CT image to be segmented is input into the depth-separable convolution module, and the depth-separable convolution module outputs a second intermediate feature map; the second intermediate feature map represents the local feature information of the lung CT image to be segmented. The second intermediate feature map is input to the Swin Transformer module, and the Swin Transformer module outputs a third intermediate feature map, a fourth intermediate feature map, and a bottom-level feature map; the third intermediate feature map, the fourth intermediate feature map, and the bottom-level feature map represent the global feature information of the lung CT image.

3. The method for segmenting pulmonary vessels in CT images as described in claim 1, characterized in that, The depth-separable convolutional module includes a Conv1 convolutional layer, a Conv2 convolutional layer, and a Conv3 convolutional layer; the lung CT image is processed sequentially through the Conv1 convolutional layer, the Conv2 convolutional layer, and the Conv3 convolutional layer to output a second intermediate feature map; The Swin Transformer module includes a first Swin Transformer module, a second Swin Transformer module, and a third Swin Transformer module; After the second intermediate feature map is mapped to a 1D sequence, it is input into the first Swing Transformer module and outputs a third intermediate feature map; the third intermediate feature map is input into the second Swing Transformer module and outputs a fourth intermediate feature map; the third intermediate feature map is input into the third Swing Transformer module and outputs a bottom-level feature map.

4. The method for segmenting pulmonary vessels in CT images as described in claim 3, characterized in that, The first SwingTransformer module includes a first Blocks and a first Merging; the first Blocks include a first Layer Normization layer, a first W-MSA layer, a second Layer Normization layer, a first fully connected layer, a first Linear Normization layer, a first SW-MSA layer, a third Layer Normization layer, and a second fully connected layer, arranged sequentially; the first Blocks outputs an unmerged third intermediate feature map; the unmerged third intermediate feature map is input into the first Merging, and the first Merging outputs the third intermediate feature map; The second Swin Transformer module includes a second Blocks and a second Merging; the second Blocks include a fourth Layer Normization layer, a second W-MSA layer, a fifth Layer Normization layer, a third fully connected layer, a second Linear Normization layer, a second SW-MSA layer, a sixth Layer Normization layer, and a fourth fully connected layer arranged sequentially; the second Blocks outputs an unmerged fourth intermediate feature map; the unmerged fourth intermediate feature map is input into the second Merging, and the second Merging outputs the fourth intermediate feature map; The third Swing Transformer module includes a third Blocks and a third Merging; the third Blocks include a seventh Layer Normlization layer, a third W-MSA layer, an eighth Layer Normlization layer, a fifth fully connected layer, a third Linear Normlization layer, a third SW-MSA layer, a ninth Layer Normlization layer, and a sixth fully connected layer arranged sequentially; the third Blocks outputs an unmerged low-level feature map; the unmerged low-level feature map is input into the third Merging, and the third Merging outputs the low-level feature map.

5. The method for segmenting pulmonary vessels in CT images as described in claim 2, characterized in that, The residual module includes a first residual module, a second residual module, a third residual module, and a fourth residual module; the multi-dimensional feature calibration module includes a first multi-dimensional feature calibration module, a second multi-dimensional feature calibration module, a third multi-dimensional feature calibration module, a fourth multi-dimensional feature calibration module, and a fifth multi-dimensional feature calibration module; the upsampling path includes a first upsampling path, a second upsampling path, a third upsampling path, and a fourth upsampling path; the channel stitching module includes a first channel stitching module, a second channel stitching module, a third channel stitching module, and a fourth channel stitching module. The bottom-level feature map is input to the fifth multi-dimensional feature calibration module, and the fifth multi-dimensional feature calibration module outputs the fifth target feature map; the fifth target feature map is input to the fourth channel stitching module. The fourth intermediate feature map is input to the fourth residual module, the fourth residual module outputs the fourth feature map, and the fourth feature map is input to the fourth channel stitching module through the fourth upsampling path; the fourth channel stitching module stitches the fifth target feature map and the fourth feature map together and outputs the fourth stitched feature map; the fourth stitched feature map is input to the fourth multi-dimensional feature calibration module, and the fourth multi-dimensional feature calibration module outputs the fourth target feature map; The third intermediate feature map is input to the third residual module, the third residual module outputs the third feature map, and the third feature map is input to the third channel stitching module through the third upsampling path; the third channel stitching module stitches the fourth target feature map and the third feature map together and outputs the third stitched feature map; the third stitched feature map is input to the third multi-dimensional feature calibration module, and the third multi-dimensional feature calibration module outputs the third target feature map; The second intermediate feature map is input to the second residual module, the second residual module outputs the second feature map, and the second feature map is input to the second channel stitching module through the second upsampling path; the second channel stitching module stitches the third target feature map and the second feature map together and outputs the second stitched feature map; the second stitched feature map is input to the second multi-dimensional feature calibration module, and the second multi-dimensional feature calibration module outputs the second target feature map; The first intermediate feature map is input to the first residual module, and the first residual module outputs the first feature map; the first intermediate feature map is the lung CT image; the first feature map is input to the first channel stitching module through the first upsampling path; the first channel stitching module stitches the second target feature map and the first feature map together and outputs the first stitched feature map; the first stitched feature map is input to the first multi-dimensional feature calibration module, and the first multi-dimensional feature calibration module outputs the first target feature map; the first target feature map is processed by the Head function to obtain the segmentation result of the lung vessels.

6. The method for segmenting pulmonary vessels in CT images as described in claim 5, characterized in that, The first multi-dimensional feature calibration module, the second multi-dimensional feature calibration module, the third multi-dimensional feature calibration module, the fourth multi-dimensional feature calibration module, and the fifth multi-dimensional feature calibration module have the same structure.

7. The method for segmenting pulmonary vessels in CT images as described in claim 1, characterized in that, Before inputting the lung CT image to be segmented into the pre-trained lung vessel segmentation model and outputting the segmentation result of the lung vessels in the lung CT image, the lung vessel segmentation method in the CT image further includes: Obtain a sample set of lung CT images; Obtain the gold standard for pulmonary vessel segmentation; Calculate the loss between the predicted segmentation result obtained by training a pre-built pulmonary vessel segmentation model on each lung CT image sample in the lung CT image sample set and the gold standard of pulmonary vessel segmentation; the loss Loss The expression is: in, The Dess loss term represents the difference between the gold standard and the predicted segmentation result. The cross-entropy loss term is the difference between the gold standard and the predicted segmentation result. The constraint weights for the Des loss term, The constraint weights for the cross-entropy loss term; Based on the loss between the predicted segmentation result and the gold standard for lung vessel segmentation, the network parameters of the lung vessel segmentation model are updated, and after a preset number of iterations, the training of the lung vessel segmentation model is terminated to obtain the trained lung vessel segmentation model.

8. A device for segmenting pulmonary vessels in CT images, characterized in that, include: Image acquisition module, used to acquire lung CT images to be segmented; An image segmentation module is used to input the lung CT image into a pre-trained lung vessel segmentation model and output the segmentation result of the lung vessels in the lung CT image. The lung vessel segmentation model includes an encoder and a decoder. The encoder includes a depthwise separable convolution module and a Swin Transformer module. The depthwise separable convolution module is used to obtain local feature information of the lung CT image to be segmented, and the Swin Transformer module is used to obtain global feature information of the lung CT image. The decoder includes a residual module, a multi-dimensional feature calibration module, an upsampling path, and a channel stitching module. The residual module, the multi-dimensional feature calibration module, the upsampling path, and the channel stitching module are used to fuse the local feature information and the global feature information. The multi-dimensional feature calibration module is used to adaptively adjust the weights of blood vessels and non-blood vessels, and to supplement and calibrate tubular information. Each multi-dimensional feature calibration module includes a channel reconstruction unit and a calibration unit. The channel reconstruction unit integrates a spatial feature map along the depth, height, and width axes based on the feature map input to each multi-dimensional feature calibration module, and performs channel reconstruction on the spatial feature map to output a channel-reconstructed feature map. The calibration unit performs element-wise multiplication on the spliced ​​feature map input to each multi-dimensional feature calibration module and the channel-reconstructed feature map to generate a corresponding target feature map. The channel reconstruction operation is used to spatially distinguish between bronchioles, terminal small blood vessels, thick bronchioles, and blood vessels in the spatial feature map. Specifically, for each input multi-dimensional feature calibration module, a spatial feature map with preset requirements is integrated along the three axes of depth, height, and width. The spatial feature map is then subjected to channel recombination operation, and the important regions of the tubular structure are preserved through spatial integration. The definition of spatial integral calculation is as follows: in, For the first m Activation characteristics of the layer decoding path; Indicates to Perform spatial integration. Indicates the pair along the depth. Perform spatial integration. Indicates the height along the pair Perform spatial integration. Indicates the pair along the width. Perform spatial integration; represent Broadcast operations in the library; The height represents the feature map. The width of the feature map is represented by Width. Depth represents the depth of the feature map. The number of channels in the input feature map; To limit two of them to j and k A four-dimensional array; To limit two of them to i and k A four-dimensional array, To limit two of them to i and j A four-dimensional array; , and The learnable parameters represent the depth of each feature slice. i Height is j and width are k Weight combinations in dimensions i =1, 2, ..., , j =1, 2, ..., , k =1, 2, ..., .

9. A terminal device, comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the lung vessel segmentation method in CT images as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the lung vessel segmentation method in CT images as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Transform and U-Net combined medical image liver segmentation method and system

    CN115965633A