Abstract
Cardiac structure segmentation in echocardiographic images is essential for quantitatively assessing cardiac function and myocardial infarction (MI) diagnosing. The accuracy of segmentation is challenging, however, because of the speckle noise, low contrast, and signal dropout as well as anatomical variability that occur in echocardiographic images. Conventional CNN-based methods are good at capturing local texture and edge information, but they lack the ability to ensure consistency across different regions and views, and CNN-based models can capture long-distance dependency but may lose local details. To address these challenges, a Hybrid CNN–Transformer U-Net (U-Net-H) is proposed that combines convolutional encoders, Transformer blocks, and a cross-attention fusion decoder, which can extract local features, learn global context, and efficiently fuse local and global features, respectively. The proposed pipeline consists of CNN encoders to extract multi-scale spatial features, self-attention to improve the contextual understanding, and cross-attention-based feature fusion in the decoder to enhance the segmentation boundaries. Experimental results on public echocardiography datasets demonstrate the superiority of the proposed model over the traditional U-Net and Transformer-only methods in terms of Dice score and Intersection over Union (IoU) values and the accuracy of the delineation of the left ventricle (LV) and the myocardium (MYO). The results show that the proposed framework is a powerful and reliable method for automatic cardiac image analysis and has great potential when it comes to clinical MI diagnosis and cardiac function assessment.
1. Introduction
Echocardiography is the most widely used imaging method used in assessing the functioning of the heart because it is inexpensive, portable, and non-invasive [1]. To be able to estimate such critical clinical variables as the ejection fraction, myocardial thickness, strain, and volumes, proper delineation of cardiac structures such as the left ventricle (LV) and myocardium is necessary. Echocardiography imaging is a distinctly different type of imaging with its own set of challenges such as low contrast, acoustic shadows, artifacts, speckle noise, and high operator dependence [2]. The recent developments in deep learning have had a significant influence on medical image segmentation, and U-Net models, being built on convolutional neural network (CNN) models, have gained widespread popularity in biomedical contexts. CNNs are highly effective to local texture pattern learning and with the limitations of the receptive field, they tend to lose global anatomical consistency. Transformers, however, are less sensitive to the demand of fine spatial detail that is needed to supply fine boundary detail, and do provide self-attention schemes to elicit long-range dependences, so the system can understand global context. Hybrid CNN-Transformer U-Net is a model that we introduce that combines the strengths of both methods [3]. The4 Transformer module has global reasoning capabilities that provide it with the ability to provide long-range contextual reasoning, and multi-scale convolutional processing plays a vital role in resolving this problem by introducing global self-attention. Their disadvantage, however, is that they lose the fine spatial details needed to extract boundaries accurately [4].
2. Literature Review
The traditional cardiac image segmentation methods included active contours, deformable models, and atlas-based registration [5]. These methods proved to be helpful under some circumstances, yet they usually had issues with the variability of cardiac shapes and noise resilience. Significant advancements have been made as a result of deep learning, and CNN architectures like U-Net, Attention U-Net, and Dense U-Net have shown notable gains in segmentation performance [6]. Nevertheless, CNN models are naturally limited by their local receptive field, which makes modeling global structural dependencies challenging. This is particularly true in echocardiography, where high contextual understanding is necessary due to poor image quality [7]. To get around this, Transformer-based models like TransUNet have introduced global self-attention mechanisms into medical image segmentation tasks. However, these models tend to have difficulties in modeling boundaries and may generate coarser segmentations. Recently, hybrid CNN–Transformer models have been proposed to increase the strengths of both CNNs and Transformers [8].
The success of Transformers in the field of computer vision [9] has encouraged their use in medical imaging. The initial successful models of TransUNet and Swin-Unet [10] showed the potential use of Transformers in medical image segmentation tasks. TransUNet combines a Transformer to encode the features extracted by a CNN encoder, while Swin-Unet uses a hierarchical Swin-Transformer as a standalone encoder. These models enhance the capability to capture global context; however, they can be computationally expensive and generally fail to utilize the capability of CNNs for local feature extraction effectively [11].
CNNs and Transformers have recently been combined to create hybrid models. These models typically use a CNN to extract initial features, which are subsequently transformed at a specific scale using a Transformer. Our model also adheres to the hybrid model concept, but we suggest a Cross-Attention Fusion Decoder in contrast to the majority of current models that merely parallel process the CNN features or swap out the CNN bottleneck for a Transformer. This decoder produces more precise and contextually consistent segmentations during the upsampling phase by dynamically interacting with the multi-scale local features of the CNN and the global contextual information of the Transformer [12].
3. Proposed System
Figure 1 shows that the hybrid CNN–Transformer framework offers a cohesive solution that can manage two of the most difficult problems in echocardiographic segmentation: local noise sensitivity and global structural reasoning. As demonstrated by experimental validation, the suggested system outperforms purely convolutional or purely Transformer-based architectures in terms of Dice, IoU, and boundary precision, demonstrating its effectiveness for trustworthy clinical cardiac image analysis [13].
Figure 1.
Proposed architecture.
Related to the segmentation of echocardiographic images, the proposed solution offers a hybrid CNN–Transformer framework that is specifically designed to overcome the pitfalls of both traditional convolutional neural networks and models based on attention [14]. The point is to apply the sensitivity of local features to CNNs and the global context modeling power to Transformers so that the network can similarly present the structural consistency of the cardiac chambers overall and their fine anatomical boundaries. The proposed architecture begins with a hierarchical convolutional encoder whose purpose is to retrieve low-level texture information, which is essential in defining the boundaries of the myocardium even in the case of low contrast and speckle noise [15]. Then, preserving spatial information, these features are abstracted to semantic information of higher levels. In addition, long-range dependencies between remote cardiac regions are captured using a Transformer-based global attention module. This is especially helpful in echocardiography because anatomical structures may be partially obscured or have ill-defined boundaries, and accurate segmentation necessitates knowledge of the overall anatomical context. By incorporating global shape and structural dependencies, the Transformer module enhances features that CNNs might not be able to adequately capture [16].
3.1. System Architecture Overview
The suggested system presents a hybrid CNN–Transformer segmentation framework that uses echocardiogram images to simultaneously learn global anatomical structure and local texture information. A Transformer-based global attention block, a cross-attention fusion mechanism, a multi-scale decoder for segmentation reconstruction, and a convolutional feature extraction module make up its four main parts. Each of these elements adds to the complementary strengths that allow the system to manage structural ambiguity, low contrast, and speckle noise. All things considered, this design enables the model to represent both holistic cardiac geometry and boundary sharpness [17].
3.2. Convolutional Feature Extraction Module
First, a convolutional encoder is applied to obtain the fine-grained spatial details of edges, textures, and boundary gradients. Although speckle noise artifacts are present, locally operating convolutional kernels have shown very good performance in the localization of the myocardial walls. The mathematical formula of the convolution operation is:
In which X is the input image, W is the convolution kernel, b is the bias term, and [σ] is a nonlinear activation function. Such a formulation enables the model to acquire local descriptors richly, which are the basis of the following global reasoning.
3.3. Global Attention Module Transformer-Based
The proposal to use CNNs to represent the long-range spatial dependencies is introduced by inserting a Transformer-based attention module into the system. This module is able to analyze both the associations between the remote anatomy regions so that cardiac structures can be coherently interpreted even in situations where edges may be inexact or completely concealed. The self-attention mechanism is explained by:
where Q, K, and V signify the query, key, and value projections of the feature map, respectively, and dk signifies the dimensionality of the key vectors.
3.4. Cross-Attention Fusion Mechanism
Once convolutional features and Transformer-enhanced features are obtained, the system integrates complementary information of these two streams in the cross-attention fusion unit. Rather than mung-fashion concatenation, it is trained to choose an adaptive weighting when using global cues and local cues. The fusion process can be defined as:
where Fcnn represents local features, Fattn are features, which are contextualised globally, and alpha is a learnable weight. The mechanism makes sure that fine anatomical boundaries and global shape characteristics are used to give a final representation.
3.5. Multi-Scale Decoder and Segmentation Output
The fused feature representation is then sent to a multi-scale decoder that successively reconstructs pixel-level segmentation maps at the final stage. Every decoder layer upsamples and adds information at different resolutions in order to sharpen the structure boundaries. We can put this process as follows:
where U(·) denotes upsampling and ‖ represents concatenation across scales. The final segmentation mask is obtained through a softmax classifier applied to the decoder output:
It produces high-resolution probability maps that effectively define cardiac chambers and cardiac myocardial boundaries. The proposed system circumvents some of the key limitations of traditional segmentation models by combining Transformer-based global reasoning with convolutional locality. The CNN module logs the boundary details and the Transformer provides the understanding of the cardiac anatomy in detail. The cross-attention fusion mechanism balances these complementary properties and the multi-scale decoder ensures high-resolution reconstruction. Therefore, the system demonstrates high levels of reliability in clinical echocardiographic analysis with better Dice accuracy, IoU, and boundary precision levels [18].
4. Result and Discussion
4.1. Quantitative Analysis
Extensive experiments were performed using publicly available echocardiographic data to comprehensively evaluate the performance of the suggested hybrid CNN–Transformer model in segmentation. Additionally, the Python 3.13.16 was used to code the proposed deep learning architecture. Some of the evaluation metrics include the Dice similarity coefficient (DSC), intersection over union (IoU), precision, recall, and 95th percentile Hausdorff distance (HD95). These measures of boundary delineation and region overlap accuracy are collectively critical in the clinical assessment of cardiac morphology and myocardial pathology. The usefulness of integrating global anatomy-based arguments with local texture-sensitive convolutional features was substantiated with the current architecture in terms of consistent and significant performance improvements over more conventional CNN architectures, Transformer-only baselines, and plain hybrid variations, particularly on the boundary-sensitive metric measures shown in Figure 2.
Figure 2.
Visual performance of the proposed system for Myocardial Infarction.
Table 1 provides an overview of the performance of all heart structures in both views of imaging. There are comparisons of a pure convolutional baseline (i), a Transformer-based baseline (ii), and a simple hybrid model that does not involve cross-attention mechanisms (iii) as well as the hybrid CNN–Transformer architecture suggested in this paper. This provides another clue as to how the design of models affects the accuracy of overlap as well as the stability of contours.
Table 1.
Quantitative performance comparison.
The model suggested had the highest performance in all measures. It had a +6.7% Dice difference and a 38% HD95 reduction over the CNN baseline and much better boundary precision. The Transformer-only baseline provided the benefits of global structure reasoning but could not provide good boundary accuracy without convolutional detail extraction. The basic hybrid technique was better but remained behind due to feature fusion incompleteness. The proposed model was the best in integrating the global and local information to provide the maximum overlap and contour accuracy, which is referred to as the cross-attention mechanism.
4.2. Chamber-Wise Segmentation Performance
To assess structural robustness, segmentation accuracy was measured for three clinically important anatomical targets: the LV endocardium, the LV epicardium, and the left atrium. These structures exhibit varying contrast levels and boundary characteristics, providing a more comprehensive evaluation of model generalizability.
The outcomes illustrate a high level of consistent performance of all three cardiac structures, which is presented in Table 2. Optimal outcomes were achieved on the segmentation of the LV endocardium, as it had a clear border. The segmentation maps of the epicardium were a little noisier; segmentation was more difficult to attain due to potential noise, attenuation, and shadowing effects. Nevertheless, it had high Dice/IoU values, proving the strength of the model in the case of low-contrast boundaries. The comparably good performance of the performance of the left atrium also confirmed the strong structural generalization within both the ventricular and atrial regions.
Table 2.
Structure-wise Dice and IoU scores.
4.3. Comparison with State-of-the-Art Methods
The suggested method was contrasted with popular medical image segmentation networks such as Attention U-Net, TransUNet, and Swin Transformer-UNet, as presented in Table 3. The performance of the cross-attention hybrid mechanism in comparison to other high-performing architectures is demonstrated by this comparison.
Table 3.
Comparison with state-of-the-art.
The proposed model outperformed all state-of-the-art methods by a Dice improvement of +1.5% over Swin-UNet, with a notably lower HD95 value. These improvements underline the fact that the combined CNN–Transformer design captures high-frequency boundaries and global cardiac geometry much better than the existing architectures. A significant IoU boost of +2.1% above the best competing model indicates improved structural coherence and reduced contour errors.
4.4. Training and Validation Performance
For the proposed system performance, the training accuracy and validation accuracy provided better results, as seen in Figure 3.
Figure 3.
Training and validation accuracy.
For the training and validation loss, the values gradually decreased and converged, which shows the system performing well, as seen in Figure 4.
Figure 4.
Training and validation loss.
5. Conclusions
A hybrid CNN–Transformer architecture for accurate and reliable cardiac structure segmentation in echocardiograms was presented in this study. In order to model long-range spatial relationships, this architecture combines a Transformer-based global attention mechanism with CNN encoders for detailed texture modeling. Anatomically valid and boundary-detailed segmentations are produced by combining multi-scale data using a cross-attention fusion technique. According to the quantitative analysis, the suggested architecture performed better than the conventional and current methods in terms of Dice, IoU, precision, recall, and HD95 metrics, especially in areas that are sensitive to boundaries. The generalizability of the suggested architecture is demonstrated by its high effectiveness in the LV endocardium, LV epicardium, and atrial regions. This architecture can be applied to a number of downstream echocardiography applications including myocardial infarction analysis and ejection fraction computation.
Author Contributions
Conceptualization, A.P.S. and B.D.; methodology, A.P.S.; software, A.P.S.; validation, A.P.S. and B.D.; formal analysis, A.P.S.; investigation, A.P.S.; resources, B.D.; data curation, A.P.S.; writing—original draft preparation, A.P.S.; writing—review and editing, B.D.; visualization, A.P.S.; supervision, B.D.; project administration, B.D.; funding acquisition, B.D. All authors have read and agreed to the published version of the manuscript.
Funding
This research received no external funding.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
The data used in the above research work are publicly available at github and accessible via the CAMUS (Cardiac Acquisitions for Multi-structure Ultrasound Segmentation) dataset to identify the robustness of the system through the following link: https://github.com/atlan-antillia/CAMUS_public-ImageMask-Dataset, accessed on 10 March 2026.
Acknowledgments
The authors used ChatGPT (GPT-5.2) solely for spelling and grammar checking during manuscript preparation. The use of this AI tool was supervised by the authors, who reviewed and verified all suggested changes and retain full responsibility for the accuracy, originality, and integrity of the manuscript. The authors have reviewed and edited the output and take full responsibility for the content of this publication.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Pinto, A.; Pinto, F.; Faggian, A.; Rubini, G.; Caranci, F.; Macarini, L.; Genovese, E.A.; Brunese, L. Sources of error in emergency ultrasonography. Crit. Ultrasound J. 2013, 5, S1. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Peels, C.H.; Visser, C.A.; Küpper, A.J.F.; Visser, F.C.; Roos, J.P. Usefulness of two-dimensional echocardiography for immediate detection of myocardial ischemia in the emergency room. Am. J. Cardiol. 1990, 65, 687–691. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Baumgartner, H.; Hung, J.; Bermejo, J.; Chambers, J.B.; Evangelista, A.; Griffin, B.P.; Iung, B.; Otto, C.M.; Pellikka, P.A.; Quiñones, M.A. Echocardiographic assessment of valve stenosis: EAE/ASE recommendations for clinical practice. Eur. J. Echocardiogr. 2009, 22, 479. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Foley, T.A.; Mankad, S.V.; Anavekar, N.S.; Bonnichsen, C.R.; Miller, M.F.; Morris, T.D.; Araoz, P.A. Cardiologist measuring left ventricular ejection fraction—Techniques and potential pitfalls. Eur. Cardiol. Rev. 2012, 8, 108–114. [Google Scholar] [CrossRef] [Scilit]
- Sanches, J.M.; Laine, A.F.; Suri, J.S. Ultrasound Imaging; Springer: Berlin/Heidelberg, Germany, 2012. [Google Scholar]
- Mazaheri, S.; Sulaiman, P.S.; Rahmat, R.W.O.K.; Khalid, F.; Kadiman, S.; Dimon, M.Z.; Tayebi, R.M. Echocardiography image segmentation: A survey. In Proceedings of International Conference on Advanced Computer Science Applications and Technologies; IEEE: New York, NY, USA, 2013; pp. 327–332. [Google Scholar] [CrossRef] [Scilit]
- Minaee, S.; Boykov, Y.Y.; Porikli, F.; Plaza, A.; Kehtarnavaz, N.; Terzopoulos, D. Image segmentation using deep learning: A survey. IEEE Trans. Pattern Anal. Mach. Intell. 2021, 44, 3523–3542. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Chen, C.; Qin, C.; Qiu, H.; Tarroni, G.; Duan, J.; Bai, W.; Rueckert, D. Deep learning for cardiac image segmentation: A review. Front. Cardiovasc. Med. 2020, 7, 25. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Gao, Z.; Pan, X.; Shao, J.; Jiang, X.; Su, Z.; Jin, K.; Ye, J. Automatic interpretation and clinical evaluation for fundus fluorescein angiography images of diabetic reti-nopathy patients by deep learning. Br. J. Ophthalmol. 2022, 107, 1852–1858. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Liu, F.; Wang, K.; Liu, D.; Yang, X.; Tian, J. Deep pyramid local attention neural network for cardiac structure segmentation in echocardiography. Med. Image Anal. 2020, 67, 101873. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Leclerc, S.; Smistad, E.; Pedrosa, J.; Ostvik, A.; Cervenansky, F.; Espinosa, F.; Espeland, T.; Berg, E.A.R.; Jodoin, P.-M.; Grenier, T.; et al. Deep learning for segmentation using an open largescale dataset in 2D echocardiography. IEEE Trans. Med. Imaging 2019, 38, 2198–2210. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Moradi, S.; Oghli, M.G.; Alizadehasl, A.; Shiri, I.; Oveisi, N.; Oveisi, M.; Maleki, M.; D’hooge, J. MFP-Unet: A novel deep learning based approach for left ventricle segmentation in echocardiography. Phys. Medica 2019, 67, 58–69. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Kim, T.; Hedayat, M.; Vaitkus, V.V.; Bëlohlávek, M.; Krishnamurthy, V.R.; Borazjani, I. Automatic segmentation of the left ventricle in echocardiographic images using convolutional neural networks. Quant. Imaging Med. Surg. 2021, 11, 1763–1781. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Girum, K.B.; Créhange, G.; Lalande, A. Learning with context feedback loop for robust medical image segmentation. IEEE Trans. Med. Imaging 2021, 40, 1542–1554. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Lei, Y.; Fu, Y.; Roper, J.R.; Higgins, K.A.; Bradley, J.D.; Curran, W.J.; Liu, T.; Yang, X. Echocardiographic image multi-structure segmentation using Cardiac-SegNet. Med. Phys. 2021, 48, 2426–2437. [Google Scholar] [CrossRef] [Scilit] [PubMed]
- Alam, G.R.; Khan, A.M.; Shejuty, M.F.; Zubayear, S.I.; Shariar, N.; Altaf, M.M.; Hassan, M.M.; AlQahtani, S.A.; Alsanad, A. Ejection fraction estimation using deep semantic segmentation neural network. J. Supercomput. 2022, 79, 27–50. [Google Scholar] [CrossRef] [Scilit]
- Saeed, M.; Muhtaseb, R.; Yaqub, M. Is contrastive learning suitable for left ventricular segmentation in echocardiographic images? arXiv 2022, arXiv:2201.07219v3. [Google Scholar]
- Zhuang, Z.; Jin, P.; Raj, A.N.J.; Yuan, Y.; Zhuang, S. Automatic segmentation of left ventricle in echocardiography based on YOLOv3 model to Achieve Constraint and Positioning. Comput Math. Methods Med. 2021, 2021, 3772129. [Google Scholar] [CrossRef] [Scilit] [PubMed]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.



