A model you train to classify images.
- macOS 10.14+Beta
- Xcode 10.0+Beta
- Create ML
Use an image classifier to train a machine learning model that you can include in your app to categorize images.
When you create the model, you give it a training data set made up of labeled images, along with parameters that control the training process. For example, you can provide the model with images of dogs and cats, in two folders labeled
cats, to train it to recognize these animals.
After training completes, you evaluate the trained model by showing the model a testing data set containing labeled images that the model hasn’t seen before. The metrics that come from this evaluation tell you whether the model performs well enough. For example, you can see how often the cat and dog classifier mistakes a cat for a dog. When the model makes too many mistakes, you can add more or better training data, or change the parameters, and try again.
When your model does perform well enough, you save it as a Core ML model file with the
mlmodel extension. You can then import this model file into an app—like the Classifying Images with Vision and Core ML sample code project—that uses a Core ML model file to classify images.