View a narrated version of the tutorial:
In this tutorial, we will learn how to extract image features using a pre-trained model. For our tutorial, we will use the model from Caffenet. More specifically, we will use Caffenet’s deploy net and model to perform feature extraction. For image features, we will use images present in a particular folder.
To obtain Caffenet model, simply run the following commands: :
If it complains that wget or tar are not installed, you need to install them respectively.
After the download is complete, Caffenet model is located at :
Now, start up Expresso by typing the following:
In this tutorial, we will extract features from all the images located in a folder. From the drop-down list titled Select the type of data, choose Folder
Next, load data by clicking on the ... button beside the text Load Data. Navigate to the path mentioned above :
Provide a name by which you wish to refer to the data --
msra9 with default dimension specification (i.e 227x227x3)
After doing so, the data import process begins. The completion of the import process is indicated by a notification. If the data import is successful, a listing appears in the View/Select Data table. The listing shows important properties of the loaded data such as number of elements, width and height of images and number of channels.
Click on Net View at the top of
Expresso's main screen.
Click on Deploy Net tab. Click on the … beside the text Load/modify existing net configuration.
In the file menu, navigate to the directory
$EXPRESSO_ROOT/tutorials/tutorial_6 and select
caffenet_deploy.prototxt. The screen now shows the loaded net.
Click on the tab Other, located at top right corner of GUI, to enter auxiliary settings. [SCR]. Check has mean box and upload the mean file located at
$EXPRESSO_ROOT/tutorials/data/imagenet_mean.npy . Enter Raw Scale as
255 and check the box titled channel swap. Check the use gpu box to use GPU for feature extraction. Click on button Add new model button. In the file dialog, navigate to location
$EXPRESSO_ROOT/tutorials/data/bvlc_reference_caffenet.caffemodel and select the file.
Finally, once the train/deploy/auxiliary info has all been added properly, the resulting configuration needs to be saved. To do so, enter a name for the net configuration --
CAFFENET in the textbox present towards the bottom-right of the GUI, titled Save net configuration as and click Save
The saved net configuration appears in a list box titled Net Configurations towards the bottom-left of the GUI.
Click on Exp View at the top of
Expresso’s main screen. Then, click on Extract Features via pre-trained net button
CAFFENET from listing titled Deploy Net Selection. Check the boxes for the layers
conv1, conv2, pool1, pool2, pool5.
msra9 from listing titled Data Selection. Enter
MSRA9Features in the field titled Name. Click on Generate to start feature extraction.
A notification will pop up once the feature extraction is complete.The listing Experiment List, located at bottom right corner, should contain the entry
MSRA9Features once the features are extracted.