Introduction
Congenital heart defects (CHD) affect approximately 1% of live births. Early detection via prenatal ultrasound is critical for improving neonatal outcomes. However, ultrasound interpretation is notoriously challenging due to inherent image noise, acoustic shadowing from fetal bones, and high inter-operator variability.
Current AI-based diagnostic tools often suffer from three major limitations: they frequently ignore the temporal dynamics of the beating heart, they are often limited to binary "normal vs. abnormal" classification, and they tend to be overconfident. In a clinical setting, a model that lacks proper calibration—the ability to quantify its own uncertainty—can be dangerous.
The TPA Framework
To address these challenges, we present Temporal Prompt Alignment (TPA). TPA is a novel framework designed to align visual motion signatures in ultrasound videos with clinical text descriptions, leveraging vision-language foundation models to improve both diagnostic accuracy and reliability.
The architecture consists of three core pillars:
- Spatiotemporal Encoding: Utilizing a foundation model like FetalCLIP, the system extracts high-level features from video frames. A temporal feature extractor (such as a Graph Neural Network or LSTM) then processes these features to capture the heart's motion over time, which is essential for identifying defects like arrhythmias or abnormal chamber contractions.
- Prompt-Aware Contrastive Learning: The model is trained to align video features with natural language prompts (e.g., "Is the fetal heart normal in this 4CH ultrasound view?"). A margin-hinge contrastive loss ensures that normal and abnormal cases are clearly separated in the mathematical feature space.
- Conditional Variational Autoencoder Style Modulation (CVAESM): This module specifically addresses the overconfidence problem. By injecting a latent style vector that represents data variability and noise, CVAESM allows the model to produce well-calibrated probability scores, effectively quantifying its own uncertainty for each video.
Experimental Setup and Datasets
The TPA framework was evaluated on two distinct datasets to test its accuracy and generalizability:
- Private Fetal CHD Dataset: This curated dataset contains 477 high-quality four-chamber view (4CH) echocardiographic videos, annotated by senior clinical consultants across 19 distinct CHD classes, including Ventricular Septal Defect (VSD) and Arrhythmia.
- EchoNet-Dynamic: To test generalizability beyond fetal hearts, the model was applied to this public dataset of over 10,000 adult echocardiograms to classify systolic dysfunction (heart pumping strength).
Key Results and Discussion
TPA achieved state-of-the-art performance on the CHD dataset with a macro F1 score of 85.40%, significantly outperforming traditional sequence models. Beyond raw accuracy, the model demonstrated superior reliability; the inclusion of the CVAESM module reduced the Expected Calibration Error (ECE) by 5.38%, ensuring that the model's confidence scores align more closely with its actual predictive accuracy.
As shown in the t-SNE visualizations, TPA produces much tighter and more distinct clusters for different heart defects compared to baseline methods. This suggests that the alignment of temporal visual features with clinical text prompts helps the model learn more discriminative representations of cardiac pathology. On the public EchoNet-Dynamic dataset, TPA boosted the macro F1 score by 4.73% over the baseline, confirming that the benefits of temporal prompt alignment extend to adult cardiac imaging.
Conclusion and Future Directions
TPA represents a significant advancement in the automated screening of fetal heart defects. By integrating temporal dynamics with clinical language and robust uncertainty quantification, it offers a more reliable tool for prenatal diagnosis. While the current study focuses on the four-chamber view, future work will explore expanding the model to handle multiple ultrasound planes and refining prompt designs to further leverage clinical expertise.
Summary updated