Home Knowledge Base Synthetic Data and Data Augmentation

Synthetic Data and Data Augmentation

Why Synthetic Data? Real data is limited, expensive, and may have privacy concerns. Synthetic data enables training at scale.

Data Augmentation

Image Augmentation

from torchvision import transforms

augment = transforms.Compose([
    transforms.RandomHorizontalFlip(),
    transforms.RandomRotation(15),
    transforms.ColorJitter(brightness=0.2, contrast=0.2),
    transforms.RandomResizedCrop(224, scale=(0.8, 1.0)),
])

Text Augmentation

def text_augment(text):
    augmentations = [
        synonym_replacement,
        random_insertion,
        random_swap,
        random_deletion,
        back_translation,
    ]
    return random.choice(augmentations)(text)

LLM-Generated Augmentation

def llm_augment(text):
    return llm.generate(f"""
Paraphrase this text while preserving the meaning:
{text}

Paraphrase:
    """)

Synthetic Data Generation

Tabular Data

from sdv.single_table import GaussianCopulaSynthesizer

synthesizer = GaussianCopulaSynthesizer(metadata)
synthesizer.fit(real_data)
synthetic_data = synthesizer.sample(1000)

Image Generation

# Use diffusion models to generate training images
synthetic_images = diffusion_model.generate(
    prompts=["a car on a highway", "a red sports car"],
    num_images_per_prompt=100
)

Instruction Data

def generate_instruction_data(domain, n):
    return llm.generate(f"""
Generate {n} diverse instruction-response pairs for {domain}.
Format as JSON: [{{"instruction": "...", "response": "..."}}]
    """)

Quality Considerations

AspectMethod
DiversityMeasure distribution coverage
RealismHuman evaluation, discriminators
PrivacyDifferential privacy, membership inference
UtilityDownstream task performance

Use Cases

DomainApplication
HealthcareReplace sensitive patient data
FinanceFraud detection training
Autonomous drivingEdge case scenarios
NLPLow-resource languages

Best Practices

synthetic datadata augmentationgen

Explore 500+ Semiconductor & AI Topics

From EUV lithography to CUDA optimization — search the full knowledge base or chat with our AI assistant.