Extract deep features from large amount of images using DeepFeatureExtractor

User 3226 | 2/18/2016, 8:40:08 PM

I am a student and I am using graphlab for a image classification project. I have 230K pictures as my training set and each picture has multiple labels. Graphlab has a pretrained model called deepfeature extractor. If I understand this correctly, this model is based on Alexnet convolutional neural network and trained 1.3 million pictures. I want to use this function to extract deep features from my training set and then feed into a logistic regression. However, it seems impossible to process this amount of pictures with a laptop that does not have a good GPU. I am considering launch a spark cluster on AWS and let the servers run for me. I have a few questions regarding here:

  1. When I run it on my laptop, it seems only use one CPU, will it be more efficient to run it on a spark cluster?
  2. which AWS instance do you recommend to use?
  3. Can neural network algorithm run parallels?
  4. How many layers will be extracted from the DeepFeatureExtractor and what are these "deep features"?
  5. I am new to deep learning, is there any good reference I can read?


User 2593 | 2/23/2016, 6:08:34 PM

Hi @yumingf,

Having a Spark cluster running to extract your features on the CPU may not be the ideal way to go. Instead, you should look into a single g2.xlarge instance with a larger ebs drive mounted to it so that you can store your images there. Extracting 230k images will still take some time (a couple of hours) but at 0.65$ an hour, it will be quite reasonable. You can get our GPU egg from here https://dato.com/download/install-graphlab-create-gpu.html, and you will need to set up all the requirements on the instance.

With a GPU you should be able to extract features from 200 images/sec. We do support multicore GPU with a larger EC2 instance, but that comes at a steeper price.

The DeepFeatureExctractor will get all features from the last fully connected layer (4096) features. This layers seems to work quite well across different applications.

Here are some extra references: https://dato.com/learn/gallery/notebooks/buildimagenetdeeplearning.html#ga=1.30228991.132607451.1455831753 https://dato.com/learn/gallery/notebooks/foodretrieval-public.html

Let us know how it goes and thanks! Charlie

User 3226 | 2/24/2016, 10:48:17 PM

Hi Charlie,

Thank you for your answer. If I understand this pretrained deep feature extractor from graphlab correctly, it was trained on these 1.3 million pictures from Imagenet competition and used Alexnet convolutional neural network. The output is the layer 19: full connection layer that has 4096 hidden unit?

Just one more suggestion: it would be nice if graphlab can provide full output from any layer in the neural network so users can choose which layer they want.

User 2593 | 2/25/2016, 6:40:30 PM

Hi @yumingf,

That is correct. It the last fully connected layer (layer 8 if you don't count activation layers) and there are 4096 hidden nodes in that layer.

Also, you can get features from some of the layers not all of them. You can basically extract features from any fully connected layer. This is explained more on here: https://dato.com/products/create/docs/generated/graphlab.neuralnetclassifier.NeuralNetClassifier.extractfeatures.html#graphlab.neuralnetclassifier.NeuralNetClassifier.extractfeatures. We do not support extracting features from convolutional layers, but that is a very good suggestion. I'll put in a feature request.