Step 4:
At this stage, you will have to modify googlenet so that it will work for our specific dataset. To do this:
1) Type deepNetworkDesigner in the command window and hit return
2) Type net=googlenet; in the command window to upload googlenet to memory
3) In the deepNetworkDesigner window, import the network (net) to the workspace (using the import button)
4)
Delete the current FC (Fully Connected) layer (near the end) and
replace it with a new one from the left panel. Change its name to
MerchFC in the right panel (properties panel). Change the output
size to 5 (since we have 5 classes, cap, cube, screwdriver, ...). Also
change the WeightLearnRate Factor and the BiasLearnRateFactor to 10 so
that the network learns faster (we don't need to retrain the earlier
layers, so we can go faster).
5) Delete the classification layer
(at the very end). If you click this layer you'll see that it has an
output size of 1000 (since googlenet can classify 1000 different types
of things). This would be incompatible with our data set which
contains only 5 classes.
6) Replace the classification output
layer with a new classification output layer from the left (Layers)
panel. By defaut, the output size is set to "auto" so it will
work with our network.
7) Click on "Analyse" at the top of the window to make sure we haven't missed anything.
8) Export it (using the key at top of figure). This will create a variable called "lgraph_1" in Matlab's workspace.
9) Change its name to NewLayers: NewLayers=lgraph_1 (this is just a little more intuitive)
10) Save the new variable in a .mat file called MerchNewLayers: save MerchNewLayers NewLayers