DOI: 10.5281/zenodo.15188747
title: Rescaled CIFAR-10 dataset

description: Motivation

The goal of introducing the Rescaled CIFAR-10 dataset is to provide a dataset that contains scale variations (up to a factor of 4), to evaluate the ability of networks to generalise to scales not present in the training data.

The Rescaled CIFAR-10 dataset was introduced in the paper:

[1] A. Perzanowski and T. Lindeberg (2025) "Scale generalisation properties of extended scale-covariant and scale-invariant Gaussian derivative networks on image datasets with spatial scaling variations”, Journal of Mathematical Imaging and Vision, 67(29), https://doi.org/10.1007/s10851-025-01245-x.

with a pre-print available at arXiv:

[2] Perzanowski and Lindeberg (2024) "Scale generalisation properties of extended scale-covariant and scale-invariant Gaussian derivative networks on image datasets with spatial scaling variations”, arXiv preprint arXiv:2409.11140.

Importantly, the Rescaled CIFAR-10 dataset contains substantially more natural textures and patterns than the MNIST Large Scale dataset, introduced in:

[3] Y. Jansson and T. Lindeberg (2022) "Scale-invariant scale-channel networks: Deep networks that generalise to previously unseen scales", Journal of Mathematical Imaging and Vision, 64(5): 506-536,  https://doi.org/10.1007/s10851-022-01082-2

and is therefore significantly more challenging.

Access and rights

The Rescaled CIFAR-10 dataset is provided on the condition that you provide proper citation for the original CIFAR-10 dataset:

[4] Krizhevsky, A. and Hinton, G. (2009). Learning multiple layers of features from tiny images. Tech. rep., University of Toronto.

and also for this new rescaled version, using the reference [1] above. 

The data set is made available on request. If you would be interested in trying out this data set, please make a request in the system below, and we will grant you access as soon as possible.

The dataset

The Rescaled CIFAR-10 dataset is generated by rescaling 32×32 RGB images of animals and vehicles from the original CIFAR-10 dataset [4]. The scale variations are up to a factor of 4. In order to have all test images have the same resolution, mirror extension is used to extend the images to size 64x64. The imresize() function in Matlab was used for the rescaling, with default anti-aliasing turned on, and bicubic interpolation overshoot removed by clipping to the [0, 255] range. The details of how the dataset was created can be found in [1].

There are 10 distinct classes in the dataset: “airplane”, “automobile”, “bird”, “cat”, “deer”, “dog”, “frog”, “horse”, “ship” and “truck”.  In the dataset, these are represented by integer labels in the range [0, 9].

The dataset is split into 40 000 training samples, 10 000 validation samples and 10 000 testing samples. The training dataset is generated using the initial 40 000 samples from the original CIFAR-10 training set. The validation dataset, on the other hand, is formed from the final 10 000 image batch of that same training set. For testing, all test datasets are built from the 10 000 images contained in the original CIFAR-10 test set.

The h5 files containing the dataset

The training dataset file (~5.9 GB) for scale 1, which also contains the corresponding validation and test data for the same scale, is:

    cifar10_with_scale_variations_tr40000_vl10000_te10000_outsize64-64_scte1p000_scte1p000.h5

Additionally, for the Rescaled CIFAR-10 dataset, there are 9 datasets (~1 GB each) for testing scale generalisation at scales not present in the training set. Each of these datasets is rescaled using a different image scaling factor, 2k/4, with k being integers in the range [-4, 4]:

    cifar10_with_scale_variations_te10000_outsize64-64_scte0p500.h5      cifar10_with_scale_variations_te10000_outsize64-64_scte0p595.h5      cifar10_with_scale_variations_te10000_outsize64-64_scte0p707.h5      cifar10_with_scale_variations_te10000_outsize64-64_scte0p841.h5      cifar10_with_scale_variations_te10000_outsize64-64_scte1p000.h5      cifar10_with_scale_variations_te10000_outsize64-64_scte1p189.h5      cifar10_with_scale_variations_te10000_outsize64-64_scte1p414.h5      cifar10_with_scale_variations_te10000_outsize64-64_scte1p682.h5      cifar10_with_scale_variations_te10000_outsize64-64_scte2p000.h5  

These dataset files were used for the experiments presented in Figures 9, 10, 15, 16, 20 and 24 in [1].

Instructions for loading the data set

The datasets are saved in HDF5 format, with the partitions in the respective h5 files named as('/x_train', '/x_val', '/x_test', '/y_train', '/y_test', '/y_val'); which ones exist depends on which data split is used.

The training dataset can be loaded in Python as:

with h5py.File(`<filename>`, 'r') as f:

    x_train = np.array( f["/x_train"], dtype=np.float32)      x_val = np.array( f["/x_val"], dtype=np.float32)      x_test = np.array( f["/x_test"], dtype=np.float32)      y_train = np.array( f["/y_train"], dtype=np.int32)      y_val = np.array( f["/y_val"], dtype=np.int32)      y_test = np.array( f["/y_test"], dtype=np.int32)  

We also need to permute the data, since Pytorch uses the format [num_samples, channels, width, height], while the data is saved as [num_samples, width, height, channels]:  

    x_train = np.transpose(x_train, (0, 3, 1, 2))      x_val = np.transpose(x_val, (0, 3, 1, 2))      x_test = np.transpose(x_test, (0, 3, 1, 2))  

The test datasets can be loaded in Python as:

with h5py.File(`<filename>`, 'r') as f:   

    x_test = np.array( f["/x_test"], dtype=np.float32)      y_test = np.array( f["/y_test"], dtype=np.int32)  

The test datasets can be loaded in Matlab as:      x_test = h5read(`<filename>`,'/x_test');      y_test = h5read(`<filename>`,'/y_test');  

The images are stored as [num_samples, x_dim, y_dim, channels] in HDF5 files. The pixel intensity values are not normalised, and are in a [0, 255] range.