BT

Apple Has Released Core ML 2

| by Roland Meertens Follow 8 Followers on Jun 07, 2018. Estimated reading time: 2 minutes | NOTICE: QCon.ai - Applied AI for Developers Apr 15 - 17, 2019, San Francisco. Join us!

At WWDC Apple released Core ML 2: a new version of their machine learning SDK for iOS devices. This new version speeds up inference time, provides the Create ML tool that allows developers to create and train custom machine learning models locally on their Mac, and enables Keras and sci-kit learn users to import their models directly into Core ML

The new release of Core ML, whose first version was released in June 2017, should create an inference time speedup of 30% for apps developed using Core ML 2. They achieve this using two techniques call "batch prediction" and "quantization". Batch prediction refers to the practice of predicting for multiple inputs at the same time (e.g. four images at the same time, instead of predicting these images one by one). Quantization is the practice of representing weights and activation in fewer bits during inference than during training. During training, you can use floating-point numbers used for weights and activations, but they slow down computation a lot during inference on non-GPU devices. By representing them in either 8 or 16 bits you still get the results you care about, but your network is both faster than before and 75% smaller.

An important new feature of the Core ML SDK is Create ML. Using Swift and macOS playgrounds developers can create and train custom machine learning models on their Mac. They can then integrate their model into their app with Core ML.

In their talks, Apple also gave an example of how the company Memrise, a site where people learn another language, used their Core ML tool. Previously their developers needed 24 hours to train a model using 20,000 images. When using Create ML and Core ML 2 they reduced this time to only 48 minutes on a MacBook Pro, and 18 minutes on an iMac Pro. It also enabled them to reduce their model size from 90MB to 3MB.

Users of Keras and sci-kit learn can import their models directly into Core ML. One downside of Core ML is that it's not possible to import TensorFlow models. However, there is a public tool released by Google that can convert them to a format that you can import.  

You can learn more about Core ML 2 on Apple's machine learning site. You can also find other information on how machine learning is integrated into Apple products in their machine learning journal.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss
BT