简体   繁体   English

使用 Tensorflow Lite Model Maker 训练图像分类 Model 时出现问题

[英]Issue with training an Image Classification Model with Tensorflow Lite Model Maker

So I'm new at ML and I have a task where I need to be able to identify a specific object with my phone's camera and trigger an action at that moment.所以我是 ML 的新手,我有一个任务,我需要能够用手机的摄像头识别特定的 object 并在那一刻触发一个动作。 I got to the point where I'm able to train the model, hook it up with a sample Android app Google provides and run it.我已经到了能够训练 model 的程度,将它与 Google 提供的示例 Android 应用程序连接起来并运行它。 All of this works perfectly with a few datasets I've downloaded from different sites, things like dogs, or flowers work fine.所有这些都与我从不同站点下载的一些数据集完美配合,狗或花之类的东西都可以正常工作。 Now, I'm trying to train the model with a set of images that contain a simple object, for this example I'm using a Sony Bluetooth speaker XB12B.现在,我正在尝试使用一组包含简单 object 的图像来训练 model,在此示例中,我使用的是索尼蓝牙扬声器 XB12B。 I took a bunch of photos of it in different surroundings but when I train the model I always get an accuracy of 1 and when I use that model in my phone using image labeling, anything it sees is 100% that object.我在不同的环境中拍了一堆照片,但是当我训练 model 时,我总是得到 1 的准确度,当我在手机中使用图像标签使用 model 时,它看到的任何东西都是 100% 的 ZA8CFDE6331BD4B66661

I'm training the model with only one class.我正在用一个 class 训练 model。

As I mentioned I'm new to this and I'm not sure what I'm doing wrong, if it's the shape of the object, the lack of more elements in the dataset or some other parameter I'm missing.正如我提到的,我是新手,我不确定我做错了什么,如果它是 object 的形状,数据集中缺少更多元素或我缺少的其他一些参数。 Any insights you guys may have or clues are greatly appreciated非常感谢你们可能有的任何见解或线索

Cheers干杯

You would have to train the model with an existing dataset + your new set of images labeled as "speaker" (for the sake of this example).您必须使用现有数据集 + 标记为“说话者”的新图像集(为了本示例)训练 model。 If you train a model with only 1 class, it will learn to predict "how close is this object to a speaker?"如果你训练一个只有 1 个 class 的 model,它将学会预测“这个 object 与扬声器有多接近?” for every object it finds instead of "is this a speaker?".对于它找到的每个 object 而不是“这是扬声器吗?”。

You need to at least use 2 classes - mark speaker images as 'speaker' and the remaining images as 'other' OR you need to use more than 2 classes - mark speaker images as 'speaker' and the remaining images as per their assigned class of 'dog', 'cat', etc.您至少需要使用 2 个类别 - 将演讲者图像标记为“演讲者”,将剩余图像标记为“其他”,或者您需要使用 2 个以上的类别 - 将演讲者图像标记为“演讲者”,其余图像根据其分配的 class 标记“狗”、“猫”等

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

相关问题 数据集 TensorFlow Lite Model Maker 对象检测 - Dataset TensorFlow Lite Model Maker object detection Tensorflow Lite Model 制造商密钥错误:“姿势” - Tensorflow Lite Model Maker KeyError: "Pose" 训练CNN模型图像分类时的张量流量NaN损失 - tensorflow NaN loss during training CNN model image classification Android 分类应用程序因 Tensorflow Lite 模型而崩溃 - Android Classification App crashes with Tensorflow Lite Model 为 Tf Lite 模型图像分类打印标签 - Printing label for Tf Lite model Image Classification Firebase Tensorflow Lite 分类模型未在 Swift 应用程序中提供正确的输出 - Firebase Tensorflow Lite Classification Model Not Giving Correct Output in Swift App 是否可以通过 TFLite Model Maker 创建多类文本分类器 Tensorflow Lite model? - Is it possible to create a multi-class Text Classifier Tensorflow Lite model by TFLite Model Maker? TensorFlow 中图像分类模型的均方误差 - Mean Squared Error for image classification model in TensorFlow 对于 tensorflow 中的分类模型,有没有办法在训练过程中施加非对称成本函数? - For a classification model in tensorflow, is there a way to impose an asymmetric cost function during the training? 将 Tensorflow 模型转换为 Tensorflow Lite - Convert Tensorflow model into Tensorflow Lite
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM