Left ventricle segmentation method based on optimized UNet and improved CBAM

By optimizing the UNet network and improving the CBAM attention mechanism, and building Nestedunet with SCBAM, VGG and jump connections, the existing left ventricular segmentation method has solved the problems of large computing resources, large model scale, and inefficient feature fusion, and achieved a more efficient and accurate left ventricular segmentation method.

CN119540249APending Publication Date: 2025-02-28SHENYANG INSTITUTE OF CHEMICAL TECHNOLOGY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411588899.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-08
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

The existing left ventricular segmentation method relies on static images, with large computing resources and model scales, which limits its application in actual clinical assistance, and inefficient feature fusion leads to information loss, high algorithm complexity, and poor real-time performance.

Method used

By optimizing the UNet network and improving the CBAM attention mechanism, a lightweight left ventricular segmentation method is constructed, and iterative up-down sampling block Nestedunet is constructed in combination with SCBAM, VGG and jump connections, enhancing feature expression capabilities and reducing computing and storage overhead.

Benefits of technology

It improves the accuracy and efficiency of left ventricular segmentation, reduces computing and storage overhead, and provides a lighter and more efficient medical-assisted diagnostic solution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119540249A_ABST
    Figure CN119540249A_ABST
Patent Text Reader

Abstract

The invention discloses a left ventricle segmentation method based on an optimized UNet network and an improved CBAM attention mechanism, and belongs to the technical field of image processing. The method specifically comprises the following steps: constructing a lightweight attention mechanism SCBAM, combining the lightweight attention mechanism SCBAM with a convolutional VGG network, cutting a UNet network to L3, and carrying out lightweight design to reduce calculation and storage overhead. By combining an SCBAM attention mechanism, a VGG network and jump connection, an iterative up-down sampling block Nestedunet is constructed, the accuracy of cardiac function evaluation is improved, and a lighter and more efficient solution is provided for automatic auxiliary diagnosis in practical application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to an image processing method, and in particular to a left ventricle segmentation method based on optimized UNet and improved CBAM. Background Art

[0002] According to the World Health Organization, heart disease is one of the leading causes of death worldwide. Accurate and effective early diagnosis is of great significance for the treatment of heart disease and reducing mortality. The left ventricular ejection fraction (EF value) reflects hemodynamics and myocardial contractility. The lower the EF value, the more severe the ventricular remodeling and the worse the myocardial contractile function. If the EF value is not calculated accurately due to unclear echocardiographic images, it may delay the treatment of heart disease patients and even be fatal in many cases. Therefore, in current medical research, it is crucial to automatically and accurately evaluate the left ventricular ejection fraction. However, most of the existing automated left ventricular segmentation methods (the core step in calculating the EF value) rely on static images, and these methods usually require a lot of computing resources and a large model size, which limits their widespread application in actual clinical assistance.

[0003] A key challenge facing current medical decision-making support systems is the limitations of computational resources and model size in their practical clinical applications. Therefore, how to reduce the computational burden and model size while maintaining model accuracy has become a pressing issue in this field. This research not only enables precise segmentation of the left ventricle but also enables accurate and effective early diagnosis of heart disease.

[0004] In recent years, the Vision Transformer (ViT) has achieved some success in various computer vision tasks. However, Transformer-based models often suffer from high computational and memory overhead, slow inference speed, and demanding hardware, resources that may be difficult for some research institutions or companies to meet. Therefore, improving the accuracy of left ventricle segmentation while keeping the number of model parameters small is particularly important.

[0005] There are several main problems that need to be solved in left ventricular segmentation optimization technology:

[0006] 1) Most existing methods make limited use of image input pixels and contain a large amount of redundant information, and the fused attention mechanism does not improve performance enough;

[0007] 2) Segmentation techniques have high requirements for information integrity. When processing multi-scale features, some methods are often limited by inefficient feature fusion operations, resulting in information loss during feature extraction and fusion.

[0008] 3) The algorithm complexity is high and the real-time performance is poor. Summary of the Invention

[0009] The purpose of this paper is to provide a left ventricle segmentation method based on an optimized UNet network and an improved CBAM attention mechanism. By improving the UNet network and optimizing the CBAM attention mechanism, this paper enhances feature expression capabilities and implements a lightweight design to reduce computational and storage overhead. Therefore, more accurate and lightweight medical decision-making support systems are a new development trend.

[0010] The present invention is achieved through the following technical solutions:

[0011] In a first aspect, the present invention provides a left ventricle segmentation method and apparatus based on an optimized UNet network and an improved CBAM attention mechanism, specifically comprising the following steps:

[0012] S1 constructs a lightweight attention mechanism SCBAM; it integrates the CBAM attention mechanism and the lightweight attention mechanism SimAM, where CBAM contains a channel attention module (CAM) and a spatial attention module (SAM).

[0013] S2 builds a local convolutional VGG network; it contains two 3×3 convolutions, two BN (BatchNormalization) layers, two ReLU functions, and an SCBAM attention mechanism.

[0014] S3 optimizes the UNet network; by trimming the UNet network and performing a lightweight design, it reduces computing and storage overhead.

[0015] S4 constructs the Nestedunet module, which includes two VGG networks, a 2×2 max pooling layer, a 2×2 upsampling layer, and skip connections to construct iterative upsampling and downsampling blocks (Nestedunet module). Replace the convolutional layers in the pruned UNet network with the Nestedunet module, forming the improved UNet network (DA-UNet++ network).

[0016] As a preferred solution, step S1 specifically includes the following steps:

[0017] S1-1: Channel attention mechanism operation: CAM captures the relationship between channels through global average pooling and global maximum pooling, generates channel attention, and gives the input feature map The calculation process of global average pooling and global maximum pooling of the channel attention module is as shown in formulas (1) to (2).

[0018]

[0019] F max (c) = max i,j F(c,i,j) (2)

[0020] Where H and W represent the height and width of the feature map, F(c,i,j) represents the input feature map, and F avg is the global average pooling result, F max is the global maximum pooling result.

[0021] Shared network: pass these two descriptors through a shared multi-layer perceptron (MLP) to generate a channel attention map The calculation process is as shown in formula (3).

[0022] M c =σ(MLP(F avg )+MLP(F max )) (3)

[0023] Where σ is the Sigmoid activation function, and the MLP consists of two fully connected layers. The output dimension of the first fully connected layer is C / r (r is the reduction rate), and the output dimension of the second fully connected layer is C.

[0024] Attention weighting: Multiply the input feature map with the channel attention map. The calculation process is as shown in formula (4).

[0025] F″=M c ⊙F′ (4)

[0026] Among them, F′ is the input feature map, M c is the channel attention map, F″ is the weighted output feature map, and ⊙ represents element-by-element multiplication.

[0027] S1-2: The SimAM module calculates the attention weight by optimizing an energy function. The energy function is based on the spatial inhibition phenomenon in neuroscience and defines an energy function to measure the importance of each neuron. The calculation process is as shown in formula (5).

[0028]

[0029] Among them, μ and σ are the mean and variance of the channel respectively, λ is a hyperparameter, and t is a neuron.

[0030] S1-3: Calculate the importance weight of each neuron by solving the closed-form solution of the energy function. The calculation process is as shown in formula (6).

[0031]

[0032] Where d is the sum of squared deviations of the feature map, v is the channel variance, and λ is a hyperparameter.

[0033] S1-4: Use the attention weight to reweight the input feature map to obtain the output feature map. The calculation process is as shown in formula (7).

[0034] X att =X×σ(E inv ) (7)

[0035] Among them, σ is the Sigmoid function and X is the input feature map.

[0036] S1-5: Spatial Attention Mechanism Operation: The SAM module captures the relationship between spatial positions through global average pooling and global maximum pooling along the channel direction to generate a spatial attention map. Given an input feature map,

[0037] Global average pooling and global maximum pooling in the channel direction obtain two descriptors and The calculation process is as shown in formulas (8) to (9).

[0038]

[0039] F m ' ax (i,j)=max c F′(c,i,j) (9)

[0040] Where F′(c,i,j) represents the input feature map, C is the number of channels, and F a ' vg is the global average pooling result, F m ' ax is the global maximum pooling result.

[0041] S1-6: Connection and convolution operation: connect the two descriptors in the channel dimension and generate a spatial attention map through the convolution layer The calculation process is as shown in formula (10).

[0042] M s =σ(Conv([F′ avg ; F′ max ])) (10)

[0043] Among them, σ is the Sigmoid activation function, [;] represents the connection operation in the channel dimension, and Conv is a 7×7 convolutional layer.

[0044] S1-7: Attention weighting: Multiply the input feature map with the spatial attention map. The calculation process is as shown in formula (11).

[0045] F″=M s ⊙F′ (11)

[0046] Among them, F′ is the input feature map, M sis the spatial attention map, and F″ is the weighted output feature map.

[0047] S1-8: When the feature map enters the attention mechanism, it first passes through the CAM module, then the SimAM module, and then the SAM module.

[0048] As a preferred solution, step S2 specifically includes the following steps:

[0049] S2-1: The feature map is input to the VGG network, and the input image is convolved with 3×3 layers, passed through the BN layer, and then passed through the ReLU function;

[0050] S2-2: The image is then convolved with a 3×3 shape, passed through a batch normalization layer, and then passed through a ReLU function.

[0051] S2-3: The image is processed through the SCBAM attention mechanism to obtain a feature map, which is then output to the VGG network.

[0052] As a preferred solution, step S3 specifically includes the following steps:

[0053] S3-1: After the introduction of deep supervision, each network of UNet (L1, L2, L3, L4) can independently output segmentation results;

[0054] S3-2: By inputting the feature map into the network of different scales, DSC (DiceSimilarityCoefficient) and IoU (IntersectionoverUnion) are calculated because they can intuitively and effectively measure the quality of the segmentation results. It is concluded that the L3 network does not reduce the segmentation accuracy while reducing the network scale and reducing the computational and storage overhead. The calculation process is as shown in formulas (12) to (13).

[0055]

[0056] Where A is the predicted segmentation result and B is the true segmentation result. |A∩B| represents the number of elements in the intersection of the predicted result and the true result. |A∪B| represents the number of elements in the union of the predicted result and the true result.

[0057] S3-3: In the present invention, the L3 pruning effect is significantly better than that of the unpruned UNet and the network scale is significantly smaller than that of the traditional UNet network. Therefore, the present invention achieves accurate data segmentation based on L3 pruning.

[0058] As a preferred solution, step S4 specifically includes the following steps:

[0059] S4-1: The image feature F0 undergoes a 1×1 convolution to adjust the number of channels and retain the original information, and then passes through a 2×2 maximum pooling layer to halve the input dimension before entering the VGG network;

[0060] S4-2: The image is upsampled by 2×2 to obtain a feature map, which is then concatenated with the previously saved map in the channel dimension to obtain feature map F2.

[0061] S4-3: The F2 feature map is then convolved through a VGG network to restore the number of channel dimensions.

[0062] In a second aspect, the present invention provides a left ventricle segmentation device based on an optimized UNet network and an improved CBAM attention mechanism, comprising the following units:

[0063] 1) Optimize the unit and merge CBAM and SimAM into SCBAM;

[0064] 2) Construction unit, integrating SCBAM into the VGG module;

[0065] 3) The first combining unit (Nestedunet), which is used to combine the VGG module with up- and down-sampling and skip connections;

[0066] 4) Optimize the unit and optimize the UNet structure to the L3 subnet;

[0067] 5) The second combined unit (Nestedunet), replaces the internal convolution of the pruned UNet with the first combined unit (Nestedunet).

[0068] In a third aspect, the present invention provides an electronic device comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate through the bus, and when the machine-readable instructions are executed by the processor, the left ventricle segmentation method based on the optimized UNet network and the improved CBAM attention mechanism is executed.

[0069] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, executes a left ventricle segmentation method based on an optimized UNet network and an improved CBAM attention mechanism.

[0070] The advantages of the present invention are:

[0071] Current left ventricular segmentation results can be somewhat crude, and the model size is large, resulting in performance uncertainty. Therefore, we address these issues by constructing a left ventricular segmentation method based on an optimized Unified Network (UNet) network and an improved CBAM attention mechanism. Existing UNet models are often limited by inefficient feature fusion when processing multi-scale features, resulting in information loss during feature extraction and fusion. To address this, we designed an improved nested UNet architecture, introducing a deeper feature extraction module (Nestedunet block) to enhance feature representation and capture multi-scale features. Furthermore, considering that nested structures can increase computational and storage overhead, we pruned the UNet network to achieve a lightweight design. Further research revealed a significant amount of redundant information in the feature maps. To address this issue, improve computational efficiency, and enhance local information, we combined CBAM with a lightweight attention mechanism, SimAM. This improvement not only improves the accuracy of automated left ventricular segmentation but also provides a more lightweight and efficient solution for automated assisted diagnosis in practical applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.

[0073] Figure 1 Schematic diagram of the network model structure in the present invention;

[0074] Figure 2 This is the SCBAM diagram of the lightweight attention module of the present invention;

[0075] Figure 3 It is the UNet subnetwork graph structure;

[0076] Figure 4 VGG graph of the local convolution module fused with SCBAM in the present invention;

[0077] Figure 5 This is a nested UNet combination graph (Nestedunet block) that combines the VGG module with up- and down-sampling and skip connections. DETAILED DESCRIPTION

[0078] In order to more clearly understand the above-mentioned objects, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that, in the absence of conflict, the embodiments of the present application and the features therein can be combined with each other.

[0079] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the scope of protection of the present invention is not limited to the specific embodiments disclosed below.

[0080] Example 1

[0081] The following combination Figures 1 to 5 The present invention specifically describes a left ventricle segmentation method based on an optimized UNet network and an improved CBAM attention mechanism.

[0082] S1 builds a lightweight attention mechanism, SCBAM, and fuses the CBAM attention mechanism with the lightweight attention mechanism, SimAM. CBAM includes a channel attention module (CAM) and a spatial attention module (SAM). This fusion of SimAM and CBAM reduces parameter redundancy, improves computational efficiency, and enhances local information without increasing model size.

[0083] S2 constructs a local convolutional VGG network, which includes two 3×3 convolutions, two Batch Normalization (BN) layers, two ReLU functions, and an SCBAM attention mechanism. This VGG network enables the model to extract and retain more low-level edge information, reducing blur in the segmentation results and further improving accuracy.

[0084] S3 optimizes the UNet network; by pruning the UNet network, it achieves a lightweight design that reduces computational and storage overhead. Since each subnetwork (L1-L4) can independently output segmentation results, unnecessary parts can be pruned, significantly reducing the network size while maintaining accuracy and reducing computational and storage overhead.

[0085] S4 constructs the Nestedunet module, which includes two VGG networks, a 2×2 max pooling layer, a 2×2 upsampling layer, and skip connections to construct iterative upsampling and downsampling blocks (Nestedunet module). Replace the convolutional layers in the pruned UNet network with the Nestedunet module, forming the improved UNet network (DA-UNet++ network).

[0086] According to the left ventricle segmentation method based on the optimized UNet network and the improved CBAM attention mechanism according to claim 1, S1 includes the following specific processes:

[0087] S1-1: Channel attention mechanism operation: CAM captures the relationship between channels through global average pooling and global maximum pooling, generates channel attention, and gives the input feature map The calculation process of global average pooling and global maximum pooling of the channel attention module is as shown in formulas (1) to (2).

[0088]

[0089] F max (c) = max i,j F(c,i,j) (2)

[0090] Where H and W represent the height and width of the feature map, F(c,i,j) represents the input feature map, and F avg is the global average pooling result, F max is the global maximum pooling result.

[0091] Shared network: pass these two descriptors through a shared multi-layer perceptron (MLP) to generate a channel attention map The calculation process is as shown in formula (3).

[0092] M c =σ(MLP(F avg )+MLP(F max )) (3)

[0093] Where σ is the Sigmoid activation function, and the MLP consists of two fully connected layers. The output dimension of the first fully connected layer is C / r (r is the reduction rate), and the output dimension of the second fully connected layer is C.

[0094] Attention weighting: Multiply the input feature map with the channel attention map. The calculation process is as shown in formula (4).

[0095] F″=M c ⊙ F′ (4)

[0096] Among them, F′ is the input feature map, M c is the channel attention map, F″ is the weighted output feature map, and ⊙ represents element-by-element multiplication.

[0097] S1-2: The SimAM module calculates the attention weight by optimizing an energy function. The energy function is based on the spatial inhibition phenomenon in neuroscience and defines an energy function to measure the importance of each neuron. The calculation process is as shown in formula (5).

[0098]

[0099] Among them, μ and σ are the mean and variance of the channel respectively, λ is a hyperparameter, and t is a neuron.

[0100] S1-3: Calculate the importance weight of each neuron by solving the closed-form solution of the energy function. The calculation process is as shown in formula (6).

[0101]

[0102] Where d is the sum of squared deviations of the feature map, v is the channel variance, and λ is a hyperparameter.

[0103] S1-4: Use the attention weight to reweight the input feature map to obtain the output feature map. The calculation process is as shown in formula (7).

[0104] X att =X×σ(E inv ) (7)

[0105] Among them, σ is the Sigmoid function and X is the input feature map.

[0106] S1-5: Spatial Attention Mechanism Operation: The SAM module captures the relationship between spatial positions through global average pooling and global maximum pooling along the channel direction to generate a spatial attention map. Given an input feature map,

[0107] Global average pooling and global maximum pooling in the channel direction obtain two descriptors and The calculation process is as shown in formulas (8) to (9).

[0108]

[0109] F m ' ax (i,j)=max c F′(c,i,j) (9)

[0110] Where F′(c,i,j) represents the input feature map, C is the number of channels, and F a ' vg is the global average pooling result, F m ' ax is the global maximum pooling result.

[0111] S1-6: Connection and convolution operation: connect the two descriptors in the channel dimension and generate a spatial attention map through the convolution layer The calculation process is as shown in formula (10).

[0112] M s =σ(Conv([F′ avg ; F′ max ])) (10)

[0113] Among them, σ is the Sigmoid activation function, [;] represents the connection operation in the channel dimension, and Conv is a 7×7 convolutional layer.

[0114] S1-7: Attention weighting: Multiply the input feature map with the spatial attention map. The calculation process is as shown in formula (11).

[0115] F″=M s ⊙F′ (11)

[0116] Among them, F′ is the input feature map, M s is the spatial attention map, and F″ is the weighted output feature map.

[0117] S1-8: When the feature map enters the attention mechanism, it first passes through the CAM module, then the SimAM module, and then the SAM module.

[0118] According to the left ventricle segmentation method based on the optimized UNet network and the improved CBAM attention mechanism according to claim 1, S2 includes the following specific processes:

[0119] S2-1: The feature map is input to the VGG network, and the input image is convolved with 3×3 layers, passed through the BN layer, and then passed through the ReLU function;

[0120] S2-2: The image is then convolved with a 3×3 shape, passed through a batch normalization layer, and then passed through a ReLU function.

[0121] S2-3: The image is processed through the SCBAM attention mechanism to obtain a feature map, which is then output to the VGG network.

[0122] According to the left ventricle segmentation method based on the optimized UNet network and the improved CBAM attention mechanism according to claim 1, S3 includes the following specific processes:

[0123] S3-1: After the introduction of deep supervision, each network of UNet (L1, L2, L3, L4) can independently output segmentation results;

[0124] S3-2: By inputting the feature map into the network of different scales, DSC (DiceSimilarityCoefficient) and IoU (IntersectionoverUnion) are calculated because they can intuitively and effectively measure the quality of the segmentation results. It is concluded that the L3 network does not reduce the segmentation accuracy while reducing the network scale and reducing the computational and storage overhead. The calculation process is as shown in formulas (12) to (13).

[0125]

[0126] Where A is the predicted segmentation result and B is the true segmentation result. |A∩B| represents the number of elements in the intersection of the predicted result and the true result. |A∪B| represents the number of elements in the union of the predicted result and the true result.

[0127] S3-3: In the present invention, the L3 pruning effect is significantly better than that of the unpruned UNet and the network scale is significantly smaller than that of the traditional UNet network. Therefore, the present invention achieves accurate data segmentation based on L3 pruning.

[0128] According to the left ventricle segmentation method based on the optimized UNet network and the improved CBAM attention mechanism according to claim 1, S4 includes the following specific processes:

[0129] S4-1: The image feature F0 undergoes a 1×1 convolution to adjust the number of channels and retain the original information, and then passes through a 2×2 maximum pooling layer to halve the input dimension before entering the VGG network;

[0130] S4-2: The image is upsampled by 2×2 to obtain a feature map, which is then concatenated with the previously saved map in the channel dimension to obtain feature map F2.

[0131] S4-3: The F2 feature map is then convolved through a VGG network to restore the number of channel dimensions.

[0132] In this embodiment, the UNet structure uses dense skip connections, which not only transfer information between the encoder and decoder, but also between feature maps of the same resolution. The multi-scale feature fusion strategy in the decoder combines features from different levels, making the capture of image details and global information more accurate, thereby improving segmentation accuracy. During further optimization, we performed structural pruning on the UNet model. In particular, after introducing deep supervision, each sub-network (L1 to L4) can independently output segmentation results, which makes it possible to prune unnecessary parts, greatly reducing the network size and reducing computational and storage overhead. On this basis, we combined SCBAM, VGG, and skip connections to construct the iterative up- and down-sampling block Nestedunet to replace the convolution module of UNet. This forms a nested UNet structure. Through the nested design, the network can capture deeper feature expressions. First, a 1×1 convolution is performed on the input to adjust the number of channels and retain the original input information. Then, the spatial dimension of the input is halved through the maximum pooling layer, and the feature map is input into the first VGG module for two convolution operations. Next, upsampling is performed through transposed convolution to double the spatial dimension of the feature map, and the upsampled feature map is spliced ​​with the previously saved map in the channel dimension and input into the second VGG module again for two convolution operations. At the same time, the SCBAM module is introduced for optimization. Through multi-level pooling and upsampling operations, Nestedunet is able to combine feature maps of different scales to capture richer contextual information. This multi-scale feature fusion strategy improves the performance of the model in segmentation tasks, especially in the recognition of object edges and complex details. In addition, the introduction of the VGG module enables the model to extract and retain more low-level edge information, reduce the fuzzy areas in the segmentation results, and further improve the accuracy. The optimized model shows excellent performance in medical image segmentation tasks, not only improving the segmentation accuracy, but also significantly reducing the computational and storage overhead, providing the possibility for deployment in actual medical environments.

[0133] To validate the effectiveness of UNet's structural pruning and SCBAM, this paper conducted an ablation study on these approaches, comparing six models: Model A (using the SE attention mechanism), Model B (using the CBAM attention mechanism), Model C (using the ECA attention mechanism), Model D (using the SCBAM attention mechanism), Model E (UNet-L1 subnetwork), Model F (UNet-L2 subnetwork), Model G (UNet-L3 subnetwork), and Model H (UNet-L4 subnetwork). To eliminate the influence of other factors, all experiments were run in a PyTorch environment on an NVIDIA GeForce RTX 4090 Ti GPU. The learning rate was set to 1e-4, the batch size to 2, and the epoch length to 50. Among the four models, Model G's DSC and IoU results exceeded those of Models E, F, and H, validating the effectiveness of structural pruning. Model D's DSC exceeded those of Models A, B, and C, confirming the effectiveness of the SCBAM attention mechanism. The experimental comparison shows that UNet's structural pruning and SCBAM attention mechanism perform the best, as shown in Table 1.

[0134] Table 1 verifies the effectiveness of structure pruning and attention mechanism

[0135]

[0136]

[0137] To verify that the DA-UNet++ network can reduce parameter count while maintaining accuracy, we compared seven models (see Table 1 for comparison results): Reference Model A (Deeplab v3), Model B (Deeplab v3+), Model C (UNet++), Model D (UNet-L2 subnetwork), Model E (ResNet34), Model F (FCN), Model G (PSPNet), and Model H (DA-UNet++). To eliminate the influence of other factors, all experiments were run in the PyTorch environment on an NVIDIA GeForce RTX 4090 Ti GPU. The learning rate was set to 1e-4, the batch size to 2, and the number of epochs to 50. Among the eight models on the EchoNet-Dynamic dataset, Model H achieved the highest DSC result with only 5.96M parameters. The UNet-L2 subnetwork had the fewest parameters, but its DSC accuracy was lower. This demonstrates that the DA-UNet++ network can reduce parameter count while maintaining accuracy, making it suitable for deployment in real-world medical settings. This is shown in Table 2.

[0138] Table 2 Comparison results of different models

[0139] Model DSC IoU FLOPs Params Deeplabv3 0.9213 0.4507 41.07G 39.63M Deeplabv3+ 0.7879 0.3940 18.61G 41.81M Unet++ 0.9262 0.4613 34.76G 9.16M UNet-l2 0.9220 0.4602 10.52G 0.52M ResNet34 0.9215 0.4607 7.69G 24.21M FCN 0.9202 0.4601 34.75G 32.95M PSPNet 0.8480 0.4240 13.35G 46.58M DA-UNet++ 0.9313 0.4653 25.74G 5.96M

[0140] Example 2

[0141] The present invention provides a left ventricle segmentation device based on an optimized UNet network and an improved CBAM attention mechanism, comprising the following units:

[0142] 1) Optimize the unit and merge CBAM and SimAM into SCBAM;

[0143] 2) Construction unit, integrating SCBAM into the VGG module;

[0144] 3) The first combining unit (Nestedunet), which is used to combine the VGG module with up- and down-sampling and skip connections;

[0145] 4) Optimization unit, optimize the UNet structure to L3 pruning;

[0146] 5) The second combined unit (Nestedunet), replaces the internal convolution of the pruned UNet with the first combined unit (Nestedunet).

[0147] Example 3

[0148] The present invention provides an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the left ventricle segmentation method based on the optimized UNet network and the improved CBAM attention mechanism is executed.

[0149] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0150] Example 4

[0151] The present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, a left ventricle segmentation method based on an optimized UNet network and an improved CBAM attention mechanism is executed.

[0152] Storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store programs.

[0153] Finally, it should be emphasized that the above contents are only preferred embodiments of the present invention, which are intended to help better understand and implement the technical solutions of the present invention and do not constitute limitations on the present invention. Although we have described the present invention in detail through specific embodiments, professionals familiar with the technology in this field can still make appropriate modifications and adjustments to their technical solutions based on these embodiments, or make equivalent replacements for certain technical features. Any modification, replacement, optimization or improvement made without departing from the spirit and basic principles of the present invention should be deemed to fall within the scope of protection of the present invention. We encourage and expect technical personnel in related fields to further develop and improve the present invention according to specific application requirements, in order to promote progress and innovation in this technical field.

Claims

1. A left ventricle segmentation method based on optimized UNet network and improved CBAM attention mechanism, characterized in that: The method comprises the following steps: S1: Construct a lightweight attention mechanism SCBAM; integrate the CBAM attention mechanism and the lightweight attention mechanism SimAM, where CBAM contains a channel attention module (CAM) and a spatial attention module (SAM); S2: Build a local convolutional VGG network; it contains two 3×3 convolutions, two BN (BatchNormalization) layers, two ReLU functions, and an SCBAM attention mechanism; S3: Optimize the UNet network; reduce computing and storage overhead by trimming the UNet network for lightweight design; S4: Construct the Nestedunet module; it contains 2 VGG networks, 2×2 maximum pooling layers and 2×2 upsampling, and skip connections to construct iterative upsampling and downsampling blocks (Nestedunet module); replace the convolutional layers in the pruned UNet network with the Nestedunet module; form the improved UNet network (DA-UNet++ network).

2. According to claim 1, a left ventricle segmentation method based on optimized UNet network and improved CBAM attention mechanism is characterized in that: The step S1 specifically includes the following steps: S1-1: Channel attention mechanism operation: CAM captures the relationship between channels through global average pooling and global maximum pooling, generates channel attention, and gives a given input feature map The calculation process of global average pooling and global maximum pooling of the channel attention module is as shown in formulas (1) to (2). F max (c)=max i,j F(c,i,j) (2) Where H and W represent the height and width of the feature map, F(c,i,j) represents the input feature map, and F avg is the global average pooling result, F max is the global maximum pooling result; Shared network: pass these two descriptors through a shared multi-layer perceptron (MLP) to generate a channel attention map The calculation process is as shown in formula (3). M c =σ(MLP(F avg )+MLP(F max )) (3) Where σ is the Sigmoid activation function, and the MLP consists of two fully connected layers. The output dimension of the first fully connected layer is C / r (r is the reduction rate), and the output dimension of the second fully connected layer is C; Attention weighting: Multiply the input feature map with the channel attention map. The calculation process is as shown in formula (4). F″=M c v F′ (4) Among them, F′ is the input feature map, M c is the channel attention map, F″ is the weighted output feature map, and ⊙ represents element-by-element multiplication; S1-2: The SimAM module calculates the attention weight by optimizing an energy function. The energy function is based on the spatial inhibition phenomenon in neuroscience and defines an energy function to measure the importance of each neuron. The calculation process is shown in formula (5). Among them, μ and σ are the mean and variance of the channel respectively, λ is a hyperparameter, and t is a neuron; S1-3: Calculate the importance weight of each neuron by solving the closed-form solution of the energy function. The calculation process is as shown in formula (6). Where d is the sum of squared deviations of the feature map, v is the channel variance, and λ is a hyperparameter; S1-4: Use the attention weight to reweight the input feature map to obtain the output feature map. The calculation process is as shown in formula (7), X att =X×σ(E inv ) (7) Among them, σ is the Sigmoid function, X is the input feature map; S1-5: Spatial attention mechanism operation: The SAM module captures the relationship between spatial positions through global average pooling and global maximum pooling along the channel direction to generate a spatial attention map; given an input feature map, Global average pooling and global maximum pooling in the channel direction obtain two descriptors and The calculation process is as shown in formulas (8) to (9). F m ′ ax (i,j)=max c F′(c,i,j) (9) Where F′(c,i,j) represents the input feature map, C is the number of channels, and F a ' vg is the global average pooling result, F m ' ax is the global maximum pooling result; S1-6: Connection and convolution operation: connect the two descriptors in the channel dimension and generate a spatial attention map through the convolution layer The calculation process is as shown in formula (10). M s =σ(Conv([F a ′ vg ;F′ max ])) (10) Among them, σ is the Sigmoid activation function, [;] represents the connection operation in the channel dimension, and Conv is a 7×7 convolution layer; S1-7: Attention weighting: Multiply the input feature map with the spatial attention map. The calculation process is as shown in formula (11). F″=M s ⊙F′ (11) Among them, F′ is the input feature map, M s is the spatial attention map, and F″ is the weighted output feature map; S1-8: When entering the attention mechanism, the feature map first passes through the CAM module, then the SimAM module, and then the SAM module.

3. According to claim 1, a left ventricle segmentation method based on optimized UNet network and improved CBAM attention mechanism is characterized in that: The step S2 specifically includes the following steps: S2-1: The feature map is input to the VGG network, and the input image is convolved by 3×3, passed through the BN layer and then the ReLU function; S2-2: The image is then convolved with 3×3 layers, passed through a BN layer, and then passed through a ReLU function; S2-3: The image is processed through the SCBAM attention mechanism to obtain a feature map, which is then output to the VGG network.

4. According to claim 1, a left ventricle segmentation method based on optimized UNet network and improved CBAM attention mechanism is characterized in that: The step S3 specifically includes the following steps: S3-1: After the introduction of deep supervision, each network of UNet (L1, L2, L3, L4) can independently output segmentation results; S3-2: The feature maps are input into networks of different sizes to calculate DSC (Dice Similarity Coefficient) and IoU (Intersection over Union), because they can intuitively and effectively measure the quality of the segmentation results. It is found that the L3 network does not reduce the segmentation accuracy while reducing the network size, computing and storage overhead. The calculation process is as shown in formulas (12) to (13). Among them: A is the predicted segmentation result and B is the actual segmentation result; |A∩B| represents the number of elements in the intersection of the predicted result and the actual result; |A∪B| represents the number of elements in the union of the predicted result and the actual result; S3-3: The L3 pruning effect is significantly better than the unpruned UNet and the network scale is significantly smaller than the traditional UNet network. Therefore, accurate data segmentation is achieved based on L3 pruning.

5. According to claim 1, a left ventricle segmentation method based on optimized UNet network and improved CBAM attention mechanism is characterized in that: The step 4 includes the following specific processes: S4-1: The image feature F0 is processed by a 1×1 convolution to adjust the number of channels and retain the original information. Then, the input dimension is halved through a 2×2 maximum pooling layer before entering the VGG network. S4-2: The image is upsampled by 2×2 to obtain a feature map, which is concatenated with the previously saved mapping in the channel dimension to obtain feature map F2; S4-3: The F2 feature map is then convolved through a VGG network to restore the number of channel dimensions.

6. A left ventricle segmentation method based on optimized UNet network and improved CBAM attention mechanism according to claim 1, characterized in that: The method includes a left ventricle segmentation device based on an optimized UNet network and an improved CBAM attention mechanism as follows: Optimize the unit and merge CBAM and SimAM into SCBAM; Building unit, integrating SCBAM into VGG module; The first combining unit (Nestedunet) is used to combine the VGG module with up- and down-sampling and skip connections; Optimization unit, optimizes the UNet structure to L3 pruning; The second combined unit (Nestedunet), replaces the internal convolution of the pruned UNet with the first combined unit (Nestedunet); Its electronic equipment includes: processor, memory, bus, and computer.

7. A left ventricle segmentation method based on optimized UNet network and improved CBAM attention mechanism according to claim 6, characterized in that: The memory stores machine-readable instructions executed by the processor. When the electronic device is running, the processor and the memory communicate through a bus. When the machine-readable instructions are executed by the processor, left ventricle segmentation based on the optimized UNet network and the improved CBAM attention mechanism is performed.

8. According to claim 6, a left ventricle segmentation method based on optimized UNet network and improved CBAM attention mechanism is characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, performs left ventricle segmentation based on an optimized UNet network and an improved CBAM attention mechanism.