uoguelph-mlrg / theano_alexnet

Theano-based Alexnet
BSD 3-Clause "New" or "Revised" License
229 stars 115 forks source link

For new dataset #34

Open DennisBang opened 7 years ago

DennisBang commented 7 years ago

Dear MR:

Recently I was trying to do some work on my own dataset but I have some questions on your preprocessing data part. What the .mat file(meta_clsloc_mat)mean? And the val_label_file? Any different with the caffe style validation labels?

Thanks for your work and help!

hma02 commented 7 years ago

@DennisBang

The meta_clsloc.mat file in the ILSVRC2014_devkit/data folder contains some meta data about the dataset, including ILSVRC2014_ID, WNID, words, gloss, num_children, wordiness_height and num_train_images (only the first 1000 synsets has num_train_images>0 and are used during training).

If you open the file meta_clsloc.mat with matlab, you will see the file only contain a single object "synsets". If you open the object "synsets", you will see one row of 1860 structs (the first 1000 structs are used for training). Similarly, in python you can do:

synsets = scipy.io.loadmat(meta_clsloc_mat)['synsets'][0]

If you open each struct, you can see it contains some fields: ILSVRC2014_ID, WNID, words, gloss, num_children, wordiness_height and num_train_images. In our case, we need WNID which corresponds to folder names in `ILSVRC2012_img_train.tar', correlates to ILSVRC2014_ID and can be used to generate image paths.

The file ILSVRC2014_clsloc_validation_ground_truth.txt, referred as val_label_file in the code, contains 50000 lines. Each line is an ILSVRC2014_ID (an integer) for the corresponding image in ILSVRC2012_img_val.tar. The ILSVRC2014_ID is used as label during training and validation.