The classification results tend to the category which has more samples than other.

74 views
Skip to first unread message

Jobs Bill

unread,
Dec 13, 2015, 1:26:25 AM12/13/15
to Caffe Users
When I train a classification net(it has 20 outputs), the training data for 20 categories is not balance, i.e. some categories have more samples than other.When training is done and I try to predict, the result is prone to sorts which have more training examples. Any suggestions for this problem?

Thanks,
Bill.

Mohit Jain

unread,
Dec 13, 2015, 5:14:59 AM12/13/15
to Caffe Users
Hi Bill,
    I would suggest using dropout to your network to overcome this problem (is just a hitch, no experiments to prove my guess). The model parameters are overfitting for the cases where there are more number of samples in specific categories. Using dropout, you can switch-off the nodes which don't decide for inputs of the classes you are not training for and hence overcome the overfitting problem that you face.

   Another possibly easier solution would be to divide your training data into chunks (equal sized or something similar) and then perform random selection of chunks from each category to train your model. Perform multiple such rounds of training with different data chunks and use the model parameters learnt in the last round of training to improve accuracy.

Hope that helps. :)

Regards,
Mohit

Jobs Bill

unread,
Dec 13, 2015, 9:20:06 PM12/13/15
to Caffe Users
Dear Mohit Jain,
Thanks for your advice, My net is something like R-CNN, which is finetuned from CaffeNet, so I think dropout is in consideration:
layer {
  name: "drop6"
  type: "Dropout"
  bottom: "fc6"
  top: "fc6"
  dropout_param {
    dropout_ratio: 0.5
  }
}
layer {
  name: "fc7"
  type: "InnerProduct"
  bottom: "fc6"
  top: "fc7"
  param {
    lr_mult: 10
    decay_mult: 1
  }

My data is random selected in windowdatalayer, but in input txt, I just used data in index(I think it's OK because windowdatalayer will random prefetch inputs).
Input txt is image path and box position which in windowdatalayer will resize to image patches and will be random selected. The real inputs in net is image patches
from box.
I don't clearly understand how to perform multiple rounds in this problem. Should I just force set equal samples for each category for training? 
在 2015年12月13日星期日 UTC+8下午6:14:59,Mohit Jain写道:
Reply all
Reply to author
Forward
Message has been deleted
0 new messages