简体   繁体   English

避免对未使用 CNN 训练的输入进行预测

[英]Avoid giving prediction for input which is not trained using CNN

I have trained 5 different hand gestures using CNN.我已经使用 CNN 训练了 5 种不同的手势。 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.但是,当我做的手势不是这 5 个经过训练的手势时,系统仍会将手势归类为经过训练的手势之一。 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%.然后我认为也许可以使用概率分数来限制预测,例如仅在概率超过 70% 时才给出预测。 But it doesn't work as the not-trained-gesture always get 100%.但它不起作用,因为未经训练的手势总是得到 100%。

What did you expect to happen when you gave your model a new gesture?当您给您的 model 一个新手势,您期望会发生什么? 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.您已经训练它将手势区分为五个类别之一,并且您有第六个 class, nothing ,它由完全没有手的图像组成。 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".有手的东西将比“无” class 更接近前五个类 - 您可能已经将其训练为“无手”的概念。 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.从信息论的角度来看,没有model 可能会从提供的训练图像中学习您想要的差异化。 If you want your model to learn hand gestures and discriminate them from other hand positions, then you have to train it appropriately.如果您希望您的 model 学习手势并将它们与其他手部位置区分开来,那么您必须对其进行适当的训练。 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.您将需要使用包含所需信息的训练集:至少 10% 的训练集必须是“无”图像的手部位置。 You may need more than 10%, perhaps even more than any other class.您可能需要超过 10%,甚至可能比任何其他 class 更多。 You may need to upgrade your topology.您可能需要升级拓扑。 Experiment -- that being the usual method of model development.实验——这是model开发的常用方法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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