Apple’s annual developer conference kicked off yesterday with a sprawling, much-anticipated keynote. The talk, as well as the follow-up “State of the Platform” presentation, included a number of interesting announcements and news about Apple’s machine learning efforts.
It’s particularly interesting to compare these announcements with those Google made at I/O, which preceded WWDC by a month. Google has built their fortunes on cloud computing and large-scale application of machine learning. Accordingly, many of their announcements centered on computationally expensive initiatives, like using ML itself to build new ML models and building huge arrays of GPU-enabled machines to provide tremendous amount of processing power. Apple’s success over the past decade has been dominated by the iPhone, and their announcements have more of a focus on creating and running ML models quickly and efficiently.
First off, Apple announced CreateML. Like Google’s MLKit (which you might be forgiven for thinking was an Apple product based on the name), CreateML provides high level, task-specific APIs for creating and training machine learning models. It includes functionality for image classifiers, text classifiers, and generic classifications and regressions.
A couple of interesting distinctives here: because of Apple’s emphasis on privacy, its ML architecture is designed to be run on-device, rather than in the cloud. CreateML models are no exception. And because some of them are solving known problems, they can be more efficient than is the case for generic solutions.
Consider the Image Classification task of recognizing types of flowers. The traditional way to train a model would be to create a convolutional neural network, initialize it with random values, and keep feeding it images until it learns to pull out a variety of features from the images, and then to figure out which features are relevant to the specific flowers we’re trying to identify. In this case, a lot of the most computationally expensive work happens when recognizing the features — once the features are known, picking out those specific to a rose is comparatively easy.
CreateML, on the other hand, uses transfer learning, which allows a developer to train a flower-recognition task much more quickly and with less data. This is because the image classification model it uses has been pre-trained on general computer vision tasks, and already knows about feature extraction. In effect, you don’t have to teach the model how to see — it already knows that. You have only to teach it what flowers look like. This makes for both quicker, more efficient training and smaller models.
CreateML also provides some nice integration with Playgrounds, its Jupyter notebook-like environment for writing and experimenting with code iteratively. Developers can drag in images to feed to the Image Classifier there with a nice GUI that makes it even simpler to train a model without having to worry about reading in the data from disk.
Apple continues to emphasize efficient use of ML models. Because it controls both the hardware and software, Apple’s platforms have some unique advantages for using ML in efficient ways. Metal allows iOS and MacOS to take advantage of GPUs where they’re available. CoreML provides a lingua franca for delivering and using trained models from all of the various network training systems. And the A11 bionic chip in the iPhone X even has two cores that are designed for and dedicated solely to running ML networks.
Speaking of CoreML, Apple also announced CoreML 2. Notably, Core ML 2 achieves faster speeds for running models using batch prediction. It can also reduce the size of trained models substantially by quantizing those models, reducing precision in places where it doesn’t effect the network’s output to do so.
The first day of WWDC has left no doubt that Apple is very serious about applying machine learning throughout their product line, both to make its operating systems more capable and to allow developers to take efficient advantage of the technology. With both Apple and Google introducing progressively higher-level and more performant tools, the doors are now open for those who don’t want to devote weeks of study to take advantage of the tech.