数据集构建网络
CIFAR-10和CIFAR-100数据集是8000万张微小图像数据集的带标签子集。CIFAR-10和CIFAR-100是由亚历克斯·克里热夫斯基(Alex Krizhevsky)、维诺德·奈尔(Vinod Nair)和杰弗里·辛顿(Geoffrey Hinton)创建的。(遗憾的是,8000万张微小图像数据集已被其作者束之高阁。找出用于为其删除行为辩解的双重思想,这留给读者作为一个练习。)
CIFAR-10数据集
CIFAR-10数据集由60000张32x32的彩色图像组成,分为10个类别,每个类别有6000张图像。其中有50000张训练图像和10000张测试图像。
该数据集被分为五个训练批次和一个测试批次,每个批次有10000张图像。测试批次恰好包含从每个类别中随机选择的1000张图像。训练批次包含其余的随机排列的图像,但某些训练批次中某一类别可能比其他类别包含更多的图像。总体而言,训练批次中每个类别恰好包含5000张图像。
以下是数据集中的类别,以及每个类别中的10张随机图像:
飞机
汽车
鸟
猫
鹿
狗
青蛙
马
船
卡车
这些类别是完全相互排斥的。汽车和卡车之间没有重叠。“汽车”包括轿车、运动型多用途汽车(SUV)之类的车辆。“卡车”仅包括大型卡车。两者都不包括皮卡。
下载
如果你要使用此数据集,请引用本页面底部的技术报告。
版本 大小 md5校验和
CIFAR-10 Python版本 163 MB c58f30108f718f92721af3b95e74349a
CIFAR-10 Matlab版本 175 MB 70270af85842c9e89bb428ec9976c926
CIFAR-10二进制版本(适用于C程序) 162 MB c32a1d4ab5d03f1284b67883e8d87530
基线结果
你可以在cuda-convnet的项目页面上找到关于此数据集的一些可复现的基线结果。这些结果是通过卷积神经网络获得的。简而言之,在不进行数据增强的情况下测试误差为18%,进行数据增强后为11%。此外,贾斯珀·斯诺克(Jasper Snoek)有一篇新论文,他在其中使用贝叶斯超参数优化来找到权重衰减和其他超参数的良好设置,这使他能够使用达到18%误差率的网络架构,在不进行数据增强的情况下获得15%的测试误差率。
其他结果
罗德里戈·贝嫩森(Rodrigo Benenson)在他的网站上收集了CIFAR-10/100和其他数据集的结果;点击此处查看。
数据集布局
Python/Matlab版本
我将描述CIFAR-10数据集Python版本的布局。Matlab版本的布局与之相同。
归档文件包含data_batch_1、data_batch_2、……、data_batch_5以及test_batch这些文件。这些文件中的每一个都是使用cPickle生成的Python“已腌制”对象。以下是一个Python 2例程,它将打开这样一个文件并返回一个字典:
def unpickle(file):
import cPickle
with open(file, 'rb') as fo:
dict = cPickle.load(fo)
return dict
def unpickle(file):
import pickle
with open(file, 'rb') as fo:
dict = pickle.load(fo, encoding='bytes')
return dict
以这种方式加载后,每个批次文件都包含一个具有以下元素的字典:
• data——一个10000x3072的无符号8位整数(uint8)的NumPy数组。数组的每一行存储一张32x32的彩色图像。数组的前1024个条目包含红色通道的值,接下来的1024个是绿色通道的值,最后的1024个是蓝色通道的值。图像以按行优先的顺序存储,因此数组的前32个条目是图像第一行的红色通道值。
• labels——一个包含10000个在0到9范围内数字的列表。索引i处的数字表示数组data中第i张图像的标签。
该数据集还包含另一个名为batches.meta的文件。它也包含一个Python字典对象。它有以下条目:
• label_names——一个10元素的列表,它为上述labels数组中的数字标签赋予了有意义的名称。例如,label_names[0] == "airplane",label_names[1] == "automobile" 等等。
二进制版本
二进制版本包含data_batch_1.bin、data_batch_2.bin、……、data_batch_5.bin以及test_batch.bin这些文件。每个文件的格式如下:
<1 x 标签><3072 x 像素>
...
<1 x 标签><3072 x 像素>
换句话说,第一个字节是第一张图像的标签,是一个在0到9范围内的数字。接下来的3072个字节是图像的像素值。前1024个字节是红色通道的值,接下来的1024个是绿色通道的值,最后的1024个是蓝色通道的值。这些值以按行优先的顺序存储,所以前32个字节是图像第一行的红色通道值。
每个文件包含10000个这样的3073字节的图像“行”,不过没有任何东西来分隔这些行。因此每个文件应该正好是30730000字节长。
还有另一个名为batches.meta.txt的文件。这是一个ASCII文件,它将0到9范围内的数字标签映射到有意义的类名。它仅仅是一个包含10个类名的列表,每行一个。第i行的类名对应数字标签i。
CIFAR-100数据集
这个数据集与CIFAR-10类似,只是它有100个类别,每个类别包含600张图像。每个类别有500张训练图像和100张测试图像。CIFAR-100中的100个类别被分组为20个超类。每张图像都有一个“细粒度”标签(它所属的类别)和一个“粗粒度”标签(它所属的超类)。
以下是CIFAR-100中的类别列表:
超类 类别
水生哺乳动物 海狸、海豚、水獭、海豹、鲸鱼
鱼类 水族箱鱼、比目鱼、鳐鱼、鲨鱼、鳟鱼
花卉 兰花、罂粟花、玫瑰花、向日葵、郁金香
食品容器 瓶子、碗、罐子、杯子、盘子
水果和蔬菜 苹果、蘑菇、橙子、梨、甜椒
家用电子设备 时钟、计算机键盘、灯、电话、电视
家用家具 床、椅子、沙发、桌子、衣柜
昆虫 蜜蜂、甲虫、蝴蝶、毛毛虫、蟑螂
大型食肉动物 熊、豹、狮子、老虎、狼
大型人造户外物体 桥梁、城堡、房屋、道路、摩天大楼
大型自然户外场景 云、森林、山脉、平原、海洋
大型杂食动物和草食动物 骆驼、牛、黑猩猩、大象、袋鼠
中型哺乳动物 狐狸、豪猪、负鼠、浣熊、臭鼬
非昆虫无脊椎动物 螃蟹、龙虾、蜗牛、蜘蛛、蠕虫
人 婴儿、男孩、女孩、男人、女人
爬行动物 鳄鱼、恐龙、蜥蜴、蛇、乌龟
小型哺乳动物 仓鼠、老鼠、兔子、鼩鼱、松鼠
树木 枫树、橡树、棕榈树、松树、柳树
车辆1 自行车、公共汽车、摩托车、皮卡、火车
车辆2 割草机、火箭、有轨电车、坦克、拖拉机
是的,我知道蘑菇实际上不是水果或蔬菜,熊实际上也不是纯粹的食肉动物。
下载
版本 大小 md5校验和
CIFAR-100 Python版本 161 MB eb9058c3a382ffc7106e4002c42a8d85
CIFAR-100 Matlab版本 175 MB 6a4bfa1dcd5c9453dda6bb54194911f4
CIFAR-100二进制版本(适用于C程序) 161 MB 03b5dce01913d631647c71ecec9e9cb8
数据集布局
Python/Matlab版本
Python和Matlab版本的布局与CIFAR-10的相同,所以我不会在这里浪费篇幅描述它们。
二进制版本
CIFAR-100的二进制版本与CIFAR-10的二进制版本类似,只是每张图像有两个标签字节(粗粒度和细粒度)和3072个像素字节,所以二进制文件看起来像这样:
<1 x 粗粒度标签><1 x 细粒度标签><3072 x 像素>
...
<1 x 粗粒度标签><1 x 细粒度标签><3072 x 像素>
原始8000万张微小图像数据集的索引
西万·萨巴托(Sivan Sabato)很友善地提供了这个文件,它将CIFAR-100图像映射到8000万张微小图像数据集中的图像。西万写道:
该文件有60000行,每行包含微小数据库中的一个索引,
其中微小数据库中的第一张图像的索引为“1”。“0”表示该图像不是来自微小数据库。
前50000行对应训练集,最后10000行对应测试集。
The CIFAR-10 and CIFAR-100 datasets are labeled subsets of the 80 million tiny images dataset. CIFAR-10 and CIFAR-100 were created by Alex Krizhevsky, Vinod Nair, and Geoffrey Hinton. (Sadly, the 80 million tiny images dataset has been thrown into the memory hole by its authors. Spotting the doublethink which was used to justify its erasure is left as an exercise for the reader.)
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 training images and 10000 test images.
The dataset is divided into five training batches and one test batch, each with 10000 images. The test batch contains exactly 1000 randomly-selected images from each class. The training batches contain the remaining images in random order, but some training batches may contain more images from one class than another. Between them, the training batches contain exactly 5000 images from each class.
Here are the classes in the dataset, as well as 10 random images from each:
| airplane |
|
|
|
|
|
|
|
|
|
|
| automobile |
|
|
|
|
|
|
|
|
|
|
| bird |
|
|
|
|
|
|
|
|
|
|
| cat |
|
|
|
|
|
|
|
|
|
|
| deer |
|
|
|
|
|
|
|
|
|
|
| dog |
|
|
|
|
|
|
|
|
|
|
| frog |
|
|
|
|
|
|
|
|
|
|
| horse |
|
|
|
|
|
|
|
|
|
|
| ship |
|
|
|
|
|
|
|
|
|
|
| truck |
|
|
|
|
|
|
|
|
|
|
The classes are completely mutually exclusive. There is no overlap between automobiles and trucks. "Automobile" includes sedans, SUVs, things of that sort. "Truck" includes only big trucks. Neither includes pickup trucks.
Download
If you're going to use this dataset, please cite the tech report at the bottom of this page.
| Version | Size | md5sum |
| 163 MB | c58f30108f718f92721af3b95e74349a | |
| 175 MB | 70270af85842c9e89bb428ec9976c926 | |
| 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 18% test error without data augmentation and 11% with. Additionally, Jasper Snoek has a new paper in which he used Bayesian hyperparameter optimization to find nice settings of the weight decay and other hyperparameters, which allowed him to obtain a test error rate of 15% (without data augmentation) using the architecture of the net that got 18%.
Other results
Rodrigo Benenson has collected results on CIFAR-10/100 and other datasets on his website; click here to view.
Dataset layout
Python / Matlab versions
I will describe 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, as well as test_batch. Each of these files is a Python "pickled" object produced with cPickle. Here is a python2 routine which will open such a file and return a dictionary:
def unpickle(file):
import cPickle
with open(file, 'rb') as fo:
dict = cPickle.load(fo)
return dict
And a python3 version:
def unpickle(file):
import pickle
with open(file, 'rb') as fo:
dict = pickle.load(fo, encoding='bytes')
return dict
Loaded in this way, each of the batch files contains a dictionary with the following elements:
• data -- a 10000x3072 numpy array of uint8s. Each row of the array stores a 32x32 colour image. The first 1024 entries contain the red channel values, the next 1024 the green, and the final 1024 the blue. The image is stored in row-major order, so that the first 32 entries of the array are the red channel values of the first row of the image.
• labels -- a list of 10000 numbers in the range 0-9. The number at index 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. It has the following entries:
• label_names -- a 10-element list 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, as well as test_batch.bin. Each of these files is formatted as follows:
<1 x label><3072 x pixel>
...
<1 x label><3072 x pixel>
In other words, the first 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 first 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 order, so the first 32 bytes are the red channel values of the first row of the image.
Each file contains 10000 such 3073-byte "rows" of images, although there is nothing delimiting the rows. Therefore each file should be 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. It is merely a list of the 10 class names, one per row. The class name on row i corresponds to numeric label i.
The CIFAR-100 dataset
This dataset is just like the CIFAR-10, except it has 100 classes containing 600 images each. There are 500 training images and 100 testing images per class. The 100 classes in the CIFAR-100 are grouped into 20 superclasses. Each image comes with a "fine" label (the class 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, sweet peppers |
| household electrical devices | clock, computer keyboard, lamp, telephone, television |
| household furniture | bed, chair, couch, table, wardrobe |
| insects | bee, beetle, butterfly, caterpillar, cockroach |
| large carnivores | bear, leopard, lion, tiger, wolf |
| large man-made outdoor things | bridge, castle, house, road, skyscraper |
| large natural outdoor scenes | cloud, forest, mountain, plain, 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 | baby, boy, girl, man, woman |
| reptiles | crocodile, dinosaur, lizard, snake, turtle |
| small mammals | hamster, mouse, rabbit, shrew, squirrel |
| trees | maple, oak, palm, pine, willow |
| vehicles 1 | bicycle, bus, motorcycle, pickup truck, train |
| vehicles 2 | lawn-mower, rocket, streetcar, tank, tractor |
Yes, I know mushrooms aren't really fruit or vegetables, and bears aren't really carnivores.
Download
| Version | Size | md5sum |
| 161 MB | eb9058c3a382ffc7106e4002c42a8d85 | |
| 175 MB | 6a4bfa1dcd5c9453dda6bb54194911f4 | |
| 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-10, except that each image has two label bytes (coarse and fine) and 3072 pixel bytes, so the binary files look like this:
<1 x coarse label><1 x fine label><3072 x pixel>
...
<1 x coarse label><1 x fine label><3072 x pixel>
Indices into the original 80 million tiny images dataset
Sivan Sabato was kind enough to provide this file, which maps CIFAR-100 images to images in the 80 million tiny images dataset. Sivan Writes:
The file has 60000 rows, each row contains a single index into the tiny db,
where the first image in the tiny dbis indexed "1". "0" stands for an image that is not from the tiny db.
The first 50000 lines correspond to the training set, and the last 10000 lines correspond
to the test set.
Reference
This tech report (Chapter 3) 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.


更多推荐





































































































所有评论(0)