Pulmonary vessel segmentation method and device
Through the pre-trained pulmonary blood vessel segmentation model, the transformer module and the attention module are used to associate the blood vessel structure, and the adaptive feature calibration module integrates information to solve the time-consuming and labor-intensive problem of blood vessel segmentation technology and improve the accuracy and efficiency of pulmonary blood vessel segmentation. .
Patent Information
- Application Number
- CN202410904771.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-08
- Publication Date
- 2024-10-01
AI Technical Summary
Existing Technology In the diagnosis and treatment of vascular diseases, blood vessel segmentation technology relies on manual annotation, which is time-consuming and labor-intensive, and the blood vessel structure is complex, resulting in low segmentation accuracy and efficiency.
Using a pre-trained pulmonary blood vessel segmentation model, combined with the encoder and decoder, the transformer module and attention module are used to obtain global feature information, the spatial and channel attention modules are associated with the blood vessel structure, and the adaptive feature calibration module integrates feature information to improve blood vessel structure. Segmentation accuracy.
It improves the segmentation accuracy and efficiency of pulmonary vascular tissue, reduces the reliance on manual annotation, obtains more accurate blood vessel segmentation results, and saves time.
Smart Images

Figure CN118735947A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of lung image segmentation, and in particular to a method and device for segmenting pulmonary blood vessels. Background Art
[0002] Medical image segmentation technology, as one of the three main tasks of medical image analysis, has always been a focus and difficulty in the field of visual research in medical imaging.
[0003] Vascular diseases pose a great threat to human health. Vascular segmentation is a key step in medical image analysis and is of great significance for the diagnosis and treatment of vascular diseases. Vascular segmentation technology can provide necessary information for surgical planning and intervention as well as monitoring the progression of vascular diseases as an important basis for studying vascular diseases. However, vascular images require experienced doctors to manually outline to achieve vascular segmentation, which will cost a lot of manpower and material resources. Therefore, in response to this problem, the medical image vascular segmentation technology processing algorithm to achieve vascular segmentation is a very good solution. The use of medical image vascular segmentation technology to achieve vascular segmentation not only reduces the workload of doctors, but also makes the segmented results more objective, and can even reach or exceed the accuracy of manual segmentation of blood vessels, which helps to realize computer-assisted medicine. Therefore, in clinical applications, computer-assisted vascular segmentation technology can segment blood vessels very well, which is of great significance for the research of computational lesion localization and diagnosis technology.
[0004] Traditional machine learning-based methods set an objective function for each CT image by extracting blood vessel features (Hessian matrix enhancement, intensity value, threshold segmentation, etc.), and obtain the optimal model parameters through optimization algorithms (gradient descent, etc.). However, because blood vessels have complex and highly intertwined structures, they often rely on manual labeling, but the manual labeling process often requires the experience of professionals and is time-consuming and laborious. Summary of the invention
[0005] The embodiments of the present invention provide a pulmonary blood vessel segmentation method and device, which can improve the segmentation accuracy of pulmonary blood vessel tissue.
[0006] In a first aspect, an embodiment of the present invention provides a pulmonary blood vessel segmentation method, comprising:
[0007] Acquire a target lung CT image;
[0008] The target lung CT image is input into a pre-trained pulmonary vascular segmentation model, which includes an encoder and a decoder; the encoder includes a linear processing operation, a transformer module and an attention module which are arranged in sequence; the linear processing operation is used to project the target lung CT image into an embedding space and perform patch division; the transformer module is used to obtain the global feature information of the target lung CT image, and the attention module includes a parallel spatial attention module and a channel attention module, the spatial attention module and the channel attention module are used to focus on the global information and detail information of the pulmonary vascular structure, and effectively associate between different spaces and channels, capture the correlation and spatiality between pulmonary vascular features, extract the long-distance information of pulmonary vessels, and improve the detail accuracy of the local feature information of pulmonary vessels; the encoder and the decoder are connected through a jump connection module; the decoder includes a deconvolution module and an adaptive feature calibration module; the deconvolution module and the adaptive feature calibration module are used to integrate the local feature information and global feature information of the pulmonary vessels;
[0009] Output the extraction results of the lung blood vessels corresponding to the target lung CT image.
[0010] In a possible implementation, a target lung CT image is input into a linear processing operation, the linear processing operation outputs a second intermediate feature map, the second intermediate feature map is input into a transformer module, the transformer module outputs a third intermediate feature map, a fourth intermediate feature map, a fifth intermediate feature map, and an underlying feature map, the third intermediate feature map, the fourth intermediate feature map, the fifth intermediate feature map, and the underlying feature map represent global feature information of the target lung CT image;
[0011] The underlying feature map is input into the spatial attention module and the channel attention module, and the spatial attention module and the channel attention module output the attention feature map, which represents the global feature information and local feature information of the target lung CT image.
[0012] In a possible implementation, the linear processing operation includes a linear embedding module and a patch partitioning module, and the target lung CT image is processed by the linear embedding module and the patch partitioning module in sequence to output a second intermediate feature map;
[0013] The transformer module includes a first-stage transformer module, a second-stage transformer module, a third-stage transformer module, and a fourth-stage transformer module;
[0014] After the second intermediate feature map is mapped to a 1D sequence, it is input into the first-stage transformer module, which outputs the third intermediate feature map. The third intermediate feature map is input into the second-stage transformer module, which outputs the fourth intermediate feature map. The fourth intermediate feature map is input into the third-stage transformer module, which outputs the fifth intermediate feature map. The fifth intermediate feature map is input into the fourth-stage transformer module, which outputs the underlying feature map.
[0015] In a possible implementation, the first-stage transformer module includes a first transformer module, a second transformer module, and a third transformer module arranged in sequence, the first transformer module includes a first Norm operation, a first multi-head self-attention calculation, a first Norm operation, and a first multi-layer perceptron operation arranged in sequence; the second transformer module includes a second Norm operation, a second multi-head self-attention calculation, a second Norm operation, and a second multi-layer perceptron operation arranged in sequence; the third transformer module includes a third Norm operation, a third multi-head self-attention calculation, a third Norm operation, and a third multi-layer perceptron operation arranged in sequence; the third multi-layer perceptron operation outputs a third intermediate feature map;
[0016] The second-stage transformer module includes a fourth transformer module, a fifth transformer module, and a sixth transformer module, which are arranged in sequence. The fourth transformer module includes a fourth Norm operation, a fourth multi-head self-attention calculation, a fourth Norm operation, and a fourth multi-layer perceptron operation, which are arranged in sequence; the fifth transformer module includes a fifth Norm operation, a fifth multi-head self-attention calculation, a fifth Norm operation, and a fifth multi-layer perceptron operation, which are arranged in sequence; the sixth transformer module includes a sixth Norm operation, a sixth multi-head self-attention calculation, a sixth Norm operation, and a sixth multi-layer perceptron operation, which are arranged in sequence; and the sixth multi-layer perceptron operation outputs a fourth intermediate feature map;
[0017] The third-stage transformer module includes a seventh transformer module, an eighth transformer module, and a ninth transformer module, which are arranged in sequence. The seventh transformer module includes a seventh Norm operation, a seventh multi-head self-attention calculation, a seventh Norm operation, and a seventh multi-layer perceptron operation, which are arranged in sequence. The eighth transformer module includes an eighth Norm operation, an eighth multi-head self-attention calculation, an eighth Norm operation, and an eighth multi-layer perceptron operation, which are arranged in sequence. The ninth transformer module includes a ninth Norm operation, a ninth multi-head self-attention calculation, a ninth Norm operation, and a ninth multi-layer perceptron operation, which are arranged in sequence. The ninth multi-layer perceptron operation outputs a fifth intermediate feature map.
[0018] The fourth-stage transformer module includes the tenth transformer module, the eleventh transformer module and the twelfth transformer module which are arranged in sequence. The tenth transformer module includes the tenth Norm operation, the tenth multi-head self-attention calculation, the tenth Norm operation and the tenth multi-layer perceptron operation which are arranged in sequence; the eleventh transformer module includes the eleventh Norm operation, the eleventh multi-head self-attention calculation, the eleventh Norm operation and the eleventh multi-layer perceptron operation which are arranged in sequence; the twelfth transformer module includes the twelfth Norm operation, the twelfth multi-head self-attention calculation, the twelfth Norm operation and the twelfth multi-layer perceptron operation which are arranged in sequence; the twelfth multi-layer perceptron operation outputs the underlying feature map.
[0019] In a possible implementation, when the underlying feature map Z12 is input into the spatial attention module, the underlying feature map is sequentially subjected to a 3×1×1 convolution operation, a BN normalization layer, and a ReLu activation function layer, and outputs a first horizontal feature information matrix. The underlying feature map is sequentially subjected to a 1×3×1 convolution operation, a BN normalization layer, and a ReLu activation function layer, and outputs a first vertical feature information matrix. The underlying feature map is sequentially subjected to a 1×1×3 convolution operation, a BN normalization layer, and a ReLu activation function layer, and outputs a first depth feature information matrix. The first horizontal feature information matrix is outputted in the first depth direction. After the feature information matrix, the first vertical feature information matrix and the first depth feature information matrix are multiplied respectively, they are sequentially subjected to the Softmax layer and the reshape operation to output the first feature attention score map; the underlying feature map is sequentially subjected to the 1×1×1 convolution operation, the BN normalization layer and the ReLu activation function layer for dimensionality reduction processing, and the first matrix feature information is output. The first matrix feature information is matrix-multiplied with the first feature attention score map to output the first weighted attention score map, and the first weighted attention score map is added to the underlying feature map to output the final spatial attention feature map;
[0020] When the underlying feature map is input into the channel attention module, the underlying feature map is sequentially subjected to a 1×1×1 convolution operation, a BN normalization layer, and a ReLu activation function layer, and the first channel feature information matrix is output. The underlying feature map is sequentially subjected to a 1×1×1 convolution operation, a BN normalization layer, and a ReLu activation function layer, and the second channel feature information matrix is output. The underlying feature map is sequentially subjected to a 1×1×1 convolution operation, a BN normalization layer, and a ReLu activation function layer, and the third channel feature information matrix is output. After the first channel feature information matrix, the second channel feature information matrix, and the third channel feature information matrix are multiplied respectively, the Softmax layer and the reshape operation are sequentially performed to output the second feature attention score map. The underlying feature map is sequentially subjected to a 1×1×1 convolution operation, a BN normalization layer, and a ReLu activation function layer for dimensionality reduction processing, and the second matrix feature information is output. The second matrix feature information is matrix-multiplied with the second feature attention score map to output the second weighted attention score map. The second weighted attention score map is added to the underlying feature map to output the final channel attention feature map.
[0021] The spatial attention feature map is added element-by-element to the channel attention feature map, and the attention feature map is output.
[0022] In a possible implementation, the deconvolution module includes a first deconvolution module, a second deconvolution module, a third deconvolution module, and a fourth deconvolution module; the jump connection module includes a first jump connection module, a second jump connection module, a third jump connection module, and a fourth jump connection module; the adaptive feature calibration module includes a first adaptive calibration module, a second adaptive calibration module, a third adaptive calibration module, and a fourth adaptive calibration module;
[0023] The attention feature map is input into a fourth deconvolution module, the fourth deconvolution module outputs a fifth deconvolution feature map, and the fifth deconvolution feature map is input into a fourth adaptive calibration module through a fourth upsampling path;
[0024] The fifth intermediate feature map is input into the fourth jump connection module, the fourth jump connection module outputs the fifth jump feature map, the fifth jump feature map is input into the fourth adaptive calibration module, the fourth adaptive calibration module calibrates the fifth deconvolution feature map and the fifth jump feature map, and then outputs the fourth calibration feature map, the fourth calibration feature map passes through the third deconvolution module after two sequentially set 3×3×3 convolution operations, BN normalization layer operations and ReLu activation function layer operations, and then passes through the third deconvolution module, the third deconvolution module outputs the fourth deconvolution feature map, and the fourth deconvolution feature map is input into the third adaptive calibration module;
[0025] The fourth intermediate feature map is input into the third jump connection module, the third jump connection module outputs the fourth jump feature map, the fourth jump feature map is input into the third adaptive calibration module, the third adaptive calibration module calibrates the fourth deconvolution feature map and the fourth jump feature map, and then outputs the third calibration feature map, the third calibration feature map passes through the second deconvolution module after two sequentially set 3×3×3 convolution operations, BN normalization layer operations and ReLu activation function layer operations, and then passes through the second deconvolution module, the second deconvolution module outputs the third deconvolution feature map, and the third deconvolution feature map is input into the second adaptive calibration module;
[0026] The third intermediate feature map is input into the second jump connection module, the second jump connection module outputs the third jump feature map, the third jump feature map is input into the second adaptive calibration module, the second adaptive calibration module calibrates the third deconvolution feature map and the third jump feature map, and then outputs the second calibration feature map, the second calibration feature map passes through the first deconvolution module after two sequentially set 3×3×3 convolution operations, BN normalization layer operations and ReLu activation function layer operations, and then passes through the first deconvolution module, the first deconvolution module outputs the second deconvolution feature map, and the second deconvolution feature map is input into the first adaptive calibration module;
[0027] The first intermediate feature map is input into the first jump connection module, the first jump connection module outputs the first jump feature map, the first jump feature map is input into the first adaptive calibration module, the first adaptive calibration module calibrates the second deconvolution feature map and the first jump feature map, and then outputs the first calibration feature map; the first calibration feature map undergoes two 3×3×3 convolution operations, a BN normalization layer operation, and a ReLu activation function layer operation, and then undergoes a 1×1×1 convolution operation to obtain the segmentation result of the pulmonary blood vessels of the target lung CT image.
[0028] In a possible implementation, the first jump connection module includes two sequentially arranged 3×3×3 convolution operations, a BN layer operation, and a ReLu activation function layer operation; the second jump connection module includes three sequentially arranged 2×2×2 deconvolution operations, a 3×3×3 convolution operation, a BN layer operation, and a ReLu activation function layer operation; the third jump connection module includes two sequentially arranged 2×2×2 deconvolution operations, a 3×3×3 convolution operation, a BN layer operation, and a ReLu activation function layer operation; the fourth jump connection module includes one sequentially arranged 2×2×2 deconvolution operation, a 3×3×3 convolution operation, a BN layer operation, and a ReLu activation function layer operation.
[0029] In a possible implementation, the first adaptive calibration module, the second adaptive calibration module, the third adaptive calibration module and the fourth adaptive calibration module have the same structure;
[0030] Among them, when each layer of deconvolution feature map and the corresponding jump feature map are input into the corresponding adaptive feature calibration module, the deconvolution feature map and the jump feature map are successively subjected to channel superposition, global average pooling, and a fully connected layer, and the first weight and the second weight of the channel are output, the deconvolution feature map is multiplied by the second weight, and the deconvolution weight feature map is output, the jump feature map is multiplied by the first weight, and the jump weight feature map is output, the deconvolution weight feature map and the jump weight feature map are element-wise added, and a deconvolution jump weight feature map is output, the deconvolution feature map and the deconvolution jump weight feature map are element-wise added, and a calibration feature map is output.
[0031] In a possible implementation, before inputting the target lung CT image into a pre-trained pulmonary vascular segmentation model, the pulmonary vascular segmentation method further includes:
[0032] Obtain a lung CT image sample set;
[0033] Obtain the gold standard for pulmonary vascular segmentation;
[0034] The loss between the predicted segmentation result obtained by inputting each lung CT image sample in the lung image sample set into the pre-built pulmonary vascular segmentation model for training and the gold standard of pulmonary vascular segmentation is calculated; the loss function is defined as:
[0035] Loss = λ 1 L Dice +λ 2 L CE
[0036] Among them, L Dice is the Dice loss term between the gold standard and the predicted image, L CE is the cross entropy loss term between the gold standard and the predicted image, λ 1 , 2 are the constraint weights of the above two loss functions respectively;
[0037] The Dice loss function is defined as follows:
[0038]
[0039] The cross entropy loss function is defined as follows:
[0040]
[0041] Among them, y is the true label, It is the model prediction image, and Smoothness is 1e-5;
[0042] By calculating the loss function between the predicted image and the gold standard, the segmentation parameters of the pulmonary vascular segmentation model are updated using back-propagation gradient derivation, and the training of the pulmonary vascular segmentation model is terminated after a preset number of iterations to obtain a pre-trained pulmonary vascular segmentation model.
[0043] In a second aspect, an embodiment of the present invention provides a pulmonary vascular segmentation device, comprising:
[0044] An image acquisition module, used for acquiring a lung CT image to be segmented;
[0045] An image segmentation module is used to input the target lung CT image into a pre-trained pulmonary vascular segmentation model, which includes an encoder and a decoder; the encoder includes a linear processing operation, a transformer module, and an attention module that are arranged in sequence; the linear processing operation is used to project the target lung CT image into an embedding space and perform patch division; the transformer module is used to obtain the global feature information of the target lung CT image, and the attention module includes a parallel spatial attention module and a channel attention module, the spatial attention module and the channel attention module are used to focus on the global information and detail information of the pulmonary vascular structure, and effectively associate different channels, capture the correlation and spatiality between pulmonary vascular features, extract the long-distance information of the pulmonary vessels, and improve the detail accuracy of the local feature information of the pulmonary vessels; the encoder and the decoder are connected through a jump connection module; the decoder includes a deconvolution module and an adaptive feature calibration module; the deconvolution module and the adaptive feature calibration module are used to integrate the local feature information and global feature information of the pulmonary vessels;
[0046] The segmentation result output module is used to output the extraction results of the pulmonary blood vessels corresponding to the target lung CT image.
[0047] The embodiment of the present invention provides a pulmonary vascular segmentation method and device, which uses a pre-constructed pulmonary vascular segmentation model and uses a transformer module to obtain global feature information in the encoding stage. The spatial attention module and the channel attention module focus on the global information and detail information of the pulmonary vascular structure, and effectively associate between different spaces and channels to capture the correlation and spatiality between pulmonary vascular features, better extract long-distance information, improve the detail accuracy of local feature information of pulmonary vessels, more widely focus on the contextual information of local features, and increase their representation capabilities, obtain local feature information, and combine the transformer module with the spatial attention module and the channel attention module to strengthen the correlation between global spatial information and local detail information; in the decoding stage, the adaptive feature calibration module is combined with the convolution operation into the pulmonary vascular segmentation model, and effective features are adaptively selected to obtain more details of the vascular structure. Features from the encoder layer and the symmetric decoder layer can be adaptively combined to optimize the representation of the vascular structure. The segmentation accuracy of local pulmonary vascular tissue is improved, more accurate pulmonary vessels are obtained, and time can be saved and efficiency can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0049] Figure 1 is a flow chart of a pulmonary blood vessel segmentation method provided by an embodiment of the present invention;
[0050] Figure 2 is a schematic diagram of the structure of a pulmonary vascular segmentation model provided by an embodiment of the present invention;
[0051] Figure 3 is a schematic diagram of the structure of a channel space attention module of a pulmonary vascular segmentation method provided by an embodiment of the present invention;
[0052] Figure 4 is a schematic diagram of the structure of an adaptive feature calibration module for pulmonary vascular segmentation provided by an embodiment of the present invention;
[0053] Figure 5 is a schematic diagram of the segmentation results of pulmonary blood vessels obtained by various methods provided in the embodiments of the present invention;
[0054] Figure 6 is a schematic diagram of the structure of a pulmonary vascular segmentation device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present invention. However, it should be clear to those skilled in the art that the present invention may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present invention.
[0056] In order to make the purpose, technical solutions and advantages of the present invention more clear, specific embodiments will be described below in conjunction with the accompanying drawings.
[0057] Figure 1 A schematic diagram of a flow chart of a pulmonary vascular segmentation method provided by an embodiment of the present invention. Figure 1 , the pulmonary vascular segmentation method is described in detail as follows:
[0058] Step 101: Acquire a target lung CT image;
[0059] In a possible implementation, the three-dimensional CT data is preliminarily preprocessed by adjusting the window width and window position, resampling, cropping and extracting the lung parenchyma, and other operations.
[0060] In a possible implementation, the preprocessing process may include: first, traversing all CT data of the lung CT image, adjusting the window width to 1800, adjusting the window level to -500, resampling all CT images, and setting the slice spacing to Spacingsize (1.0, 1.0, 1.0) to ensure that the spacing between slices remains consistent; extracting the lung parenchyma mask of all CT image data to achieve the purpose of lung parenchyma pre-segmentation and eliminate interference outside the lung area. The preprocessed three-dimensional CT image is stored in a Numpy array and saved in NIFTI format to obtain the target lung CT image.
[0061] Before segmentation, the lung parenchyma pre-segmentation method is used to extract the lung parenchyma mask, which provides reliable prior knowledge for the subsequent pulmonary vascular segmentation model, thereby improving the segmentation accuracy of the pulmonary vessels.
[0062] Step 102: Input the target lung CT image into a pre-trained pulmonary vascular segmentation model, the pulmonary vascular segmentation model includes an encoder and a decoder; the encoder includes a linear processing operation, a transformer module and an attention module arranged in sequence; the linear processing operation is used to project the target lung CT image into an embedding space and perform patch division; the transformer module is used to obtain the global feature information of the target lung CT image, the attention module includes a parallel spatial attention module and a channel attention module, the spatial attention module and the channel attention module are used to focus on the global information and detail information of the pulmonary vascular structure, and effectively associate between different channels, capture the correlation and spatiality between pulmonary vascular features, extract the long-distance information of the pulmonary vessels, and improve the detail accuracy of the local feature information of the pulmonary vessels; the encoder and the decoder are connected by a jump connection module; the decoder includes a deconvolution module and an adaptive feature calibration module; the deconvolution module and the adaptive feature calibration module are used to integrate the local feature information and the global feature information of the pulmonary vessels; Figure 2 , which is a schematic diagram of the structure of the pulmonary vascular segmentation model.
[0063] The Transformers module is used as an encoder to learn the sequence representation of the input, which can effectively capture global multi-scale information. The spatial attention module and the channel attention module can better extract spatial and channel features.
[0064] The skip connection module enables the pulmonary vascular segmentation model to make full use of information at different levels and improve segmentation accuracy.
[0065] Feature extraction through an adaptive feature calibration module enables optimal representation of vascular structures.
[0066] Step 103: Output the extraction result of the pulmonary blood vessels corresponding to the target pulmonary CT image.
[0067] In a possible implementation, a target lung CT image is input into a linear processing operation, the linear processing operation outputs a second intermediate feature map, the second intermediate feature map is input into a transformer module, the transformer module outputs a third intermediate feature map Z3, a fourth intermediate feature map Z6, a fifth intermediate feature map Z9 and a bottom-level feature map Z12, the third intermediate feature map Z3, the fourth intermediate feature map Z6, the fifth intermediate feature map Z9 and the bottom-level feature map Z12 represent global feature information of the target lung CT image;
[0068] The underlying feature map Z12 inputs the spatial attention module and the channel attention module, and the spatial attention module and the channel attention module output the attention feature map F', which represents the local feature information of the target lung CT image.
[0069] The target lung CT image is called the first intermediate feature map Z0.
[0070] In a possible implementation, the linear processing operation includes a linear embedding module and a patch partitioning module, and the target lung CT image is processed by the linear embedding module and the patch partitioning module in sequence to output a second intermediate feature map;
[0071] The transformer module includes a first-stage transformer module, a second-stage transformer module, a third-stage transformer module, and a fourth-stage transformer module;
[0072] After the second intermediate feature map is mapped to a 1D sequence, it is input into the first-stage transformer module, and the third intermediate feature map Z3 is output. The third intermediate feature map Z3 is input into the second-stage transformer module, and the fourth intermediate feature map Z6 is output. The fourth intermediate feature map Z6 is input into the third-stage transformer module, and the fifth intermediate feature map Z9 is output. The fifth intermediate feature map Z9 is input into the fourth-stage transformer module, and the bottom-level feature map Z12 is output.
[0073] In a possible implementation, the first-stage transformer module includes a first transformer module, a second transformer module, and a third transformer module arranged in sequence, the first transformer module includes a first Norm operation, a first multi-head self-attention calculation, a first Norm operation, and a first multi-layer perceptron operation arranged in sequence; the second transformer module includes a second Norm operation, a second multi-head self-attention calculation, a second Norm operation, and a second multi-layer perceptron operation arranged in sequence; the third transformer module includes a third Norm operation, a third multi-head self-attention calculation, a third Norm operation, and a third multi-layer perceptron operation arranged in sequence; the output size of the third multi-layer perceptron operation is The third intermediate feature map Z3;
[0074] The second-stage transformer module includes a fourth transformer module, a fifth transformer module, and a sixth transformer module, which are arranged in sequence. The fourth transformer module includes a fourth Norm operation, a fourth multi-head self-attention calculation, a fourth Norm operation, and a fourth multi-layer perceptron operation, which are arranged in sequence. The fifth transformer module includes a fifth Norm operation, a fifth multi-head self-attention calculation, a fifth Norm operation, and a fifth multi-layer perceptron operation, which are arranged in sequence. The sixth transformer module includes a sixth Norm operation, a sixth multi-head self-attention calculation, a sixth Norm operation, and a sixth multi-layer perceptron operation, which are arranged in sequence. The output size of the sixth multi-layer perceptron operation is The fourth intermediate feature map Z6;
[0075] The third-stage transformer module includes the seventh transformer module, the eighth transformer module and the ninth transformer module, which are arranged in sequence. The seventh transformer module includes the seventh Norm operation, the seventh multi-head self-attention calculation, the seventh Norm operation and the seventh multi-layer perceptron operation, which are arranged in sequence. The eighth transformer module includes the eighth Norm operation, the eighth multi-head self-attention calculation, the eighth Norm operation and the eighth multi-layer perceptron operation, which are arranged in sequence. The ninth transformer module includes the ninth Norm operation, the ninth multi-head self-attention calculation, the ninth Norm operation and the ninth multi-layer perceptron operation, which are arranged in sequence. The output size of the ninth multi-layer perceptron operation is The fifth intermediate feature map Z9;
[0076] The fourth-stage transformer module includes the tenth transformer module, the eleventh transformer module and the twelfth transformer module, which are arranged in sequence. The tenth transformer module includes the tenth Norm operation, the tenth multi-head self-attention calculation, the tenth Norm operation and the tenth multi-layer perceptron operation, which are arranged in sequence. The eleventh transformer module includes the eleventh Norm operation, the eleventh multi-head self-attention calculation, the eleventh Norm operation and the eleventh multi-layer perceptron operation, which are arranged in sequence. The twelfth transformer module includes the twelfth Norm operation, the twelfth multi-head self-attention calculation, the twelfth Norm operation and the twelfth multi-layer perceptron operation, which are arranged in sequence. The output size of the twelfth multi-layer perceptron operation is The underlying feature map Z12.
[0077] In order to better extract global feature information, the encoder stage consists of 12 transformer modules.
[0078] In a possible implementation, when the underlying feature map Z12 is input into the spatial attention module, the underlying feature map Z12 successively undergoes a 3×1×1 convolution operation, a BN normalization layer, and a ReLu activation function layer, and outputs a first horizontal feature information matrix Q. The underlying feature map Z12 successively undergoes a 1×3×1 convolution operation, a BN normalization layer, and a ReLu activation function layer, and outputs a first vertical feature information matrix K. The underlying feature map Z12 successively undergoes a 1×1×3 convolution operation, a BN normalization layer, and a ReLu activation function layer, and outputs a first depth feature information matrix J. The first horizontal feature information matrix Q, the first vertical feature information matrix K, and the first depth feature information matrix J are multiplied respectively, and then successively undergo a Softmax layer and a reshape operation to output a first feature attention score map F. 1 The underlying feature map Z12 undergoes 1×1×1 convolution operations, BN normalization layers, and ReLu activation function layers in turn to perform dimensionality reduction processing and output the first matrix feature information V. The first matrix feature information V and the first feature attention score map F 1 Matrix multiplication, output the first weighted attention score map F 1 ', the first weighted attention score map F 1 'Add to the underlying feature map Z12 and output the final spatial attention feature map F 1 ”;
[0079] When the underlying feature map Z12 is input into the channel attention module, the underlying feature map Z12 undergoes a 1×1×1 convolution operation, a BN normalization layer, and a ReLu activation function layer in sequence, and outputs the first channel feature information matrix Q'. The underlying feature map Z12 undergoes a 1×1×1 convolution operation, a BN normalization layer, and a ReLu activation function layer in sequence, and outputs the second channel feature information matrix K'. The underlying feature map Z12 undergoes a 1×1×1 convolution operation, a BN normalization layer, and a ReLu activation function layer in sequence, and outputs the third channel feature information matrix J'. After the first channel feature information matrix Q', the second channel feature information matrix K', and the third channel feature information matrix J' are multiplied respectively, they pass through the Softmax layer and reshape operation in sequence to output the second feature attention score map F 2 The underlying feature map Z12 undergoes 1×1×1 convolution operations, BN normalization layers, and ReLu activation function layers in turn to perform dimensionality reduction processing and output the second matrix feature information V'. The second matrix feature information V' and the second feature attention score map F 2 Matrix multiplication, output the second weighted attention score map F 2 ', the second weighted attention score map F 2 'Add to the underlying feature map Z12 and output the final channel attention feature map F 2 ”;
[0080] Spatial attention feature map F 1 ” and channel attention feature map F 2 "Add element by element and output the attention feature map F", such as Figure 3 shown.
[0081] In a possible implementation, the deconvolution module includes a first deconvolution module D1, a second deconvolution module D2, a third deconvolution module D3 and a fourth deconvolution module D4; the jump connection module includes a first jump connection module S1, a second jump connection module S2, a third jump connection module S3 and a fourth jump connection module S4; the adaptive feature calibration module includes a first adaptive calibration module F1, a second adaptive calibration module F2, a third adaptive calibration module F3 and a fourth adaptive calibration module F4;
[0082] Attention feature map F ” Input the fourth deconvolution module D4, the output size of the fourth deconvolution module D4 is A fifth deconvolution feature map E5 is input into a fourth adaptive calibration module F4;
[0083] The fifth intermediate feature map Z9 is input into the fourth jump connection module S4, and the output size of the fourth jump connection module S4 is The fifth jump feature map C5 is input into the fourth adaptive calibration module F4. The fourth adaptive calibration module F4 calibrates the fifth deconvolution feature map E5 and the fifth jump feature map C5, and outputs a fourth calibration feature map. The fourth calibration feature map undergoes two sequentially set 3×3×3 convolution operations, a BN normalization layer operation, and a ReLu activation function layer operation, and then passes through the third deconvolution module D3. The output size of the third deconvolution module D3 is A fourth deconvolution feature map E4 is input into a third adaptive calibration module F3;
[0084] The fourth intermediate feature map Z6 is input into the third jump connection module S3, and the output size of the third jump connection module S3 is The fourth jump feature map C4 is input into the third adaptive calibration module F3. The third adaptive calibration module F3 calibrates the fourth deconvolution feature map E4 and the fourth jump feature map C4, and outputs a third calibration feature map. The third calibration feature map undergoes two sequentially set 3×3×3 convolution operations, a BN normalization layer operation, and a ReLu activation function layer operation, and then passes through the second deconvolution module D2. The second deconvolution module D2 outputs a size of The third deconvolution feature map E3 is input into the second adaptive calibration module F2;
[0085] The third intermediate feature map Z3 is input into the second jump connection module S2, and the output size of the second jump connection module S2 is The third jump feature map C3 is input into the second adaptive calibration module F2. After the second adaptive calibration module F2 calibrates the third deconvolution feature map E3 and the third jump feature map C3, it outputs a second calibration feature map. After the second calibration feature map undergoes two sequentially set 3×3×3 convolution operations, BN normalization layer operations and ReLu activation function layer operations, it passes through the first deconvolution module D1. The first deconvolution module D1 outputs a second deconvolution feature map E2 with a size of H×W×D×64. The second deconvolution feature map E2 is input into the first adaptive calibration module F1.
[0086] For the convenience of description, the target lung CT image is called the first intermediate feature map Z0, whose size is H×W×D×1. The first intermediate feature map Z0 is input into the first jump connection module S1, and the first jump connection module S1 outputs the first jump feature map C1 with a size of H×W×D×64. The first jump feature map C1 is input into the first adaptive calibration module F1. The first adaptive calibration module F1 calibrates the second deconvolution feature map E2 and the first jump feature map C1, and then outputs the first calibration feature map; the first calibration feature map undergoes two 3×3×3 convolution operations, a BN normalization layer operation, and a ReLu activation function layer operation, and then undergoes a 1×1×1 convolution operation to obtain the segmentation result of the lung blood vessels of the target lung CT image.
[0087] In a possible implementation, the first jump connection module S1 includes two sequentially arranged 3×3×3 convolution operations, BN layer operations, and ReLu activation function layer operations; the second jump connection module S2 includes three sequentially arranged 2×2×2 deconvolution operations, 3×3×3 convolution operations, BN layer operations, and ReLu activation function layer operations; the third jump connection module S3 includes two sequentially arranged 2×2×2 deconvolution operations, 3×3×3 convolution operations, BN layer operations, and ReLu activation function layer operations; the fourth jump connection module S4 includes one sequentially arranged 2×2×2 deconvolution operations, 3×3×3 convolution operations, BN layer operations, and ReLu activation function layer operations.
[0088] The feature map of the corresponding resolution in the encoder stage of each layer is spliced with the feature map of the corresponding layer in the decoding stage in the channel dimension to enhance the detail features of the tubular structure and reduce the loss of detail information.
[0089] In a possible implementation, the first adaptive calibration module F1, the second adaptive calibration module F2, the third adaptive calibration module F3 and the fourth adaptive calibration module F4 have the same structure;
[0090] Among them, when each layer of deconvolution feature map and the corresponding jump feature map are input into the corresponding adaptive feature calibration module, the deconvolution feature map and the jump feature map are sequentially subjected to channel superposition, global average pooling, and a fully connected layer, and the first weight Z1 and the second weight Z2 of the channel are output, the deconvolution feature map is multiplied by the second weight Z2, and the deconvolution weight feature map is output, the jump feature map is multiplied by the first weight Z1, and the jump weight feature map is output, the deconvolution weight feature map and the jump weight feature map are element-wise added, and the deconvolution jump weight feature map is output, the deconvolution feature map and the deconvolution jump weight feature map are element-wise added, and the calibration feature map is output, such as Figure 4 shown.
[0091] The decoding path consists of four groups of decoding blocks. After upsampling 2 times to restore the feature map size, each decoding block uses an adaptive feature calibration module to adaptively adjust the weights of blood vessels and non-blood vessels to further extract and refine tubular information. The adaptive feature calibration module selectively integrates features from the encoder and symmetric decoder layers using the first weight z1 and second weight z2 for self-learning features. The feature-oriented importance scores are calculated using the channel attention mechanism and the sigmoid function. In the channel weighting mechanism, features that are significantly related to vascular structures will be given greater weights, which is beneficial to the segmentation task. It has a good effect on the problem of terminal fine branch breakage in the complex morphological structure of blood vessels and improves the accuracy of vascular segmentation.
[0092] The design of the adaptive feature calibration module improves the efficiency of the network in extracting image feature information, integrates image spatial information, reorganizes it according to channels, and performs weighted combinations along each spatial dimension, so as to better utilize the features learned from the neural network, ensure the relative priority of the activated areas of the tubular structures of the lungs, strengthen the representation learning of tubular objects, and thus better segment the tubular structures in the lungs, solve the problem of discontinuous segmentation of the tubular structures of the lungs, and further improve the accuracy of obtaining information on the tubular structures of the lungs.
[0093] In a possible implementation, before inputting the target lung CT image into a pre-trained pulmonary vascular segmentation model, the pulmonary vascular segmentation method further includes:
[0094] Step 201: Acquire a lung CT image sample set;
[0095] Step 202: Obtaining the gold standard for pulmonary vascular segmentation;
[0096] Step 203: Calculate the loss between the predicted segmentation result obtained by inputting each lung CT image sample in the lung image sample set into the pre-built pulmonary vascular segmentation model for training and the gold standard of pulmonary vascular segmentation; the loss function is defined as:
[0097] Loss = λ 1 L Dice +λ 2 L CE
[0098] Among them, L Dice is the Dice loss term between the gold standard and the predicted image, L CE is the cross entropy loss term between the gold standard and the predicted image, λ 1 , 2 are the constraint weights of the above two loss functions respectively;
[0099] The Dice loss function is defined as follows:
[0100]
[0101] The cross entropy loss function is defined as follows:
[0102]
[0103] Among them, y is the true label, It is the model prediction image, and Smoothness is 1e-5;
[0104] Step 204: By calculating the loss function between the predicted image and the gold standard, the segmentation parameters of the pulmonary vascular segmentation model are updated using back-propagation gradient derivation, and the training of the pulmonary vascular segmentation model is terminated after a preset number of iterations to obtain a pre-trained pulmonary vascular segmentation model.
[0105] In a possible implementation, the training of the pulmonary vascular segmentation model is terminated after 1000 iterations.
[0106] The Dice coefficient and intersection over union (IoU) are used as evaluation criteria to evaluate the segmentation model:
[0107] A set of data is randomly selected as the test data set, and the preprocessed images are sent as input to this segmentation model to predict the pulmonary vascular segmentation results. The Dice coefficient and intersection over union (IoU) are used as evaluation criteria to evaluate the segmentation model, where the Dice coefficient is defined as:
[0108]
[0109] y, The gold standard and segmentation network prediction results of pulmonary vascular are shown respectively. The Dice coefficient score of the completely overlapping area of the two images is 1. The Dice coefficient explicitly measures the consistency between the two medical anatomical regions, thus reflecting the quality of the segmentation. is y and The intersection between |y| and Represents y and The number of voxels in the three-dimensional space domain, where the coefficient of the numerator is 2, is because the denominator has repeated calculations of y and common elements between them.
[0110] The Intersection over Union (IoU) is defined as:
[0111]
[0112] y, They are the gold standard and segmentation network prediction results of the pulmonary vascular. The intersection-over-union ratio of the two images that completely overlap is 1. The intersection-over-union ratio explicitly measures the consistency between the two medical anatomical regions, thus reflecting the quality of the segmentation. is y and The intersection between is y and The union between .
[0113] An embodiment of the present application provides the following comparative experiment: The experimental data used in this comparative experiment are:
[0114] 1. VESSEL12 lung dataset, which provides 20 sets of CT and CTA images and private pulmonary vascular data annotated by experts. The original resolution of each image is 512*512*512. Due to the limitation of the experimental environment, it is preprocessed. The size of each image in the real experimental data is 128*128*128. The ratio of training set, validation set and test set is 6:2:2.
[0115] 2. ATM22 lung dataset, which comes from the Airway Tree Modeling Challenge 2022 (ATM22) held by MICCAI in 2022. It contains 299 CT images. Due to the limitation of the experimental environment, we uniformly processed the CT datasets provided by them, including window width, window level, resampling, bed removal and cropping operations. The ratio of training set, validation set and test set is 269:10:20. Private vascular annotation was performed on this dataset.
[0116] The results of the comparative experiment are shown in Table 1.
[0117] Table 1 Dice coefficient and IoU obtained based on VESSEL12 lung dataset and ATM22 lung dataset
[0118]
[0119] The pulmonary vascular segmentation method provided in this application has excellent Dice coefficient and Iou for segmenting pulmonary vascular, and Figure 5 The pulmonary vascular segmentation results obtained by various methods are shown in FIG. 1 . The segmentation results obtained by the present application are more accurate than those of Vnet, UNETR, Swin_UNETR and other methods, while ensuring the effectiveness and feasibility of the pulmonary vascular segmentation model of the present application.
[0120] It can be seen that the present invention provides a pulmonary vascular segmentation method. Through the pre-constructed pulmonary vascular segmentation model, the transformer module is used to obtain global feature information in the encoding stage. The spatial attention module and the channel attention module focus on the global information and detail information of the pulmonary vascular structure, and effectively associate between different channels to capture the correlation and spatiality between pulmonary vascular features, better extract long-distance information, improve the detail accuracy of the local feature information of the pulmonary vascular, more widely focus on the contextual information of the local features, and increase their representation capabilities, obtain local feature information, and combine the transformer module with the spatial attention module and the channel attention module to strengthen the correlation between global spatial information and local detail information; in the decoding stage, the adaptive feature calibration module is combined with the convolution operation into the pulmonary vascular segmentation model, and effective features are adaptively selected to obtain more details of the vascular structure. Features from the encoder layer and the symmetric decoder layer can be adaptively combined to optimize the representation of the vascular structure. The segmentation accuracy of local pulmonary vascular tissue is improved, more accurate pulmonary vessels are obtained, and time can be saved and efficiency can be improved.
[0121] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean 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 embodiment of the present invention.
[0122] The following is an embodiment of the device of the present invention. For details not described in detail therein, reference may be made to the corresponding method embodiment described above.
[0123] Figure 6 A schematic diagram of the structure of a pulmonary blood vessel segmentation device provided by an embodiment of the present invention is shown. For ease of description, only the parts related to the embodiment of the present invention are shown, which are described in detail as follows:
[0124] like Figure 6 As shown, the pulmonary vascular segmentation device 2 includes:
[0125] An image acquisition module 21 is used to acquire a lung CT image to be segmented;
[0126] The image segmentation module 22 is used to input the target lung CT image into a pre-trained pulmonary vascular segmentation model, which includes an encoder and a decoder; the encoder includes a linear processing operation, a transformer module and an attention module which are arranged in sequence; the linear processing operation is used to project the target lung CT image into an embedding space and perform patch division; the transformer module is used to obtain the global feature information of the target lung CT image, and the attention module includes a parallel spatial attention module and a channel attention module, the spatial attention module and the channel attention module are used to focus on the global information and detail information of the pulmonary vascular structure, and effectively associate different channels, capture the correlation and spatiality between pulmonary vascular features, extract the long-distance information of the pulmonary vessels, and improve the detail accuracy of the local feature information of the pulmonary vessels; the encoder and the decoder are connected by a jump connection module; the decoder includes a deconvolution module and an adaptive feature calibration module; the deconvolution module and the adaptive feature calibration module are used to integrate the local feature information and the global feature information of the pulmonary vessels;
[0127] The segmentation result output module 23 is used to output the extraction result of the pulmonary blood vessels corresponding to the target pulmonary CT image.
[0128] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by 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 embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0129] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0130] Those skilled in the art will appreciate that the units and algorithm steps of each example 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 performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0131] In the embodiments provided by the present invention, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0132] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0133] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A pulmonary vascular segmentation method, It is characterized in that include: Acquire a target lung CT image; The target lung CT image is input into a pre-trained pulmonary vascular segmentation model, wherein the pulmonary vascular segmentation model includes an encoder and a decoder; the encoder includes a linear processing operation, a transformer module and an attention module which are arranged in sequence; the linear processing operation is used to project the target lung CT image into an embedding space and perform patch division; the transformer module is used to obtain global feature information of the target lung CT image, and the attention module includes a parallel spatial attention module and a channel attention module, wherein the spatial attention module and the channel attention module are used to focus on the global information and detail information of the pulmonary vascular structure, and to effectively associate between different spaces and channels, capture the correlation and spatiality between pulmonary vascular features, extract the long-distance information of pulmonary vessels, and improve the detail accuracy of the local feature information of pulmonary vessels; the encoder and the decoder are connected via a jump connection module; the decoder includes a deconvolution module and an adaptive feature calibration module; the deconvolution module and the adaptive feature calibration module are used to integrate the local feature information and the global feature information of the pulmonary vessels; The extraction result of the pulmonary blood vessels corresponding to the target pulmonary CT image is output.
2. A pulmonary blood vessel segmentation method according to claim 1, It is characterized in that The target lung CT image is input into the linear processing operation, the linear processing operation outputs a second intermediate feature map, the second intermediate feature map is input into the transformer module, the transformer module outputs a third intermediate feature map, a fourth intermediate feature map, a fifth intermediate feature map and a bottom layer feature map, the third intermediate feature map, the fourth intermediate feature map, the fifth intermediate feature map and the bottom layer feature map represent global feature information of the target lung CT image; The underlying feature map is input into the spatial attention module and the channel attention module, and the spatial attention module and the channel attention module output an attention feature map, which represents the global feature information and local feature information of the target lung CT image.
3. A pulmonary blood vessel segmentation method according to claim 2, It is characterized in that The linear processing operation includes a linear embedding module and a patch division module, and the target lung CT image is processed by the linear embedding module and the patch division module in sequence to output the second intermediate feature map; The transformer module includes a first-stage transformer module, a second-stage transformer module, a third-stage transformer module, and a fourth-stage transformer module; After the second intermediate feature map is mapped to a 1D sequence, it is input into the first-stage transformer module, and the third intermediate feature map is output. The third intermediate feature map is input into the second-stage transformer module, and the fourth intermediate feature map is output. The fourth intermediate feature map is input into the third-stage transformer module, and the fifth intermediate feature map is output. The fifth intermediate feature map is input into the fourth-stage transformer module, and the bottom-level feature map is output.
4. A pulmonary blood vessel segmentation method according to claim 3, It is characterized in that The first-stage transformer module includes a first transformer module, a second transformer module and a third transformer module which are arranged in sequence, wherein the first transformer module includes a first Norm operation, a first multi-head self-attention calculation, a first Norm operation and a first multi-layer perceptron operation which are arranged in sequence; the second transformer module includes a second Norm operation, a second multi-head self-attention calculation, a second Norm operation and a second multi-layer perceptron operation which are arranged in sequence; the third transformer module includes a third Norm operation, a third multi-head self-attention calculation, a third Norm operation and a third multi-layer perceptron operation which are arranged in sequence; the third multi-layer perceptron operation outputs the third intermediate feature map; The second-stage transformer module includes a fourth transformer module, a fifth transformer module and a sixth transformer module arranged in sequence, the fourth transformer module includes a fourth Norm operation, a fourth multi-head self-attention calculation, a fourth Norm operation and a fourth multi-layer perceptron operation arranged in sequence; the fifth transformer module includes a fifth Norm operation, a fifth multi-head self-attention calculation, a fifth Norm operation and a fifth multi-layer perceptron operation arranged in sequence; the sixth transformer module includes a sixth Norm operation, a sixth multi-head self-attention calculation, a sixth Norm operation and a sixth multi-layer perceptron operation arranged in sequence; the sixth multi-layer perceptron operation outputs the fourth intermediate feature map; The third-stage transformer module includes a seventh transformer module, an eighth transformer module and a ninth transformer module which are arranged in sequence, and the seventh transformer module includes a seventh Norm operation, a seventh multi-head self-attention calculation, a seventh Norm operation and a seventh multi-layer perceptron operation which are arranged in sequence; the eighth transformer module includes an eighth Norm operation, an eighth multi-head self-attention calculation, an eighth Norm operation and an eighth multi-layer perceptron operation which are arranged in sequence; the ninth transformer module includes a ninth Norm operation, a ninth multi-head self-attention calculation, a ninth Norm operation and a ninth multi-layer perceptron operation which are arranged in sequence; the ninth multi-layer perceptron operation outputs the fifth intermediate feature map; The fourth-stage transformer module includes a tenth transformer module, an eleventh transformer module and a twelfth transformer module arranged in sequence, and the tenth transformer module includes a tenth Norm operation, a tenth multi-head self-attention calculation, a tenth Norm operation and a tenth multi-layer perceptron operation arranged in sequence; the eleventh transformer module includes an eleventh Norm operation, an eleventh multi-head self-attention calculation, an eleventh Norm operation and an eleventh multi-layer perceptron operation arranged in sequence; the twelfth transformer module includes a twelfth Norm operation, a twelfth multi-head self-attention calculation, a twelfth Norm operation and a twelfth multi-layer perceptron operation arranged in sequence; the twelfth multi-layer perceptron operation outputs the underlying feature map.
5. A pulmonary blood vessel segmentation method according to claim 2, It is characterized in that When the underlying feature map is input into the spatial attention module, the underlying feature map is sequentially subjected to a 3×1×1 convolution operation, a BN normalization layer, and a ReLu activation function layer, and outputs a first horizontal feature information matrix. The underlying feature map is sequentially subjected to a 1×3×1 convolution operation, a BN normalization layer, and a ReLu activation function layer, and outputs a first vertical feature information matrix. The underlying feature map is sequentially subjected to a 1×1×3 convolution operation, a BN normalization layer, and a ReLu activation function layer, and outputs a first depth feature information matrix. The first horizontal feature information matrix, the After the first vertical feature information matrix and the first depth feature information matrix are multiplied respectively, they are sequentially subjected to the Softmax layer and the reshape operation to output a first feature attention score map; the underlying feature map is sequentially subjected to the 1×1×1 convolution operation, the BN normalization layer and the ReLu activation function layer to perform dimensionality reduction processing, and the first matrix feature information is output. The first matrix feature information is matrix-multiplied with the first feature attention score map to output a first weighted attention score map, and the first weighted attention score map is added to the underlying feature map to output a final spatial attention feature map; When the underlying feature map is input into the channel attention module, the underlying feature map is sequentially subjected to a 1×1×1 convolution operation, a BN normalization layer, and a ReLu activation function layer, and a first channel feature information matrix is output. The underlying feature map is sequentially subjected to a 1×1×1 convolution operation, a BN normalization layer, and a ReLu activation function layer, and a second channel feature information matrix is output. The underlying feature map is sequentially subjected to a 1×1×1 convolution operation, a BN normalization layer, and a ReLu activation function layer, and a third channel feature information matrix is output. The first channel feature information matrix, the second channel feature information matrix, and the third channel feature information matrix are respectively multiplied, and then sequentially subjected to a Softmax layer and a reshape operation to output a second feature attention score map. The underlying feature map is sequentially subjected to a 1×1×1 convolution operation, a BN normalization layer, and a ReLu activation function layer to perform dimensionality reduction processing, and a second matrix feature information is output. The second matrix feature information is matrix-multiplied with the second feature attention score map to output a second weighted attention score map. The second weighted attention score map is added to the underlying feature map to output a final channel attention feature map. The spatial attention feature map is added element by element to the channel attention feature map, and an attention feature map is output.
6. A pulmonary blood vessel segmentation method according to claim 5, It is characterized in that The deconvolution module includes a first deconvolution module, a second deconvolution module, a third deconvolution module and a fourth deconvolution module; the jump connection module includes a first jump connection module, a second jump connection module, a third jump connection module and a fourth jump connection module; the adaptive feature calibration module includes a first adaptive calibration module, a second adaptive calibration module, a third adaptive calibration module and a fourth adaptive calibration module; The attention feature map is input into the fourth deconvolution module, the fourth deconvolution module outputs a fifth deconvolution feature map, and the fifth deconvolution feature map is input into the fourth adaptive calibration module; The fifth intermediate feature map is input into the fourth jump connection module, the fourth jump connection module outputs the fifth jump feature map, the fifth jump feature map is input into the fourth adaptive calibration module, the fourth adaptive calibration module calibrates the fifth deconvolution feature map and the fifth jump feature map, and then outputs a fourth calibration feature map, the fourth calibration feature map is subjected to two sequentially set 3×3×3 convolution operations, a BN normalization layer operation, and a ReLu activation function layer operation, and then passes through the third deconvolution module, the third deconvolution module outputs a fourth deconvolution feature map, and the fourth deconvolution feature map is input into the third adaptive calibration module; The fourth intermediate feature map is input into the third jump connection module, the third jump connection module outputs a fourth jump feature map, the fourth jump feature map is input into the third adaptive calibration module, the third adaptive calibration module calibrates the fourth deconvolution feature map and the fourth jump feature map, and then outputs a third calibration feature map, the third calibration feature map is subjected to two sequentially set 3×3×3 convolution operations, a BN normalization layer operation, and a ReLu activation function layer operation, and then passes through the second deconvolution module, the second deconvolution module outputs a third deconvolution feature map, and the third deconvolution feature map is input into the second adaptive calibration module; The third intermediate feature map is input into the second jump connection module, the second jump connection module outputs the third jump feature map, the third jump feature map is input into the second adaptive calibration module, the second adaptive calibration module calibrates the third deconvolution feature map and the third jump feature map, and then outputs a second calibration feature map, the second calibration feature map passes through the first deconvolution module after two sequentially set 3×3×3 convolution operations, BN normalization layer operations and ReLu activation function layer operations, and then passes through the first deconvolution module, the first deconvolution module outputs a second deconvolution feature map, and the second deconvolution feature map is input into the first adaptive calibration module; The first intermediate feature map is input into the first skip connection module, the first skip connection module outputs a first skip feature map, the first skip feature map is input into the first adaptive calibration module, the first adaptive calibration module calibrates the second deconvolution feature map and the first skip feature map, and then outputs a first calibration feature map; The first calibration feature map undergoes two sequentially arranged 3×3×3 convolution operations, a BN normalization layer operation, and a ReLu activation function layer operation, and then undergoes a 1×1×1 convolution operation to obtain the segmentation result of the pulmonary blood vessels of the target pulmonary CT image.
7. A pulmonary blood vessel segmentation method according to claim 6, It is characterized in that The first jump connection module includes two sequentially arranged 3×3×3 convolution operations, a BN layer operation, and a ReLu activation function layer operation; the second jump connection module includes three sequentially arranged 2×2×2 deconvolution operations, a 3×3×3 convolution operation, a BN layer operation, and a ReLu activation function layer operation; The third jump connection module includes two sequentially arranged 2×2×2 deconvolution operations, 3×3×3 convolution operations, BN layer operations, and ReLu activation function layer operations; The fourth jump connection module includes a 2×2×2 deconvolution operation, a 3×3×3 convolution operation, a BN layer operation, and a ReLu activation function layer operation, which are arranged in sequence at one time.
8. A pulmonary blood vessel segmentation method according to claim 6, It is characterized in that The first adaptive calibration module, the second adaptive calibration module, the third adaptive calibration module and the fourth adaptive calibration module have the same structure; Among them, when each layer of deconvolution feature map and the corresponding jump feature map are input into the corresponding adaptive feature calibration module, the deconvolution feature map and the jump feature map are successively subjected to channel superposition, global average pooling, and a fully connected layer, and the first weight and the second weight of the channel are output, the deconvolution feature map is multiplied by the second weight, and the deconvolution weight feature map is output, the jump feature map is multiplied by the first weight, and the jump weight feature map is output, the deconvolution weight feature map and the jump weight feature map are element-wise added, and a deconvolution jump weight feature map is output, the deconvolution feature map and the deconvolution jump weight feature map are element-wise added, and a calibration feature map is output.
9. The pulmonary blood vessel segmentation method according to claim 1, It is characterized in that Before inputting the target lung CT image into a pre-trained pulmonary vascular segmentation model, the pulmonary vascular segmentation method further includes: Obtain a lung CT image sample set; Obtain the gold standard for pulmonary vascular segmentation; The loss between the predicted segmentation result obtained by inputting each lung CT image sample in the lung image sample set into the pre-built pulmonary vascular segmentation model for training and the gold standard of the pulmonary vascular segmentation is calculated; the loss function is defined as: Loss=λ 1 L Dice +λ 2 L CE Among them, L Dice is the Dice loss term between the gold standard and the predicted image, L CE is the cross entropy loss term between the gold standard and the predicted image, λ 1 , 2 are the constraint weights of the above two loss functions respectively; The Dice loss function is defined as follows: The cross entropy loss function is defined as follows: Among them, y is the true label, It is the model prediction image, and Smoothness is 1e-5; By calculating the loss function between the predicted image and the gold standard, the segmentation parameters of the pulmonary vascular segmentation model are updated using back-propagation gradient derivation, and the training of the pulmonary vascular segmentation model is terminated after a preset number of iterations to obtain a pre-trained pulmonary vascular segmentation model.
10. A pulmonary vascular segmentation device, It is characterized in that include: An image acquisition module, used for acquiring a lung CT image to be segmented; An image segmentation module is used to input the target lung CT image into a pre-trained pulmonary vascular segmentation model, wherein the pulmonary vascular segmentation model includes an encoder and a decoder; the encoder includes a linear processing operation, a transformer module and an attention module arranged in sequence; the linear processing operation is used to project the target lung CT image into an embedding space and perform patch division; the transformer module is used to obtain global feature information of the target lung CT image, and the attention module includes a parallel spatial attention module and a channel attention module, wherein the spatial attention module and the channel attention module are used to focus on the global information and detail information of the pulmonary vascular structure, and to effectively associate different channels, capture the correlation and spatiality between pulmonary vascular features, extract the long-distance information of the pulmonary vessels, and improve the detail accuracy of the local feature information of the pulmonary vessels; the encoder and the decoder are connected by a jump connection module; the decoder includes a deconvolution module and an adaptive feature calibration module; the deconvolution module and the adaptive feature calibration module are used to integrate the local feature information and the global feature information of the pulmonary vessels; The segmentation result output module is used to output the extraction result of the pulmonary blood vessels corresponding to the target lung CT image.
Citation Information
Patent Citations
Method and device for segmenting lung blood vessels in CT image, terminal equipment and medium
CN116740081A
