Use Create ML with familiar tools like Swift and macOS playgrounds to create and train custom machine learning models on your Mac. You can train models to perform tasks like recognizing images, extracting meaning from text, or finding relationships between numerical values.
You train a model to recognize patterns by showing it representative samples. For example, you can train a model to recognize dogs by showing it lots of images of different dogs. After you’ve trained the model, you test it out on data it hasn’t seen before, and evaluate how well it performed the task. When the model is performing well enough, you’re ready to integrate it into your app using Core ML.
Create ML leverages the machine learning infrastructure built in to Apple products like Photos and Siri. This means your image classification and natural language models are smaller and take much less time to train.
Now we will create a ML model using CreateML,
First open CreateMl and select Image Classification option and provide a name to your model.
After that we will jump to a screen like this, here we have to provide data for creating a model. We are using data that contains Dogs and Cat images, also you can see in the console that we have to provide two type of data first is Training Data and second is Testing Data. Training data is used to train a ML model and Testing data is used to test our ML model that we have created. Next we will provide data to respective places.
Now you can see that we have 2 classes and 24 items in training and for testing we have 2 classes and 8 items. Next is we have to start training the model.
After completion we have our evaluations which shows we have successfully trained the data and test it with 100% precision in each cases.
Now your model is ready to download.
In this project we are using same model which we have created and here we can select image via gallery or by camera.
After selecting the image we get our results in the form of confidence percenetage form
To know more about CoreML working you can check my CoreML Object Detection project on github.