Using Create ML to classify thousands of categories

In the Vision with Core ML session at WWDC the Vision FeaturePrint pretrained model was discussed. The presenter stated it is capable of predicting over 1000 categories. In my app I have 6000 categories to classify. Does this mean I cannot use Create ML to classify more than 1000 categories, or what will occur if I try to?

Accepted Reply

The Vision FeaturePrint model is not so much a classifier as a feature extractor, which means it knows a lot about photos and the kinds of objects that are typically found inside photos. When you apply it to a photo, this model gives you a vector of "features", which are just 2000 or so numbers.


Create ML then trains a classifier on top of these extracted features. Typically, when a feature extractor like Vision FeaturePrint is trained this is done on the ImageNet dataset, which has 1000 different categories. However, you can use as many different categories are you like, since Create ML will give you a customized classifier for your specific categories.


(I haven't actually tried this, an so Create ML may have some limits on the number of categories it allows, but in theory there is no such limitation. I've previously trained a ResNet-based classifier on 150,000 categories and that worked, although I did not use Create ML for that.)

Replies

The Vision FeaturePrint model is not so much a classifier as a feature extractor, which means it knows a lot about photos and the kinds of objects that are typically found inside photos. When you apply it to a photo, this model gives you a vector of "features", which are just 2000 or so numbers.


Create ML then trains a classifier on top of these extracted features. Typically, when a feature extractor like Vision FeaturePrint is trained this is done on the ImageNet dataset, which has 1000 different categories. However, you can use as many different categories are you like, since Create ML will give you a customized classifier for your specific categories.


(I haven't actually tried this, an so Create ML may have some limits on the number of categories it allows, but in theory there is no such limitation. I've previously trained a ResNet-based classifier on 150,000 categories and that worked, although I did not use Create ML for that.)