Heart image segmentation method based on state space model and dual-path multi-scale enhancement
By combining state space model and dual-path multi-scale enhancement technology in cardiac image segmentation, the problem that deep learning models are difficult to capture long-distance features and high computational complexity in cardiac image segmentation is solved, and more efficient and accurate heart images are achieved Split effect.
Patent Information
- Application Number
- CN202411170349.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-08-26
AI Technical Summary
Deep learning models are difficult to effectively capture long-distance image features in cardiac image segmentation tasks, and their computational complexity is high, which limits their use in actual clinical applications.
Using the cardiac image segmentation method based on state space model (SSM) and dual-path multi-scale enhancement, the SSM state space model branches, convolution branches and attention branches are integrated through the state space attention module and the dual-path multi-scale enhancement module, and combined with the SSM state space model Channel aggregation and multi-scale fusion branches improve the model's accuracy of the structure boundary recognition of heart image and the ability to recognize structures at different scales.
It significantly improves the accuracy and efficiency of cardiac image segmentation, reduces the computational complexity, adapts to the complexity and diversity of cardiac images, and improves the accuracy of cardiac disease diagnosis and treatment planning.
Smart Images

Figure CN119151956A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image segmentation, and in particular to a cardiac image segmentation method based on a state space model and dual-path multi-scale enhancement. Background Art
[0002] In today's medical imaging processing, accurate segmentation of cardiac images is crucial for in-depth understanding of heart disease, formulation of treatment plans, and monitoring of disease progression. As the application of artificial intelligence in the medical field continues to expand, deep learning, especially convolutional neural networks (CNNs) and Transformer models, has shown great potential in cardiac image segmentation tasks. These neural network models provide powerful tools for medical image analysis by automatically extracting high-dimensional features and identifying complex image patterns, significantly improving segmentation accuracy and efficiency compared to traditional methods.
[0003] However, although deep learning models have made significant progress, they still face some limitations in cardiac image segmentation tasks. CNN models are limited to local receptive fields and have difficulty in effectively capturing long-range image feature dependencies, which is crucial for understanding the integrity of cardiac structures. Although Transformer-based models can process global information, the computational complexity caused by their self-attention mechanism increases quadratically with the image size, which greatly increases the computational burden of processing high-resolution cardiac images and limits their use in actual clinical applications. Recently, the introduction of the Mamba model combined with the state-space model (SSM) provides us with a new perspective. SSM shows its unique advantages in handling long-range dependencies, and its computational complexity is linearly related to the input size, which greatly reduces the demand for computing resources compared to traditional deep learning models. Therefore, it is particularly important to explore a method that can effectively handle long-range dependencies in cardiac images while maintaining high efficiency in the use of computing resources. Summary of the invention
[0004] In order to overcome the deficiencies of the above technologies, the present invention provides a cardiac image segmentation method that can effectively process long-distance dependencies in cardiac images while maintaining high efficiency in the use of computing resources.
[0005] The technical solution adopted by the present invention to overcome the technical problems is:
[0006] A cardiac image segmentation method based on a state space model and dual-path multi-scale enhancement, comprising:
[0007] a) Collect N left atrium MRI image data to obtain a left atrium MRI image data set E, where E = {E1, E2, ..., E i ,...,E N}, Ei is the i-th left atrium MRI image data, i∈{1,...,N}; b) the i-th left atrium MRI image data E i Preprocessing is performed to obtain the preprocessed i-th left atrium MRI image data S i The preprocessed left atrium MRI image dataset is S, S = {S1, S2, ..., S i ,...,S N};
[0008] c) Divide the preprocessed left atrium MRI image dataset S into a training set, a validation set, and a test set, slice each preprocessed left atrium MRI image data in the training set along the Z axis to obtain a slice image set F consisting of X slice images train , F train ={F1,F2,...,F i ,...,F X}, F i For the i-th slice image, i∈{1,…,X}, slice each preprocessed left atrial MRI image data in the test set along the Z axis to obtain a slice image set F consisting of Y slice images test , F test ={F1,F2,...,F j ,...,F Y}, F j is the jth slice image, i∈{1,...,Y};
[0009] d) Establishing a segmentation network model consisting of an encoder and a decoder;
[0010] e) Take the i-th slice image F in the training set i Input into the encoder of the segmentation network model and output the feature map
[0011] f) The feature map Input into the decoder of the segmentation network model and output the predicted segmentation image
[0012] g) Using the SGD optimizer, using the total loss function L total Train the segmentation network model to obtain an optimized segmentation network model;
[0013] h) Take the jth slice image F in the test set j Input into the optimized segmentation network model and output the predicted segmentation image Furthermore, in step a), N left atrial MRI image data are collected from the 2018 Atrial Segmentation Challenge dataset.
[0014] Further, step b) comprises the following steps:
[0015] b-1) The i-th left atrium MRI image data E i Slice along the Z axis, and resample the slices to a pixel pitch of 1.5 in the X axis direction and 1.5 in the Y axis direction;
[0016] b-2) Use the CenterCrop function in pytorch to perform a center cropping operation on the slice after the resampling operation. The size of the cropped slice is 112×112;
[0017] b-3) Use the torch.stack() function to stack the slices after center cropping to restore the left atrium MRI image data E i ′;
[0018] b-4) Use the random_flip_rotate() function to rotate the left atrium MRI image data E i 'Flip along the horizontal or vertical axis with a probability of 0.5, and the flip angle is 90 degrees to obtain the rotated left atrium MRI image data E i ″;
[0019] b-5) The rotated left atrium MRI image data E i ″Perform Z-Score standardization to obtain the pre-processed i-th left atrium MRI image data S i .
[0020] Furthermore, in step c), the preprocessed left atrial MRI image dataset S is divided into a training set, a validation set, and a test set in a ratio of 6:1:3.
[0021] Further, step e) comprises the following steps:
[0022] e-1) The encoder of the segmentation network model is composed of a convolutional layer, a first state space attention module SSSCA, a first maximum pooling layer, a second state space attention module SSSCA, a second maximum pooling layer, a third state space attention module SSSCA, a third maximum pooling layer, a fourth state space attention module SSSCA, and a fourth maximum pooling layer. The first state space attention module SSSCA, the second state space attention module SSSCA, the third state space attention module SSSCA, and the fourth state space attention module SSSCA are all composed of SSM branches, convolution branches, and attention branches; the SSM branch is composed of the first LayerNorm layer, the first Linear layer, the first SiLu activation function, the second Linear layer, the depth-separable convolution layer, the second SiLu activation function, the state space model SSM, and the second LayerNorm layer; the convolution branches are all composed of a BatchNorm layer, a first convolution layer, a first ReLu activation function, a second convolution layer, a second ReLu activation function, and a point-by-point convolution layer; the attention branch is composed of a channel attention mechanism CAM and a spatial attention mechanism SAM;
[0023] e-2) Take the i-th slice image F in the training set i Input into the convolutional layer of the encoder and output the feature map
[0024] e-3) Use the torch.chunk() function in pytorch to map the feature map Perform Split operation and output the feature map and feature map The feature map Input to the first LayerNorm layer of the SSM branch of the first state space attention module SSSCA, and output the feature map F l 1-1 , the feature map F l 1-1 It is sequentially input into the first Linear layer and the first SiLu activation function of the SSM branch of the first state space attention module SSSCA, and the feature map is output. The feature map It is sequentially input into the second Linear layer, the depth-separable convolution layer, and the second SiLu activation function of the SSM branch of the first state-space attention module SSSCA, and the feature map F is output. l 1-3 , F l 1-3 It is sequentially input into the state space model SSM of the SSM branch of the first state space attention module SSSCA and the second LayerNorm layer, and the feature map F is output.l 1-4 , the feature map F l 1-2 With the feature map F l 1-4 Perform multiplication operation to obtain feature map F l 1 ; The feature map Input to the BatchNorm layer of the convolution branch of the first state space attention module SSSCA, and output the feature map The feature map The first convolutional layer, the first ReLu activation function, the second convolutional layer, and the second ReLu activation function of the convolutional branch of the first state space attention module SSSCA are input in sequence to output the feature map. The feature map Input into the point-by-point convolution layer of the convolution branch of the first state space attention module SSSCA, and output the feature map The feature map F l 1 With feature map The Concat operation is performed through the torch.cat() function in pytorch to obtain the feature map The feature map Input into the channel attention mechanism CAM of the attention branch of the first state space attention module SSSCA, and output the feature map The feature map Input into the spatial attention mechanism SAM of the attention branch of the first state space attention module SSSCA, and output the feature map The feature map With feature map Perform addition operation to obtain feature map e-4) The feature map Input to the first maximum pooling layer of the encoder, and output the feature map e-5) Use the torch.chunk() function in pytorch to map the feature map Perform Split operation and output the feature map and feature map The feature map Input to the first LayerNorm layer of the SSM branch of the second state space attention module SSSCA, and output the feature map F l 2-1 , the feature map F l 2-1It is sequentially input into the first Linear layer and the first SiLu activation function of the SSM branch of the second state space attention module SSSCA, and the feature map F is output. l 2-2 , the feature map F l 2-1 It is sequentially input into the second Linear layer, the depth-separable convolution layer, and the second SiLu activation function of the SSM branch of the second state-space attention module SSSCA, and the feature map F is output. l 2-3 , F l 2-3 It is input into the state space model SSM of the SSM branch of the second state space attention module SSSCA and the second LayerNorm layer in sequence, and the feature map F is output. l 2-4 , the feature map F l 2-2 With the feature map F l 2-4 Perform multiplication operation to obtain feature map F l 2 ; The feature map Input to the BatchNorm layer of the convolution branch of the second state space attention module SSSCA, and output the feature map The feature map The first convolutional layer, the first ReLu activation function, the second convolutional layer, and the second ReLu activation function of the convolutional branch of the second state space attention module SSSCA are input in sequence to output the feature map. The feature map Input into the point-by-point convolution layer of the convolution branch of the second state space attention module SSSCA, and output the feature map The feature map F l 2 With feature map The Concat operation is performed through the torch.cat() function in pytorch to obtain the feature map The feature map Input into the channel attention mechanism CAM of the attention branch of the second state space attention module SSSCA, and output the feature map The feature map Input into the spatial attention mechanism SAM of the attention branch of the second state space attention module SSSCA, and output the feature map The feature map With feature map Perform addition operation to obtain feature map e-6) The feature map Input to the second maximum pooling layer of the encoder, and output the feature map e-7) Use the torch.chunk() function in pytorch to map the feature map Perform Split operation and output the feature map and feature map The feature map Input to the first LayerNorm layer of the SSM branch of the third state space attention module SSSCA, and output the feature map F l 3-1 , the feature map F l 3-1 It is sequentially input into the first Linear layer and the first SiLu activation function of the SSM branch of the third state space attention module SSSCA, and the feature map F is output. l 3-2 , the feature map F l 3-1 It is sequentially input into the second Linear layer, the depth-separable convolution layer, and the second SiLu activation function of the SSM branch of the third state-space attention module SSSCA, and the feature map F is output. l 3-3 , F l 3-3 It is sequentially input into the state space model SSM of the SSM branch of the third state space attention module SSSCA and the second LayerNorm layer, and the feature map F is output. l 3-4 , the feature map F l 3-2 With the feature map F l 3-4 Perform multiplication operation to obtain feature map F l 3 ; The feature map Input to the BatchNorm layer of the convolution branch of the third state space attention module SSSCA, and output the feature map The feature map The first convolution layer, the first ReLu activation function, the second convolution layer, and the second ReLu activation function of the convolution branch of the third state space attention module SSSCA are input in sequence to output the feature map. The feature map Input into the point-by-point convolution layer of the convolution branch of the third state space attention module SSSCA, and output the feature map The feature map F l 3 With feature map The Concat operation is performed through the torch.cat() function in pytorch to obtain the feature map The feature map Input into the channel attention mechanism CAM of the attention branch of the third state space attention module SSSCA, and output the feature map The feature map Input into the spatial attention mechanism SAM of the attention branch of the third state space attention module SSSCA, and output the feature map The feature map With feature map Perform addition operation to obtain feature map e-8) The feature map Input to the third maximum pooling layer of the encoder, and output the feature map e-9) Use the torch.chunk() function in pytorch to map the feature map Perform Split operation and output the feature map and feature map The feature map Input to the first LayerNorm layer of the SSM branch of the fourth state space attention module SSSCA, and output the feature map F l 4-1 , the feature map F l 4-1 It is sequentially input into the first Linear layer and the first SiLu activation function of the SSM branch of the fourth state space attention module SSSCA, and the feature map F is output. l 4-2 , the feature map F l 4-1 It is sequentially input into the second Linear layer, the depth-separable convolution layer, and the second SiLu activation function of the SSM branch of the fourth state-space attention module SSSCA, and the feature map F is output. l 4-3 , F l 4-3 It is sequentially input into the state space model SSM of the SSM branch of the fourth state space attention module SSSCA and the second LayerNorm layer, and the feature map F is output. l 4-4 , the feature map F l 4-2 With the feature map F l 4-4 Perform multiplication operation to obtain feature map F l 4 ; The feature map Input to the BatchNorm layer of the convolution branch of the fourth state space attention module SSSCA, and output the feature map The feature map The first convolution layer, the first ReLu activation function, the second convolution layer, and the second ReLu activation function of the convolution branch of the fourth state space attention module SSSCA are input in sequence to output the feature map The feature map Input into the point-by-point convolution layer of the convolution branch of the fourth state space attention module SSSCA, and output the feature map The feature map F l 4 With feature map The Concat operation is performed through the torch.cat() function in pytorch to obtain the feature map The feature map Input to the channel attention mechanism CAM of the attention branch of the fourth state space attention module SSSCA, and output the feature map The feature map Input into the spatial attention mechanism SAM of the attention branch of the fourth state space attention module SSSCA, and output the feature map The feature map With feature map Perform addition operation to obtain feature map e-10) The feature map Input to the fourth maximum pooling layer of the encoder, and output the feature map Preferably, in step e-2), the convolution kernel size of the convolution layer of the encoder is 3×3; in step e-3), the convolution kernel size of the depthwise separable convolution layer of the SSM branch of the first state space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, the convolution kernel size of the first convolution layer of the convolution branch of the first state space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, the convolution kernel size of the second convolution layer of the convolution branch of the first state space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, and the convolution kernel size of the point-by-point convolution layer of the convolution branch of the first state space attention module SSSCA is 3×3 and the step size is 1; step e-4) The pooling kernel of the first maximum pooling layer in step e-5) is 2×2 and the step size is 2; the convolution kernel size of the depthwise separable convolution layer of the SSM branch of the second state-space attention module SSSCA in step e-5) is 3×3, the padding is 1, and the step size is 1, the convolution kernel size of the first convolution layer of the convolution branch of the second state-space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, the convolution kernel size of the second convolution layer of the convolution branch of the second state-space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, and the convolution kernel size of the point-by-point convolution layer of the convolution branch of the second state-space attention module SSSCA is 3×3 and the step size is 1; the second maximum pooling layer in step e-6) The pooling kernel is 2×2 and the stride is 2; in step e-7), the convolution kernel size of the depthwise separable convolution layer of the SSM branch of the third state-space attention module SSSCA is 3×3, the padding is 1, and the stride is 1; the convolution kernel size of the first convolution layer of the convolution branch of the third state-space attention module SSSCA is 3×3, the padding is 1, and the stride is 1; the convolution kernel size of the second convolution layer of the convolution branch of the third state-space attention module SSSCA is 3×3, the padding is 1, and the stride is 1; the convolution kernel size of the point-by-point convolution layer of the convolution branch of the third state-space attention module SSSCA is 3×3 and the stride is 1; in step e-8), the pooling kernel of the third maximum pooling layer is 2× 2, with a step size of 2; in step e-9), the convolution kernel size of the depthwise separable convolution layer of the SSM branch of the fourth state-space attention module SSSCA is 3×3, padded with 1, and with a step size of 1; the convolution kernel size of the first convolution layer of the convolution branch of the fourth state-space attention module SSSCA is 3×3, padded with 1, and with a step size of 1; the convolution kernel size of the second convolution layer of the convolution branch of the fourth state-space attention module SSSCA is 3×3, padded with 1, and with a step size of 1; the convolution kernel size of the point-by-point convolution layer of the convolution branch of the fourth state-space attention module SSSCA is 3×3, with a step size of 1; in step e-10), the pooling kernel of the fourth maximum pooling layer is 2×2, with a step size of 2.
[0025] Further, step f) comprises the following steps:
[0026] f-1) The decoder of the segmentation network model is composed of a first dual-path multi-scale enhancement module DPMSFE, a first transposed convolutional layer, a first residual block, a second dual-path multi-scale enhancement module DPMSFE, a second transposed convolutional layer, a second residual block, a third path multi-scale enhancement module DPMSFE, a third transposed convolutional layer, a third residual block, a fourth dual-path multi-scale enhancement module DPMSFE, a fourth transposed convolutional layer, a fourth residual block, and a convolutional layer; the first dual-path multi-scale enhancement module DPMSFE, the second dual-path multi-scale enhancement module DPMSFE, the third dual-path multi-scale enhancement module DPMSFE, and the fourth dual-path multi-scale enhancement module D PMSFE is composed of a lower convolution layer, a channel aggregation branch, a multi-scale fusion branch, and an upper convolution layer. The channel aggregation branch is composed of an average pooling layer, a first convolution layer, a ReLU activation function, and a second convolution layer in sequence. The multi-scale fusion branch is composed of a first convolution layer, a second convolution layer, a third convolution layer, a maximum pooling layer, a fourth convolution layer, and a Sigmoid activation function. The first residual block, the second residual block, the third residual block, and the fourth residual block are all composed of a first convolution layer, a first BatchNorm layer, a first ReLU activation function, a second convolution layer, a second BatchNorm layer, a second ReLU activation function, and a third ReLU activation function.
[0027] f-2) The feature map Input to the lower convolution layer of the first dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map Input to the channel aggregation branch of the first dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map With feature map Perform multiplication operation to obtain the feature map The feature map The first convolutional layer, the second convolutional layer, and the third convolutional layer of the multi-scale fusion branch of the first dual-path multi-scale enhancement module DPMSFE of the decoder are input respectively, and the feature map is output. Feature Map Feature Map The feature map Feature Map Feature Map Perform addition operation to obtain feature map The feature map The maximum pooling layer, the fourth convolutional layer, and the Sigmoid activation function of the multi-scale fusion branch of the first dual-path multi-scale enhancement module DPMSFE of the decoder are input in sequence, and the feature map is output. The feature map With feature map Perform multiplication operation and output the feature map The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the upper convolution layer of the first dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map f-3) The feature map With feature map Perform the addition operation and output the feature map f-4) The feature map Input to the first transposed convolutional layer of the decoder, and output the feature map The feature map It is sequentially input into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function of the first residual block of the decoder, and the feature map is output. The feature map It is sequentially input into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function of the first residual block of the decoder, and the feature map is output. The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the third ReLU activation function of the first residual block of the decoder, and output the feature map f-5) The feature map The input is sent to the lower convolution layer of the second dual-path multi-scale enhancement module DPMSFE of the decoder, and the output is the feature map The feature map Input to the channel aggregation branch of the second dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map With feature map Perform multiplication operation to obtain the feature map The feature map The first convolutional layer, the second convolutional layer, and the third convolutional layer of the multi-scale fusion branch of the second dual-path multi-scale enhancement module DPMSFE of the decoder are input respectively, and the feature map is output. Feature Map Feature Map The feature map Feature Map Feature Map Perform addition operation to obtain feature map The feature map The maximum pooling layer, the fourth convolutional layer, and the Sigmoid activation function of the multi-scale fusion branch of the second dual-path multi-scale enhancement module DPMSFE of the decoder are input in sequence, and the feature map is output. The feature map With feature map Perform multiplication operation and output the feature map The feature map With feature map Perform the addition operation and output the feature map The feature map The input is sent to the upper convolution layer of the second dual-path multi-scale enhancement module DPMSFE of the decoder, and the output is the feature map f-6) The feature map With feature map Perform the addition operation and output the feature map f-7) The feature map Input to the second transposed convolutional layer of the decoder, and output the feature map The feature map It is sequentially input into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function of the second residual block of the decoder, and the feature map is output. The feature map It is sequentially input into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function of the second residual block of the decoder, and the feature map is output. The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the third ReLU activation function of the second residual block of the decoder, and output the feature map f-8) The feature map Input to the lower convolution layer of the third dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map Input to the channel aggregation branch of the third dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map With feature map Perform multiplication operation to obtain the feature map The feature map They are respectively input into the first convolutional layer, the second convolutional layer, and the third convolutional layer of the multi-scale fusion branch of the third dual-path multi-scale enhancement module DPMSFE of the decoder, and the feature map is output. Feature Map Feature Map The feature map Feature Map Feature Map Perform addition operation to obtain feature map The feature map The maximum pooling layer, the fourth convolution layer, and the Sigmoid activation function of the multi-scale fusion branch of the third dual-path multi-scale enhancement module DPMSFE of the decoder are input in sequence, and the feature map is output. The feature map With feature map Perform multiplication operation and output the feature map The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the upper convolution layer of the third dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map f-9) The feature map With feature map Perform the addition operation and output the feature map f-10) The feature map Input to the third transposed convolution layer of the decoder, and output the feature map The feature map It is sequentially input into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function of the third residual block of the decoder, and the feature map is output. The feature map It is sequentially input into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function of the third residual block of the decoder, and the feature map is output. The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the third ReLU activation function of the third residual block of the decoder, and output the feature map f-11) The feature map Input to the lower convolution layer of the fourth dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map Input to the channel aggregation branch of the fourth dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map With feature map Perform multiplication operation to obtain the feature map The feature map They are respectively input into the first convolutional layer, the second convolutional layer, and the third convolutional layer of the multi-scale fusion branch of the fourth dual-path multi-scale enhancement module DPMSFE of the decoder, and the feature map is output. Feature Map Feature Map The feature map Feature Map Feature Map Perform addition operation to obtain feature map The feature map The maximum pooling layer, the fourth convolutional layer, and the Sigmoid activation function of the multi-scale fusion branch of the fourth dual-path multi-scale enhancement module DPMSFE of the decoder are input in sequence, and the feature map is output. The feature map With feature map Perform multiplication operation and output the feature map The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the upper convolution layer of the fourth dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map f-12) The feature map With feature map Perform the addition operation and output the feature map f-13) The feature map Input to the fourth transposed convolution layer of the decoder, and output the feature map The feature map It is sequentially input into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function of the fourth residual block of the decoder, and the feature map is output. The feature map It is sequentially input into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function of the fourth residual block of the decoder, and the feature map is output. The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the third ReLU activation function of the fourth residual block of the decoder, and output the feature map f-14) The feature map Input into the convolutional layer of the decoder, and output the predicted segmentation image Preferably, in step f-2), the convolution kernel size of the lower convolution layer of the first dual-path multi-scale enhancement module DPMSFE is 1×1 and the step size is 1, the convolution kernel size of the first convolution layer of the channel aggregation branch of the first dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the second convolution layer of the channel aggregation branch of the first dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the first convolution layer of the multi-scale fusion branch of the first dual-path multi-scale enhancement module DPMSFE is 3×3, the step size is 1, and the padding is 1, the convolution kernel size of the second convolution layer of the multi-scale fusion branch of the first dual-path multi-scale enhancement module DPMSFE is 5×5, the step size is 1. , padding is 2, the convolution kernel size of the third convolution layer of the multiscale fusion branch of the first dual-path multi-scale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3, the convolution kernel size of the fourth convolution layer of the multiscale fusion branch of the first dual-path multi-scale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3, the convolution kernel size of the upper convolution layer of the first dual-path multi-scale enhancement module DPMSFE is 1×1, and the step size is 1; in step f-4), the convolution kernel size of the first transposed convolution layer of the decoder is 2×2, and the step size is 2, the convolution kernel size of the first convolution layer of the first residual block of the decoder is 3×3, and the convolution kernel size of the second convolution layer of the first residual block of the decoder is 3× 3; in step f-5), the convolution kernel size of the lower convolution layer of the second dual-path multi-scale enhancement module DPMSFE is 1×1 and the step size is 1, the convolution kernel size of the first convolution layer of the channel aggregation branch of the second dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the second convolution layer of the channel aggregation branch of the second dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the first convolution layer of the multiscale fusion branch of the second dual-path multi-scale enhancement module DPMSFE is 3×3, the step size is 1, and the padding is 1, the convolution kernel size of the second convolution layer of the multiscale fusion branch of the second dual-path multi-scale enhancement module DPMSFE is 5×5, the step size is 1, and the padding is The padding is 2, the convolution kernel size of the third convolution layer of the multiscale fusion branch of the second dual-path multi-scale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3, the convolution kernel size of the fourth convolution layer of the multiscale fusion branch of the second dual-path multi-scale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3, and the convolution kernel size of the upper convolution layer of the second dual-path multi-scale enhancement module DPMSFE is 1×1 and the step size is 1; in step f-7), the convolution kernel size of the second transposed convolution layer of the decoder is 2×2 and the step size is 2, the convolution kernel size of the first convolution layer of the second residual block of the decoder is 3×3, and the convolution kernel size of the second convolution layer of the second residual block of the decoder is 3×3;In step f-8), the convolution kernel size of the lower convolution layer of the third dual-path multi-scale enhancement module DPMSFE is 1×1 and the step size is 1, the convolution kernel size of the first convolution layer of the channel aggregation branch of the third dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the second convolution layer of the channel aggregation branch of the third dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the first convolution layer of the multiscale fusion branch of the third dual-path multi-scale enhancement module DPMSFE is 3×3, the step size is 1, and the padding is 1, the convolution kernel size of the second convolution layer of the multiscale fusion branch of the third dual-path multi-scale enhancement module DPMSFE is 5×5, the step size is 1, and the padding is 2. The convolution kernel size of the third convolution layer of the multiscale fusion branch of the third dual-path multi-scale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3. The convolution kernel size of the fourth convolution layer of the multiscale fusion branch of the third dual-path multi-scale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3. The convolution kernel size of the upper convolution layer of the third dual-path multi-scale enhancement module DPMSFE is 1×1 and the step size is 1; in step f-10), the convolution kernel size of the third transposed convolution layer of the decoder is 2×2 and the step size is 2, the convolution kernel size of the first convolution layer of the third residual block of the decoder is 3×3, and the convolution kernel size of the second convolution layer of the third residual block of the decoder is 3×3; In step f-11), the convolution kernel size of the lower convolution layer of the fourth dual-path multi-scale enhancement module DPMSFE is 1×1, and the step size is 1, the convolution kernel size of the first convolution layer of the channel aggregation branch of the fourth dual-path multi-scale enhancement module DPMSFE is 1×1, and the convolution kernel size of the second convolution layer of the channel aggregation branch of the fourth dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the first convolution layer of the multiscale fusion branch of the fourth dual-path multi-scale enhancement module DPMSFE is 3×3, the step size is 1, and the padding is 1, the convolution kernel size of the second convolution layer of the multiscale fusion branch of the fourth dual-path multi-scale enhancement module DPMSFE is 5×5, the step size is 1, and the padding is 2, the convolution kernel size of the third convolution layer of the multiscale fusion branch of the fourth dual-path multiscale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3, the convolution kernel size of the fourth convolution layer of the multiscale fusion branch of the fourth dual-path multiscale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3, and the convolution kernel size of the upper convolution layer of the fourth dual-path multiscale enhancement module DPMSFE is 1×1 and the step size is 1; in step f-13), the convolution kernel size of the fourth transposed convolution layer of the decoder is 2×2 and the step size is 2, the convolution kernel size of the first convolution layer of the fourth residual block of the decoder is 3×3, and the convolution kernel size of the second convolution layer of the fourth residual block of the decoder is 3×3. Further, by formula L; total =αL Dice +βL CECalculate the total loss function L total , where α and β are hyperparameters, L Dice is the Dice loss function, L CE is the cross entropy loss function.
[0028] Preferably, when training the segmentation network model, the learning rate is set to 0.01, the batch size is set to 8, the number of iterations is set to 1000, the hyperparameter α is set to 0.4, and the hyperparameter β is set to 0.4.
[0029] The beneficial effects of the present invention are as follows: the state-space attention module not only improves the recognition accuracy of the model for the boundaries of various structures in the cardiac image by integrating the SSM state-space model branch, the convolution branch and the attention branch, but also utilizes the unique advantage of SSM in handling long-distance dependencies while maintaining the computational complexity linearly related to the input size, which helps to segment the cardiac image more accurately and computationally efficiently. The dual-path multi-scale enhancement module can enhance the model's recognition ability for structures of different scales, improve the model's adaptability and robustness, and help process cardiac structures of various sizes through channel aggregation branches and multi-scale fusion branches. Therefore, our method can better adapt to the complexity and diversity of cardiac image segmentation, provide segmentation results with higher accuracy and efficiency, and significantly improve the accuracy of heart disease diagnosis and treatment planning. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 is a structural diagram of a segmentation network of the present invention;
[0031] Figure 2 It is a structural diagram of the state space attention module SSSCA of the present invention;
[0032] Figure 3 It is a structural diagram of the dual-path multi-scale enhancement module DPMSFE of the present invention. DETAILED DESCRIPTION
[0033] The following is combined with Figure 1 , Attachment Figure 2 , Attachment Figure 3 The present invention is further described.
[0034] A cardiac image segmentation method based on a state space model and dual-path multi-scale enhancement, comprising:
[0035] a) Collect N left atrium MRI image data to obtain a left atrium MRI image data set E, where E = {E1, E2, ..., E i ,...,E N}, E i is the i-th left atrium MRI image data, i∈{1,...,N}.
[0036] b) The i-th left atrium MRI image data E i Preprocessing is performed to obtain the preprocessed i-th left atrium MRI image data S i The preprocessed left atrium MRI image dataset is S, S = {S1, S2, ..., S i ,...,S N}.
[0037] c) Divide the preprocessed left atrial MRI image dataset S into a training set, a validation set, and a test set. Slice each preprocessed left atrial MRI image data in the training set along the Z axis to obtain a slice image set Ftrain consisting of X slice images, F train ={F1,F2,...,F i ,...,F X}, F i For the i-th slice image, i∈{1,...,X}, slice each preprocessed left atrial MRI image data in the test set along the Z axis to obtain a slice image set Ftest consisting of Y slice images, F test ={F1,F2,…,F j ,…,F Y}, F j is the j-th slice image, i∈{1,…,Y}.
[0038] d) Establish a segmentation network model consisting of an encoder and a decoder.
[0039] e) Take the i-th slice image F in the training set i Input into the encoder of the segmentation network model and output the feature map
[0040] f) The feature map Input into the decoder of the segmentation network model and output the predicted segmentation image
[0041] g) Using the SGD optimizer, using the total loss function L total Train the segmentation network model to obtain an optimized segmentation network model.
[0042] h) Take the jth slice image F in the test set j Input into the optimized segmentation network model and output the predicted segmentation image In one embodiment of the present invention, in step a), N left atrial MRI image data are collected from the 2018 Atrial Segmentation Challenge dataset.
[0043] In one embodiment of the present invention, step b) comprises the following steps:
[0044] b-1) The i-th left atrium MRI image data E i Slice along the Z axis and resample the slices to a pixel pitch of 1.5 in the X axis direction and a pixel pitch of 1.5 in the Y axis direction.
[0045] b-2) Use the CenterCrop function in pytorch to perform a center cropping operation on the slices after the resampling operation. The size of the cropped slices is 112×112.
[0046] b-3) Use the torch.stack() function to stack the slices after center cropping to restore the left atrium MRI image data E i ′.
[0047] b-4) Use the random_flip_rotate() function to rotate the left atrium MRI image data E i 'Flip along the horizontal or vertical axis with a probability of 0.5, and the flip angle is 90 degrees to obtain the rotated left atrium MRI image data E i ″.
[0048] b-5) The rotated left atrium MRI image data E i ″Perform Z-Score standardization to obtain the pre-processed i-th left atrium MRI image data S i .
[0049] In one embodiment of the present invention, in step c), the preprocessed left atrial MRI image dataset S is divided into a training set, a validation set, and a test set in a ratio of 6:1:3.
[0050] In one embodiment of the present invention, step e) comprises the following steps:
[0051] e-1) The encoder of the segmentation network model is composed of a convolutional layer, a first state space attention module SSSCA, a first maximum pooling layer, a second state space attention module SSSCA, a second maximum pooling layer, a third state space attention module SSSCA, a third maximum pooling layer, a fourth state space attention module SSSCA, and a fourth maximum pooling layer. The first state space attention module SSSCA, the second state space attention module SSSCA, the third state space attention module SSSCA, and the fourth state space attention module SSSCA are all composed of SSM branches, convolution branches, and attention branches. ; The SSM branch consists of the first LayerNorm layer (LN), the first Linear layer, the first SiLu activation function, the second Linear layer, the depth-wise separable convolution layer (DwConv), the second SiLu activation function, the state-space model SSM, and the second LayerNorm layer; the convolution branches are composed of the BatchNorm layer (BN), the first convolution layer, the first ReLu activation function, the second convolution layer, the second ReLu activation function, and the point-by-point convolution layer (PwConv); the attention branch is composed of the channel attention mechanism CAM and the spatial attention mechanism SAM.
[0052] e-2) Take the i-th slice image F in the training set i Input into the convolutional layer of the encoder and output the feature map
[0053] e-3) Use the torch.chunk() function in pytorch to map the feature map Perform Split operation and output the feature map and feature map The feature map Input to the first LayerNorm layer of the SSM branch of the first state space attention module SSSCA, and output the feature map F l 1-1 , the feature map F l 1-1 It is sequentially input into the first Linear layer and the first SiLu activation function of the SSM branch of the first state space attention module SSSCA, and the feature map F is output. l 1 -2 , the feature map F l 1-1 It is sequentially input into the second Linear layer, the depth-separable convolution layer, and the second SiLu activation function of the SSM branch of the first state-space attention module SSSCA, and the feature map F is output. l 1-3 , F l 1-3It is sequentially input into the state space model SSM of the SSM branch of the first state space attention module SSSCA and the second LayerNorm layer, and the feature map F is output. l 1-4 , the feature map F l 1-2 With the feature map F l 1-4 Perform multiplication operation to obtain feature map F l 1 ; The feature map Input to the BatchNorm layer of the convolution branch of the first state space attention module SSSCA, and output the feature map The feature map The first convolutional layer, the first ReLu activation function, the second convolutional layer, and the second ReLu activation function of the convolutional branch of the first state space attention module SSSCA are input in sequence to output the feature map. The feature map Input into the point-by-point convolution layer of the convolution branch of the first state space attention module SSSCA, and output the feature map The feature map F l 1 With feature map The Concat operation is performed through the torch.cat() function in pytorch to obtain the feature map The feature map Input into the channel attention mechanism CAM of the attention branch of the first state space attention module SSSCA, and output the feature map The feature map Input into the spatial attention mechanism SAM of the attention branch of the first state space attention module SSSCA, and output the feature map The feature map With feature map Perform addition operation to obtain feature map e-4) The feature map Input to the first maximum pooling layer of the encoder, and output the feature map e-5) Use the torch.chunk() function in pytorch to map the feature map Perform Split operation and output the feature map and feature map The feature map Input to the first LayerNorm layer of the SSM branch of the second state space attention module SSSCA, and output the feature map F l 2-1 , the feature map F l2-1 It is sequentially input into the first Linear layer and the first SiLu activation function of the SSM branch of the second state space attention module SSSCA, and the feature map F is output. l 2 -2 , the feature map F l 2-1 It is sequentially input into the second Linear layer, the depth-separable convolution layer, and the second SiLu activation function of the SSM branch of the second state-space attention module SSSCA, and the feature map F is output. l 2-3 , F l 2-3 It is input into the state space model SSM of the SSM branch of the second state space attention module SSSCA and the second LayerNorm layer in sequence, and the feature map F is output. l 2-4 , the feature map F l 2-2 With the feature map F l 2-4 Perform multiplication operation to obtain feature map F l 2 ; The feature map Input to the BatchNorm layer of the convolution branch of the second state space attention module SSSCA, and output the feature map The feature map The first convolutional layer, the first ReLu activation function, the second convolutional layer, and the second ReLu activation function of the convolutional branch of the second state space attention module SSSCA are input in sequence to output the feature map. The feature map Input into the point-by-point convolution layer of the convolution branch of the second state space attention module SSSCA, and output the feature map The feature map F l 2 With feature map The Concat operation is performed through the torch.cat() function in pytorch to obtain the feature map The feature map Input into the channel attention mechanism CAM of the attention branch of the second state space attention module SSSCA, and output the feature map The feature map Input into the spatial attention mechanism SAM of the attention branch of the second state space attention module SSSCA, and output the feature map The feature map With feature map Perform addition operation to obtain feature map e-6) The feature map Input to the second maximum pooling layer of the encoder, and output the feature map e-7) Use the torch.chunk() function in pytorch to map the feature map Perform Split operation and output the feature map and feature map The feature map Input to the first LayerNorm layer of the SSM branch of the third state space attention module SSSCA, and output the feature map F l 3-1 , the feature map F l 3-1 It is sequentially input into the first Linear layer and the first SiLu activation function of the SSM branch of the third state space attention module SSSCA, and the feature map F is output. l 3-2 , the feature map F l 3-1 It is sequentially input into the second Linear layer, the depth-separable convolution layer, and the second SiLu activation function of the SSM branch of the third state-space attention module SSSCA, and the feature map F is output. l 3-3 , F l 3-3 It is sequentially input into the state space model SSM of the SSM branch of the third state space attention module SSSCA and the second LayerNorm layer, and the feature map F is output. l 3-4 , the feature map F l 3-2 With the feature map F l 3-4 Perform multiplication operation to obtain feature map F l 3 ; The feature map Input to the BatchNorm layer of the convolution branch of the third state space attention module SSSCA, and output the feature map The feature map The first convolution layer, the first ReLu activation function, the second convolution layer, and the second ReLu activation function of the convolution branch of the third state space attention module SSSCA are input in sequence to output the feature map. The feature map Input into the point-by-point convolution layer of the convolution branch of the third state space attention module SSSCA, and output the feature map The feature map F l 3 With feature map The Concat operation is performed through the torch.cat() function in pytorch to obtain the feature map The feature map Input into the channel attention mechanism CAM of the attention branch of the third state space attention module SSSCA, and output the feature map The feature map Input into the spatial attention mechanism SAM of the attention branch of the third state space attention module SSSCA, and output the feature map The feature map With feature map Perform addition operation to obtain feature map e-8) The feature map Input to the third maximum pooling layer of the encoder, and output the feature map e-9) Use the torch.chunk() function in pytorch to map the feature map Perform Split operation and output the feature map and feature map The feature map Input to the first LayerNorm layer of the SSM branch of the fourth state space attention module SSSCA, and output the feature map F l 4-1 , the feature map F l 4-1 It is sequentially input into the first Linear layer and the first SiLu activation function of the SSM branch of the fourth state space attention module SSSCA, and the feature map F is output. l 4-2 , the feature map F l 4-1 It is sequentially input into the second Linear layer, the depth-separable convolution layer, and the second SiLu activation function of the SSM branch of the fourth state-space attention module SSSCA, and the feature map F is output. l 4-3 , F l 4-3 It is sequentially input into the state space model SSM of the SSM branch of the fourth state space attention module SSSCA and the second LayerNorm layer, and the feature map F is output. l 4-4 , the feature map F l 4-2 With the feature map F l 4-4 Perform multiplication operation to obtain feature map F l 4 ; The feature map Input to the BatchNorm layer of the convolution branch of the fourth state space attention module SSSCA, and output the feature map The feature map The first convolution layer, the first ReLu activation function, the second convolution layer, and the second ReLu activation function of the convolution branch of the fourth state space attention module SSSCA are input in sequence to output the feature map The feature map Input into the point-by-point convolution layer of the convolution branch of the fourth state space attention module SSSCA, and output the feature map The feature map F l 4 With feature map The Concat operation is performed through the torch.cat() function in pytorch to obtain the feature map The feature map Input to the channel attention mechanism CAM of the attention branch of the fourth state space attention module SSSCA, and output the feature map The feature map Input into the spatial attention mechanism SAM of the attention branch of the fourth state space attention module SSSCA, and output the feature map The feature map With feature map Perform addition operation to obtain feature map e-10) The feature map Input to the fourth maximum pooling layer of the encoder, and output the feature map In this embodiment, the convolution kernel size of the convolution layer of the encoder in step e-2) is 3×3; in step e-3), the convolution kernel size of the depthwise separable convolution layer of the SSM branch of the first state space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, the convolution kernel size of the first convolution layer of the convolution branch of the first state space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, the convolution kernel size of the second convolution layer of the convolution branch of the first state space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, and the convolution kernel size of the point-by-point convolution layer of the convolution branch of the first state space attention module SSSCA is 3×3 and the step size is 1; step e- 4) The pooling kernel of the first maximum pooling layer is 2×2 and the step size is 2; in step e-5), the convolution kernel size of the depthwise separable convolution layer of the SSM branch of the second state-space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, the convolution kernel size of the first convolution layer of the convolution branch of the second state-space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, the convolution kernel size of the second convolution layer of the convolution branch of the second state-space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, and the convolution kernel size of the point-by-point convolution layer of the convolution branch of the second state-space attention module SSSCA is 3×3 and the step size is 1; in step e-6), the second maximum pool The pooling kernel of the convolution layer is 2×2 and the stride is 2; in step e-7), the convolution kernel size of the depthwise separable convolution layer of the SSM branch of the third state-space attention module SSSCA is 3×3, the padding is 1, and the stride is 1, the convolution kernel size of the first convolution layer of the convolution branch of the third state-space attention module SSSCA is 3×3, the padding is 1, and the stride is 1, the convolution kernel size of the second convolution layer of the convolution branch of the third state-space attention module SSSCA is 3×3, the padding is 1, and the stride is 1, the convolution kernel size of the point-by-point convolution layer of the convolution branch of the third state-space attention module SSSCA is 3×3, and the stride is 1; in step e-8), the pooling kernel of the third maximum pooling layer is 2 ×2, with a step size of 2; in step e-9), the convolution kernel size of the depthwise separable convolution layer of the SSM branch of the fourth state-space attention module SSSCA is 3×3, with a padding of 1 and a step size of 1; the convolution kernel size of the first convolution layer of the convolution branch of the fourth state-space attention module SSSCA is 3×3, with a padding of 1 and a step size of 1; the convolution kernel size of the second convolution layer of the convolution branch of the fourth state-space attention module SSSCA is 3×3, with a padding of 1 and a step size of 1; the convolution kernel size of the point-by-point convolution layer of the convolution branch of the fourth state-space attention module SSSCA is 3×3, with a step size of 1; in step e-10), the pooling kernel of the fourth maximum pooling layer is 2×2, with a step size of 2.
[0054] In one embodiment of the present invention, step f) comprises the following steps:
[0055] f-1) The decoder of the segmentation network model is composed of a first dual-path multi-scale enhancement module DPMSFE, a first transposed convolutional layer, a first residual block, a second dual-path multi-scale enhancement module DPMSFE, a second transposed convolutional layer, a second residual block, a third path multi-scale enhancement module DPMSFE, a third transposed convolutional layer, a third residual block, a fourth dual-path multi-scale enhancement module DPMSFE, a fourth transposed convolutional layer, a fourth residual block, and a convolutional layer; the first dual-path multi-scale enhancement module DPMSFE, the second dual-path multi-scale enhancement module DPMSFE, the third dual-path multi-scale enhancement module DPMSFE, and the fourth dual-path multi-scale enhancement module DPMSFE are all composed of the lower convolutional layer. The channel aggregation branch is composed of the average pooling layer, the first convolution layer, the ReLU activation function, and the second convolution layer. The multi-scale fusion branch is composed of the first convolution layer, the second convolution layer, the third convolution layer, the maximum pooling layer, the fourth convolution layer, and the Sigmoid activation function. The first residual block, the second residual block, the third residual block, and the fourth residual block are all composed of the first convolution layer, the first BatchNorm layer, the first ReLU activation function, the second convolution layer, the second BatchNorm layer, the second ReLU activation function, and the third ReLU activation function. f-2) The feature map is converted into Input to the lower convolution layer of the first dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map Input to the channel aggregation branch of the first dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map With feature map Perform multiplication operation to obtain the feature map The feature map The first convolutional layer, the second convolutional layer, and the third convolutional layer of the multi-scale fusion branch of the first dual-path multi-scale enhancement module DPMSFE of the decoder are input respectively, and the feature map is output. Feature Map Feature Map The feature map Feature Map Feature Map Perform addition operation to obtain feature map The feature map The maximum pooling layer, the fourth convolutional layer, and the Sigmoid activation function of the multi-scale fusion branch of the first dual-path multi-scale enhancement module DPMSFE of the decoder are input in sequence, and the feature map is output. The feature map With feature map Perform multiplication operation and output the feature map The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the upper convolution layer of the first dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map f-3) The feature map With feature map Perform the addition operation and output the feature map f-4) The feature map Input to the first transposed convolutional layer of the decoder, and output the feature map The feature map It is sequentially input into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function of the first residual block of the decoder, and the feature map is output. The feature map It is sequentially input into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function of the first residual block of the decoder, and the feature map is output. The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the third ReLU activation function of the first residual block of the decoder, and output the feature map f-5) The feature map The input is sent to the lower convolution layer of the second dual-path multi-scale enhancement module DPMSFE of the decoder, and the output is the feature map The feature map Input to the channel aggregation branch of the second dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map With feature map Perform multiplication operation to obtain the feature map The feature map The first convolutional layer, the second convolutional layer, and the third convolutional layer of the multi-scale fusion branch of the second dual-path multi-scale enhancement module DPMSFE of the decoder are input respectively, and the feature map is output. Feature Map Feature Map The feature map Feature Map Feature Map Perform addition operation to obtain feature map The feature map The maximum pooling layer, the fourth convolutional layer, and the Sigmoid activation function of the multi-scale fusion branch of the second dual-path multi-scale enhancement module DPMSFE of the decoder are input in sequence, and the feature map is output. The feature map With feature map Perform multiplication operation and output the feature map The feature map With feature map Perform the addition operation and output the feature map The feature map The input is sent to the upper convolution layer of the second dual-path multi-scale enhancement module DPMSFE of the decoder, and the output is the feature map f-6) The feature map With feature map Perform the addition operation and output the feature map f-7) The feature map Input to the second transposed convolutional layer of the decoder, and output the feature map The feature map It is sequentially input into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function of the second residual block of the decoder, and the feature map is output. The feature map It is sequentially input into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function of the second residual block of the decoder, and the feature map is output. The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the third ReLU activation function of the second residual block of the decoder, and output the feature map f-8) The feature map Input to the lower convolution layer of the third dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map Input to the channel aggregation branch of the third dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map With feature map Perform multiplication operation to obtain the feature map The feature map They are respectively input into the first convolutional layer, the second convolutional layer, and the third convolutional layer of the multi-scale fusion branch of the third dual-path multi-scale enhancement module DPMSFE of the decoder, and the feature map is output. Feature Map Feature Map The feature map Feature Map Feature Map Perform addition operation to obtain feature map The feature map The maximum pooling layer, the fourth convolutional layer, and the Sigmoid activation function of the multi-scale fusion branch of the third dual-path multi-scale enhancement module DPMSFE of the decoder are input in sequence, and the feature map is output. The feature map With feature map Perform multiplication operation and output the feature map The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the upper convolution layer of the third dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map f-9) The feature map With feature map Perform the addition operation and output the feature map f-10) The feature map Input to the third transposed convolution layer of the decoder, and output the feature map The feature map It is sequentially input into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function of the third residual block of the decoder, and the feature map is output. The feature map It is sequentially input into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function of the third residual block of the decoder, and the feature map is output. The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the third ReLU activation function of the third residual block of the decoder, and output the feature map f-11) The feature map Input to the lower convolution layer of the fourth dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map Input to the channel aggregation branch of the fourth dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map With feature map Perform multiplication operation to obtain the feature map The feature map They are respectively input into the first convolutional layer, the second convolutional layer, and the third convolutional layer of the multi-scale fusion branch of the fourth dual-path multi-scale enhancement module DPMSFE of the decoder, and the feature map is output. Feature Map Feature Map The feature map Feature Map Feature Map Perform addition operation to obtain feature map The feature map The maximum pooling layer, the fourth convolutional layer, and the Sigmoid activation function of the multi-scale fusion branch of the fourth dual-path multi-scale enhancement module DPMSFE of the decoder are input in sequence, and the feature map is output. The feature map With feature map Perform multiplication operation and output the feature map The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the upper convolution layer of the fourth dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map f-12) The feature map With feature map Perform the addition operation and output the feature map f-13) The feature map Input to the fourth transposed convolution layer of the decoder, and output the feature map The feature map It is sequentially input into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function of the fourth residual block of the decoder, and the feature map is output. The feature map It is sequentially input into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function of the fourth residual block of the decoder, and the feature map is output. The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the third ReLU activation function of the fourth residual block of the decoder, and output the feature map f-14) The feature map Input into the convolutional layer of the decoder, and output the predicted segmentation image In this embodiment, in step f-2), the convolution kernel size of the lower convolution layer of the first dual-path multi-scale enhancement module DPMSFE is 1×1 and the step size is 1, the convolution kernel size of the first convolution layer of the channel aggregation branch of the first dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the second convolution layer of the channel aggregation branch of the first dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the first convolution layer of the multi-scale fusion branch of the first dual-path multi-scale enhancement module DPMSFE is 3×3, the step size is 1, and the padding is 1, the convolution kernel size of the second convolution layer of the multi-scale fusion branch of the first dual-path multi-scale enhancement module DPMSFE is 5×5, the step size is 5×5, and the padding is 5×5. The convolution kernel size of the third convolution layer of the multiscale fusion branch of the first dual-path multi-scale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3. The convolution kernel size of the fourth convolution layer of the multiscale fusion branch of the first dual-path multi-scale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3. The convolution kernel size of the upper convolution layer of the first dual-path multi-scale enhancement module DPMSFE is 1×1, and the step size is 1. In step f-4), the convolution kernel size of the first transposed convolution layer of the decoder is 2×2, and the step size is 2. The convolution kernel size of the first convolution layer of the first residual block of the decoder is 3×3, and the convolution kernel size of the second convolution layer of the first residual block of the decoder is 3×3; in step f-5), the convolution kernel size of the lower convolution layer of the second dual-path multi-scale enhancement module DPMSFE is 1×1, and the step size is 1, the convolution kernel size of the first convolution layer of the channel aggregation branch of the second dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the second convolution layer of the channel aggregation branch of the second dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the first convolution layer of the multiscale fusion branch of the second dual-path multi-scale enhancement module DPMSFE is 3×3, the step size is 1, and the padding is 1, the convolution kernel size of the second convolution layer of the multiscale fusion branch of the second dual-path multi-scale enhancement module DPMSFE is 5×5, the step size is 1, The padding is 2, the convolution kernel size of the third convolution layer of the multiscale fusion branch of the second dual-path multi-scale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3, the convolution kernel size of the fourth convolution layer of the multiscale fusion branch of the second dual-path multi-scale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3, and the convolution kernel size of the upper convolution layer of the second dual-path multi-scale enhancement module DPMSFE is 1×1 and the step size is 1; in step f-7), the convolution kernel size of the second transposed convolution layer of the decoder is 2×2 and the step size is 2, the convolution kernel size of the first convolution layer of the second residual block of the decoder is 3×3, and the convolution kernel size of the second convolution layer of the second residual block of the decoder is 3×3;In step f-8), the convolution kernel size of the lower convolution layer of the third dual-path multi-scale enhancement module DPMSFE is 1×1 and the step size is 1, the convolution kernel size of the first convolution layer of the channel aggregation branch of the third dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the second convolution layer of the channel aggregation branch of the third dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the first convolution layer of the multiscale fusion branch of the third dual-path multi-scale enhancement module DPMSFE is 3×3, the step size is 1, and the padding is 1, the convolution kernel size of the second convolution layer of the multiscale fusion branch of the third dual-path multi-scale enhancement module DPMSFE is 5×5, the step size is 1, and the padding is 2. The convolution kernel size of the third convolution layer of the multiscale fusion branch of the third dual-path multi-scale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3. The convolution kernel size of the fourth convolution layer of the multiscale fusion branch of the third dual-path multi-scale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3. The convolution kernel size of the upper convolution layer of the third dual-path multi-scale enhancement module DPMSFE is 1×1 and the step size is 1; in step f-10), the convolution kernel size of the third transposed convolution layer of the decoder is 2×2 and the step size is 2, the convolution kernel size of the first convolution layer of the third residual block of the decoder is 3×3, and the convolution kernel size of the second convolution layer of the third residual block of the decoder is 3×3; In step f-11), the convolution kernel size of the lower convolution layer of the fourth dual-path multi-scale enhancement module DPMSFE is 1×1, and the step size is 1, the convolution kernel size of the first convolution layer of the channel aggregation branch of the fourth dual-path multi-scale enhancement module DPMSFE is 1×1, and the convolution kernel size of the second convolution layer of the channel aggregation branch of the fourth dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the first convolution layer of the multiscale fusion branch of the fourth dual-path multi-scale enhancement module DPMSFE is 3×3, the step size is 1, and the padding is 1, the convolution kernel size of the second convolution layer of the multiscale fusion branch of the fourth dual-path multi-scale enhancement module DPMSFE is 5×5, the step size is 1, and the padding is 2, the convolution kernel size of the third convolution layer of the multiscale fusion branch of the fourth dual-path multiscale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3, the convolution kernel size of the fourth convolution layer of the multiscale fusion branch of the fourth dual-path multiscale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3, and the convolution kernel size of the upper convolution layer of the fourth dual-path multiscale enhancement module DPMSFE is 1×1 and the step size is 1; in step f-13), the convolution kernel size of the fourth transposed convolution layer of the decoder is 2×2 and the step size is 2, the convolution kernel size of the first convolution layer of the fourth residual block of the decoder is 3×3, and the convolution kernel size of the second convolution layer of the fourth residual block of the decoder is 3×3. ;
[0056] In one embodiment of the present invention, the formula L total =αLDice +βL CE Calculate the total loss function L total , where α and β are hyperparameters, L Dice is the Dice loss function, L CE is the cross entropy loss function.
[0057] In this embodiment, when training the segmentation network model, the learning rate is set to 0.01, the batch size is set to 8, the number of iterations is set to 1000, the hyperparameter α is set to 0.4, and the hyperparameter β is set to 0.4.
[0058] In order to verify the reliability of this patented method, the final predicted segmentation results A systematic evaluation is conducted and compared with existing deep learning segmentation methods, as shown in Table 1:
[0059]
[0060] In the experimental method, two classic medical image segmentation methods, MT and DAN, and four methods with better performance in existing medical image segmentation methods, namely UA-MT, CCT, SASSNet, and DTC, were compared. Our evaluation index adopts the four most commonly used evaluation indicators, namely Dice, Jaccard, ASD, and 95HD. The higher the scores of Dice and Jaccard, the better the performance, and the lower the scores of ASD and 95HD, the better the performance. From the data in the table, it can be seen that the Dice evaluation index of the method of the present invention is improved by 0.77% compared with the previous optimal method, and the Jaccard evaluation index is improved by 0.46% compared with the previous optimal method. The ASD evaluation index and the 95HD evaluation index are 1.75 and 6.63 respectively, which are better than the previous methods. In short, such performance improvement shows that the method of the present invention can better handle long-distance dependencies in cardiac images, thereby obtaining better segmentation effects.
[0061] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A cardiac image segmentation method based on state space model and dual-path multi-scale enhancement, characterized in that: include: a) Collect N left atrium MRI image data to obtain a left atrium MRI image data set E, where E = {E1, E2, ..., E i ,...,E N }, E i is the i-th left atrium MRI image data, i∈{1,...,N}; b) The i-th left atrium MRI image data E i Preprocessing is performed to obtain the preprocessed i-th left atrium MRI image data S i The preprocessed left atrium MRI image dataset is S, S = {S1, S2, ..., S i ,...,S N }; c) Divide the preprocessed left atrial MRI image dataset S into a training set, a validation set, and a test set. Slice each preprocessed left atrial MRI image data in the training set along the Z axis to obtain a slice image set Ftrain consisting of X slice images, F train ={F1,F2,...,F i ,...,F X }, F i For the i-th slice image, i∈{1,...,X}, slice each preprocessed left atrial MRI image data in the test set along the Z axis to obtain a slice image set Ftest consisting of Y slice images, F test ={F1,F2,...,F j ,...,F Y }, F j is the jth slice image, i∈{1,...,Y}; d) Establishing a segmentation network model consisting of an encoder and a decoder; e) Take the i-th slice image F in the training set i Input into the encoder of the segmentation network model and output the feature map f) The feature map Input into the decoder of the segmentation network model and output the predicted segmentation image g) Using the SGD optimizer, using the total loss function L total Train the segmentation network model to obtain an optimized segmentation network model; h) Take the jth slice image F in the test set j Input into the optimized segmentation network model and output the predicted segmentation image 2. The cardiac image segmentation method based on state space model and dual-path multi-scale enhancement according to claim 1, characterized in that: In step a), N left atrial MRI image data are collected from the 2018 Atrial Segmentation Challenge dataset.
3. The cardiac image segmentation method based on state space model and dual-path multi-scale enhancement according to claim 1, characterized in that: Step b) comprises the following steps: b-1) The i-th left atrium MRI image data E i Slice along the Z axis, and resample the slices to a pixel pitch of 1.5 in the X axis direction and a pixel pitch of 1.5 in the Y axis direction; b-2) Use the CenterCrop function in pytorch to perform a center cropping operation on the slice after the resampling operation. The size of the cropped slice is 112×112; b-3) Use the torch.stack() function to stack the slices after center cropping to restore the left atrium MRI image data E i ′; b-4) Use the random_flip_rotate() function to rotate the left atrium MRI image data E i 'Flip along the horizontal or vertical axis with a probability of 0.5, and the flip angle is 90 degrees to obtain the rotated left atrium MRI image data E i ″; b-5) The rotated left atrium MRI image data E i ″Perform Z-Score standardization to obtain the pre-processed i-th left atrium MRI image data S i .
4. The cardiac image segmentation method based on state space model and dual-path multi-scale enhancement according to claim 1, characterized in that: In step c), the preprocessed left atrial MRI image dataset S is divided into a training set, a validation set, and a test set in a ratio of 6:1:
3.
5. The cardiac image segmentation method based on state space model and dual-path multi-scale enhancement according to claim 1, characterized in that: Step e) comprises the following steps: e-1) The encoder of the segmentation network model consists of a convolutional layer, a first state space attention module SSSCA, a first maximum pooling layer, a second state space attention module SSSCA, a second maximum pooling layer, a third state space attention module SSSCA, a third maximum pooling layer, a fourth state space attention module SSSCA, and a fourth maximum pooling layer. The first state space attention module SSSCA, the second state space attention module SSSCA, the third state space attention module SSSCA, and the fourth state space attention module SSSCA are all composed of SSM branches, convolution branches, and attention branches; the SSM branch is composed of the first LayerNorm layer, the first Linear layer, the first SiLu activation function, the second Linear layer, the depth-separable convolution layer, the second SiLu activation function, the state space model SSM, and the second LayerNorm layer; the convolution branches are all composed of a BatchNorm layer, a first convolution layer, a first ReLu activation function, a second convolution layer, a second ReLu activation function, and a point-by-point convolution layer; the attention branch is composed of a channel attention mechanism CAM and a spatial attention mechanism SAM; e-2) The i-th slice image F in the training set is trained on the i Input into the convolutional layer of the encoder and output the feature map e-3) Use the torch.chunk() function in pytorch to map the feature map Perform Split operation and output the feature map and feature map The feature map Input to the first LayerNorm layer of the SSM branch of the first state space attention module SSSCA, and output the feature map The feature map It is sequentially input into the first Linear layer and the first SiLu activation function of the SSM branch of the first state space attention module SSSCA, and the feature map is output. The feature map It is sequentially input into the second Linear layer, the depth-separable convolution layer, and the second SiLu activation function of the SSM branch of the first state-space attention module SSSCA, and the feature map is output. Will It is input into the state space model SSM of the SSM branch of the first state space attention module SSSCA and the second LayerNorm layer in sequence, and the feature map is output. The feature map With feature map Perform multiplication operation to obtain the feature map The feature map Input to the BatchNorm layer of the convolution branch of the first state space attention module SSSCA, and output the feature map The feature map It is sequentially input into the first convolutional layer, the first ReLu activation function, the second convolutional layer, and the second ReLu activation function of the convolutional branch of the first state space attention module SSSCA, and the feature map is output. The feature map Input into the point-by-point convolution layer of the convolution branch of the first state space attention module SSSCA, and output the feature map The feature map With feature map The Concat operation is performed through the torch.cat() function in pytorch to obtain the feature map The feature map Input into the channel attention mechanism CAM of the attention branch of the first state space attention module SSSCA, and output the feature map The feature map Input into the spatial attention mechanism SAM of the attention branch of the first state space attention module SSSCA, and output the feature map The feature map With feature map Perform addition operation to obtain feature map e-4) The feature map Input to the first maximum pooling layer of the encoder, and output the feature map e-5) Use the torch.chunk() function in pytorch to map the feature map Perform Split operation and output the feature map and feature map The feature map Input to the first LayerNorm layer of the SSM branch of the second state space attention module SSSCA, and output the feature map The feature map It is sequentially input into the first Linear layer and the first SiLu activation function of the SSM branch of the second state space attention module SSSCA, and the feature map is output. The feature map It is sequentially input into the second Linear layer, the depth-separable convolution layer, and the second SiLu activation function of the SSM branch of the second state-space attention module SSSCA, and the feature map is output. Will It is input into the state space model SSM of the SSM branch of the second state space attention module SSSCA and the second LayerNorm layer in sequence, and the feature map is output. The feature map With feature map Perform multiplication operation to obtain the feature map The feature map Input to the BatchNorm layer of the convolution branch of the second state space attention module SSSCA, and output the feature map The feature map The first convolutional layer, the first ReLu activation function, the second convolutional layer, and the second ReLu activation function of the convolutional branch of the second state space attention module SSSCA are input in sequence to output the feature map. The feature map Input into the point-by-point convolution layer of the convolution branch of the second state space attention module SSSCA, and output the feature map The feature map With feature map The Concat operation is performed through the torch.cat() function in pytorch to obtain the feature map The feature map Input into the channel attention mechanism CAM of the attention branch of the second state space attention module SSSCA, and output the feature map The feature map Input into the spatial attention mechanism SAM of the attention branch of the second state space attention module SSSCA, and output the feature map The feature map With feature map Perform addition operation to obtain feature map e-6) The feature map Input to the second maximum pooling layer of the encoder, and output the feature map e-7) Use the torch.chunk() function in pytorch to map the feature map Perform Split operation and output the feature map and feature map The feature map Input to the first LayerNorm layer of the SSM branch of the third state space attention module SSSCA, and output the feature map The feature map It is sequentially input into the first Linear layer and the first SiLu activation function of the SSM branch of the third state space attention module SSSCA, and the feature map is output. The feature map It is sequentially input into the second Linear layer, the depth-separable convolution layer, and the second SiLu activation function of the SSM branch of the third state-space attention module SSSCA, and the feature map is output. Will It is input into the state space model SSM of the SSM branch of the third state space attention module SSSCA and the second LayerNorm layer in sequence, and the feature map is output. The feature map With feature map Perform multiplication operation to obtain the feature map The feature map Input to the BatchNorm layer of the convolution branch of the third state space attention module SSSCA, and output the feature map The feature map The first convolution layer, the first ReLu activation function, the second convolution layer, and the second ReLu activation function of the convolution branch of the third state space attention module SSSCA are input in sequence to output the feature map. The feature map Input into the point-by-point convolution layer of the convolution branch of the third state space attention module SSSCA, and output the feature map The feature map With feature map The Concat operation is performed through the torch.cat() function in pytorch to obtain the feature map The feature map Input into the channel attention mechanism CAM of the attention branch of the third state space attention module SSSCA, and output the feature map The feature map Input into the spatial attention mechanism SAM of the attention branch of the third state space attention module SSSCA, and output the feature map The feature map With feature map Perform addition operation to obtain feature map e-8) The feature map Input to the third maximum pooling layer of the encoder, and output the feature map e-9) Use the torch.chunk() function in pytorch to map the feature map Perform Split operation and output the feature map and feature map The feature map Input to the first LayerNorm layer of the SSM branch of the fourth state space attention module SSSCA, and output the feature map The feature map It is sequentially input into the first Linear layer and the first SiLu activation function of the SSM branch of the fourth state space attention module SSSCA, and the feature map is output. The feature map It is sequentially input into the second Linear layer, the depth-separable convolution layer, and the second SiLu activation function of the SSM branch of the fourth state-space attention module SSSCA, and the feature map is output. Will It is input into the state space model SSM of the SSM branch of the fourth state space attention module SSSCA and the second LayerNorm layer in sequence, and the feature map is output. The feature map With feature map Perform multiplication operation to obtain the feature map The feature map Input to the BatchNorm layer of the convolution branch of the fourth state space attention module SSSCA, and output the feature map The feature map The first convolution layer, the first ReLu activation function, the second convolution layer, and the second ReLu activation function of the convolution branch of the fourth state space attention module SSSCA are input in sequence to output the feature map The feature map Input into the point-by-point convolution layer of the convolution branch of the fourth state space attention module SSSCA, and output the feature map The feature map With feature map The Concat operation is performed through the torch.cat() function in pytorch to obtain the feature map The feature map Input to the channel attention mechanism CAM of the attention branch of the fourth state space attention module SSSCA, and output the feature map The feature map Input into the spatial attention mechanism SAM of the attention branch of the fourth state space attention module SSSCA, and output the feature map The feature map With feature map Perform addition operation to obtain feature map e-10) The feature map Input to the fourth maximum pooling layer of the encoder, and output the feature map 6. The cardiac image segmentation method based on state space model and dual-path multi-scale enhancement according to claim 5, characterized in that: In step e-2), the convolution kernel size of the convolution layer of the encoder is 3×3; in step e-3), the convolution kernel size of the depthwise separable convolution layer of the SSM branch of the first state-space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, the convolution kernel size of the first convolution layer of the convolution branch of the first state-space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, the convolution kernel size of the second convolution layer of the convolution branch of the first state-space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, and the convolution kernel size of the point-by-point convolution layer of the convolution branch of the first state-space attention module SSSCA is 3×3 and the step size is 1; in step e-4), the first The pooling kernel of the maximum pooling layer is 2×2 and the step size is 2; the convolution kernel size of the depthwise separable convolution layer of the SSM branch of the second state-space attention module SSSCA in step e-5) is 3×3, the padding is 1, and the step size is 1, the convolution kernel size of the first convolution layer of the convolution branch of the second state-space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, the convolution kernel size of the second convolution layer of the convolution branch of the second state-space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, the convolution kernel size of the point-by-point convolution layer of the convolution branch of the second state-space attention module SSSCA is 3×3, and the step size is 1; the pool of the second maximum pooling layer in step e-6) The convolution kernel size is 2×2 and the step size is 2; in step e-7), the convolution kernel size of the depthwise separable convolution layer of the SSM branch of the third state-space attention module SSSCA is 3×3, the padding is 1, and the step size is 1; the convolution kernel size of the first convolution layer of the convolution branch of the third state-space attention module SSSCA is 3×3, the padding is 1, and the step size is 1; the convolution kernel size of the second convolution layer of the convolution branch of the third state-space attention module SSSCA is 3×3, the padding is 1, and the step size is 1; the convolution kernel size of the point-by-point convolution layer of the convolution branch of the third state-space attention module SSSCA is 3×3 and the step size is 1; in step e-8), the pooling kernel of the third maximum pooling layer is 2×2 , the step size is 2; in step e-9), the convolution kernel size of the depthwise separable convolution layer of the SSM branch of the fourth state-space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, the convolution kernel size of the first convolution layer of the convolution branch of the fourth state-space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, the convolution kernel size of the second convolution layer of the convolution branch of the fourth state-space attention module SSSCA is 3×3, the padding is 1, and the step size is 1, the convolution kernel size of the point-by-point convolution layer of the convolution branch of the fourth state-space attention module SSSCA is 3×3, and the step size is 1; in step e-10), the pooling kernel of the fourth maximum pooling layer is 2×2, and the step size is 2.
7. The cardiac image segmentation method based on state space model and dual-path multi-scale enhancement according to claim 1, characterized in that: Step f) comprises the following steps: f-1) The decoder of the segmentation network model is composed of a first dual-path multi-scale enhancement module DPMSFE, a first transposed convolutional layer, a first residual block, a second dual-path multi-scale enhancement module DPMSFE, a second transposed convolutional layer, a second residual block, a third path multi-scale enhancement module DPMSFE, a third transposed convolutional layer, a third residual block, a fourth dual-path multi-scale enhancement module DPMSFE, a fourth transposed convolutional layer, a fourth residual block, and a convolutional layer; the first dual-path multi-scale enhancement module DPMSFE, the second dual-path multi-scale enhancement module DPMSFE, the third dual-path multi-scale enhancement module DPMSFE, and the fourth dual-path multi-scale enhancement module D PMSFE is composed of a lower convolution layer, a channel aggregation branch, a multi-scale fusion branch, and an upper convolution layer. The channel aggregation branch is composed of an average pooling layer, a first convolution layer, a ReLU activation function, and a second convolution layer in sequence. The multi-scale fusion branch is composed of a first convolution layer, a second convolution layer, a third convolution layer, a maximum pooling layer, a fourth convolution layer, and a Sigmoid activation function. The first residual block, the second residual block, the third residual block, and the fourth residual block are all composed of a first convolution layer, a first BatchNorm layer, a first ReLU activation function, a second convolution layer, a second BatchNorm layer, a second ReLU activation function, and a third ReLU activation function. f-2) The feature map The input is sent to the lower convolution layer of the first dual-path multi-scale enhancement module DPMSFE of the decoder, and the output is the feature map The feature map Input to the channel aggregation branch of the first dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map With feature map Perform multiplication operation to obtain the feature map The feature map The first convolutional layer, the second convolutional layer, and the third convolutional layer of the multi-scale fusion branch of the first dual-path multi-scale enhancement module DPMSFE of the decoder are input respectively, and the feature map is output. Feature Map Feature Map The feature map Feature Map Feature Map Perform addition operation to obtain feature map The feature map The maximum pooling layer, the fourth convolutional layer, and the Sigmoid activation function of the multi-scale fusion branch of the first dual-path multi-scale enhancement module DPMSFE of the decoder are input in sequence, and the feature map is output. The feature map With feature map Perform multiplication operation and output the feature map The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the upper convolution layer of the first dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map f-3) The feature map With feature map Perform the addition operation and output the feature map f-4) The feature map Input to the first transposed convolutional layer of the decoder, and output the feature map The feature map It is sequentially input into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function of the first residual block of the decoder, and the feature map is output. The feature map It is sequentially input into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function of the first residual block of the decoder, and the feature map is output. The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the third ReLU activation function of the first residual block of the decoder, and output the feature map f-5) The feature map The input is sent to the lower convolution layer of the second dual-path multi-scale enhancement module DPMSFE of the decoder, and the output is the feature map The feature map Input to the channel aggregation branch of the second dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map With feature map Perform multiplication operation to obtain the feature map The feature map The first convolutional layer, the second convolutional layer, and the third convolutional layer of the multi-scale fusion branch of the second dual-path multi-scale enhancement module DPMSFE of the decoder are input respectively, and the feature map is output. Feature Map Feature Map The feature map Feature Map Feature Map Perform addition operation to obtain feature map The feature map The maximum pooling layer, the fourth convolutional layer, and the Sigmoid activation function of the multi-scale fusion branch of the second dual-path multi-scale enhancement module DPMSFE of the decoder are input in sequence, and the feature map is output. The feature map With feature map Perform multiplication operation and output the feature map The feature map With feature map Perform the addition operation and output the feature map The feature map The input is sent to the upper convolution layer of the second dual-path multi-scale enhancement module DPMSFE of the decoder, and the output is the feature map f-6) The feature map With feature map Perform the addition operation and output the feature map f-7) The feature map Input to the second transposed convolutional layer of the decoder, and output the feature map The feature map It is sequentially input into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function of the second residual block of the decoder, and the feature map is output. The feature map It is sequentially input into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function of the second residual block of the decoder, and the feature map is output. The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the third ReLU activation function of the second residual block of the decoder, and output the feature map f-8) The feature map Input to the lower convolution layer of the third dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map Input to the channel aggregation branch of the third dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map With feature map Perform multiplication operation to obtain the feature map The feature map They are respectively input into the first convolutional layer, the second convolutional layer, and the third convolutional layer of the multi-scale fusion branch of the third dual-path multi-scale enhancement module DPMSFE of the decoder, and the feature map is output. Feature Map Feature Map The feature map Feature Map Feature Map Perform addition operation to obtain feature map The feature map The maximum pooling layer, the fourth convolution layer, and the Sigmoid activation function of the multi-scale fusion branch of the third dual-path multi-scale enhancement module DPMSFE of the decoder are input in sequence, and the feature map is output. The feature map With feature map Perform multiplication operation and output the feature map The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the upper convolution layer of the third dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map f-9) The feature map With feature map Perform the addition operation and output the feature map f-10) The feature map Input to the third transposed convolution layer of the decoder, and output the feature map The feature map It is sequentially input into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function of the third residual block of the decoder, and the feature map is output. The feature map It is sequentially input into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function of the third residual block of the decoder, and the feature map is output. The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the third ReLU activation function of the third residual block of the decoder, and output the feature map f-11) The feature map Input to the lower convolution layer of the fourth dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map Input to the channel aggregation branch of the fourth dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map The feature map With feature map Perform multiplication operation to obtain the feature map The feature map They are respectively input into the first convolutional layer, the second convolutional layer, and the third convolutional layer of the multi-scale fusion branch of the fourth dual-path multi-scale enhancement module DPMSFE of the decoder, and the feature map is output. Feature Map Feature Map The feature map Feature Map Feature Map Perform addition operation to obtain feature map The feature map The maximum pooling layer, the fourth convolutional layer, and the Sigmoid activation function of the multi-scale fusion branch of the fourth dual-path multi-scale enhancement module DPMSFE of the decoder are input in sequence, and the feature map is output. The feature map With feature map Perform multiplication operation and output the feature map The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the upper convolution layer of the fourth dual-path multi-scale enhancement module DPMSFE of the decoder, and output the feature map f-12) The feature map With feature map Perform the addition operation and output the feature map f-13) The feature map Input to the fourth transposed convolution layer of the decoder, and output the feature map The feature map It is sequentially input into the first convolutional layer, the first BatchNorm layer, and the first ReLU activation function of the fourth residual block of the decoder, and the feature map is output. The feature map It is sequentially input into the second convolutional layer, the second BatchNorm layer, and the second ReLU activation function of the fourth residual block of the decoder, and the feature map is output. The feature map With feature map Perform the addition operation and output the feature map The feature map Input to the third ReLU activation function of the fourth residual block of the decoder, and output the feature map f-14) The feature map Input into the convolutional layer of the decoder, and output the predicted segmentation image 8. The cardiac image segmentation method based on state space model and dual-path multi-scale enhancement according to claim 7, characterized in that: In step f-2), the convolution kernel size of the lower convolution layer of the first dual-path multi-scale enhancement module DPMSFE is 1×1 and the step size is 1, the convolution kernel size of the first convolution layer of the channel aggregation branch of the first dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the second convolution layer of the channel aggregation branch of the first dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the first convolution layer of the multi-scale fusion branch of the first dual-path multi-scale enhancement module DPMSFE is 3×3, the step size is 1, and the padding is 1, the convolution kernel size of the second convolution layer of the multi-scale fusion branch of the first dual-path multi-scale enhancement module DPMSFE is 5×5, the step size is 1, and the padding is is 2, the convolution kernel size of the third convolution layer of the multiscale fusion branch of the first dual-path multi-scale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3, the convolution kernel size of the fourth convolution layer of the multiscale fusion branch of the first dual-path multi-scale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3, and the convolution kernel size of the upper convolution layer of the first dual-path multi-scale enhancement module DPMSFE is 1×1 and the step size is 1; in step f-4), the convolution kernel size of the first transposed convolution layer of the decoder is 2×2 and the step size is 2, the convolution kernel size of the first convolution layer of the first residual block of the decoder is 3×3, and the convolution kernel size of the second convolution layer of the first residual block of the decoder is 3×3; In step f-5), the convolution kernel size of the lower convolution layer of the second dual-path multi-scale enhancement module DPMSFE is 1×1 and the step size is 1, the convolution kernel size of the first convolution layer of the channel aggregation branch of the second dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the second convolution layer of the channel aggregation branch of the second dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the first convolution layer of the multiscale fusion branch of the second dual-path multi-scale enhancement module DPMSFE is 3×3, the step size is 1, and the padding is 1, the convolution kernel size of the second convolution layer of the multiscale fusion branch of the second dual-path multi-scale enhancement module DPMSFE is 5×5, the step size is 1, and the padding is is 2, the convolution kernel size of the third convolution layer of the multiscale fusion branch of the second dual-path multi-scale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3, the convolution kernel size of the fourth convolution layer of the multiscale fusion branch of the second dual-path multi-scale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3, and the convolution kernel size of the upper convolution layer of the second dual-path multi-scale enhancement module DPMSFE is 1×1 and the step size is 1; in step f-7), the convolution kernel size of the second transposed convolution layer of the decoder is 2×2 and the step size is 2, the convolution kernel size of the first convolution layer of the second residual block of the decoder is 3×3, and the convolution kernel size of the second convolution layer of the second residual block of the decoder is 3×3;In step f-8), the convolution kernel size of the lower convolution layer of the third dual-path multi-scale enhancement module DPMSFE is 1×1 and the step size is 1, the convolution kernel size of the first convolution layer of the channel aggregation branch of the third dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the second convolution layer of the channel aggregation branch of the third dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the first convolution layer of the multiscale fusion branch of the third dual-path multi-scale enhancement module DPMSFE is 3×3, the step size is 1, and the padding is 1, the convolution kernel size of the second convolution layer of the multiscale fusion branch of the third dual-path multi-scale enhancement module DPMSFE is 5×5, the step size is 1, and the padding is 2. The convolution kernel size of the third convolution layer of the multiscale fusion branch of the third dual-path multi-scale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3. The convolution kernel size of the fourth convolution layer of the multiscale fusion branch of the third dual-path multi-scale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3. The convolution kernel size of the upper convolution layer of the third dual-path multi-scale enhancement module DPMSFE is 1×1 and the step size is 1; in step f-10), the convolution kernel size of the third transposed convolution layer of the decoder is 2×2 and the step size is 2, the convolution kernel size of the first convolution layer of the third residual block of the decoder is 3×3, and the convolution kernel size of the second convolution layer of the third residual block of the decoder is 3×3; In step f-11), the convolution kernel size of the lower convolution layer of the fourth dual-path multi-scale enhancement module DPMSFE is 1×1, and the step size is 1, the convolution kernel size of the first convolution layer of the channel aggregation branch of the fourth dual-path multi-scale enhancement module DPMSFE is 1×1, and the convolution kernel size of the second convolution layer of the channel aggregation branch of the fourth dual-path multi-scale enhancement module DPMSFE is 1×1, the convolution kernel size of the first convolution layer of the multiscale fusion branch of the fourth dual-path multi-scale enhancement module DPMSFE is 3×3, the step size is 1, and the padding is 1, the convolution kernel size of the second convolution layer of the multiscale fusion branch of the fourth dual-path multi-scale enhancement module DPMSFE is 5×5, the step size is 1, and the padding is 2, the convolution kernel size of the third convolution layer of the multiscale fusion branch of the fourth dual-path multiscale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3, the convolution kernel size of the fourth convolution layer of the multiscale fusion branch of the fourth dual-path multiscale enhancement module DPMSFE is 7×7, the step size is 1, and the padding is 3, and the convolution kernel size of the upper convolution layer of the fourth dual-path multiscale enhancement module DPMSFE is 1×1 and the step size is 1; in step f-13), the convolution kernel size of the fourth transposed convolution layer of the decoder is 2×2 and the step size is 2, the convolution kernel size of the first convolution layer of the fourth residual block of the decoder is 3×3, and the convolution kernel size of the second convolution layer of the fourth residual block of the decoder is 3×3. ; 9. The cardiac image segmentation method based on state space model and dual-path multi-scale enhancement according to claim 1, characterized in that: By formula L total =αL Dice +βL CE Calculate the total loss function L total , where α and β are hyperparameters, L Dice is the Dice loss function, L CE is the cross entropy loss function.
10. The cardiac image segmentation method based on state space model and dual-path multi-scale enhancement according to claim 9, characterized in that: When training the segmentation network model, the learning rate is set to 0.01, the batch size is set to 8, the number of iterations is set to 1000, the hyperparameter α is set to 0.4, and the hyperparameter β is set to 0.4.
Citation Information
Patent Citations
Heart segmentation method based on multi-scale attention U-net network
CN113744210A
Semi-supervised medical image segmentation method based on geometric consistency constraint
CN114862800A
3D atrial image segmentation method and system based on shape-guided dual consistency
CN115082493A
Lightweight heart MRI segmentation method based on feature selection
CN117409014A
Heart MRI image segmentation method based on edge feature enhancement
CN117635942A
Cited By
Heart nuclear magnetic resonance image segmentation method and system based on supervision signal expansion
CN120411506A
