Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Machine Learning by (19k points)

I trained GoogLeNet model from scratch. But it didn't give me the promising results.
As an alternative, I would like to do fine tuning of GoogLeNet model on my dataset. Does anyone know what are the steps should I follow?

1 Answer

0 votes
by (33.1k points)
edited by

As you want to do image classification. These should be the steps for finetuning a model:

1. Classification layer

The original classification layer outputs predictions for 1000 classes. You'll need to replace it with a new layer with appropriate num_output. Replacing the classification layer:

  1. Change layer's name 
  2. Change num_output to the right number of output classes you are trying to predict.

2. Data

You should make a new training dataset with the new labels to fine-tune. 

3. How extensive a finetuning you want?

When fine-tuning a model, you can train each model's weights to fix some weights and train only the weights of the top-most layers. This choice is up to you and it usually depends on the amount of training data available.

Each layer holds trainable parameters that have param { lr_mult: XX }. This coefficient determines how susceptible these weights to SGD updates. Setting param { lr_mult: 0 } means you fix the weights of this layer and they will not be changed during the training process.

4. Run Caffe

Simply run Caffe train but supply it with Caffe model weights as an initial weight:

~$ $CAFFE_ROOT/build/tools/caffe train -solver /path/to/solver.ptototxt -weights /path/to/orig_googlenet_weights.caffemodel 

Hope this answer helps you! Studying Machine Learning Algorithms would also be quite specific in learning this course.

If you want to know more about Machine Learning then watch this video:

Browse Categories

...