Skip to content

Synthetic Dataset Generation with Few-shot Guidance: LoFT [Arxiv] & DataDream [ECCV24]

Notifications You must be signed in to change notification settings

ExplainableML/LoFT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2fde392 Β· Mar 31, 2025

History

13 Commits
Mar 11, 2025
Mar 11, 2025
Mar 31, 2025
Mar 11, 2025
Mar 11, 2025
Mar 11, 2025
Mar 11, 2025

Repository files navigation

Synthetic Dataset Generation with Few-shot Guidance

This repository contains the codebase of a series of projects on synthetic dataset generation with few-shot guidance.

Preliminary Setup

We use Stable-Diffusion-2-1-base as a base diffusion model.

Also, few-shot real data should be formed in the following way. Each data file should be located in the path PATH_TO_REAL_FEWSHOT/$DATASET/shot$N_SHOT_seed$FEWSHOT_SEED/$CLASS_NAME/$FILE. The list of $CLASS_NAME For each $DATASET can be found in sd-finetune/util.py file. For instance, when using a 16-shot setting, files should be located as follows:

πŸ“‚ data
|_πŸ“‚ real_train_fewshot
  |_πŸ“‚ imagenet
    |_πŸ“‚ shot16_seed0
      |_πŸ“‚ abacus
        |_πŸ“„ n02666196_17944.JPEG
        |_πŸ“„ n02666196_10754.JPEG
        |_πŸ“„ n02666196_10341.JPEG
        ...
        |_πŸ“„ n02666196_16649.JPEG
      |_πŸ“‚ clothes iron
      |_πŸ“‚ great white shark
      |_πŸ“‚ goldfish
      |_πŸ“‚ tench
      ...
  |_πŸ“‚ eurosat
    |_πŸ“‚ shot16_seed0
      |_πŸ“‚ AnnualCrop
      |_πŸ“‚ Forest
      ...

Step

You can run LoFT, DataDream-class, and DataDream-dataset methods by following the process below.

  1. Install the necessary dependencies in requirements.txt.
  2. Finetune diffusion model: Follow the instructions in the sd-finetune folder.
  3. Dataset generation: Follow the instructions in the generation folder.
  4. Train classification model with synthetic data: Follow the instructions in the classification folder.

Citation

If you use this code in your research, please kindly cite the following papers

@article{kim2025loft,
TBD
}

@article{kim2024datadream,
  title={DataDream: Few-shot Guided Dataset Generation},
  author={Kim, Jae Myung and Bader, Jessica and Alaniz, Stephan and Schmid, Cordelia and Akata, Zeynep},
  journal={arXiv preprint arXiv:2407.10910},
  year={2024}
}

About

Synthetic Dataset Generation with Few-shot Guidance: LoFT [Arxiv] & DataDream [ECCV24]

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published