Home

Awesome

The Official PyTorch Implementation of SDP (Scheduled Data Prior)

Online Boundary-Free Continual Learning by Scheduled Data Prior<br> Hyunseo Koh, Minhyuk Seo, Jihwan Bang, Hwanjun Song, Deokki Hong, Seulki Park, Jung-Woo Ha, Jonghyun Choi<br> ICLR 2023<br>

Overview

<img src="./overview.png" width="450"> <img src="./method_overview.png" width="450">

Abstract

Typical continual learning setup assumes that the dataset is split into multiple discrete tasks. We argue that it is less realistic as the streamed data would have no notion of task boundary in real-world data. Here, we take a step forward to investigate more realistic online continual learning – learning continuously changing data distribution without explicit task boundary, which we call boundary-free setup. As there is no clear boundary of tasks, it is not obvious when and what information in the past to be preserved as a better remedy for the stability-plasticity dilemma. To this end, we propose a scheduled transfer of previously learned knowledge. We further propose a data-driven balancing between the knowledge in the past and the present in learning objective. Moreover, since it is not straight-forward to use the previously proposed forgetting measure without task boundaries, we further propose a novel forgetting measure based on information theory that can capture forgetting. We empirically evaluate our method on a Gaussian data stream, its periodic extension, which assumes periodic data distribution frequently observed in real-life data, as well as the conventional disjoint task-split. Our method outperforms prior arts by large margins in various setups, using four popular benchmark datasets – CIFAR-10, CIFAR-100, TinyImageNet and ImageNet.

Results

Results of CL methods on various datasets, for online continual learning on Gaussian Data Stream, measured by <img src="https://render.githubusercontent.com/render/math?math=A_\text{AUC}"> metric. For more details, please refer to our paper.

MethodsCIFAR10CIFAR100TinyImageNetImageNet
ER55.97±0.8536.93±0.7721.78±0.7624.16
DER++56.12±0.1428.77±0.6717.13±0.8819.34
ER-MIR56.48±0.1834.76±1.2021.64±0.7712.86
GDumb46.45±0.6828.81±0.7418.81±0.6413.74
CLIB63.01±0.3142.79±0.6527.53±0.9434.11
SDP66.51±0.4246.34±0.6430.49±0.6935.52

Getting Started

To set up the environment for running the code, you can either use the docker container, or manually install the requirements in a virtual environment.

Using Docker Container (Recommended)

We provide the Docker image khs8157/sdp on Docker Hub. To download the docker image, run the following command:

<pre> docker pull khs8157/sdp:latest </pre>

After pulling the image, you may run the container via following command:

<pre> docker run --gpus all -it --shm-size=64gb -v <i>/PATH/TO/CODE</i>:<i>/PATH/TO/CODE</i> --name=<i>CONTAINER_NAME</i> khs8157/sdp:latest bash </pre>

Replace the arguments written in <i>italic</i> with your own arguments.

Requirements

If not using Docker container, install the requirements using the following command

<pre> pip install -r requirements.txt </pre>

Running Experiments

Downloading the Datasets

CIFAR10, CIFAR100, and TinyImageNet can be downloaded by running the corresponding scripts in the dataset/ directory. ImageNet dataset can be downloaded from Kaggle.

Experiments Using Shell Script

Experiments for the implemented methods can be run by executing experiment.sh by

<pre> bash experiment.sh </pre>

You may change various arguments for different experiments.

Creating the Data Stream

We provide a jupyter notebook make_stream.ipynb to construct the data streams used in the experiment. You may create your own Boundary-Free data streams by modifying the distribution, period, and etc.

Citation

If you used our code, SDP method, Boundary-Free setup, or KLR and KGR metric, please cite our paper.

<pre> @inproceedings{koh2023online, title={Online Boundary-Free Continual Learning by Scheduled Data Prior}, author={Koh, Hyunseo and Seo, Minhyuk and Bang, Jihwan and Song, Hwanjun and Hong, Deokki and Park, Seulki and Ha, Jung-Woo and Choi, Jonghyun}, booktitle={ICLR}, year={2023} } </pre>

Acknowledgment

This work is partly supported by the NRF grant (No.2022R1A2C4002300), IITP grants (No.2020-0-01361-003, AI Graduate School Program (Yonsei University) 5%, No.2021-0-02068, AI Innovation Hub 5%, 2022-0-00077, 20%, 2022-0-00113, 20%, 2022-0-00959, 15%, 2022-0-00871, 15%, 2022-0-00951, 15%) funded by the Korea government (MSIT).