A Comparative Analysis of Transformer-Based Architectures for 2D Echocardiographic Segmentation
Abstract
Accurate segmentation of cardiac structures in 2D echocardiography is a crucial step for the computation of clinically relevant indices, such as ventricular volumes and ejection fraction (EF). While convolutional neural networks, and in particular UNet-based architectures, have long represented the state of the art for this task, recent advances in Transformer-based models have shown promising potential. In this work, we present a controlled comparison between CNN-based and transformer-based architectures under a shared protocol for multi-class segmentation of the left ventricle, myocardium, and left atrium. Specifically, we evaluate UNet together with TransUNet, SwinUNet, and MedFormer models, using the publicly available CAMUS dataset as a benchmark. For external evaluation, these models are further tested on a dedicated in-house dataset, comprising full cardiac-cycle sequences from 27 healthy volunteers acquired with a different ultrasound system. In this last case, performance is evaluated not only in terms of segmentation accuracy but also in terms of left-ventricular geometry and EF estimation accuracy. Results on CAMUS show that UNet and MedFormer achieve broadly comparable performance, while TransUNet also remains competitive, with the best-performing architecture depending on the anatomical structure, cardiac phase, and evaluation metric. On the in-house dataset, all models show a moderate performance decrease, with MedFormer exhibiting the most consistent advantages for left-ventricular and myocardial segmentation. Overall, this study highlights the strengths and limitations of several transformer-based models in echocardiographic segmentation and provides insights into their performance under external evaluation condition and temporal consistency.