arXiv:2610.31139cs.CVOct 2026

Manuscript Offprint

arXiv:2610.31139

Pos4CHD: A Positive-Free Mask-Guided Counterfactual Synthesis Framework for Fetal Congenital Heart Defect Analysis

Wenjie Xuan, Yapeng Li, Hang Su, Chen Cheng, Juhua Liu, Sheng Zhao, Ziming Huang, Bo Du

Wenjie Xuan, Yapeng Li, Hang Su, Chen Cheng, Juhua Liu, Member, IEEE, Sheng Zhao, Ziming Huang, and Bo Du, Senior Member, IEEE

Abstract—The scarcity of positive cases remains a major bottleneck in developing automated diagnostic systems for fetal Congenital Heart Defects (CHDs), particularly for rare subtypes. Although normal cases are accessible with effort, positive cases are hard to collect due to low incidence rates and privacy concerns, causing severe class imbalance or absence of positive training samples. Existing works resort to synthesizing positives with conditional generative models, but they are task-specific and require positive training samples, hindering application for fetal CHDs. To this end, we propose a positive-free mask-guided counterfactual generation framework for fetal echocardiography, namely Pos4CHD, which enables realistic, high-quality synthesis of pseudo-positive samples from semantic masks, with only normal samples at hand. Technically, we first develop FE-Gen, a mask-guided generative model tailored for fetal heart ultrasound synthesis that mitigates histogram drift and enhances image-mask spatial alignment. Building on FE-Gen, Pos4CHD employs a mask-to-image generation paradigm for CHD synthesis. It first manipulates semantic masks to simulate fetal-heart structural anomalies and then renders anatomically consistent images. Extensive experiments on in-house datasets, together with expert evaluations, demonstrate the visual fidelity ( −12.97-12.97 FID) and anatomical consistency ( +3.96%+3.96\% DSC) of synthesized images. Further validations across diverse real-world CHD diagnosis tasks exhibit promising results and consistent increments, including zero-shot classification (achieving 93.25% ACC on EbA and 72.92% ACC on TAPVC), lesion detection ( +6.95%+6.95\% mAP50 on VSD), and anatomy segmentation ( +10.49%+10.49\% DSC on fetal heart) compared with baselines. Codes and models are publicly available on GitHub.

Index Terms—Fetal echocardiography, diffusion model, counterfactual synthesis, data augmentation

I. INTRODUCTION

This work was supported in part by the National Key Research and Development Program of China under Grant 2023YFC2705701, in part by the National Natural Science Foundation of China under Grants 62225113, 625B2132 and U23B2048, in part by the Science and Technology Major Project of Hubei Province under Grants 2025BCB026, and in part by the China Birth Defect Intervention and Rescue Foundation and Beijing ByteDance Charity Foundation under 2026CFBD-CKZN-005. Corresponding author: Juhua Liu (e-mail: liujuhua@whu.edu.cn)

Wenjie Xuan, Yapeng Li, Hang Su, Juhua Liu and Bo Du are with the School of Computer Science, Wuhan University, Wuhan, China. {dreamxwj, yapengli, hangsu, liujuhua, dubo}@whu.edu.cn).

Chen Cheng, Sheng Zhao and Ziming Huang are with Maternal and Child Health Hospital of Hubei Province, Wuhan, China. {chengchen777, zhao1015568495}@163.com, huangziming@hbfy.com).

Figure

Fig. 1. Paradigm comparison for (a) class/text-, (b) layout-, (c) mask-guided medical counterfactual synthesis. Since CHDs are structural anomalies, we employ a mask-guided paradigm for fetal CHD synthesis without positive training samples, providing dense structural guidance, fine spatial alignment, and interpretability for downstream analysis.

FETAL congenital heart defects (CHDs), characterized by heterogeneous structural anomalies, are one of the leading causes of infant mortality, which affects approximately 0.8~1.0% of live births [1], [2]. Fetal echocardiography, i.e., fetal heart ultrasound, is the primary tool for prenatal examination due to its radiation-free, low-cost, and real-time nature. Clinicians typically examine fetal heart anatomical structures using standardized cardiac views [3] like the Four-Chamber (4CH) view, Three-Vessel and Trachea (3VT) view, etc., which provide essential and vital references for cardiac function analysis. This practice helps early detection and diagnosis of various CHD subtypes, including Ebstein's Anomaly (EbA), Total Anomalous Pulmonary Venous Connection (TAPVC), Ventricular Septal Defect (VSD), etc., contributing to improved worldwide pregnancy healthcare [4].

ii

IEEE TRANSACTIONS AND JOURNALS TEMPLATE

However, compared with existing AI systems for MRI, CT, and X-rays [5], AI-assisted fetal CHD detection and analysis remains underdeveloped due to severe data scarcity, which stems from: (1) the acquisition of standardized fetal cardiac views requires expertise and experience, (2) varied view quality across operators and examinations, and (3) cardiac anatomical annotation is labor-intensive and requires expertise, resulting in few high-quality public datasets. More importantly, given the wide range of CHD subtypes ( ≥\geq27), although normal cases are accessible through clinical efforts, positive cases for rare CHDs are often out of reach owing to low incidence rates (<1/10,000) [2] and privacy constraints. This positive-sample scarcity hinders the training of downstream models, leading to severe class imbalance and potential generalization issues [6].

Recent advances in generative models, e.g., diffusion models, offer a promising solution to medical data scarcity via image synthesis. Existing studies focused on improving image fidelity [7], [8] and anatomical plausibility [9], [10] across different imaging modalities, and adapting generative foundation models for medical applications [11]–[13]. Conditional generative models, e.g., Stable Diffusion (SD) [14] and ControlNet [15], further enable task-specific conditional guidance to synthesize images with desired properties. Practices (see Fig. 1) include class labels or text prompts [16], [17] for anatomical description, layouts [18] for lesion position and size, segmentation masks [19], [20] for structure and shape, with optional reference images [21], [22] to provide extra context for local variations. Such methods can produce paired image-condition data for augmentation purposes and benefit various downstream tasks including classification, segmentation, and multi-center generalization [10], [23]. Recent counterfactual synthesis explores generating positive cases, such as tumors [24], thyroid cancers [25], breast lesions [26], etc.

Despite these advances, directly applying such approaches to fetal CHD synthesis remains challenging. First, most works are designed for specific tasks and limited scenarios. We need to redesign a framework for fetal CHD synthesis, where the complicated cardiac anatomy and heterogeneous CHD subtypes raise the complexity. Second, current methods [24]–[26] require positive samples to learn lesion-specific textures and structures, implicitly assuming the availability of positive cases. But this assumption is violated because of the absence of fetal CHD samples, particularly for rare subtypes. Third, existing works lack fine-grained control over synthesized images. As shown in Fig. 1, given that CHDs are mostly structural anomalies, the class labels and text prompts offer limited spatial control, where the anatomical plausibility of synthesized positives depends on generative priors and is hardly guaranteed. Though bounding boxes offer locations and enable simulation of position and size variations, they still fall short in depicting morphology and fine-grained variations, thus insufficient to distinguish anatomical differences across CHD subtypes. Therefore, we raise the question: can we design a unified framework to synthesize realistic and anatomy-consistent samples of diverse CHD subtypes for downstream analysis, with only negative samples at hand?

To this end, we propose Pos4CHD, a positive-free mask-guided counterfactual synthesis framework for fetal CHD analysis. Firstly, considering the absence of publicly available datasets, we collect ~8k fetal 4CH views and ~500 expert-annotations covering 14 key anatomical structures (Sec. III-C.1), and train FE-Gen (Sec. III-C.2), a mask-conditioned generator for fetal echocardiography, which features: 1) learnable semantic queries that enhance the spatial alignment between synthesized images and conditioning masks, and 2) a regularization term that mitigates the histogram drift when adapting diffusion models for ultrasound with improved image fidelity. Building on FE-Gen, Pos4CHD (Sec. III-B) utilizes a mask-to-image generation strategy to synthesize fetal CHDs from normal samples. Specifically, it first manipulates cardiac masks to simulate structural anomalies with respect to clinical prior knowledge, realizing rule-based counterfactual mask generation for fetal CHDs. Then, FE-Gen renders corresponding echocardiographic images guided by masks, yielding spatially aligned pseudo-positive samples. These synthesized samples are subsequently utilized to augment downstream training data after quality checking. Experiments and expert evaluations demonstrate the image fidelity and anatomical consistency of FE-Gen (Sec. IV-B.1). Extensive experiments on real-world scenarios, including zero-shot EbA/TAPVC classification, VSD detection, and fetal cardiac anatomy segmentation, verify the effectiveness of Pos4CHD, which not only enables training models without real positives but also consistently outperforms the baseline (Sec. IV-B.2). Notably, models trained solely on synthesized data can generalize well to real samples.

Our contributions are summarized as follows:

  1. We develop Pos4CHD, a positive-free mask-to-image counterfactual generation framework to tackle the scarcity of fetal CHD cases, especially rare subtypes, which offers pseudo-positive image-mask pairs for diverse CHDs through rule-based counterfactual mask manipulation and mask-guided fetal ultrasound synthesis.

  2. We collect normal fetal 4CH-view datasets with rich pixel-level anatomical annotation. Based on the collected data, we train FE-Gen, a mask-guided generative model for fetal echocardiography, realizing improved ultrasound fidelity and advanced image-mask alignment.

  3. Experiments together with expert evaluations demonstrate the effectiveness of our synthesized samples for data augmentation across various downstream tasks, bringing consistent improvements on zero-shot CHD classification, lesion detection, and fetal heart anatomy segmentation. Detailed ablations and discussions provide valuable insights to the community on how to obtain and utilize the synthesized positive samples with our method.

References (53)