perplexed about create ml app and object detection

I am trying to train a model using the create ml app to do object detection on approximately 10 different classes (ultimately). Here is what I have done so far, with corresponding results:


1. train 1 class with approx. 50 images. results in excellent object detection, and a model size of approx 65 MB

2. train 2 classes, one with approx. 150 images, the other with 50 images. results in very good object detection and a model size of approx. 65 MB

3. train 6 classes, one with approx 50 images, the rest with 150 or more images, a total of approx. 3000 images. results in varying qualitys of object detection from very good to very poor. the model size is still approx. 65 MB.


Here are my questions:

1. why is the model size the same regardless of complexity, number of images, and number of classes

2. is there some parameters that I can change to allow the output to be larger and more precise?

3. how many images should I have for each class?

4. do I have to label every instance of each class in each image?

Replies

The answer to 4 is a yes. The object detector model regards anything that's not tagged as not part of the model, so if you have a object class in an image that isn't annotated the model will be trained to not detect it.


Could that explain the results you're seeing?

Thanks Stuart,


That does explain some things. It is kind of frustrating that it works that way because the real world is significantly different than I want to label a "cat" or "dog. Especially... say, hypothetically you wanted to label fruit in their "natural" environment. So you go off and start labelling bananas, and apples, etc. You do so in 1000s of images so that your model performs well. Everything goes great, you have 1000s of images labeled, and you're set. Next thing you know, you get a requirement to label vegetables. So now you have to go back through the 1000s of images and add labels for the vegetables that may or may not be in the images that you labeled the fruit in, along with labeling all the fruit that might occur in your new vegetable images? That is both painful and frustrating and does not scale very well. I'm open to any advice. 🙂

What else do you expect ? Some automatic pre-labelling of existing 1000 images based on the training result of the new images ?

it could easily work similar to image classification, such that I could only tell it about the thing I'm interested in... say for example I put a box around a dog in all the images in a given folder, that is not to say that there isn't a cat in the image, I am only trying to teach it dog. Then if I add a folder for cat, I could box only the cats in those images... that is not to say there are no dogs on those images. So it could train on dog, then on cat independently of each other, then merge what it learns together so that I have one model that knows how to identify a cat, and a dog. Alternatively, a human has to go through and relabel everything, each time a new item needs to be added.

Sometimes it is easier to rub out confusing things in an image editor. So you could have a picture with a cat and other animals. Rub out the other animals in the cat folder. You can have a folder of images that contain none clasified animals, rub out all the classified ones. Alternativly you label all the anamals and programatically remove labels for the animals you are not yet classifying before training. Its best to have balanced data with about the same number of each thing you are detecting. To add a new classification you may need to scrape more images containg that animal to make it balanced. When you have enough change the filter so it does not remove that label. Another trick for balancing is to use augmentation on enough images to make it balanced. So, for example, flip enough images of the the one that you are short of to make up the difference. (programatically flip the labels too)