Augmenting the Caffe ImageNet Tutorial to Train on Custom Data

306 views
Skip to first unread message

Paul McElroy

unread,
Jun 9, 2016, 7:55:05 PM6/9/16
to Caffe Users
Hey there guys!

I'm trying to augment the Caffe ImageNet Tutorial to train on some custom image sets.  My reasoning is this, since ImageNet takes 5 "business days" minimum to allow access to their image sets, I need get my own data or repurpose some other data.

What I've decided to do is to use the Caltech101 images.  So first of all, let me get this straightened out:
I have to (1) create a "synsets.txt" file containing the names of each class. (2) I need to create a "synset_words.txt" file containing the text labels of each number label. (3) I need to create a "train.txt" file with the filepaths of each training image, a space, and a number indicating label identity. (4) Do the same thing to create a "test.txt" but the number label needs to be 0.  (5) put some number of each class's members into a folder named "test" and the rest into a folder named "train".

Is that all correct?  The current ilsvrc12 auxillary data files has a file called "val.txt" and one called "det_synset_words.txt".  I'm not sure what they're for.  Do I need to create a version of those for my repurposing of Caltech101?

How the heck do I make an imagenet_mean.binaryproto for my new image set?

What the heck is the "imagenet.bet.pickle" file?  I have never seen it mentioned in any tutorials or articles regarding Caffe.

After all that's done, I still need to resize my images, correct? I can use the shell script mentioned in the tutorial above, right?
for name in /path/to/imagenet/val/*.JPEG; do
    convert -resize 256x256\! $name $name
done
Or does the "create_imagenet.sh" script do that for me when it runs?

When creating my new "imagenet_mean.binaryproto" file, do I need a second one that relates to the original data set that CaffeNet trained on or am I good picking up training of any image set with a newly made mean proto made just against new data?

Anything else I'll need to change? Anything in the prototxt files? I'm significantly reducing the class against which the original model was trained and I may even be removing or changing the names of many of them (since the image sets were made by different groups of people). What kind of classification results can I expect with this?

Thanks for any help people! I really appreciate anything you can offer!

Hossein Hasanpour

unread,
Jun 10, 2016, 3:49:29 AM6/10/16
to Caffe Users
You can download the whole ImageNet dataset (LSVRC2012 and others ) from here as well: http://academictorrents.com/browse.php?search=ImageNet+LSVRC+2012

Paul McElroy

unread,
Jun 10, 2016, 12:22:32 PM6/10/16
to Caffe Users
So I'd want the "ImageNet LSVRC 2012 Training Set (Object Detection)" file that's 147Gbs?  My poor Jetson doesn't have room for that, I suppose I need a subset of the images.

How does my repurposing of the Caltech101 set look?  If my thinking's good there I can probably figure out how to apply the same set up to any data set.

Also, what's the pickle file for?
Reply all
Reply to author
Forward
0 new messages