0

I tried using pre-trained bvlc_reference_caffenet.caffemodel for object recognition from images. I got good results for images containing only a single object. For images with multiple objects, I removed the argmax() term from prediction which gives the class label with the maximum probability.

Still, the accuracy is very less for the labels which I am getting. So, I am thinking of training the same caffemodel on my own dataset (containing images with multiple objects). How should I proceed? Is there any way to retrain a pre-trained caffemodel with the different dataset?

Shai
  • 111,146
  • 38
  • 238
  • 371
  • It is not clear whether you want to train your network for single label or multi-label classification. For multi-label classification use PR #523 of Caffe. – Harsh Wardhan Mar 02 '16 at 11:30

1 Answers1

0

What you are after is called "finetuning": taking a deep net trained for task A, reusing its weights and re-train it to accomplish task B.
You can start with this tutorial, but you will find much more information simply by googling "finetune caffe model".

You may also be interested in this post regarding training caffe with mutiple categories per input image.

Community
  • 1
  • 1
Shai
  • 111,146
  • 38
  • 238
  • 371
  • How much time does a pretrained caffemodel take for finetuning, if I am about to use CPU instead of GPU? – Omkar Acharya Dec 23 '15 at 08:59
  • 1
    depends on number of iterations you run – Umang Gupta Dec 23 '15 at 09:03
  • I am using a very less dataset for training just for now. How many iterations should I go with? – Omkar Acharya Dec 23 '15 at 09:22
  • @foo how many iterations does it take to cover the new training set once (an "epoch")? – Shai Dec 23 '15 at 09:25
  • my solver.prototxt file is like: ` net: "/home/foo/Project/train_val.prototxt" test_iter: 1000 test_interval: 1000 base_lr: 0.01 lr_policy: "step" gamma: 0.1 stepsize: 100000 display: 20 max_iter: 450000 momentum: 0.9 weight_decay: 0.0005 snapshot: 10000 snapshot_prefix: "/home/foo/caffe/models/bvlc_reference_caffenet/caffenet_train" solver_mode: CPU ` – Omkar Acharya Dec 23 '15 at 09:27