英文:
Tensorflow images classification
问题
我一直在遵循官方TensorFlow指南进行图像分类,因为我想编写一个钢铁废料分类器脚本。在使用一组各种废料照片训练模型之后,我测试了脚本,更多或多或少地按照预期工作。问题实际上是在我提交非钢铁图像(如汽车、花朵和动物)进行测试时出现的,事实上,正如你可以想象的那样,脚本应该几乎不给出结果,但实际上它确实给出了从80%到98%不等的结果,我真的找不到处理错误或未经训练的类别分类的方法。你有没有任何提示或高级指南,以完善脚本?任何帮助都非常感谢
英文:
I've been following the official tensorflow guide for image classification because I want to code a steel scrap classifier script. After training the model with a set of various scrap photos I've tested the script and more or less it works as it should. Problems are actually popping out whenever I submit for test non steel images (like cars, flowers and animals), in fact as you can imagine the script should give almost 0% result but instead it actually gives ranging from 80% to 98% result and I can't really find a way to handle errors or non trained class classification. Do you have any tips or advanced guides in order to refine the script? Any help is very much appreciated
答案1
得分: 1
你的分类器在其他对象(如钢材)上效果不好,因为这些图像不在分布之内。解决这个问题的常见方法是使用两阶段模型:
-
钢材 vs. 非钢材提取:一个简单的方法是只是用一个布尔值指示图像是否包含钢材。一个更复杂的方法是使用边界框提取钢材,可以通过微调诸如 YOLO 这样的骨干网络来实现。
-
废旧 vs. 非废旧分类器:你已经建立了这个,所以你已经完成了一半。
英文:
Your classifier does not work well on other objects as steel because these images are out of distribution. A common solution to this problem is to use a two-stage model:
-
Steel vs. non-steel extraction: An easy way would be to just have a bool to indicate whether a picture contains steel or not. A more sophisticated approach would be to extract steel using bounding boxes, which can be done by finetuning a backbone such as YOLO.
-
Scrap vs. non-scrap classifier: You already built this, so you're halfway done.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论