Editing
Synthetic Data
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
<div style="background-color: #4B0082; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> {{BloomIntro}} Synthetic data generation is the process of programmatically creating artificial data that mimics the statistical properties of real-world data, without containing actual sensitive records. As AI systems require ever-larger training datasets while privacy regulations restrict data sharing, synthetic data has become a critical tool. It enables training on data that doesn't exist yet (rare events, edge cases), augmenting scarce real data, testing AI systems safely, and sharing datasets across organizations without exposing private information. </div> __TOC__ <div style="background-color: #000080; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> == <span style="color: #FFFFFF;">Remembering</span> == * '''Synthetic data''' β Artificially generated data that preserves statistical properties of real data without containing actual records. * '''Data augmentation''' β Creating modified versions of existing samples (rotations, flips, noise) to expand training data; a simple form of synthetic data. * '''Generative model''' β A model that learns the distribution of training data and can sample new examples from it. * '''GAN (for synthesis)''' β Using Generative Adversarial Networks to create realistic synthetic tabular, image, or text data. * '''Variational Autoencoder (VAE)''' β A generative model that encodes data to a latent distribution and samples new data. * '''Differential privacy (DP)''' β A mathematical guarantee that synthetic data cannot be used to identify individuals in the original dataset. * '''Fidelity''' β How statistically similar the synthetic data is to the real data. * '''Utility''' β How useful the synthetic data is for training models (does a model trained on synthetic data work on real data?). * '''Privacy (for synthetic data)''' β The degree to which the synthetic data protects the privacy of individuals in the original dataset. * '''Membership inference attack''' β A privacy attack testing whether a specific record was in the training data; used to evaluate synthetic data privacy. * '''CTGAN''' β Conditional Tabular GAN; one of the most widely used methods for synthetic tabular data generation. * '''SDV (Synthetic Data Vault)''' β An open-source library for synthetic tabular data generation using multiple methods. * '''Train-on-synthetic, test-on-real (TSTR)''' β The standard utility evaluation: train a model on synthetic data, test on real data. * '''Simulation-based synthesis''' β Generating synthetic data from physics or domain simulations rather than generative models. </div> <div style="background-color: #006400; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> == <span style="color: #FFFFFF;">Understanding</span> == '''Why synthetic data?''' Four main use cases: '''Privacy''': Healthcare, finance, and legal data are highly sensitive. Synthetic data preserves statistical patterns without containing real patient or customer records, enabling sharing, collaboration, and ML development without regulatory risk. '''Data scarcity''': Some events are rare β industrial faults, rare diseases, fraud patterns, crash scenarios. Real datasets may contain only dozens of examples. Synthetic data can generate thousands of realistic rare-event examples for training. '''Data augmentation''': Standard image training uses random crops, flips, and color jitter. Modern approaches use diffusion models to generate entirely new training images, dramatically expanding effective dataset size. '''Simulation''': Autonomous vehicle companies generate billions of synthetic driving scenarios from physics simulators (CARLA, AirSim) to train perception and planning models β impossible to collect all scenarios in the real world. '''The fidelity-privacy-utility triangle''': You cannot simultaneously maximize all three. High-fidelity synthetic data closely resembles the original β but may expose private information. Applying differential privacy (DP) to synthesis guarantees privacy but reduces fidelity and utility. Finding the optimal operating point for a specific use case is the key challenge. '''Evaluation gap''': A common failure mode β synthetic data looks statistically similar but fails as training data. Low-order statistics (means, correlations) may match while high-order structure (rare combinations, causal relationships) does not. Always evaluate with TSTR: does a model trained on synthetic data achieve comparable test performance on real data? </div> <div style="background-color: #8B0000; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> == <span style="color: #FFFFFF;">Applying</span> == '''Tabular synthetic data generation with SDV:''' <syntaxhighlight lang="python"> import pandas as pd from sdv.tabular import CTGAN from sdv.evaluation import evaluate from sdv.metrics.tabular import KSComplement, TVComplement # Real data (e.g., customer transactions) real_data = pd.read_csv("customer_data.csv") # Fit CTGAN generative model model = CTGAN( epochs=300, batch_size=500, generator_dim=(256, 256), discriminator_dim=(256, 256), ) model.fit(real_data) # Generate synthetic dataset synthetic_data = model.sample(num_rows=10000) print(synthetic_data.head()) # Evaluate fidelity (statistical similarity) results = evaluate( synthetic_data, real_data, metrics=[KSComplement, TVComplement], aggregate=False ) print(results) # TSTR evaluation: train classifier on synthetic, test on real from sklearn.ensemble import GradientBoostingClassifier from sklearn.metrics import accuracy_score target = 'churn' X_syn = synthetic_data.drop(target, axis=1) y_syn = synthetic_data[target] X_real_test = real_data.drop(target, axis=1) y_real_test = real_data[target] clf = GradientBoostingClassifier().fit(X_syn, y_syn) score = accuracy_score(y_real_test, clf.predict(X_real_test)) print(f"TSTR accuracy: {score:.3f}") # Compare against train-on-real baseline </syntaxhighlight> ; Synthetic data method by data type : '''Tabular''' β CTGAN, GaussianCopula, TVAE (SDV library) : '''Images (augmentation)''' β Albumentations, torchvision.transforms : '''Images (generative)''' β Stable Diffusion inpainting, DreamBooth for novel objects : '''Time series''' β TimeGAN, PAR (SDV), Temporal Fusion Transformer synthesis : '''Text''' β LLM generation with domain prompts, backtranslation : '''Simulation''' β CARLA (autonomous driving), NVIDIA Isaac (robotics), Unity ML-Agents </div> <div style="background-color: #8B4500; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> == <span style="color: #FFFFFF;">Analyzing</span> == {| class="wikitable" |+ Synthetic Data Approach Tradeoffs ! Method !! Fidelity !! Privacy !! Utility || Complexity |- | Rule-based simulation || Medium || High || High (domain-specific) || High |- | Statistical sampling || Low-medium || High || Low-medium || Low |- | CTGAN/TVAE || High || Medium || High || Medium |- | Diffusion model || Very high || Low || Very high || High |- | DP-GAN || Medium || Guaranteed (Ξ΅,Ξ΄) || Lower || High |} '''Failure modes''': Mode collapse in GAN synthesis β the generator produces limited variety. Privacy leakage β even without direct record memorization, synthetic data can allow membership inference. Distribution mismatch β synthetic data looks similar in aggregate but fails on edge cases the model learned from real data. Overfitting to synthetic data β model learns synthetic-data-specific artifacts. </div> <div style="background-color: #483D8B; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> == <span style="color: #FFFFFF;">Evaluating</span> == Comprehensive synthetic data evaluation: # '''Statistical fidelity''': column-level distributions (KS test), pairwise correlations, mutual information. # '''Utility (TSTR)''': train on synthetic, test on real β compare to train-on-real baseline. Good synthetic data achieves >90% of real-data model performance. # '''Privacy''': run membership inference attacks; ensure attack success rate β random guess. # '''Rare event coverage''': verify rare categories and edge cases are proportionally represented. # '''Domain expert review''': have subject matter experts inspect samples for plausibility. </div> <div style="background-color: #2F4F4F; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;"> == <span style="color: #FFFFFF;">Creating</span> == Designing a synthetic data pipeline: # Characterize real data: distributions, correlations, constraints (valid ranges, foreign keys). # Choose method: CTGAN for tabular, diffusion for images, TimeGAN for sequences. # Apply constraints: post-generation filtering to enforce domain rules (age β₯ 0, income > 0, valid date ranges). # Evaluate fidelity and TSTR on held-out real data split. # Privacy audit: run membership inference; if needed, apply DP noise (SDMetrics dpsynth). # Data validation: automated schema checks before synthetic data enters any training pipeline. [[Category:Artificial Intelligence]] [[Category:Synthetic Data]] [[Category:Machine Learning]] </div>
Summary:
Please note that all contributions to BloomWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BloomWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Template:BloomIntro
(
edit
)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information