Home

Awesome

Frequency Domain-based Dataset Distillation (FreD) [NeurIPS 2023]

This repository contains an official PyTorch implementation for the paper "Frequency Domain-based Dataset Distillation" in NeurIPS 2023.

Donghyeok Shin *, Seungjae Shin *, and Il-Chul Moon
<sup> * Equal contribution </sup> <br>

| paper | slides | pretrained |

Updates

Overview

Teaser image

Abstract This paper presents FreD, a novel parameterization method for dataset distillation, which utilizes the frequency domain to distill a small-sized synthetic dataset from a large-sized original dataset. Unlike conventional approaches that focus on the spatial domain, FreD employs frequency-based transforms to optimize the frequency representations of each data instance. By leveraging the concentration of spatial domain information on specific frequency components, FreD intelligently selects a subset of frequency dimensions for optimization, leading to a significant reduction in the required budget for synthesizing an instance. Through the selection of frequency dimensions based on the explained variance, FreD demonstrates both theoretical and empirical evidence of its ability to operate efficiently within a limited budget, while better preserving the information of the original dataset compared to conventional parameterization methods. Furthermore, based on the orthogonal compatibility of FreD with existing methods, we confirm that FreD consistently improves the performances of existing distillation methods over the evaluation scenarios with different benchmark datasets.

Requirements

This code was tested with CUDA 11.4 and Python 3.8.

pip install -r requirements.txt

Usage

The main hyper-parameters of FreD are as follows:

The detailed values of these hyper-parameters can be found in our paper. For other hyper-parameters, we follow the default setting of each dataset distillation objectives. Please refer to the bash file for detailed arguments to run the experiment.

Below are some example commands to run FreD with each dataset distillation objective.

FreD with Gradient Matching (DC)

cd DC/scripts
sh run_DC_FreD.sh

FreD with Distribution Matching (DM)

cd DM/scripts
sh run_DM_FreD.sh

FreD with Trajectory Matching (TM)

cd TM/scripts
sh run_buffer.sh
sh run_TM_FreD.sh

FreD with Other Dataset Distillation Objective

FreD is a highly compatible parameterization method regardless of the dataset distillation objective. Herein, we provide simple guidelines for how to use FreD with different dataset distillation objectives.

# Define the frequency domain-based parameterization 
synset = SynSet(args)

# Initialization
synset.init(images_all, labels_all, indices_class)

# Get partial synthetic dataset
images_syn, labels_syn = synset.get(indices=indices)

# Get entire dataset (need_copy is optional)
images_syn, labels_syn = synset.get(need_copy=True)

ImageNet-[A,B,C,D,E]

cd ImageNet-abcde/scripts
sh run_XXX_FreD.sh

3D-MNIST

cd 3D-MNIST/scripts
sh run_DM_FreD.sh

Robustness of Corruption

cd corruption-exp/scripts
sh run.sh

Experiment Results

MNISTFashionMNISTSVHNCIFAR-10CIFAR-100Tiny-ImageNet
1 img/cls95.884.682.260.634.619.2
10 img/cls97.689.189.570.342.724.2
50 img/cls--90.375.847.826.4
ImageNetteImageWoofImageFruitImageYellowImageMeowImageSquawk
1 img/cls66.838.343.763.243.257.0
10 img/cls72.041.347.069.248.667.3
ImageNet-AImageNet-BImageNet-CImageNet-DImageNet-E
DC w/ FreD53.154.854.242.841.0
DM w/ FreD58.058.655.646.345.0
TM w/ FreD67.769.363.654.455.4

More results can be found in our paper.

Citation

If you find the code useful for your research, please consider citing our paper.

@inproceedings{shin2023frequency,
  title={Frequency Domain-Based Dataset Distillation},
  author={Shin, DongHyeok and Shin, Seungjae and Moon, Il-chul},
  booktitle={Thirty-seventh Conference on Neural Information Processing Systems},
  year={2023}
}

This work is heavily built upon the code from