Lightweight cardiac ultrasound image segmentation algorithm based on boundary enhancement
By using multi-scale feature extraction and edge prediction networks in the echocardiography segmentation algorithm, combined with the channel attention boundary sensing module, the existing technology problems of unclear recognition of boundary blurred images and noise sensitivity are solved, and the echocardiography segmentation is improved. accuracy and robustness.
Patent Information
- Application Number
- CN202410689896.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-05-30
AI Technical Summary
Existing echocardiography segmentation methods cannot effectively extract ultrasound image features when the training data is limited and the image quality is poor. In particular, image features with blurred and irregular boundaries cannot be clearly recognized, and motion artifacts and plaques cannot be easily detected. and noise sensitivity, unable to effectively identify ventricular boundaries.
A lightweight cardiac ultrasound image segmentation algorithm based on boundary enhancement is used to extract multi-scale and multi-level features through multiple residual U-shaped modules of different depths, and a multi-level edge feature fusion module and channel attention boundary sensing module are constructed, combined with the edge prediction network ,extract and fuse features for cardiac ultrasound image ,segmentation.
It improves the ability to identify image boundaries with irregular shapes and uneven brightness, enhances the robustness of the segmentation model, reduces model complexity, and improves the performance of cardiac ultrasound image segmentation.
Smart Images

Figure CN118570474A
Abstract
Description
Technical Field
[0001] The present invention proposes a lightweight cardiac ultrasound image segmentation algorithm based on boundary enhancement, which relates to the field of medical ultrasound image processing. Background Art
[0002] As a non-invasive, real-time imaging modality, echocardiography is crucial in clinical practice for assessing cardiac function and detecting various abnormalities. Calculating changes in ventricular or atrial volume is an important indicator of cardiac function. In clinical practice, this is typically assessed by manually marking the left ventricular area during systole and diastole and then calculating the volume. However, this manual assessment is time-consuming, error-prone, inaccurate, and exhibits high inter-observer variance.
[0003] In addition, medical image processing is different from natural image processing. First, the labeled medical data set is relatively small, and the labeling requires the participation of professionals. However, doctors are short on time and cannot fully devote themselves to the labeling work, which limits the algorithm design by the amount of data. Second, ultrasound images have problems such as uneven brightness, low contrast between the myocardium and the blood pool, and motion artifacts and noise in the images. In particular, the boundaries of the heart structure are irregular, unclear, and changeable. These factors make the echocardiogram segmentation task challenging.
[0004] Existing medical image segmentation methods can be roughly divided into two types: image segmentation methods based on convolutional neural networks and image segmentation methods based on transformer architecture. However, these two methods of medical image segmentation not only require a high number of parameters, but also require the assistance of a large amount of data to achieve ideal results. Furthermore, most existing models are based on the backbone network of image classification tasks to extract features, and these features may not be effective in segmentation tasks, especially for image features with fuzzy boundaries and irregularities such as ultrasound images.
[0005] In summary, existing image segmentation methods cannot effectively extract echocardiographic features and perform segmentation tasks when training data is limited and image quality is poor.
[0006] Therefore, how to efficiently extract multi-scale features and edge features in ultrasound images and effectively fuse them to segment important areas in cardiac ultrasound images is a technical problem that needs to be solved urgently. Summary of the Invention
[0007] The technical problem to be solved by the present invention is to propose a lightweight cardiac ultrasound image segmentation algorithm based on boundary enhancement to solve the problem that traditional methods used in ultrasound image segmentation tasks are sensitive to motion artifacts, plaques and noise, and cannot effectively identify ventricular boundaries.
[0008] The present invention is achieved through the following technical solutions:
[0009] A lightweight cardiac ultrasound image segmentation algorithm based on boundary enhancement includes the following steps:
[0010] Step 1: Obtain a cardiac ultrasound image, encode the cardiac ultrasound image based on multiple residual U-shaped modules (RSUs) of different depths, and extract multi-level and multi-scale features of the cardiac ultrasound image.
[0011] Step 2: Construct a multi-level edge feature fusion module to extract the shallow features of the cardiac ultrasound image from the multi-level and multi-scale features of the cardiac ultrasound image, construct an edge prediction network based on the shallow features of the cardiac ultrasound image, and characterize the edge prediction branch through the edge prediction network.
[0012] Step 3. Construct a channel attention boundary perception module and fuse the edge features, the output features of the RUS module during decoding, and the output features of the RUS module during the corresponding encoding process to decode the multi-level and multi-scale features of the cardiac ultrasound image and the shallow features of the cardiac ultrasound image to obtain the multi-stage feature subgraph of the cardiac ultrasound image.
[0013] Step 4: Perform segmentation prediction on the obtained multi-stage feature subgraphs of the cardiac ultrasound image, and then fuse the multi-stage feature subgraphs of the cardiac ultrasound image after segmentation prediction to obtain the final segmentation result of the cardiac ultrasound image.
[0014] Furthermore, the Step 1 specifically includes the following steps:
[0015] Step 1.1: Input the cardiac ultrasound image x into the encoder based on the residual U-shaped module RSU level for encoding, where:
[0016]
[0017] H represents the height of the original input ultrasound image, W represents the width of the original input ultrasound image, and C represents the number of channels of the original ultrasound image.
[0018] Step 1.2: Perform convolutional layer processing on the initial attribute x to obtain the intermediate representation map F(x) of the cardiac ultrasound image.
[0019]
[0020] Among them, C out is the number of channels.
[0021] Step 1.3: Based on the U-shaped encoder-decoder in the RSU module, the multi-level and multi-scale features U(F(x)) of the cardiac ultrasound image are extracted from the intermediate representation image F(x) of the cardiac ultrasound image.
[0022] Step 1.4: Connect the residual of F(x) processed by the convolutional layer in the RSU module to U(F(x)) processed by the U-type encoder-decoder H RSU (x) is the output feature map of the RSU module at this level.
[0023] Η RSU (x) = F(x) + U(F(x))
[0024] in,
[0025] Furthermore, the encoder based on the residual U-shaped module RSU level structure is an encoder based on a cascade of six U-shaped residual modules RSU of different depths.
[0026] The RSU module is used in the feature extraction stage, and each feature extraction stage corresponds to an RSU module.
[0027] The RSU module includes an RSU-L module and an RSU-D module.
[0028] Among them, the RSU-L module performs downsampling encoding and upsampling decoding operations on the input features to extract multi-scale features in the input feature map.
[0029] The RSU-D module is used to extract features using dilated convolution on the input features.
[0030] During the encoding process, after the multi-scale features in the cardiac ultrasound image extracted by each RSU module are down-sampled by maximum pooling, the multi-scale features in the cardiac ultrasound image after maximum pooling down-sampling are used as the input feature map of the next RSU module.
[0031] The encoding process includes 4 RSU-L modules, namely RSU-7, RSU-6, RSU-5 and RSU-4, and 2 RSU-D modules.
[0032] The decoding process includes five RSU modules, which are used to extract and fuse the features of the corresponding RSU encoder, edge features, and the RSU output features of the encoder at the previous level. The decoding process also includes one RSU-D module and four RSU-L modules, namely RSU-4, RSU-5, RSU-6, and RSU-7.
[0033] The original image passes through the encoding process RSU-7, RSU-6, RSU-5, RSU-4, the first RSU-D and the second RSU-D in sequence, and then enters the decoding process, passing through the first RSU-D, RSU-4, RSU-5, RSU-6 and RSU-7 in sequence.
[0034] Furthermore, the RSU-D modules are respectively the first RSU-D and the second RSU-D, and the RSU-L modules are respectively RSU-7, RSU-6, RSU-5 and RSU-4.
[0035] The RSU-L module is specifically represented as follows:
[0036] (Cin,M,Cout)
[0037] Where L represents the depth of the U-type encoder-decoder in the RSU module, M is the number of intermediate layers, and C in , and C out Represents the number of input channels and output channels of the model.
[0038] Furthermore, the Step 2 specifically includes the following steps:
[0039] Step 2.1: Extract the shallow features F1 after the output of the RSU-5 module is max-pooled and down-sampled during the encoder encoding process, and the shallow features F2 output by the RSU-4 module.
[0040]
[0041] Step 2.2: Based on the multi-level edge feature fusion module, the extracted shallow features F1 and F2 are denoised to obtain the edge feature F of the cardiac ultrasound image. edge .
[0042] F edge =W1·F1+W2·F2
[0043] Among them, W1 and W2 represent the gate weights from the softmax layer.
[0044] Step 2.3: Obtain the edge feature F of the cardiac ultrasound image edge After interpolation upsampling, 3x3 convolution layer, batch normalization and activation function processing, we get F edge3 、F edge2 and F edge1 .
[0045]
[0046] Step 2.4: For the F edge1 Perform 3x3 convolution layer processing to obtain the boundary prediction P of the cardiac ultrasound image B .
[0047]
[0048] Among them, C labelis the number of channels of the label map.
[0049] Furthermore, the specific steps of Step 2.2 are as follows:
[0050] Step 2.2.1: Perform 1x1 convolution and concatenation operations on the extracted shallow features F1 and F2 to obtain the spatial gate G1 of the shallow feature F1 and the spatial gate G2 of F2.
[0051]
[0052] Step 2.2.2: Perform gating weight processing of the softmax layer on the spatial gate G1 and the spatial gate G2 respectively to obtain the gating weight W1 of G1 and the gating weight W2 of G2.
[0053]
[0054] Step 2.2.3: Based on the gate weight W1 of G1 and the gate weight W2 of G2, the extracted shallow features F1 and F2 are denoised to obtain the edge feature F of the cardiac ultrasound image. edge .
[0055] F edge =W1·F1+W2·F2
[0056] Among them, W1 and W2 represent the gate weights from the softmax layer.
[0057] Furthermore, the Step 3 specifically includes the following steps:
[0058] Step 3.1: Based on the channel attention boundary perception module and the fusion of edge features, the edge feature F of the cardiac ultrasound image is edge Perform attention-enhanced boundary perception feature calculation to obtain F att :
[0059]
[0060] Among them, AMP(·) represents the adaptive maximum pooling operation, MLP(·) is a two-layer fully connected network followed by a Sigmoid activation function, Stands for element-wise product.
[0061] Step 3.2: Based on the output features of the RSU-D module during the decoding process, the features of the decoded output are processed by interpolation to obtain F dec , then use F dec With the F att Perform splicing operation to obtain F cat .
[0062] F cat =cat(F dec ,F att )
[0063] Step 3.3: For the F cat Perform 3x3 convolutional network processing to obtain F' cat .
[0064] Step 3.4: F dec With F' cat Perform the final aggregation to obtain the final aggregated feature F of the cardiac ultrasound image boundary agg .
[0065]
[0066] Among them, GAM represents the global attention module, It is element-wise addition.
[0067] Step 3.5: Based on the RSU-D input features in the encoding process that are mirrored with the RSU-D in the decoding process, F agg It is concatenated with the RSU-D input features during the encoding process and used as the input value of the next RSU module during the decoding process.
[0068] Furthermore, the Step 4 specifically includes the following steps:
[0069] Step 4.1: The sub-feature map output by the deepest encoder RSU-D in the encoding process and the sub-feature map output by each decoder RSU in the decoding process are upsampled through a 3x3 convolutional network and interpolation method, and the sub-feature map after the upsampling operation and the sub-feature map output by each decoder are converted into a segmentation prediction sub-map of the label image size and number of channels.
[0070] Step 4.2: Perform splicing operation and 1x1 convolution layer processing on the segmentation prediction sub-image to obtain the final image segmentation prediction image.
[0071] Step 4.3. Based on the model overall loss function and the binary cross entropy loss function, deep supervised training is performed on the image segmentation prediction map, and the parameters in the training model are updated using the gradient descent method to reduce the prediction bias in the model.
[0072] Among them, the overall loss function of the model is:
[0073]
[0074] in, is the loss of the nth segmentation prediction map, there are 7 segmentation prediction losses, n∈{0,…,N=6}, is the boundary prediction loss.
[0075] The binary cross entropy loss function is
[0076]
[0077] Among them, (h,w) is the pixel coordinate, G (h,w) and P (h,w) They represent the pixel value of the label and the predicted value of the model respectively, 1 represents the segmented target area, and 0 represents the background.
[0078] Furthermore, the image segmentation prediction graph includes 6 prediction segmentation subgraphs 1 final segmentation prediction map and 1 boundary prediction feature.
[0079] Compared with the prior art, the present invention has at least one of the following beneficial effects:
[0080] 1. The present invention extracts multi-scale and multi-level features from images by cascading residual U-shaped modules of different depths. In the model encoding stage, the multi-level edge feature fusion module (CFM) is used to extract shallow features and construct edge prediction branches. This overcomes the problem that traditional methods are easily affected by artifacts, patches, and noise in the image when extracting features, and have difficulty recognizing fuzzy boundaries with irregular shapes and uneven brightness.
[0081] 2. The present invention captures more contextual information in the image by mixing different receptive fields, enhances the prediction robustness of the segmentation model, uses an edge prediction network to enhance the representation of edge information, and utilizes the edge perception module BAM to fuse high-order information in the image with edge information. While reducing the complexity of the model, it efficiently extracts key features, thereby improving the segmentation performance of cardiac ultrasound images. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] Figure 1 is a flow chart of the steps of the present invention;
[0083] Figure 2 It is the overall framework diagram of the model network;
[0084] Figure 3 It is a schematic diagram of the residual U-type module (RSU) structure;
[0085] Figure 4 These are the true labels and prediction results of the left ventricle in the public dataset. DETAILED DESCRIPTION
[0086] Traditional methods for ultrasound image segmentation are sensitive to motion artifacts, plaques, and noise, and are unable to effectively identify ventricular boundaries.
[0087] The main technical solution adopted in the embodiment of the present application is: extracting multi-scale and multi-level features in the image by cascading residual U-shaped modules of different depths, and extracting shallow features through the multi-level edge feature fusion module CFM in the model encoding stage to construct an edge prediction branch, which makes up for the problem that traditional methods are easily affected by artifacts, patches and noise in the image when extracting features, and cannot clearly recognize fuzzy boundaries with irregular shapes and uneven brightness.
[0088] To better understand the above technical solutions, exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. Rather, these embodiments are provided to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0089] This application discloses a lightweight cardiac ultrasound image segmentation algorithm based on boundary enhancement, comprising the following steps:
[0090] Step 1: Obtain a cardiac ultrasound image and encode it based on six residual U-shaped modules (RSUs) of different depths to extract multi-level and multi-scale features of the cardiac ultrasound image. Specifically:
[0091] Step 1.1: Input the cardiac ultrasound image x into the encoder based on the residual U-shaped module level for encoding, where:
[0092]
[0093] H represents the height of the original input ultrasound image, W represents the width of the original input ultrasound image, and C represents the number of channels of the original ultrasound image, which is 3.
[0094] Step 1.2: Perform convolutional layer processing on the initial attributes x of the cardiac ultrasound image in the input encoder to obtain the intermediate representation graph F(x) of the cardiac ultrasound image;
[0095]
[0096] Among them, C out is the number of channels, which is 64.
[0097] Step 1.3: Based on the U-type encoder-decoder in the RSU module, the multi-level and multi-scale features U(F(x)) of the cardiac ultrasound image are extracted from the intermediate representation image F(x) of the cardiac ultrasound image, as shown in Figure 3As shown;
[0098] Step 1.4: Connect the residual of F(x) processed by the convolutional layer in the RSU module to U(F(x)) processed by the U-type encoder-decoder H RSU (x) is the output feature map of the RSU module at this level.
[0099] Η RSU (x) = F(x) + U(F(x))
[0100] in,
[0101] It should be noted that the overall network structure is as follows: Figure 2 Each feature extraction stage corresponds to the RSU-L(C in ,M,C out ) module, L represents the depth of the encoder in the RSU module, which is determined based on the input image size, C in =64 and C out =64 represents the number of input channels and output channels of the model, M is the number of intermediate layers, and M is set to 16 to achieve lightweight model.
[0102] The RSU module is similar to a U-shaped network and includes an RSU-L module and an RSU-D module. The RSU-L module is used to perform downsampling encoding and upsampling decoding operations on the input features to extract multi-scale features from cardiac ultrasound images.
[0103] The RSU-D module is used to extract features from the input features using dilated convolution, and after performing maximum pooling downsampling on the multi-scale features in the cardiac ultrasound image extracted by each RSU module, the multi-scale features in the cardiac ultrasound image after maximum pooling downsampling are used as the input feature map of the next RSU module.
[0104] The RSU-D modules are the first RSU-D and the second RSU-D, and the RSU-L modules are RSU-7, RSU-6, RSU-5 and RSU-4. The encoding part of the model uses RSU-7, RSU-6, RSU-5, RSU-4, and the first RSU-D and the second RSU-D to extract multi-scale features.
[0105] RSU-D uses dilated convolution to avoid the problem of small-sized features losing information during downsampling, such as Figure 3 As shown, the encoding process of RSU-7 is for the original ultrasound image input feature First, the intermediate feature F(x) in Step 1.4 is obtained through convolutional layer processing, and then the multi-level and multi-scale features U(F(x)) of the cardiac ultrasound image are obtained through a U-shaped encoder-decoder with a depth of 7. The RSU-7 encoding process includes 5 maximum pooling downsampling operations and one hole convolution, and the decoding process includes 5 interpolation upsampling operations. The residual connection H of the intermediate feature F(x) of RSU-7 and the multi-level and multi-scale features U(F(x)) of the cardiac ultrasound image processed by the U-shaped encoder-decoder with a depth of 7 is used. RSU (x) is the output feature map of the RSU-7 module at this level.
[0106] Η RSU (x) = F(x) + U(F(x))
[0107] The original cardiac ultrasound image is processed through RSU-7, RSU-6, RSU-5, RSU-4 modules, and four times of maximum pooling to obtain the input feature map. First, the intermediate feature F(x) is obtained through the convolution layer, then it is encoded through 4 dilated convolution layers and decoded through 3 dilated convolution layers to obtain the feature U(F(x)). F(x) and U(F(x)) are added to obtain H RSU (x) is used as the output of RSU-D. The internal structure of the second RSU-D module is the same as that of the first RSU-D module. The output features of the first RSU-D module are max-pooled and down-sampled as the input features of the second RSU-D module.
[0108] Step 2: Construct a multi-level edge feature fusion module to extract the shallow features of the cardiac ultrasound image from the multi-level and multi-scale features of the cardiac ultrasound image. Build an edge prediction network based on the shallow features of the cardiac ultrasound image. Use the edge prediction network to characterize the edge prediction branch to enhance the edge information. Specifically:
[0109] Step 2.1: Extract the shallow features F1 and F2 of the RSU-4 output after maximum pooling and downsampling during the encoder encoding process;
[0110]
[0111] Step 2.2: Based on the multi-level edge feature fusion module, the extracted shallow features F1 and F2 are denoised to obtain the edge feature F of the cardiac ultrasound image. edge .
[0112] F edge =W1·F1+W2·F2
[0113] Among them, W1 and W2 represent the gate weights from the softmax layer.
[0114] It should be noted that: F edge Specifically, it is obtained through the following steps:
[0115] Perform 1x1 convolution and concatenation operations on the extracted shallow features F1 and F2 to obtain the spatial gate G1 of the shallow features F1 and the spatial gate G2 of F2;
[0116]
[0117] Perform gating weight processing of the softmax layer on the spatial gate G1 and the spatial gate G2 respectively to obtain the gating weight W1 of G1 and the gating weight W2 of G2;
[0118]
[0119] Based on the gate weight W1 of G1 and the gate weight W2 of G2, the extracted shallow features F1 and F2 are denoised to obtain the edge feature F of the cardiac ultrasound image. edge :
[0120] F edge =W1·F1+W2·F2
[0121] Step 2.3: Obtained cardiac ultrasound image edge features F edge After interpolation upsampling, 3x3 convolution layer, batch normalization and activation function processing, we get F edge3 、F edge2 and F edge1 ;
[0122]
[0123] Step 2.4: For the F edge1 Perform 3x3 convolution layer processing to obtain the boundary prediction P of the cardiac ultrasound image B .
[0124]
[0125] Among them, C label is the number of channels of the label map
[0126] Step 3: Construct a channel attention boundary perception module and fuse the edge features, the output features of the RUS module during decoding, and the output features of the RUS module during the corresponding encoding process. Decode the multi-level and multi-scale features of the cardiac ultrasound image and the shallow features of the cardiac ultrasound image to obtain the multi-stage feature subgraph of the cardiac ultrasound image. Specifically:
[0127] Step 3.1: Based on the channel attention boundary perception module and the fusion of edge features, the edge feature F of the cardiac ultrasound image is edge Perform attention-enhanced boundary perception feature calculation to obtain F att :
[0128]
[0129] Among them, AMP(·) represents the adaptive maximum pooling operation, MLP(·) is a two-layer fully connected network followed by a Sigmoid activation function, Stands for element-wise product.
[0130] Step 3.2: Based on the output features of the RSU-D module during the decoding process, the features of the decoded output are processed by interpolation to obtain F dec , then use F dec With the F att Perform splicing operation to obtain F cat .
[0131] F cat =cat(F dec ,F att )
[0132] Step 3.3: For the F cat Perform 3x3 convolutional network processing to obtain F' cat ;
[0133] Step 3.4: F dec With F' cat Perform the final aggregation to obtain the final aggregated feature F of the cardiac ultrasound image boundary agg .
[0134]
[0135] Among them, GAM represents the global attention module, It is element-wise addition
[0136] Step 3.5: Based on the RSU-D input features in the encoding process that are mirrored with the RSU-D in the decoding process, F agg It is concatenated with the RSU-D input features during the encoding process and used as the input value of the next RSU module during the decoding process.
[0137] Step 4: Perform segmentation prediction on the obtained multi-stage feature subgraphs of the cardiac ultrasound image, and then fuse the multi-stage feature subgraphs of the cardiac ultrasound image after segmentation prediction to obtain the final segmentation result of the cardiac ultrasound image. The specific steps are as follows:
[0138] Step 4.1: To preserve the rich information of features at different levels and improve computational efficiency, the sub-feature maps output by the deepest encoder RSU-D in the encoding process and the sub-feature maps output by each decoder RSU in the decoding process are upsampled through a 3x3 convolutional network and interpolation method. The upsampled sub-feature maps and the sub-feature maps output by each decoder are converted into segmentation prediction sub-maps of the label image size and number of channels.
[0139] Step 4.2: Perform splicing operations and 1x1 convolution layer processing on the segmentation prediction sub-images to obtain the final image segmentation prediction image;
[0140] Step 4.3: Based on the model overall loss function and the binary cross entropy loss function, deep supervised training is performed on the image segmentation prediction map, and the parameters in the training model are updated using the gradient descent method to reduce the prediction bias in the model.
[0141] Among them, the overall loss function of the model is:
[0142]
[0143] in, is the loss of the nth segmentation prediction map, there are 7 segmentation prediction losses, n∈{0,…,N=6}, is the boundary prediction loss.
[0144] The binary cross entropy loss function is:
[0145]
[0146] Among them, (h,w) is the pixel coordinate, (H,W) is the height and width of the image, G (h,w) and P (h,w) They represent the pixel value of the label and the predicted value of the model respectively, 1 represents the segmented target area, and 0 represents the background.
[0147] It should be noted that the image segmentation prediction graph includes 6 prediction segmentation sub-graphs: 1 final segmentation prediction map and 1 boundary prediction feature.
[0148] Based on the above specific implementation records, the present invention is practicable as follows:
[0149] 1. Experimental data: (public dataset);
[0150] The EchoNet-Dynamic dataset, released by Stanford University in 2020, is a large-scale cardiac motion video dataset for medical machine learning. It includes 10,036 echocardiogram videos covering a range of typical echocardiography laboratory imaging conditions. Ejection fraction, systolic and diastolic frames are labeled, and the left ventricular regions at end-systole and end-diastole are annotated by human experts. Labeled frames are extracted from the videos and converted into 112x112 pixel images. The image labels are binary: left ventricle and background.
[0151] 2. Experimental setup;
[0152] All experiments were implemented using the PyTorch framework and optimized using the Adam optimizer. The training epochs were 400, and the learning rate was set to 0.001. The dataset contains 20,048 labeled images, of which 14,920 were used for training, 2,576 for validation, and 2,552 for testing. The F1 score and Intersection over Union (IoU) were used as evaluation metrics.
[0153] The F1 score is an indicator used in statistics to measure the accuracy of a binary classification model. It takes into account both the accuracy and recall of the classification model. The F1 score can be regarded as a weighted balance of the model's accuracy and recall. It is calculated as follows:
[0154]
[0155] Precision refers to the proportion of samples whose predicted value is 1 and whose true value is also 1 among all samples whose predicted value is 1:
[0156]
[0157] Recall, also known as recall, refers to the proportion of samples with a predicted value of 1 and a true value of 1 to all samples with a true value of 1:
[0158]
[0159] Among them, TP is true positive, that is, the number of samples correctly classified as positive; FP is false positive, that is, the number of samples that are actually negative but mistakenly classified as positive; FN is false negative, that is, the number of samples that are actually positive but mistakenly classified as negative.
[0160] IoU is the ratio of the intersection and union of the model's prediction results for a certain category and the true value, and is calculated as follows:
[0161]
[0162] 3. Experimental results
[0163] Through the above steps, the EchoNet-Dynamic dataset is experimentally verified, and the experimental results are shown in Table 1. The experimental results are visualized. Figure 4 .
[0164]
[0165]
[0166] Table 1: Prediction results of the model for left ventricle segmentation on the public dataset EchoNet-Dynamic.
[0167] The specific embodiments of the present invention are described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in this field without departing from the scope of the present invention.
Claims
1. A lightweight cardiac ultrasound image segmentation algorithm based on boundary enhancement, characterized in that: The following steps are involved: Step 1: Obtain a cardiac ultrasound image, encode the cardiac ultrasound image based on multiple residual U-shaped modules RSU with different depths, and extract multi-level and multi-scale features of the cardiac ultrasound image; Step 2: Construct a multi-level edge feature fusion module to extract the shallow features of the cardiac ultrasound image from the multi-level and multi-scale features of the cardiac ultrasound image, construct an edge prediction network based on the shallow features of the cardiac ultrasound image, and characterize the edge prediction branch through the edge prediction network; Step 3, construct a channel attention boundary perception module and fuse the edge features, the output features of the RUS module in the decoding process and the output features of the RUS module in the corresponding encoding process, decode the multi-level and multi-scale features of the cardiac ultrasound image and the shallow features of the cardiac ultrasound image, and obtain the multi-stage feature subgraph of the cardiac ultrasound image; Step 4: Perform segmentation prediction on the obtained multi-stage feature sub-graphs of the cardiac ultrasound image, and then fuse the multi-stage feature sub-graphs of the cardiac ultrasound image after segmentation prediction to obtain the final segmentation result of the cardiac ultrasound image.
2. The lightweight cardiac ultrasound image segmentation algorithm based on boundary enhancement according to claim 1 is characterized in that: The Step 1 specifically includes the following steps: Step 1.1: Input the cardiac ultrasound image x into the encoder based on the residual U-shaped module RSU level for encoding, where: H represents the height of the original input ultrasound image, W represents the width of the original input ultrasound image, and C represents the number of channels of the original ultrasound image; Step 1.2: Perform convolutional layer processing on the initial attribute x to obtain the intermediate representation graph F(x) of the cardiac ultrasound image; Among them, C out is the number of channels; Step 1.3: Based on the U-shaped encoder-decoder in the RSU module, the multi-level and multi-scale features U(F(x)) of the cardiac ultrasound image are extracted from the intermediate representation image F(x) of the cardiac ultrasound image; Step 1.4: Connect the residual of F(x) processed by the convolutional layer in the RSU module to U(F(x)) processed by the U-type encoder-decoder RSU (x) is the output feature map of the RSU module at this level; Η RSU (x)=F(x)+U(F(x)) in, 3. The lightweight cardiac ultrasound image segmentation algorithm based on boundary enhancement according to claim 2 is characterized in that: The encoder based on the residual U-shaped module RSU level is an encoder based on six U-shaped residual modules RSU cascaded with different depths; The RSU module is used in the feature extraction stage, and each feature extraction stage corresponds to an RSU module; The RSU module includes an RSU-L module and an RSU-D module; The RSU-L module performs down-sampling encoding and up-sampling decoding operations on the input features to extract multi-scale features in the input feature map; The RSU-D module is used to extract features using dilated convolution on the input features; During the encoding process, after the multi-scale features in the cardiac ultrasound image extracted by each RSU module are down-sampled by maximum pooling, the multi-scale features in the cardiac ultrasound image after maximum pooling down-sampling are used as the input feature map of the next RSU module.
4. The lightweight cardiac ultrasound image segmentation algorithm based on boundary enhancement according to claim 3 is characterized in that: The RSU-D modules are respectively the first RSU-D and the second RSU-D, and the RSU-L modules are respectively RSU-7, RSU-6, RSU-5 and RSU-4; The RSU-L module is specifically represented as follows: (Cin,M,Cout) Where L represents the depth of the U-type encoder-decoder in the RSU module, M is the number of intermediate layers, and C in , and C out Represents the number of input channels and output channels of the model.
5. The lightweight cardiac ultrasound image segmentation algorithm based on boundary enhancement according to claim 1, characterized in that: The Step 2 specifically includes the following steps: Step 2.1: Extract the shallow features F1 of the output of the RSU-5 module after maximum pooling and downsampling, and the shallow features F2 of the RSU-4 output during the encoding process of the encoder; Step 2.2: Based on the multi-level edge feature fusion module, the extracted shallow features F1 and F2 are denoised to obtain the edge feature F of the cardiac ultrasound image. edge ; F edge =W1·F1+W2·F2 Among them, W1 and W2 represent the gate weights from the softmax layer. Step 2.3: Obtain the edge feature F of the cardiac ultrasound image edge After interpolation upsampling, 3x3 convolution layer, batch normalization and activation function processing, we get F edge3 、F edge2 and F edge1 ; Step 2.4: For the F edge1 Perform 3x3 convolutional layer processing to obtain the boundary prediction P of the cardiac ultrasound image B ; Among them, C label is the number of channels of the label map.
6. The lightweight cardiac ultrasound image segmentation algorithm based on boundary enhancement according to claim 5 is characterized in that: The specific steps of Step 2.2 are as follows: Step 2.2.1: Perform 1x1 convolution and concatenation operations on the extracted shallow features F1 and F2 to obtain the spatial gate G1 of the shallow features F1 and the spatial gate G2 of F2; Step 2.2.2: Perform gating weight processing of the softmax layer on the spatial gate G1 and the spatial gate G2 respectively to obtain the gating weight W1 of G1 and the gating weight W2 of G2; Step 2.2.3: Based on the gate weight W1 of G1 and the gate weight W2 of G2, the extracted shallow features F1 and F2 are denoised to obtain the edge feature F of the cardiac ultrasound image. edge ; F edge =W1·F1+W2·F2 Among them, W1 and W2 represent the gate weights from the softmax layer.
7. The lightweight cardiac ultrasound image segmentation algorithm based on boundary enhancement according to claim 1, characterized in that: The Step 3 specifically includes the following steps: Step 3.1: Based on the channel attention boundary perception module and the fusion of edge features, the edge feature F of the cardiac ultrasound image is edge Perform attention-enhanced boundary perception feature calculation to obtain F att : Among them, AMP(·) represents the adaptive maximum pooling operation, MLP(·) is a two-layer fully connected network followed by a Sigmoid activation function, stands for element-wise product; Step 3.2: Based on the output features of the RSU-D module during the decoding process, the features of the decoded output are processed by interpolation to obtain F dec , and then use F dec With the F att Perform splicing operation to obtain F cat ; F cat =cat(F dec ,F att ) Step 3.3: For the F cat Perform 3x3 convolutional network processing to obtain F' cat ; Step 3.4: F dec With F' cat Perform the final aggregation to obtain the final aggregation feature F of the cardiac ultrasound image boundary agg ; Among them, GAM represents the global attention module, It is element-by-element addition; Step 3.5: Based on the RSU-D input features in the encoding process that are mirrored with the RSU-D in the decoding process, F agg It is concatenated with the RSU-D input features during the encoding process and used as the input value of the next RSU module during the decoding process.
8. The lightweight cardiac ultrasound image segmentation algorithm based on boundary enhancement according to claim 1, characterized in that: The Step 4 specifically includes the following steps: Step 4.1: The sub-feature map output by the deepest encoder RSU-D in the encoding process and the sub-feature map output by each decoder RSU in the decoding process are upsampled through a 3x3 convolutional network and interpolation method, and the sub-feature map after the upsampling operation and the sub-feature map output by each decoder are converted into a segmentation prediction sub-map of the label image size and number of channels; Step 4.2: Perform splicing operation and 1x1 convolution layer processing on the segmentation prediction sub-image to obtain the final image segmentation prediction image; Step 4.3: Based on the overall model loss function and the binary cross entropy loss function, the image segmentation prediction map is trained with deep supervision, and the parameters in the training model are updated using the gradient descent method; Among them, the overall loss function of the model is: in, is the loss of the nth segmentation prediction map. There are 7 segmentation prediction losses, n∈{0,…,N=6}, is the boundary prediction loss; The binary cross entropy loss function is Where (h, w) is the pixel coordinate, G (h,w) and P (h,w) They represent the pixel value of the label and the predicted value of the model respectively, 1 represents the segmented target area, and 0 represents the background.
9. The lightweight cardiac ultrasound image segmentation algorithm based on boundary enhancement according to claim 8, characterized in that: The image segmentation prediction graph includes 6 prediction segmentation sub-graphs 1 Final segmentation prediction map and 1 boundary prediction feature.
Citation Information
Patent Citations
Intestinal tract lesion segmentation method combining multi-scale U-shaped residual encoder and overall reverse attention mechanism
CN112712528A
Medical ultrasonic image segmentation method and system based on adaptive feature fusion
CN117078692A
Mammary gland ultrasonic medical image segmentation algorithm based on global multi-scale residual U-HRNet network
CN117392093A
Cited By
Sheep intramuscular fat content estimation method and system based on ultrasonic image
CN119205708A
Carotid plaque segmentation method and device in ultrasonic image, equipment and medium
CN120047463A
Cardiac ultrasonic image shooting suggestion generation method and system, medium and equipment
CN120411075A
