Create ML is 100 Percent Swift Machine Learning

Machine learning (ML) is rapidly becoming a key framework for a new digital future. It seems like every tech firm wants to utilize this subset of artificial intelligence (A.I.), which uses a variety of techniques to “train” programs to become better at particular tasks.

At this year’s WWDC, Apple announced a new way to train machine learning models – entirely in Swift – with a new service dubbed Create ML. As a more direct method for training machine learning models, Create ML is meant to supplant TensorFlow and other machine learning models in the ‘creation’ phase of machine learning.

As Apple sees it, there are three steps to machine learning: create, train, implement. Create ML focuses on machine learning in the context of images, text, and tabular data, with imagery the most applicable of the three. So if you were trying to train a machine learning model to differentiate between images of fruit, you would first create files of those fruits; one folder would contain images of strawberries, then one for bananas, and so on.

After you’ve collected images and arranged them to your liking, it’s time to train the model. With Create ML, that can happen in Swift Playgrounds, Apple’s training platform for the Swift programming language: After importing createMLUI, simply initialize the builder (MLImageClassifierBuilder) and drag-and-drop your files. Swift Playgrounds also assigns a confidence score to the model. After testing your model against new imagery, you can drag-and-drop the trained model into an Xcode app build with CoreML.

Create ML

This all happens locally on the Mac, using the system GPU and CPU. Create ML typically reduces the file size of trained models, sometimes by 90 percent or more; although traditional machine-learning model training has several tedious hoops to jump through, Create ML leaps past several of them. This might seem insecure, but it’s apparently logically sound.

Fundamentally, Create ML is for Swift developers; that’s a core reason you can start in Swift Playgrounds and finish in Xcode. Apple clearly feels that iOS and macOS developers haven’t been learning the languages that other ML frameworks support, and has moved to fill that gap.