Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
This post was edited and submitted for review 1 year ago and failed to reopen the post:
Original close reason(s) were not resolved
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
简短回答:是的,您可以使用简单的逻辑运算来检查类 ID,然后仅显示属于该类的边界框(如果您不想使用单个输出层重新训练模型)
但是,要正确回答问题并使用最佳实际场景;让我们检查一下单类和多类对象检测之间的区别以及是否值得重新训练。
在模型架构方面,只有不同的层才是全连接层(当然只有当你使用相同的主干网进行特征提取时)。单类目标检测器只有回归层集,而多类目标检测模型有回归层+softmax分类器来检测和分类多类标签。
那么您应该使用哪一个呢?
在某些情况下(即使您试图检测单个类别),不同的对象看起来彼此非常相似,将它们分成多个类别并在多类别检测器中训练它们将减少为您的类别提供误报结果的机会想要欲望。您可能会认为这种情况就像您现在不知道猫是什么一样,并且由于它们与狗相似,因此您很容易将猫误认为是狗。但如果你现在知道猫和狗是分开的,那么将它们误认为彼此的可能性就很低。
几乎所有时候,深度学习问题都没有通用的解决方案。但现在了解它们背后的理论将引导您走向成功。
如果您想将该模型 (ssd_mobilenet_v3) 转换为单类对象检测器,您需要做的就是 删除全连接层,添加你自己的层,然后训练为平常;
Short Answer: Yes, you can use a simple logical operation to check class ID then display only bounding boxes belonging to that class (If you don't want to retrain the model with single output layer)
However, to correctly answer the question and use the best practical scenario; let's check what's the difference between single class and multiclass object detection is and if it is worth to retrain it.
In terms of model architecture, only different layer is the fully connected layer (Of course only if you're using the same backbone for feature extraction.) Single-class object detectors only have a regression layer set, whereas multi-class object detection models have regression layer + softmax classifier to detect and classify multi class labels.
So which one you should use?
In some cases (even if you're trying to detect single class) where different objects look very similar to eachother, seperating them into multiple classes and training them in multi-class detector will reduce the chances to give false positive result for the class you want to desire. You may think this case like you do not now what cat is and since they're similar to dogs, you can easily mistake a cat to a dog. But if you now what cat and dog are seperately, the chances are low to mistake them for eachother.
Almost all the time, there is no general solution to a deep learning problem. But nowing the theory behind them will lead you to success.
If you want to convert that model (ssd_mobilenet_v3) to single-class object detector, all you need to do is remove fully connected layer, add your own then train as usual;