What's new with machine learning in macOS Mojave

Machine learning. It's the big technology of the moment, and Apple's continuing with its device-driven approach. While Other companies focus on server-side machine learning, Apple is continuing to puts its focus on device-bound frameworks and techniques to train machine learning models. With its latest technologies, developers should see boosts in productivity and performance. And when it comes to Apple's machine learning frameworks and tools for macOS Mojave, we're really talking about two things.

Let's talk about what's new with machine learning in macOS Mojave, specifically Core ML 2 and Create ML.

Core ML 2

Core ML is Apple's framework for high-performance, on-device machine learning, and it's getting some improvements with Core ML 2. The latest version of the framework supports up to 30 layer types, as well as standard machine learning models like SVMs, tree ensembles, and generalized linear models. And apps built using Core ML models, on both macOS and iOS, will continue to offer excellent performance without having to contact a server or send data off of a device.

With an assist from the latest version of Metal, Core ML 2 model training can see boosts of up to 20x while training using third-party libraries like Turi, TensorFlow, and Watson Services when using your device's GPU. On-device processing has also received an upgrade, moving up to 30% faster because of Apple's implementation of batch predictions into the framework. Developers can also reduce the size of their models by up to 75% in some cases.

Create ML

Create ML is a tool meant to help developers who are not experts in machine learning generate and test machine learning models to bring them to their apps. Using Create ML, developers can train models to recognize images, parse meaning from text, or find a relationship between numerical values. You can use common data sets, or bring in your own. After developers have tested their Create ML models and are satisfied with their performance, the work done with Create ML can be integrated into their apps using Core ML.

Most importantly, outside of ease of use for non-expert developers, is Create ML's emphasis on creating custom models on your Mac. Utilizing the power of Metal and model testing using the GPU, developers can get some really impressive results while training models with Create ML. Models can even be trained using Xcode's Playgrounds. According to Apple's documentation, image classification and natural language models built with Create ML take less time to train and end up smaller in size.

On stage at WWDC 2018, Apple's Craig Federighi gave the example of Memrise, a developer who, among other things, uses device cameras to identify objects and speak their names in multiple languages. The company would previously need 24 hours to train one of their models using 20,000 images. Using Create ML, Memrise was able to reduce that time to 48 minutes on a MacBook Pro, and 18 minutes on an iMac Pro. Thanks to work done for Core ML 2 and Create ML, the developer was also able to reduce the size of its model from 90MB to 3MB.

The bottom line

Machine learning model training is getting a big leg up from Metal and GPU-based training in Apple's next big software updates. Core ML 2 focuses on even faster performance over its predecessor, with the same easy integration of different machine learning models. Create ML, meanwhile, allows any developer to incorporate machine learning into their apps on both macOS and iOS, training models on the Macs they use every day.

Questions?

If you want to know more about the changes coming to Apple's machine learning framework and tools, let us know in the comments.

Joseph Keller

Joseph Keller is the former Editor in Chief of iMore. An Apple user for almost 20 years, he spends his time learning the ins and outs of iOS and macOS, always finding ways of getting the most out of his iPhone, iPad, Apple Watch, and Mac.