license:apache-2.0 size_categories:n<1K format:imagefolder modality:image library:datasets library:mlcroissant arxiv:2407.04325 arxiv:2007.08558 region:us
---
license: apache-2.0
configs:
  - config_name: foregrounds
    data_files: data/foregrounds/**/*
  - config_name: backgrounds
    data_files: data/backgrounds/*
---
# Transforms-2D Base Dataset

This dataset contains foreground objects and background images used by the Transforms-2D dataset in the paper [Understanding the Role of Invariance in Transfer Learning](https://arxiv.org/abs/2407.04325), published at TMLR 2024.
The code for the paper is available [here](https://github.com/tillspeicher/representation-invariance-transfer), including the [implementation of the Transforms-2D dataset](https://github.com/tillspeicher/representation-invariance-transfer/tree/master/src/transforms_2d).

The Transforms-2D dataset consists of transformed versions of image objects with transparency masks (from this base dataset), pasted onto background images (also from this base dataset).
It is used to study the role of invariance in transfer learning, by creating images with carefully controlled transformations.

## Usage

The dataset here comes in two configurations: a `foregrounds` configuration with 61 classes of images and several images per class, and a `backgrounds` configuration with 867 background images of nature scenes.

To load the respective configuration, use

```python
from datasets import load_dataset

data = load_dataset(
    "tillspeicher/transforms_2d_base",
    "foregrounds", # or "backgrounds"
    # There's only one the "train" split
    split="train",
)
```

## Citation

If you are using the Transform-2D dataset, please consider citing the following paper:
```bibtex
@article{
    speicher2024understanding,
    title={Understanding the Role of Invariance in Transfer Learning},
    author={Till Speicher and Vedant Nanda and Krishna P. Gummadi},
    journal={Transactions on Machine Learning Research},
    issn={2835-8856},
    year={2024},
    url={https://arxiv.org/abs/2407.04325},
}
```


## Attribution

The data here is based on the [SI-Score dataset](https://github.com/google-research/si-score/tree/master?tab=readme-ov-file) ([paper](https://arxiv.org/abs/2007.08558)) and re-uploaded to HF to make it easier to access than the original AWS S3 bucket.
If you are using this dataset, please consider citing the original authors as well.

The foreground images are segmented versions of OpenImages, with CC-licenses.
The attributions for each image can be found on the [OpenImages](https://storage.googleapis.com/openimages/web/download.html) website in the Image IDs CSVs.

The background images come from Pexels.com and carry a Pexels license.
Some of the background images do not carry a Pexels license.
The attributions for these images are listed in `samples_attributions.md`.
