- The paper presents SYNRARE, a tool for generating synthetic electronic health records (EHR) tailored for testing machine learning algorithms in rare disease detection, enabling researchers to create custom cohorts with controllable disease prevalence and complexity.
- Synthea’s SYNRARE builds on its rule-based architecture for precise control over disease trajectories and demographics, avoiding potential biases from real-world data but sacrificing some realism
- The tool extends Synthea’s capabilities by adding global modification features, legacy module migration, and BMI-driven comorbidity modeling, thus supporting nuanced disease simulations and realistic comorbidity scenarios.
Motivation and problem statement
Machine learning applied to Electronic Health Records (EHRs) has demonstrated the ability to flag patients at risk for rare diseases (RDs), including wild-type transthyretin amyloid cardiomyopathy, acute hepatic porphyria, and Gaucher disease [Huda et al. 2021; Cohen et al. 2020; Wilson et al. 2023]. However, RD research faces two structural obstacles: datasets are extremely imbalanced—RDs are defined in the EU as conditions affecting fewer than 1 in 2,000 individuals—which inflates false positives via Bayes' theorem, and privacy/ethical constraints severely restrict access to real-world EHR data [Fecho et al. 2022]. The consequence is that novel ML methods for RD detection cannot be systematically stress-tested before undergoing lengthy data access procedures.
SYNRARE addresses this gap as a graphical user interface built on the Synthea framework [Walonoski et al. 2018], enabling researchers to generate synthetic EHR cohorts containing a minority subgroup of simulated RD patients that differ from a majority common-disease population by a definable, user-controlled degree. The tool is explicitly positioned for technical evaluation of algorithms—i.e., measuring how well classifiers or outlier detectors can separate a minority class from a realistic majority class—not for clinical inference about the diseases themselves.
Design rationale: rule-based over data-driven generation
The authors deliberately build on Synthea's rule-based architecture rather than data-driven generators such as MedGAN [Choi et al. 2017], CTGAN-based pipelines, or commercial engines like Syntegra. The stated justification is control: rule-based modules expose disease trajectories and demographic parameters explicitly, so users can manipulate them without inheriting biases from an underlying real-world data distribution. This is a defensible trade-off given the benchmarking objective—when the goal is to characterize performance limits under controlled conditions, full parameterization of the data-generating process is more valuable than distributional fidelity to real EHRs. The cost is realism, which the authors concede directly (see below).
Functionality
SYNRARE requires Python 3.8+ and Java JDK 11 and operates in three module-selection modes:
- Single Module: view and edit individual states of one disease module.
- Multiple Modules: co-generate patients from a selected subset of modules, supporting custom comorbidity combinations.
- All Modules: generate a general hospital-like population.
- Custom user-supplied modules can be loaded in any mode.
Each state in a Synthea module follows a Uniform, Gaussian, or Exponential distribution (or an exact value), and SYNRARE exposes these parameters for editing. A notable engineering contribution is legacy module migration, which upgrades older Synthea modules with missing fields or unsupported distributions so they become editable.
Global modification
Synthea's native editor lacks batch operations; modifying every state by hand is impractical. SYNRARE adds a Random Modification mode that applies global changes parameterized by three knobs: variance magnitude, range shift, and modification probability. The effects are distribution-dependent: increasing variance widens Gaussian distributions but leaves Exponential distributions unchanged; range shifts translate bounds (Uniform) or means (Gaussian, Exponential). The authors recommend range shifts of 1–1.5 for minor perturbations, noting that a shift of 2 can move a Uniform(25, 50) state to Uniform(50, 75)—a substantial semantic change. After applying changes, the user receives a summary of affected states that must be approved or rejected, and modified modules are written as new files, preserving originals.
BMI-driven comorbidity modeling
A second feature adjusts patient BMI across five categories (Normal through Obesity Class III) and automatically propagates associated health effects. The adjustment factors are grounded in epidemiological evidence—meta-analytic estimates indicate overweight adults have roughly 20–50% higher odds of coronary heart disease and stroke, while obesity roughly doubles risk [Guh et al. 2009]. Representative parameters include a +25 mmHg systolic blood pressure increment for Obesity Class III relative to normal weight, a fasting glucose multiplier of ×1.24, a liver enzyme multiplier of ×1.60, and a disease probability multiplier of ×2.10 at Class III. This allows researchers to generate confounded cohorts in which comorbidity burden varies systematically—a realistic complication for classification tasks.
Example use case
The paper demonstrates the workflow on bronchitis versus a synthetic rare lung-disease variant. Applying Random Modification with variance 1.1, range shift 1.2, and 100% modification probability produces a variant whose PCA projection overlaps substantially with the original module, making simple interpretable models such as logistic regression insufficient for binary separation. By progressively relaxing the modification parameters, users can construct a difficulty gradient of classification scenarios. The authors note the framework extends beyond binary classification to outlier detection and clustering, though no quantitative benchmark results (e.g., AUROC curves across difficulty levels) are reported in the paper itself—the PCA visualization is the only empirical evidence presented.
Limitations and open questions
The authors are candid about several constraints. First, Synthea generates "idealized" disease trajectories containing relevant symptoms and interventions, whereas real RD EHRs are characterized by extensive missingness and confounding [Li et al. 2021; Ren et al. 2024]; results obtained on SYNRARE data therefore bound technical capability rather than predict real-world performance. Second, effective use presupposes substantial domain knowledge—disease progression, clinical guidelines, phenotype characterization—to produce credible scenarios; the tool lowers the implementation barrier but not the expertise barrier. Third, the Exponential distribution is invariant to variance adjustments, limiting the modification space for states using that distribution type. Finally, the paper validates usability qualitatively rather than quantitatively: no experiments establish that models ranked on SYNRARE benchmarks correlate with their ranking on real RD EHR tasks, leaving open whether this proxy preserves model ordering.
Conclusion
SYNRARE packages Synthea's rule-based patient simulation behind a no-code interface with three targeted extensions: global module modification with tunable dissimilarity, legacy module migration, and evidence-based BMI-driven comorbidity modeling. Its principal value is enabling controlled, reproducible testbeds in which the minority-class separation problem of rare disease diagnosis can be studied at arbitrary difficulty without privacy constraints. Its usefulness as a benchmarking proxy ultimately rests on the untested assumption that algorithm behavior on idealized rule-generated trajectories transfers to messy real-world RD cohorts.