1
$\begingroup$

I am new to deep learning and computer vision. I have a problem where i use yolo algorithm (https://pjreddie.com/) to detect objects. In the original paper, they define the output to recognize 80 classes, but for my problem i just want to recognize human only.

So i change the final layer to only 1 neuron, and do the training process with transfer learning techniques (used pretrained weights for the cases of 80 classes, of course not use the final layer weights and these weights becomes random number for my problems). I feed only human data to the algorithm. However, i realize that after longer training, the model becomes worse. It starts to recognize other objects as human.

I would like to hear any advice from you guys, should i also feed non-human data to the model.

Thanks

$\endgroup$
1
$\begingroup$

So you have a network pretrained on 80 classes. I also assume that one of these classes are human (or else this is just not the way to go*) I suspect that the final layer contains 80 labels, correct? Then you then 'rescale' this layer to 1 label and then train on some data you possess? Then you're basically trying to teach the network that it shouldn't care about the 79 other classes, which is just nonsense I think.

What you could do, and I do not recommend this, but if you feel like you have to use this exact network, you just keep the 80 outputs and only look at the label correspondning to the human.

You shouldn't do this because the network is WAY bigger than it needs to be to only classify human/non human, which will make it slower than it needs to be.

What you rather want to do is either to train your own network (If you have lots of training data, I suspect this wouldn't be be the hardest thing to train) or obtain a CNN that is pretrained on human classification.

(*I've heard rumours that you can do pretty well on retraining a class on a pretrained network. I just don't know if the rumours are true or how to go about it.)

$\endgroup$
  • $\begingroup$ Yes, one way is to reuse the network with 80 classes, but it will be very expensive since i just want to care about the presence of human only. In general, if i want to detect human only, i have also to give it data of non-human right? $\endgroup$ – Tuyen Vo Quang Mar 29 '18 at 1:57
  • $\begingroup$ As I say in the answer, yes it would be expensive, but about the same as your approach. If you want to train it yourself, you need to give it human and non-human data. $\endgroup$ – Andreas Storvik Strauman Mar 29 '18 at 7:51
  • $\begingroup$ What do you think about the ratio between human/non-human data? $\endgroup$ – Tuyen Vo Quang Mar 29 '18 at 8:43
  • $\begingroup$ Hard to say. Depends on the data. Use all of what you have :) $\endgroup$ – Andreas Storvik Strauman Mar 29 '18 at 8:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.