Left ventricular segmentation method and system in cardiac echocardiography video
By constructing a left ventricular video segmentation network, combining Transformer encoding and the foreground focusing adaptive attention mechanism of CNN branches with a spatiotemporal memory, the problems of high annotation cost, unstable boundaries, and noise interference in left ventricular segmentation of echocardiogram videos are solved. Stable and accurate segmentation is achieved in complex environments, which has significant technological advancements and clinical application value.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTHWEST UNIV
- Filing Date
- 2026-02-13
- Publication Date
- 2026-04-21
AI Technical Summary
Existing left ventricular segmentation techniques for echocardiography videos suffer from problems such as high manual annotation costs, unstable segmentation of weak boundary regions, severe ultrasound speckle noise interference, drastic morphological changes during the cardiac cycle, and insufficient video temporal consistency.
A left ventricular video segmentation network is adopted, which includes a backbone, a CNN branch, and a memory and refinement module. The backbone includes a downsampling layer, a Transformer encoder block, a cue encoder, and a mask decoder. The CNN branch includes a pre-block, an attention module, and a CNN module. The memory and refinement module includes a memory bank, a weighted aggregation module, and a memory reconstruction module. By introducing a foreground focusing adaptive attention mechanism and a spatiotemporal memory bank mechanism, combined with wavelet transform, stable, continuous, and high-precision segmentation of the left ventricular region is achieved.
It significantly improves the model's structural response capability, noise robustness, and temporal consistency in weak boundary regions, reduces the cost of manual annotation, enables stable and accurate left ventricular segmentation in complex clinical environments, and has stronger cross-scenario generalization ability.
Smart Images

Figure CN121725406B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer vision technology, and in particular to a method and system for left ventricular segmentation in echocardiography video. Background Technology
[0002] Echocardiography, due to its advantages of being non-invasive, real-time, low-cost, and bedside-accessible, has become one of the main imaging methods for clinical assessment of cardiac structure and function. Left ventricular ejection fraction (LVEF) is an important quantitative indicator reflecting left ventricular systolic function and is widely used in the diagnosis, classification, and efficacy evaluation of various cardiovascular diseases, including heart failure, cardiomyopathy, coronary artery disease, and valvular heart disease. Clinically, the calculation of LVEF usually relies on the contour drawing and volume estimation of the left ventricle at end-diastole and end-systole, such as using the Simpson two-plane method or methods based on area-length models. Therefore, the accuracy and stability of left ventricular segmentation directly affect the reliability of ejection fraction measurement results.
[0003] However, due to limitations in ultrasound imaging mechanisms and acquisition environments, echocardiographic videos generally suffer from problems such as strong speckle noise, low contrast between the myocardium and blood pool, blurred tissue boundaries, and artifact interference. This is particularly true in the apex, interventricular septum, and near the papillary muscles, where the left ventricle exhibits a distinctly weak boundary characteristic, posing a significant challenge to accurate segmentation. Furthermore, the left ventricle undergoes significant morphological changes and spatial displacement throughout a complete cardiac cycle, and individual differences and pathological characteristics among patients further increase the complexity of the video segmentation task.
[0004] Existing automatic left ventricular segmentation methods mainly include those based on traditional image processing and those based on deep learning. Traditional methods typically rely on manually designed edge features, shape priors, or model assumptions, making them sensitive to noise and deformation, and exhibiting limited robustness. While deep learning-based methods have made some progress in static ultrasound image segmentation, most focus on single-frame modeling, making it difficult to fully utilize temporal information within the cardiac cycle. This leads to segmentation discontinuities or instability in weak boundary regions and intermediate frames. In recent years, some studies have attempted to introduce temporal modeling, optical flow constraints, or memory mechanisms to improve video segmentation consistency, but these still generally rely on large amounts of precisely labeled data and have shortcomings in noise accumulation and error propagation, affecting the model's generalization ability in real-world clinical scenarios. Summary of the Invention
[0005] This invention provides a method and system for left ventricular segmentation in echocardiography videos, addressing the following technical problems: existing left ventricular segmentation techniques in echocardiography videos suffer from high manual annotation costs, unstable segmentation of weak boundary regions, severe ultrasound speckle noise interference, drastic morphological changes during the cardiac cycle, and insufficient consistency in video temporal sequence.
[0006] To address the above technical problems, this invention provides a method for left ventricular segmentation in echocardiography video, comprising the following steps:
[0007] Collect and preprocess echocardiogram video sequences to construct a video dataset;
[0008] The video sequences in the video dataset are subjected to data augmentation processing, and then divided into training set, validation set and test set.
[0009] Construct a left ventricular video segmentation network;
[0010] The constructed left ventricular video segmentation network is trained end-to-end using the training set and optimized using the validation set to obtain the left ventricular video segmentation model.
[0011] The test set or the cardiac ultrasound video to be segmented is input into the left ventricular video segmentation model, and the frame-by-frame segmentation results of the left ventricle are output.
[0012] Furthermore, the left ventricular video segmentation network includes a backbone, a CNN branch, and a memory and refinement module; the backbone includes a downsampling layer, a Transformer encoder block, a cue encoder, and a mask decoder; the CNN branch includes a pre-block, an attention module, and a CNN module; the memory and refinement module includes a memory bank, a weighted aggregation module, and a memory reconstruction module.
[0013] The input frame at the current moment is downsampled by the downsampling layer and then image-based encoding is performed by the Transformer encoding block to extract image embedding features;
[0014] The input frame at the current moment is processed by the preceding block for preceding feature extraction, then by the attention module for extraction and incorporation of attention, and finally by the CNN module for final feature extraction to obtain CNN local features;
[0015] The memory bank stores the structural information of historical frames in a key-value format;
[0016] The input frame at the current moment that is not the first frame is downsampled by the downsampling layer of the backbone and then projected to obtain the query feature Query.
[0017] The weighted aggregation module performs similarity matching between the query feature Query and the historical Key in the memory to obtain similarity weights, and performs weighted aggregation on the historical Values according to the similarity weights to obtain cross-frame memory prompt features input to the mask decoder;
[0018] The prompt encoder is used to receive external prompts in the first frame and encode them as prompt embeddings;
[0019] For the first frame, the mask decoder fuses the corresponding image embedding features, the CNN local features, and the cue embedding to output the corresponding left ventricular segmentation probability map; for non-first frames, the mask decoder fuses the corresponding image embedding features, the CNN local features, and the cross-frame memory cue features to output the corresponding left ventricular segmentation probability map.
[0020] The memory reconstruction module performs memory reconstruction on the left ventricular segmentation probability map output by the mask decoder through wavelet transform to obtain reconstruction features, which are then input into the memory bank. The memory bank generates and stores historical frames in key-value format based on the reconstruction features.
[0021] Furthermore, in the CNN branch, the input of the attention module is to extract shape-aware attention facing the left ventricular foreground region through the foreground focusing adaptive module. The extracted shape-aware attention is then batch-normalized and input into the multilayer perceptron. Finally, the output of the multilayer perceptron is added to the input of the attention module to obtain the attention fusion feature input to the CNN module.
[0022] The operation performed by the foreground focusing adaptive module is as follows:
[0023] Global average pooling is performed on the input features along the horizontal and vertical directions, and then broadcast and summed to obtain the directional context features;
[0024] Two-stage asymmetric depth convolution is used to perform shape-aware attention calibration on directional context features to highlight the foreground region of the left ventricle and generate a spatial attention weight map.
[0025] The input features are recalibrated using an attention weight map and residual fusion is employed to output shape-aware attention.
[0026] Furthermore, spatial attention weight map , For directional context features, and These represent the kernel size as follows: and Depth convolution, This represents batch normalization and nonlinear activation. For the Sigmoid function; shape-aware attention , Indicates input features, For the size of the kernel Depth convolution, For element-wise multiplication, This is a feature refinement function that includes normalization and channel multilayer perceptron.
[0027] Furthermore, the CNN module includes a CNN block and a cross-branch interaction module; the CNN block is composed of multiple cascaded convolutional layers, used to propagate and structurally enhance the output features of the attention module layer by layer, and finally outputs local CNN features; the cross-branch interaction module is composed of multiple cascaded ParaBlocks, the first... The ParaBlock layer is used for the first CNN block. Convolutional features output by the layer and Transformer coding block Image embedding features output by the layer After performing a synchronized update, the result is obtained , Input the next layer of the CNN block and the next layer of the Transformer encoding block respectively.
[0028] Furthermore, the operation of the memory reconstruction module includes:
[0029] Perform multi-scale wavelet transform decomposition on the probability map or mask map predicted in the current frame to obtain a low-frequency approximate component and a high-frequency detail component.
[0030] High-frequency detail components are selected to enhance edge and texture structure information, and the enhanced multi-scale representation is fused with the image embedding of the current frame to generate reconstructed features that are input into the memory bank.
[0031] The memory uses the query feature corresponding to the current frame as the key, and performs feature concatenation or incremental fusion operation between the reconstructed feature of the current frame and the value of the previous frame to obtain the value of the current frame, storing the structural information of the current frame in key-value format.
[0032] Furthermore, the enhanced multi-scale representation is fused with the image embedding of the current frame to generate reconstructed features for writing into the memory bank, specifically including:
[0033] Refined mask embedding is constructed based on high-frequency detail components. and embed with the current image Fusion to generate attention weights , This represents a 3×3 convolution. Represents a 1×1 convolution. Indicates channel splicing;
[0034] Attention weights After performing Softmax normalization, the refined mask is embedded. Modulation is performed to obtain refined output characteristics. , This is element-wise multiplication.
[0035] Furthermore, the acquired echocardiogram video sequences are preprocessed, including resampling, size normalization, illumination characteristic normalization, invalid region cropping, frame sequence consistency correction, and tag quality check.
[0036] Invalid region cropping refers to removing invalid information around a video using morphological edge cropping techniques, as well as threshold-based soft cropping of backgrounds in frames that do not belong to the main heart area.
[0037] Frame sequence consistency correction includes: reading the key phase identifier information of the cardiac cycle corresponding to the video sequence, and judging whether the time direction of the video sequence is consistent based on the key phase identifier information; when the key phase order is detected to be inconsistent with the preset order, the video sequence and its corresponding frame-by-frame labeled sequence are flipped or rearranged in the time dimension so that the video sequence meets the uniform cardiac stage evolution direction in the time dimension, and the key phase includes at least end-diastole and end-systole.
[0038] Data augmentation processing is performed on video sequences in the video dataset, including one or more of the following: random rotation, scale perturbation, gamma transformation, brightness perturbation, background perturbation, and temporal perturbation.
[0039] Furthermore, during the model training phase, the data-augmented ultrasound video sequence and its corresponding first and last frame annotations are input into the constructed left ventricular video segmentation network for training. During training, a weighted combination of binary cross-entropy loss and Dice loss is used. The model training adopts the AdamW optimization strategy, combined with cosine annealing learning rate scheduling, and keeps the parameters of the backbone frozen during training, only updating the trainable parameters of the CNN branches and memory and refinement modules.
[0040] The present invention also provides a left ventricular segmentation system for cardiac echocardiography video, which is based on the aforementioned left ventricular segmentation method for cardiac echocardiography video. Its key features are: including a data acquisition unit, a data enhancement unit, a network construction unit, a network training unit, and a network application unit.
[0041] The data acquisition unit is used to acquire cardiac echocardiogram video sequences and perform preprocessing to construct a video dataset;
[0042] The data augmentation unit is used to perform data augmentation processing on the video sequences of the video dataset, and then divides them into training set, validation set and test set.
[0043] The network construction unit is used to construct a left ventricular video segmentation network;
[0044] The network training unit is used to perform end-to-end training of the constructed left ventricular video segmentation network using the training set, and to optimize it using the validation set to obtain a left ventricular video segmentation model.
[0045] The network application unit is used to input the test set or the cardiac ultrasound video to be segmented into the left ventricular video segmentation model and output the frame-by-frame segmentation results of the left ventricular video.
[0046] This invention provides a method and system for left ventricular segmentation in echocardiography videos. A left ventricular video segmentation network is designed, comprising a backbone, CNN branches, and a memory and refinement module. The backbone includes downsampling layers, Transformer coding blocks, cue encoders, and mask decoders, where the downsampling layers, Transformer coding blocks, and CNN branches together constitute the image encoder. To enhance the representation of weak ultrasound boundaries and local structures, this invention sets up learnable CNN branches in parallel as bypasses to the Transformer-based backbone. The CNN branches include pre-blocks (for extracting spatially continuous local texture features), an attention module introducing a foreground focusing adaptive attention mechanism, a CNN module, and a cross-branch interaction module (CBA). The memory and refinement module includes a memory bank, a weighted aggregation module, and a memory reconstruction module (emphasizing a wavelet transform-based memory reconstruction strategy). This segmentation network enhances the structural response of the weak boundary region of the left ventricle by introducing a foreground-focusing adaptive attention mechanism, and refines the temporal memory features at multiple scales using a memory reconstruction strategy (based on wavelet transform). This achieves stable, continuous, and high-precision segmentation of the left ventricular region throughout the entire cardiac cycle with minimal manual annotation. Compared with existing echocardiographic video segmentation techniques, the advantages of this invention are:
[0047] 1. Significant improvements have been achieved in model structure design, weak supervision adaptability, temporal consistency maintenance, and noise robustness. First, the feature encoding method of the main backbone of this invention can effectively utilize the powerful generalization ability of the pre-trained model, enabling the model to maintain stable feature extraction capabilities under different devices, patients, and imaging conditions, significantly outperforming the performance of traditional convolutional networks in cross-domain environments. Second, the foreground focusing adaptive module utilizes directional spatial attention and saliency enhancement strategies to re-enhance the blurred boundaries of the left ventricle, thereby improving the problems of unclear contours and insufficient contrast commonly found in ultrasound images and enhancing the model's structural response to weak boundary regions. This module can still achieve stable foreground focusing effects under conditions of strong noise and artifacts, which is difficult to achieve with existing methods based solely on convolution or Transformers.
[0048] 2. The spatiotemporal memory mechanism proposed in this invention establishes robust cross-frame structural connections between historical frames and subsequent frames, enabling the model to fully utilize historical information to guide the prediction of the current frame. This fundamentally improves common problems in ultrasound video segmentation such as jumps, jitter, and shape discontinuities. Traditional methods often rely solely on single-frame features or short-term neighborhood information, while this invention, through key-value matching and similarity retrieval mechanisms, ensures that the left ventricular structure maintains consistent morphological constraints throughout the entire cardiac cycle, thereby significantly improving sequence-level stability. Furthermore, this invention incorporates a wavelet transform-based memory reconstruction module. By performing multi-scale decomposition and reconstruction of the prediction results in the wavelet domain, it effectively filters out erroneous responses caused by speckle noise and random artifacts, making the structural information written into the memory bank more reliable and thus improving the overall quality of memory-guided prediction.
[0049] 3. The segmentation inference process of this invention relies solely on a lightweight cue from the first frame of the video to automatically segment the entire echocardiogram sequence, achieving accurate prediction of the left ventricular structure throughout the cardiac cycle. This feature significantly reduces the cost of manual annotation, enabling the model to maintain excellent performance even under weak supervision. In summary, the ultrasound video segmentation method proposed in this invention, based on adaptive attention and memory refinement mechanisms, possesses stronger boundary recovery capabilities, higher noise resistance, better temporal consistency, and better cross-scenario generalization ability. It can achieve stable, accurate, and continuous left ventricular segmentation results in complex clinical ultrasound environments, demonstrating significant technological advancements and extremely high clinical application value. Attached Figure Description
[0050] Figure 1 This is a flowchart of the left ventricular segmentation method for cardiac echocardiography video provided in an embodiment of the present invention;
[0051] Figure 2 This is an architecture diagram of the left ventricular video segmentation network provided in an embodiment of the present invention;
[0052] Figure 3 This is an architecture diagram of the foreground focusing adaptive module provided in an embodiment of the present invention;
[0053] Figure 4 This is an architecture diagram of the wavelet transform-based memory reconstruction module provided in an embodiment of the present invention;
[0054] Figure 5 This is an example of left ventricular segmentation on the CAMUS dataset provided by an embodiment of the present invention. Figure 5 (a) shows the visualization results of the UNet prediction mask. Figure 5 (b) shows the visualization results of the predicted mask from SAMUS. Figure 5 (c) shows the visualization results of the prediction mask from MemSAM. Figure 5(d) shows the visualization result of the prediction mask of the left ventricular video segmentation network generated by this invention;
[0055] Figure 6 A comparison chart of various methods and error ranges for calculating left ventricular ejection fraction on the CAMUS dataset provided in this embodiment of the invention;
[0056] Figure 7 A comparison chart of other methods for calculating left ventricular ejection fraction on the CAMUS dataset provided in this embodiment of the invention with the present method;
[0057] Figure 8 A bubble chart showing the correlation of left ventricular ejection fraction calculation results on the CAMUS dataset provided in this embodiment of the invention. Detailed Implementation
[0058] The embodiments of the present invention are described in detail below with reference to the accompanying drawings. The embodiments are given for illustrative purposes only and should not be construed as limiting the present invention. The accompanying drawings are for reference and illustration only and do not constitute a limitation on the scope of patent protection of the present invention, because many changes can be made to the present invention without departing from the spirit and scope of the present invention.
[0059] The method for left ventricular segmentation in echocardiography video provided in this embodiment of the invention, such as... Figure 1 The flowchart shown includes the following steps:
[0060] S1. Acquire cardiac echocardiogram video sequences and preprocess them to construct a video dataset;
[0061] S2. Perform data augmentation on the video sequences in the video dataset, and then divide them into training set, validation set and test set;
[0062] S3. Construct a left ventricular video segmentation network;
[0063] S4. The constructed left ventricular video segmentation network is trained end-to-end using the training set and optimized using the validation set to obtain the left ventricular video segmentation model.
[0064] S5. Input the test set or the cardiac ultrasound video to be segmented into the left ventricular video segmentation model, and output the frame-by-frame segmentation results of the left ventricle.
[0065] The following provides a more detailed explanation of each step.
[0066] (1) Step S1
[0067] In step S1, a large number of echocardiogram sequences are first acquired from publicly available datasets such as the EchoNet-Dynamic dataset and the CAMUS dataset, supplemented by data collected in real clinical environments, to construct a video sample library with sufficient diversity and realistic imaging characteristics. These sequences cover different probe angles, different types of instrument brands, different patient body types, and various scanning conditions, enabling the model to adapt to ultrasound scenarios in multiple fields, multiple centers, and multiple devices. The acquired data all exhibit typical ultrasound features such as varying degrees of noise contamination, speckle artifacts, and blurred boundaries; therefore, this invention particularly emphasizes the diversity of its training data. In terms of annotation, this invention follows the standard annotation method for left ventricular motion images in clinical ultrasound analysis, providing accurate segmentation masks only for the end-diastolic (ED) and end-systolic (ES) frames of each cardiac cycle. The remaining frames do not require manual annotation, thus completing the full-cycle prediction requirement of a video sequence at extremely low annotation cost. Since the ED and ES frames can represent the deformation extreme points of the entire cardiac cycle, they are particularly suitable as anchor points for weak supervision, providing a reliable structural reference for subsequent video-level segmentation tasks.
[0068] For the acquired video sequences, preprocessing is required, including resampling, size normalization, illumination characteristic normalization, invalid region cropping, frame sequence consistency correction, and label quality checking. Size normalization refers to scaling all frames to a uniform spatial resolution. Illumination characteristic normalization refers to normalizing brightness, grayscale distribution, and contrast to ensure that videos captured by different devices have uniform illumination characteristics. Invalid region cropping refers to removing invalid information such as black borders, text, and measurement lines around the video using morphological edge cropping techniques, and performing threshold-based soft cropping of backgrounds that do not belong to the main cardiac region in the frames to reduce interference from useless areas. Frame sequence consistency correction includes: reading the key phase identifier information of the cardiac cycle corresponding to the video sequence, determining whether the temporal direction of the video sequence is consistent based on the key phase identifier; when a key phase order is detected to be inconsistent with the preset order, the video sequence and its corresponding frame-by-frame labeled sequence are flipped or rearranged in the temporal dimension to ensure that the video sequence meets a uniform cardiac stage evolution direction in the temporal dimension; the key phases include at least end-diastolic (ED) and end-systolic (ES).
[0069] (2) Step S2
[0070] To enhance the model's adaptability to complex deformations in real-world scenarios, this invention performs various data augmentation processes on the video dataset, including but not limited to random rotation, scale perturbation, gamma transformation, brightness perturbation, background perturbation, and temporal perturbation. Specifically, random rotation simulates different viewing angles, scale perturbation simulates scaling changes caused by probe movement, gamma transformation simulates changes in light intensity, brightness perturbation simulates reflection changes under different skin textures or depths of penetration, CutMix enhances the model's robustness to different structural backgrounds, and temporal perturbation simulates situations where sudden increases in inter-frame differences occur due to the movement of the machine's probe at different depths.
[0071] The enhanced data is not only more complex, but also more faithfully reflects sudden structural changes, speckle changes, and non-uniform changes in the cardiac cycle in real clinical practice, giving the model stronger generalization ability and cross-domain stability.
[0072] (3) Step S3
[0073] The left ventricular video segmentation network constructed in this invention is as follows: Figure 2 As shown, the system includes a backbone, CNN branches, and a memory and refinement module. The backbone comprises downsampling layers, Transformer encoder blocks, cue encoders, and mask decoders, where the downsampling layers, Transformer encoder blocks, and CNN branches together constitute the image encoder. To enhance the representation of weak ultrasound boundaries and local structures, this invention sets up learnable CNN branches in parallel as bypasses of the Transformer-based backbone. The CNN branches include pre-blocks, attention modules, and CNN modules. The memory and refinement module includes a memory bank, a weighted aggregation module, and a memory reconstruction module.
[0074] The input frame at the current time ( After being downsampled by the downsampling layer, the image is input into the Transformer encoding block for global semantic feature extraction, thus obtaining the image embedding features.
[0075] The input frame at the current time ( After local texture features are extracted by the pre-block, they are enhanced for saliency by the attention module and further input into the CNN module for structural refinement, thereby obtaining CNN local features;
[0076] The memory bank stores historical frames in key-value format. t-1 ,frame t-2 ...) structural information;
[0077] The input frame at the current moment that is not the first frame (frame) t The query feature Query is obtained by downsampling the data through the main downsampling layer and then projecting it onto the main layer.
[0078] The weighted aggregation module performs similarity matching between the query feature Query and the historical Key in the memory to obtain similarity weights; and performs weighted aggregation on the historical Values according to the similarity weights to obtain the cross-frame memory cue feature input mask decoder; the cue encoder is used to receive external cues (such as single-point cues) in the first frame and encode them as cue embeddings;
[0079] For the first frame, the mask decoder fuses the CNN local features, image embedding features, and cue embeddings to output the corresponding left ventricular segmentation probability map; for non-first frames, the mask decoder fuses the CNN local features, image embedding features, and cross-frame memory cue features to output the corresponding left ventricular segmentation probability map.
[0080] The memory reconstruction module performs memory reconstruction on the left ventricular segmentation probability map output by the mask decoder through wavelet transform to obtain reconstruction features, and then fuses the reconstruction features with the image embedding to obtain refined output features as historical frames and writes them into the memory bank.
[0081] The external cue is only present in the first frame, meaning the cue encoder only generates the cue embedding for the first frame, and then writes the cue into the memory bank through the memory reconstruction module.
[0082] To adapt to small-sample medical scenarios, this invention can freeze the parameters of the backbone and only update the CNN branches (FFA, memory components, and decoder-related trainable parts) to reduce the risk of overfitting and improve parameter efficiency.
[0083] like Figure 2 As shown, in the CNN branch, the pre-processor block includes one first convolutional block and three second convolutional blocks. The first convolutional block includes a 3x3 convolution, layer normalization (LN), and the GELU activation function. The second convolutional blocks include max pooling (MaxPool), layer normalization (LN), and the GELU activation function, used to extract local texture structure features with spatial continuity. The input to the attention module is processed by the foreground focusing adaptive module (FFA) to extract shape-aware attention facing the left ventricular foreground region. The extracted shape-aware attention is further processed by batch normalization (BN) before being input to the multilayer perceptron. Finally, the output of the multilayer perceptron is added to the input of the attention module to obtain the attention fusion feature input to the CNN module.
[0084] The structure of the Foreground Focus Adaptive Module (FFA) is as follows: Figure 3 As shown, let the input features of this module be... FFA first performs orientation context encoding, then performs global average pooling on the features along the horizontal and vertical directions, and finally broadcasts and sums them to obtain the orientation context features. :
[0085] ,
[0086] in, and These represent global average pooling operations along the horizontal and vertical axes, respectively. This indicates the sum of broadcasts.
[0087] Subsequently, a two-stage asymmetric depthwise convolution is used to perform shape-aware attention calibration on the orientation context features to highlight the foreground region of the left ventricle, generating a spatial attention weight map. :
[0088] ,
[0089] in, and These represent the kernel size as follows: and Depth convolution; This represents batch normalization and nonlinear activation; This is the Sigmoid function.
[0090] Finally, the input feature X is recalibrated using the attention weight map A and residual fusion is employed to improve the significant response of the weak boundary region of the left ventricle and alleviate boundary blurring. The final output is a shape-aware attention function. :
[0091] ,
[0092] in, For the size of the kernel Depth convolution, For element-wise multiplication, This is a feature refinement function that includes normalization and channel MLP.
[0093] FFA adopts, for example Figure 3 The structure shown can dynamically highlight the left ventricular foreground region while preserving the original contextual information, enhancing weak boundary response and improving fine-grained structure segmentation capabilities.
[0094] In a preferred embodiment, the CNN module includes a CNN block and a cross-branch interaction module (CBA). The CNN block is composed of multiple cascaded convolutional layers, used to propagate and structurally enhance the output features of the attention module layer by layer, and finally outputs the local CNN features. The cross-branch interaction module consists of multiple ParaBlocks at a preset depth. Cascaded configuration, the first The ParaBlock layer is used for the first CNN block. Convolutional features output by the layer and Transformer coding block Image embedding features output by the layer After performing a synchronized update, the result is obtained , Input the next layer of the CNN block and the next layer of the Transformer encoding block, respectively.
[0095] Specifically, no. The ParaBlock layer simultaneously receives image embedding features from the output of the Transformer coded block. Local features of CNN branches and output the updated features. , :
[0096] ,
[0097] Each ParaBlock layer includes a normalization unit, a multi-head attention unit, a feedforward network unit, and a residual connection structure, and supports both window attention and global attention modes: when the window size... Local attention computation is performed within the window to enhance the modeling ability of left ventricular edge texture and local continuous structure; when the window size... Global attention is employed to enhance long-range dependencies, and a cross-branch spatial interaction unit, Space_Adapter, is further introduced to achieve deep fusion between Transformer features and CNN features. Space_Adapter uses Transformer features as query vectors. Using CNN local features as key and value vectors Perform cross-attention matching to obtain fused features And inject backbone features in a residual manner. Simultaneously, the CNN branch features are locally enhanced after the global interaction layer using a convolutional refinement unit (refine_Adapter) to further strengthen weak boundary responses and suppress speckle noise interference. Furthermore, a lightweight feedforward adapter (MLP_Adapter) is introduced in the global interaction layer to perform bottleneck mapping on the normalized features and inject them as scaled residuals. Through this multi-layer ParaBlock stacking, the CNN module can maintain spatially continuous texture representation while progressively interacting and fusing with the Transformer backbone semantic features, thereby enhancing the fine-grained representation capability of the weak boundary region of the left ventricle and providing high-quality local structural features for subsequent cross-branch interaction modules and the mask decoder.
[0098] like Figure 2As shown, the Transformer encoding block consists of multiple stacked encoding units. Each layer includes a normalization unit, a multi-head attention unit, a feedforward network unit, and a residual connection structure, used to establish long-range dependencies between different spatial locations, thereby outputting updated image embedding features. In a preferred embodiment, the multi-head attention unit supports two modes: window attention and global attention. When the window size is greater than zero, attention calculation is performed within the local window to enhance local modeling capabilities; when the window size is zero, global attention is used to enhance cross-regional structural association representation. This invention uses a Transformer-based image encoder as the backbone of global semantic modeling to encode input ultrasound frames into image embedding features. After the input frame image is patch-embedded and mapped into a token sequence, global semantic features are extracted under the action of multiple self-attention and feedforward networks to obtain the corresponding image embedding.
[0099] In this embodiment, the prompt encoder encodes point prompt information and outputs sparse prompt embeddings for use by the mask decoder. Point prompts include point coordinate information and category label information, where point coordinates are represented in image pixel coordinates, and category labels are used to mark the type of point prompt. Specifically, the prompt encoder first performs pixel center alignment processing on the input point coordinates, that is, adds a preset offset (e.g., 0.5) to the point coordinates so that the point coordinates fall at the pixel center position; when only point prompts are input and no box prompts are input, the prompt encoder further introduces fill points to align the number of point prompts, that is, concatenates the fill points with preset coordinates and corresponding fill labels into the point prompt sequence, where the fill labels are used to indicate that the point is a non-valid point prompt.
[0100] Subsequently, the prompt encoder performs positional encoding on the processed point coordinates: the point coordinates are normalized according to the input image size, and the normalized coordinates are mapped to a high-dimensional space and encoded using sine and cosine functions to obtain point position embeddings containing spatial location information. Further, the prompt encoder superimposes corresponding type embeddings onto the point position embeddings based on the category label of the point prompt: when the label indicates a filled point, the corresponding point position embedding is set to zero and a preset "non-point" type embedding is superimposed; when the label indicates a negative point, a negative point type embedding is superimposed; when the label indicates a positive point, a positive point type embedding is superimposed. The point prompt embeddings obtained in the above manner constitute sparse point prompt embeddings and are used as prompt conditions input to the mask decoder to guide the mask decoder to combine image embedding features and output the left ventricle segmentation result of the current frame.
[0101] Speckle noise in ultrasound images has strong random high-frequency characteristics. If the noise contamination is directly embedded into the memory, it can easily lead to error accumulation and memory degradation. To address this, this invention incorporates a wavelet transform-based memory reconstruction module (WTM) in the memory and refinement module during the memory writing stage. This module performs multi-scale decomposition and structural enhancement on the prediction mask or probability map, suppressing noise and strengthening edge information from a frequency domain perspective.
[0102] The structure of the wavelet transform-based memory reconstruction module (WTM) is as follows: Figure 4 As shown, it includes: performing multi-scale wavelet transform decomposition on the probability map or mask map predicted in the current frame to obtain a low-frequency approximation component and a high-frequency detail component; selecting the high-frequency detail component to enhance the edge and texture structure information, and fusing the enhanced multi-scale representation with the image embedding of the current frame to generate reconstructed features for writing into the memory bank, so as to suppress feature contamination caused by ultrasonic speckle noise and reduce the accumulation of cross-frame memory errors.
[0103] Let the current frame probability map output by the mask decoder be... .right Perform three-level Haar wavelet transform decomposition ( ), yielding low-frequency approximate components and high-frequency detail components:
[0104] ,
[0105] in, This is a low-frequency approximate sub-band. , , These are horizontal, vertical, and diagonal high-frequency detail subbands, respectively.
[0106] The decomposition can be recursively performed to form a multi-scale frequency domain representation. Since the high-frequency components mainly contain edge and texture structure information, this invention constructs a refined mask embedding based on the high-frequency detail components. And with the current i-th frame image Embedding and fusion to generate attention weights :
[0107] ,
[0108] in, This represents a 3×3 convolution. Represents a 1×1 convolution. This indicates channel splicing.
[0109] Attention weights After Softmax normalization, embedding is performed using a mask. Modulation is performed to obtain the refined output characteristics:
[0110] .
[0111] Based on this, Write to working memory or long-term memory to update memory content. Specifically, working memory updates memory at time steps. The key and value update methods are as follows:
[0112] ,
[0113] in, This indicates the query feature corresponding to the current frame. This indicates feature splicing or incremental fusion operations. Through this method, the memory writing process retains valid historical information while introducing current frame structure features modulated by the foreground. This strengthens the target foreground representation, suppresses the accumulation of background noise, reduces the risk of cross-frame memory error propagation, and improves the stability and consistency of temporal segmentation results during the writing phase.
[0114] Specifically, for the first frame, the mask decoder first fuses the image embedding features, CNN local features, and dense cue embeddings element-wise, and inputs the sparse cue embeddings as conditional tokens into the decoding Transformer. A bidirectional attention mechanism enables deep interaction between the cue information and image features, resulting in an intermediate feature representation that integrates spatial semantics, foreground constraints, and temporal memory. Subsequently, the mask decoder upsamples the low-resolution features output from the decoding Transformer, gradually restoring the spatial resolution through deconvolution, normalization, and nonlinear activation operations, and generating candidate segmentation results using a dynamic mask prediction mechanism. Specifically, the mask decoder uses mask tokens to generate corresponding dynamic prediction parameters and applies these parameters to the upsampled features to obtain a pixel-wise segmentation response, thereby outputting the left ventricle segmentation probability map for the current frame. .
[0115] Similarly, for non-first frames, the mask decoder generates the left ventricle segmentation result at the current moment based on the same process as the first frame. It integrates image embedding features from the Transformer coding block, CNN local features from the CNN branch output, and cross-frame memory cue features.
[0116] (4) Step S4
[0117] During the model training phase, this invention employs a training strategy combining weak supervision and semi-supervision. The enhanced echocardiogram video sequence from step S2, along with its corresponding key temporal frame annotations (including end-diastolic and end-systolic frames), is input into the left ventricular segmentation model for end-to-end training. During training, segmentation loss is calculated only on manually annotated key temporal frames, thereby significantly reducing annotation costs while achieving effective modeling of complete cardiac cycle video sequences. For any annotated key temporal frame... The model outputs the corresponding left ventricular segmentation prediction probability map. Its difference from the real annotation mask The segmentation loss between them is defined as a weighted combination of the weighted binary cross-entropy loss and the Dice loss:
[0118] ,
[0119] in, The weighting coefficient, used to balance the contributions of the two loss terms, is taken in one embodiment of the present invention. . for and Weighted binary cross-entropy loss between them for and The Dice loss between them.
[0120] In terms of temporal modeling, this invention does not explicitly introduce additional temporal consistency loss. Instead, it achieves effective utilization of historical frame information at the network structure level through cross-frame memory and prompting guidance mechanism, so that the segmentation prediction of the current frame is constrained by historical structural information in the feature space, thereby enhancing the continuity and stability of video segmentation results in the temporal dimension.
[0121] The model training employs the AdamW optimization strategy, combined with cosine annealing learning rate scheduling, to make the training process smoother and more stable. To prevent overfitting of the backbone, its parameters are frozen during training, and only the trainable parameters of FFA, memory module, WTM, and mask decoder are updated, enabling the model to efficiently adapt to the characteristics of the ultrasound domain.
[0122] (5) Step S5
[0123] During the inference phase, only a simple cue, such as a single-point cue, is needed for the first frame. The model writes this cue into its memory, and then automatically outputs the segmentation result for each subsequent frame. The entire process can obtain the left ventricular segmentation sequence of the complete cardiac cycle without any additional manual intervention.
[0124] Based on the segmentation results, the end-diastolic and end-systolic volumes of the left ventricle are estimated in a consistent manner, enabling automatic, objective, and reliable calculation of the left ventricular ejection fraction, thereby improving the efficiency and clinical reliability of cardiac function assessment.
[0125] (6) Experiment
[0126] To further verify the accuracy and temporal consistency of the left ventricle segmentation method of the present invention in scenarios with weak boundary conditions, speckle noise, and cross-frame structural deformation in cardiac ultrasound, quantitative and qualitative comparative experiments were conducted based on publicly available cardiac echocardiogram video datasets to demonstrate the effectiveness and superiority of the present invention method.
[0127] This embodiment selects two widely used publicly available cardiac ultrasound video datasets for validation: the CAMUS dataset and the EchoNet-Dynamic dataset. The CAMUS dataset contains two-dimensional ultrasound video sequences from 500 patients, covering apical two-chamber (A2C) and four-chamber (A4C) views, providing frame-by-frame pixel-level left ventricular segmentation annotations. In the experiment, this dataset was divided into training, validation, and test sets in a 7:1:2 ratio. The EchoNet-Dynamic dataset contains 10,030 apical four-chamber (A4C) view ultrasound videos, with manual annotations provided only for the end-diastolic (ED) and end-systolic (ES) frames of each cardiac cycle; the remaining frames are unannotated, which is consistent with weakly supervised and semi-supervised video segmentation application scenarios.
[0128] This invention employs multiple evaluation metrics to measure segmentation performance, including the mean Dice coefficient (mDice), the mean intersection-to-union ratio (mIoU), the 95th percentile Hausdorff distance (HD95), and the mean symmetry surface distance (ASSD). HD95 measures the maximum deviation between the predicted and actual boundaries (using the 95th percentile after removing outliers), while ASSD assesses the mean distance error of the boundaries. Furthermore, to further evaluate the impact of segmentation results on clinical functional parameters, this embodiment calculates the ejection fraction (LVEF) based on the predicted ED / ES left ventricular contour and uses the Pearson correlation coefficient (corr), mean deviation (bias), and standard deviation (std) to measure the consistency of cardiac function estimation.
[0129] In the experiment, each segment of echocardiography video was uniformly cropped into a fixed length of 10 frames, ensuring that the first and last frames corresponded to end-diastole (ED) and end-systole (ES), respectively. All input frames were scaled to [size missing]. Resolution. During training, enhancement strategies such as random rotation, random scaling, gamma perturbation, and contrast perturbation are employed, each executed with a probability of 0.5, to improve the model's robustness to ultrasound noise, weak boundaries, and morphological changes. The model is based on the SAM framework, freezing the pre-trained Transformer backbone parameters and updating only the foreground enhancement module (FFA), memory module, WTM, and relevant trainable parameters of the time-series decoder, thereby avoiding the risk of overfitting in small-sample medical scenarios. Training uses the AdamW optimizer with a base learning rate of [missing information]. And it is scheduled in conjunction with a learning rate decay strategy.
[0130] The quantitative comparison results of the method of the present invention on the CAMUS dataset are shown in Table 1. As can be seen from Table 1, the method of the present invention achieves the best performance in both mDice and mIoU indices, while significantly reducing the boundary error indices HD95 and ASSD.
[0131] Table 1 shows the results of left ventricular segmentation metrics on the CAMUS dataset.
[0132]
[0133] As shown in Table 1, the present invention achieves 93.14% mDice and 87.33% mIoU under the CAMUS-Semi setting, which are 0.42% and 0.72% higher than the existing MemSAM method, respectively. At the same time, it reduces HD95 to 3.98 mm and ASSD to 1.63 mm, indicating that the present invention has significant advantages in terms of left ventricular boundary positioning accuracy and structural continuity.
[0134] Table 2 Comparison results on the EchoNet-Dynamic dataset
[0135]
[0136] As can be seen from Table 2, the method of the present invention achieves 93.51% mDice and 87.63% mIoU, and achieves a greater reduction in HD95 and ASSD, especially ASSD, which is reduced to 1.45mm. This shows that the model still has excellent cross-frame consistency and generalization ability under weak supervision.
[0137] The above results verify that the Foreground Focusing Attention (FFA) module proposed in this invention can effectively enhance the response in weak boundary regions, while the Wavelet Memory Reconstruction (WTM) module can suppress noise contamination and reduce memory error accumulation, thereby maintaining stability in cross-frame prediction.
[0138] To further illustrate the segmentation results more intuitively, the prediction mask visualization results of UNet, SAMUS, MemSAM, and the left ventricular video segmentation network generated in this invention on the test set are as follows: Figure 5 As shown, Figure 5 (a) shows the visualization results of the UNet prediction mask. Figure 5 (b) shows the visualization results of the predicted mask from SAMUS. Figure 5 (c) shows the visualization results of the prediction mask from MemSAM. Figure 5 Image (d) shows the visualization result of the prediction mask of the left ventricular video segmentation network generated by this invention. Figure 5 As can be seen, the present invention can still output a continuous and clear left ventricular contour under speckle noise interference and boundary blurring, and is more stable in the apical region and rapid deformation stage.
[0139] Furthermore, the consistency analysis of the estimated ejection fraction (LVEF) in this invention is as follows: Figure 6 , Figure 7 and Figure 8 As shown. Among them, Figure 6 , Figure 7 The figures show comparisons of various methods and error ranges for calculating left ventricular ejection fraction on the CAMUS dataset provided in this embodiment of the invention, as well as comparisons between other methods and this method, to reflect the performance of different methods in terms of prediction error and stability. Figure 8 The correlation bubble chart provided in this embodiment of the invention is used to represent the correlation consistency between the prediction results of each method and the actual values.
[0140] Depend on Figure 8 It can be seen that the method of this invention obtained a high correlation coefficient value under the Pearson correlation index, indicating that its prediction results have strong consistency with the actual measured values and can accurately reflect the changing trends of cardiac function parameters. Simultaneously, combined with... Figure 6 , Figure 7 The Bias±Std comparison results shown demonstrate that the method of this invention exhibits good stability in terms of deviation control and error fluctuation range. Overall experimental results indicate that the segmentation framework proposed in this invention can provide reliable technical support for the automated assessment of left ventricular volume and ejection fraction, and has significant application value.
[0141] It should be noted that the various processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved. This embodiment does not impose any limitations on these steps.
[0142] Corresponding to the above method, this embodiment of the invention also provides a cardiac echocardiography video left ventricular segmentation system, based on a cardiac echocardiography video left ventricular segmentation method, the key of which is: including a data acquisition unit, a data enhancement unit, a network construction unit, a network training unit, and a network application unit;
[0143] The data acquisition unit is used to acquire and preprocess cardiac echocardiogram video sequences to construct a video dataset;
[0144] The data augmentation unit is used to perform data augmentation processing on video sequences in a video dataset, and then divides it into training set, validation set and test set;
[0145] Network building blocks are used to construct a left ventricular video segmentation network;
[0146] The network training unit is used to train the constructed left ventricular video segmentation network end-to-end using the training set and optimize it using the validation set to obtain the left ventricular video segmentation model.
[0147] The network application unit is used to input the test set or the cardiac ultrasound video to be segmented into the left ventricular video segmentation model and output the frame-by-frame segmentation results of the left ventricular video.
[0148] The embodiments described in this invention can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with the implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0149] Computer programs for implementing the methods and systems of the present invention may be written in any combination of one or more programming languages and stored in a computer-readable storage medium. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0150] Computer-readable storage media can be tangible media that may contain or store computer programs for use by or in conjunction with an instruction execution system, apparatus, or device. Computer-readable storage media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, optical disc read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0151] In summary, this invention discloses a method and system for left ventricular segmentation in echocardiography videos based on foreground-focused adaptive attention and wavelet transform memory reconstruction strategies. The method includes the following steps: S1. Acquiring a large number of echocardiography video sequences and performing standardized processing, including resampling and size normalization, invalid region cropping, and using key temporal information of the cardiac cycle (end-diastolic ED and end-systolic ES) to perform frame sequence consistency correction, format unification, and label quality checks on the video sequences to construct a standardized video dataset; S2. Improving the robustness of the preprocessed video sequences to ultrasound speckle noise, weak boundaries, and changes in cardiac cycle structure by employing data augmentation methods such as random rotation, scaling, flipping, contrast perturbation, and gamma perturbation, and dividing the dataset into training, validation, and test sets; S3. Constructing an image encoder (based on Transformer and CNN), a cue encoder, a mask decoder, a spatiotemporal memory bank, a foreground-focused adaptive attention module (FFA), and a wavelet transform-based memory reconstruction module (WT). The network employs a left ventricular video segmentation technique (M), where FFA (Forward Context Analysis) dynamically focuses on the left ventricular foreground region through orientation context encoding and shape-aware attention calibration to alleviate boundary blurring. WTM (Wavelet Transformation) performs multi-scale wavelet decomposition on the prediction mask and selectively enhances high-frequency structural information before memory writing, thereby suppressing noise contamination and memory error accumulation, and improving cross-frame feature quality and temporal consistency. In step S4, the training set is input into the left ventricular video segmentation network for end-to-end training. A segmentation loss function is used to supervise the optimization of the prediction mask and corresponding annotations, and the Adam or AdamW optimizer is used to update the network parameters. Learning rate warm-up and multinomial decay strategies are used to gradually improve the model's ability to express weak boundary details, cross-frame consistency, and morphological changes at different cardiac stages. In step S5, the test set or the echocardiogram video to be segmented is input into the trained model. Predictive segmentation results for the left ventricular region are generated through foreground adaptive enhancement and spatiotemporal memory guidance mechanisms. Based on the segmentation results, cardiac function parameters such as left ventricular end-diastolic volume, end-systolic volume, and ejection fraction are further calculated. This invention has advantages such as strong foreground focusing ability, excellent anti-speckle noise performance, high memory update stability, and good video temporal consistency. It can not only significantly improve the accuracy and robustness of automatic left ventricular segmentation in cardiac ultrasound, but also provide reliable technical support for the automated assessment of cardiac function parameters, and has good clinical application value.
[0152] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.
Claims
1. A method for left ventricular segmentation in echocardiography video, characterized in that, Including the following steps: Collect and preprocess echocardiogram video sequences to construct a video dataset; The video sequences in the video dataset are subjected to data augmentation processing, and then divided into training set, validation set and test set. Construct a left ventricular video segmentation network; The constructed left ventricular video segmentation network is trained end-to-end using the training set and optimized using the validation set to obtain the left ventricular video segmentation model. The test set or the cardiac ultrasound video to be segmented is input into the left ventricular video segmentation model, and the frame-by-frame segmentation results of the left ventricle are output. The left ventricular video segmentation network includes a backbone, a CNN branch, and a memory and refinement module; the backbone includes a downsampling layer, a Transformer encoder block, a cue encoder, and a mask decoder; the CNN branch includes a pre-block, an attention module, and a CNN module; the memory and refinement module includes a memory bank, a weighted aggregation module, and a memory reconstruction module. The input frame at the current moment is downsampled by the downsampling layer and then image-based encoding is performed by the Transformer encoding block to extract image embedding features; The input frame at the current moment is processed by the preceding block for preceding feature extraction, then by the attention module for extraction and incorporation of attention, and finally by the CNN module for final feature extraction to obtain CNN local features; The memory bank stores the structural information of historical frames in a key-value format; The input frame at the current moment that is not the first frame is downsampled by the downsampling layer of the backbone and then projected to obtain the query feature Query. The weighted aggregation module performs similarity matching between the query feature Query and the historical Key in the memory to obtain similarity weights, and performs weighted aggregation on the historical Values according to the similarity weights to obtain cross-frame memory prompt features input to the mask decoder; The prompt encoder is used to receive external prompts in the first frame and encode them as prompt embeddings; For the first frame, the mask decoder fuses the corresponding image embedding features, the CNN local features, and the cue embedding to output the corresponding left ventricular segmentation probability map; for non-first frames, the mask decoder fuses the corresponding image embedding features, the CNN local features, and the cross-frame memory cue features to output the corresponding left ventricular segmentation probability map. The memory reconstruction module performs memory reconstruction on the left ventricular segmentation probability map output by the mask decoder through wavelet transform to obtain reconstruction features, which are then input into the memory bank. The memory bank stores historical frames in key-value format based on the reconstructed features.
2. The method for left ventricular segmentation in echocardiography video according to claim 1, characterized in that: In the CNN branch, the input of the attention module is to extract shape-aware attention facing the left ventricular foreground region through the foreground focusing adaptive module. The extracted shape-aware attention is then batch-normalized and input into the multilayer perceptron. Finally, the output of the multilayer perceptron is added to the input of the attention module to obtain the attention fusion feature input to the CNN module. The operation performed by the foreground focusing adaptive module is as follows: Global average pooling is performed on the input features along the horizontal and vertical directions, and then broadcast and summed to obtain the directional context features; Two-stage asymmetric depth convolution is used to perform shape-aware attention calibration on directional context features to highlight the foreground region of the left ventricle and generate a spatial attention weight map. The input features are recalibrated using an attention weight map and residual fusion is employed to output shape-aware attention.
3. The method for left ventricular segmentation in echocardiography video according to claim 2, characterized in that: Spatial attention weight map , For directional context features, and These represent the kernel size as follows: and Depth convolution, This represents batch normalization and nonlinear activation. For the Sigmoid function; shape-aware attention , Indicates input features, For the size of the kernel Depth convolution, For element-wise multiplication, This is a feature refinement function that includes normalization and channel multilayer perceptron.
4. The method for left ventricular segmentation in echocardiography video according to claim 1, characterized in that, The CNN module includes a CNN block and a cross-branch interaction module; the CNN block is composed of multiple cascaded convolutional layers, used to propagate and structurally enhance the output features of the attention module layer by layer, and finally outputs local CNN features; the cross-branch interaction module is composed of multiple cascaded ParaBlocks, the first of which... The ParaBlock layer is used for the first CNN block. Convolutional features output by the layer and Transformer coding block Image embedding features output by the layer After performing a synchronized update, the result is obtained Input the next layer of the CNN block and the next layer of the Transformer encoding block respectively.
5. The method for left ventricular segmentation in echocardiography video according to claim 1, characterized in that, The operation of the memory reconstruction module includes: Perform multi-scale wavelet transform decomposition on the probability map or mask map predicted in the current frame to obtain a low-frequency approximate component and a high-frequency detail component. High-frequency detail components are selected to enhance edge and texture structure information, and the enhanced multi-scale representation is fused with the image embedding of the current frame to generate reconstructed features that are input into the memory bank. The memory uses the query feature corresponding to the current frame as the key, and performs feature concatenation or incremental fusion operation between the reconstructed feature of the current frame and the value of the previous frame to obtain the value of the current frame, storing the structural information of the current frame in key-value format.
6. The method for left ventricular segmentation in echocardiography video according to claim 5, characterized in that, The enhanced multi-scale representation is fused with the image embedding of the current frame to generate reconstructed features for writing into the memory bank, specifically including: Refined mask embedding is constructed based on high-frequency detail components. and embed with the current image Fusion to generate attention weights , This represents a 3×3 convolution. Represents a 1×1 convolution. Indicates channel splicing; Attention weights After performing Softmax normalization, the refined mask is embedded. Modulation is performed to obtain refined output characteristics. , This is element-wise multiplication.
7. The method for left ventricular segmentation in echocardiography video according to any one of claims 2 to 6, characterized in that: The preprocessing of the acquired echocardiogram video sequences includes resampling, size normalization, illumination characteristic normalization, invalid region cropping, frame sequence consistency correction, and tag quality check. Invalid region cropping refers to removing invalid information around a video using morphological edge cropping techniques, as well as threshold-based soft cropping of backgrounds in frames that do not belong to the main heart area. Frame sequence consistency correction includes: reading the key phase identifier information of the cardiac cycle corresponding to the video sequence, and judging whether the time direction of the video sequence is consistent based on the key phase identifier information; When the key phase sequence is detected to be inconsistent with the preset sequence, the video sequence and its corresponding frame-by-frame labeled sequence are flipped or rearranged in the time dimension so that the video sequence satisfies a unified cardiac phase evolution direction in the time dimension. The key phase includes at least the end of diastole and the end of systole. Data augmentation processing is performed on video sequences in the video dataset, including one or more of the following: random rotation, scale perturbation, gamma transformation, brightness perturbation, background perturbation, and temporal perturbation.
8. The method for left ventricular segmentation in echocardiography video according to claim 7, characterized in that: During the model training phase, the augmented ultrasound video sequence and its corresponding first and last frame annotations are input into the constructed left ventricular video segmentation network for training. During training, a weighted combination of binary cross-entropy loss and Dice loss is used. The model training adopts the AdamW optimization strategy, combined with cosine annealing learning rate scheduling, and keeps the parameters of the backbone frozen during training, only updating the trainable parameters of the CNN branches and memory and refinement modules.
9. A cardiac echocardiography video left ventricular segmentation system, based on the cardiac echocardiography video left ventricular segmentation method according to any one of claims 1 to 8, characterized in that: It includes a data acquisition unit, a data augmentation unit, a network construction unit, a network training unit, and a network application unit; The data acquisition unit is used to acquire cardiac echocardiogram video sequences and perform preprocessing to construct a video dataset; The data augmentation unit is used to perform data augmentation processing on the video sequences of the video dataset, and then divides them into training set, validation set and test set. The network construction unit is used to construct a left ventricular video segmentation network; The network training unit is used to perform end-to-end training of the constructed left ventricular video segmentation network using the training set, and to optimize it using the validation set to obtain a left ventricular video segmentation model. The network application unit is used to input the test set or the cardiac ultrasound video to be segmented into the left ventricular video segmentation model and output the frame-by-frame segmentation results of the left ventricular video.
Citation Information
Patent Citations
Video object segmentation method based on query adaptive attention and discriminative memory
CN121305441A
Multi-mode prostate cancer detection method fusing memory mechanism and space Transform
CN121414684A