Controlled Synthesis of Imperfect Datasets for Machine Learning Education: A Variational Autoencoder, Wasserstein GAN, and Gaussian Mixture Model Framework with Domain-Aware Fraud and Error Injection
Abstract Machine learning and data science education overwhelmingly relies on pre-cleaned, statically curated benchmark datasets from repositories such as the UCI ML Repository and Kaggle. These datasets are ill-suited to teaching the realities of production data pipelines, which invariably contain missing values arising from mixed mechanisms, domain-specific typographic errors, format inconsistencies, and embedded fraud of varying sophistication. This paper presents a configurable framework for generating synthetic imperfect datasets tailored to four United Kingdom financial domains: banking transactions, mortgage lending, insurance claims, and investment and trading. The framework offers three alternative generators, one selected per request: a $$\beta $$ -Variational Autoencoder ( $$\beta $$ -VAE) with KL annealing, a Wasserstein GAN with Gradient Penalty (WGAN-GP) and their hybrid, with a Gaussian Mixture Model (GMM) fitted to the VAE latent space as an optional prior, all implemented entirely in pure NumPy so that every operation is an explicit array computation. A probabilistic error injection layer introduces nine distinct corruption types—covering MCAR, MAR, and structural errors—allocated via a Dirichlet prior over a user-specified global error budget. A domain-aware fraud injection layer encodes archetypes drawn from UK Finance, Payment Systems Regulator, Financial Conduct Authority (FCA) and Association of British Insurers (ABI) taxonomies. Evaluation across the four domains, against external baselines fitted to the same training splits, shows that the $$\beta $$ -VAE attains a mean Kolmogorov–Smirnov statistic of 0.104 against a held-out partition of the rule-based seed corpus , ahead of CTGAN and TVAE on the same target at 1/34 and 1/9 of their respective fitting times, and that a structureless independent-marginals generator matches every marginal while destroying the correlation structure, so marginal fidelity alone does not discriminate between generators. A zero-cost smoothed bootstrap of the seed corpus attains a better statistic still on both marginal fidelity and correlation error, and a Gaussian copula is ahead of the $$\beta $$ -VAE on categorical divergence and correlation error at a fifth of its fitting cost, so the case for the generative stage is not made on fidelity to the seed corpus and is not made here. Validation against real record-level data shows close agreement for bounded quantities and substantial disagreement in the tails, so the framework is characterised as generating plausible rather than realistic records. A detector transcribed from the documented fraud injection ranges and fitted to nothing attains AUROC 0.994 when archetypes overwrite records outright, which motivates an overlap-controlled injection scheme introduced here that makes archetype separability a declared continuous parameter; at its default expression coefficient $$\lambda = 0.25$$ the same detector falls to 0.609, while a trained classifier reaches 0.948. Error injection realises a stable and monotone but systematically low fraction of the requested rate, averaging 0.596 of it, and the missingness mechanisms are verified to be correctly instantiated when isolated from the default allocation. Generation scales to 100,000 records in 7.0 min on two commodity CPU cores without GPU acceleration. No evidence involving learners or instructors is presented; a protocol for the evaluation that would be required is specified in full.
Authors
- Khoa Phung (ORCID: https://orcid.org/0000-0002-9341-2033)
Institutions
- University of the West of England (GB)
Publication Details
- Journal
- SN Computer Science
- Published
- 2026-11-11
- DOI
- https://doi.org/10.1007/s42979-026-05421-7
- Primary Topic
- Generative Adversarial Networks and Image Synthesis
- Type
- article
- Field-Weighted Citation Impact
- 0.00