简体   繁体   中英

Avoid giving prediction for input which is not trained using CNN

I have trained 5 different hand gestures using CNN. They are working well and give the correct prediction. However, when I do a hand gesture which is other than these 5 trained gestures, the system will still categorize the hand gesture as one of the trained gesture. Meaning, the result given is wrong as the hand gesture should not be predicted. How should I overcome this issue?

I took some random pictures and categorize them as "nothing", then train them with the hand gestures to reduce the false detection. But it doesn't really help much.

Then I think maybe can use probability score to restrict the prediction, like prediction only given if the probability is more than 70%. But it doesn't work as the not-trained-gesture always get 100%.

What did you expect to happen when you gave your model a new gesture? You've trained it to discriminate hand gestures into one of five classes, and you have a sixth class, nothing , which consists of images with no hand at all. Amending my comment above (bad counting), you now present it with an image that doesn't fit any of those six classes, according to your functional definition.

The problem you have is that you haven't built a viable training set. Something with a hand will match the first five classes much more closely than the "nothing" class -- which you've likely trained to be the concept "no hand". Therefore, you get the best match that has a hand in it, because of the many points of similarity, and very few of difference: what does the "thumb-up" gesture have in common with the "random" photos you provided?

From a standpoint of information theory, no model is likely to learn the differentiation you want from the provided training images. If you want your model to learn hand gestures and discriminate them from other hand positions, then you have to train it appropriately. Giving it a weak "other" concept isn't going to work, as you've already realized.

You will need to use a training set that includes the desired information: at least 10% of the set will have to be hand positions that are "nothing" images. You may need more than 10%, perhaps even more than any other class. You may need to upgrade your topology. Experiment -- that being the usual method of model development.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM