In previous posts, we explored some of the compelling applications for Machine Learning on mobile apps, and considered whether the learning/computation should happen on-device or in the cloud. In this post, we’ll explore what are the options for implementing AI based applications on Android and iOS.
The good news is that both Android and iOS platforms have announced first-class support for Machine Learning applications. Google announced Neural Networks API to accelerate on-device machine intelligence on Android 8.1 and Tensorflow Light for using in mobile and embedded devices. Apple announced the CoreML framework at their developer conference, WWDC 2017.
Now we will list the steps involved in setting up a simple machine learning application on mobile platforms: Andriod and iOS. For better understanding, we’ll consider the example of an app with Image Recognition using a neural network.
(Note: the below steps are more on the technical side, but just goes on to show the simple high-level steps required to get machine learning setup on your apps.)
Below are the steps to be followed in setting up Andriod Machine Learning platform:
In Android, the machine learning computation is completely based on pre-trained Tensorflow models, combined with a standard SDK. There is no platform level API to get output from a model (unlike Apple). However, Android has an advanced Neural Net API, which lets you train models on the device, on the go. Pretty powerful and advanced, but not many devices supported (as of the writing of this blog, at least).
Below is the list of steps to be followed in setting up iOS Machine Learning platform:
We see that both Android and iOS platforms are adopting Machine Learning in a big way, by providing built-in support for them. They’ve made it easy for developers to drag-drop trained models and use them on the fly in few simple steps. And there are several tools available to convert and reuse these models across the platforms.