Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
490 views
in Technique[技术] by (71.8m points)

python - 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. 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. 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. 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.

I'm training the model with only one class.

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. Any insights you guys may have or clues are greatly appreciated

Cheers


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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). If you train a model with only 1 class, it will learn to predict "how close is this object to a speaker?" for every object it finds instead of "is this a speaker?".

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...