sdh0818 / FreD

Official PyTorch implementation for Frequency Domain-based Dataset Distillation [NeurIPS 2023]
Apache License 2.0
27 stars 1 forks source link

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
* Equal contribution

| 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)

FreD with Distribution Matching (DM)

FreD with Trajectory Matching (TM)

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]

3D-MNIST

Robustness of Corruption

Experiment Results

MNIST FashionMNIST SVHN CIFAR-10 CIFAR-100 Tiny-ImageNet
1 img/cls 95.8 84.6 82.2 60.6 34.6 19.2
10 img/cls 97.6 89.1 89.5 70.3 42.7 24.2
50 img/cls - - 90.3 75.8 47.8 26.4
ImageNette ImageWoof ImageFruit ImageYellow ImageMeow ImageSquawk
1 img/cls 66.8 38.3 43.7 63.2 43.2 57.0
10 img/cls 72.0 41.3 47.0 69.2 48.6 67.3
ImageNet-A ImageNet-B ImageNet-C ImageNet-D ImageNet-E
DC w/ FreD 53.1 54.8 54.2 42.8 41.0
DM w/ FreD 58.0 58.6 55.6 46.3 45.0
TM w/ FreD 67.7 69.3 63.6 54.4 55.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