加载的 MobileNet 模型给出了错误的预测

Loaded MobileNet model giving wrong predictions

我正在尝试加载 mobilenet_v2_1.4_224 (link: https://github.com/tensorflow/models/tree/master/research/slim/nets/mobilenet) 在 TensorFlow 中训练,并在 GoLang.

中提供

问题是,当我尝试用熊猫对图像进行预测时,我得到了错误的预测。我的猜测是我下载了错误的 imagenet 标签文件。我上面提到的网络是在哪个 imagenet 数据集上训练的?

来自 Tensorflow Model Zoo 的 AFAIK MobileNet 是在 ILSVRC-2012-CLS 上训练的,它有 1,000 类,包括大熊猫和小熊猫。

但是,由于 MobileNet 并非 100% 准确,您可能会遇到不同的结果,具体取决于您提供的输入图像。确保它紧紧围绕熊猫裁剪,并尝试各种图像,因为有些图像可能 return 不正确的标签,因为即使是最好的 MobileNets V2 模型在 ImageNet 数据集上的准确率也约为 70%。

如果您希望能够更精确地分类 pandas,我建议您使用 Panda 数据集重新训练您的 MobileNet 模型。有很多关于如何执行此操作的可用示例,我在下面链接了几个使用 MobileNets 架构和 Tensorflow 作为框架的示例。

https://www.tensorflow.org/hub/tutorials/image_retraining

https://hackernoon.com/creating-insanely-fast-image-classifiers-with-mobilenet-in-tensorflow-f030ce0a2991

https://medium.com/@sumit.arora/training-a-neural-network-using-mobilenets-in-tensorflow-for-image-classification-on-android-14f2792f64c1