How to Read Cifar 100 in Matlab

< Dorsum to Alex Krizhevsky's home page

The CIFAR-ten and CIFAR-100 are labeled subsets of the 80 million tiny images dataset. They were collected by Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton.

The CIFAR-10 dataset

The CIFAR-10 dataset consists of 60000 32x32 colour images in 10 classes, with 6000 images per class. There are 50000 preparation images and 10000 test images.

The dataset is divided into five training batches and ane test batch, each with 10000 images. The exam batch contains exactly 1000 randomly-selected images from each class. The training batches contain the remaining images in random order, only some training batches may comprise more images from one course than another. Between them, the training batches comprise exactly 5000 images from each class.

Here are the classes in the dataset, too as 10 random images from each:

airplane
auto
bird
cat
deer
dog
frog
horse
ship
truck

The classes are completely mutually sectional. There is no overlap between automobiles and trucks. "Automobile" includes sedans, SUVs, things of that sort. "Truck" includes merely big trucks. Neither includes pickup trucks.

Download

If you're going to use this dataset, please cite the tech report at the lesser of this folio.
Version Size md5sum
CIFAR-10 python version 163 MB c58f30108f718f92721af3b95e74349a
CIFAR-10 Matlab version 175 MB 70270af85842c9e89bb428ec9976c926
CIFAR-x binary version (suitable for C programs) 162 MB c32a1d4ab5d03f1284b67883e8d87530

Baseline results

You can find some baseline replicable results on this dataset on the project page for cuda-convnet. These results were obtained with a convolutional neural network. Briefly, they are xviii% exam error without information augmentation and 11% with. Additionally, Jasper Snoek has a new paper in which he used Bayesian hyperparameter optimization to find overnice settings of the weight disuse and other hyperparameters, which immune him to obtain a test error rate of 15% (without information augmentation) using the architecture of the internet that got 18%.

Other results

Rodrigo Benenson has been kind enough to collect results on CIFAR-10/100 and other datasets on his website; click here to view.

Dataset layout

Python / Matlab versions

I will depict the layout of the Python version of the dataset. The layout of the Matlab version is identical.

The archive contains the files data_batch_1, data_batch_2, ..., data_batch_5, also every bit test_batch. Each of these files is a Python "pickled" object produced with cPickle. Hither is a python2 routine which volition open such a file and return a lexicon:

def unpickle(file):     import cPickle     with open up(file, 'rb') every bit fo:         dict = cPickle.load(fo)     return dict      
And a python3 version:
def unpickle(file):     import pickle     with open up(file, 'rb') as fo:         dict = pickle.load(fo, encoding='bytes')     return dict      
Loaded in this way, each of the batch files contains a lexicon with the following elements:
  • data -- a 10000x3072 numpy assortment of uint8due south. Each row of the assortment stores a 32x32 colour image. The first 1024 entries contain the red aqueduct values, the next 1024 the dark-green, and the final 1024 the blueish. The paradigm is stored in row-major guild, so that the first 32 entries of the array are the cherry-red channel values of the showtime row of the prototype.
  • labels -- a list of 10000 numbers in the range 0-9. The number at alphabetize i indicates the label of the ith image in the array data.

The dataset contains another file, called batches.meta. It too contains a Python dictionary object. Information technology has the following entries:
  • label_names -- a 10-element listing which gives meaningful names to the numeric labels in the labels array described above. For example, label_names[0] == "airplane", label_names[1] == "automobile", etc.

Binary version

The binary version contains the files data_batch_1.bin, data_batch_2.bin, ..., data_batch_5.bin, also as test_batch.bin. Each of these files is formatted as follows:
<1 x label><3072 10 pixel> ... <one x characterization><3072 x pixel>
In other words, the start byte is the label of the first image, which is a number in the range 0-9. The next 3072 bytes are the values of the pixels of the image. The commencement 1024 bytes are the red channel values, the next 1024 the green, and the final 1024 the blue. The values are stored in row-major society, so the outset 32 bytes are the reddish aqueduct values of the offset row of the image.

Each file contains 10000 such 3073-byte "rows" of images, although in that location is nothing delimiting the rows. Therefore each file should exist exactly 30730000 bytes long.

There is another file, called batches.meta.txt. This is an ASCII file that maps numeric labels in the range 0-9 to meaningful class names. Information technology is just a list of the 10 class names, one per row. The class proper name on row i corresponds to numeric label i.

The CIFAR-100 dataset

This dataset is just like the CIFAR-ten, except information technology has 100 classes containing 600 images each. In that location are 500 training images and 100 testing images per grade. The 100 classes in the CIFAR-100 are grouped into twenty superclasses. Each image comes with a "fine" label (the form to which it belongs) and a "coarse" label (the superclass to which it belongs).
Here is the list of classes in the CIFAR-100:
Superclass Classes
aquatic mammals beaver, dolphin, otter, seal, whale
fish aquarium fish, flatfish, ray, shark, trout
flowers orchids, poppies, roses, sunflowers, tulips
food containers bottles, bowls, cans, cups, plates
fruit and vegetables apples, mushrooms, oranges, pears, sugariness peppers
household electrical devices clock, computer keyboard, lamp, telephone, idiot box
household piece of furniture bed, chair, couch, table, wardrobe
insects bee, protrude, butterfly, caterpillar, cockroach
big carnivores bear, leopard, lion, tiger, wolf
large man-made outdoor things bridge, castle, business firm, road, skyscraper
big natural outdoor scenes cloud, forest, mount, apparently, sea
large omnivores and herbivores camel, cattle, chimpanzee, elephant, kangaroo
medium-sized mammals fox, porcupine, possum, raccoon, skunk
non-insect invertebrates crab, lobster, snail, spider, worm
people infant, male child, girl, man, woman
reptiles crocodile, dinosaur, cadger, snake, turtle
small mammals hamster, mouse, rabbit, shrew, squirrel
trees maple, oak, palm, pine, willow
vehicles ane bicycle, bus, motorcycle, pickup truck, train
vehicles 2 backyard-mower, rocket, streetcar, tank, tractor

Yep, I know mushrooms aren't actually fruit or vegetables and bears aren't really carnivores.

Download

Version Size md5sum
CIFAR-100 python version 161 MB eb9058c3a382ffc7106e4002c42a8d85
CIFAR-100 Matlab version 175 MB 6a4bfa1dcd5c9453dda6bb54194911f4
CIFAR-100 binary version (suitable for C programs) 161 MB 03b5dce01913d631647c71ecec9e9cb8

Dataset layout

Python / Matlab versions

The python and Matlab versions are identical in layout to the CIFAR-10, so I won't waste space describing them here.

Binary version

The binary version of the CIFAR-100 is just like the binary version of the CIFAR-ten, except that each image has two label bytes (coarse and fine) and 3072 pixel bytes, so the binary files wait similar this:
<i x fibroid characterization><one ten fine label><3072 x pixel> ... <ane x fibroid label><1 x fine label><3072 x pixel>

Indices into the original 80 one thousand thousand tiny images dataset

Sivan Sabato was kind enough to provide this file, which maps CIFAR-100 images to images in the 80 meg tiny images dataset. Sivan Writes:
The file has 60000 rows, each row contains a unmarried index into the tiny db, where the beginning image in the tiny db is indexed "1". "0" stands for an image that is not from the tiny db. The first 50000 lines stand for to the preparation ready, and the terminal 10000 lines stand for to the test set.      

Reference

This tech report (Chapter three) describes the dataset and the methodology followed when collecting it in much greater detail. Please cite it if you intend to use this dataset.
  • Learning Multiple Layers of Features from Tiny Images, Alex Krizhevsky, 2009.

rodriguezsentes.blogspot.com

Source: https://www.cs.toronto.edu/~kriz/cifar.html

0 Response to "How to Read Cifar 100 in Matlab"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel