LOUISVILLE, KENTUCKY
DENVER, COLORADO
CHICAGO, ILLINOIS
MADISON, WISCONSIN
HARRISBURG, PENNSYLVANIA
ATLANTA, GEORGIA
CINCINNATI, OHIO
TORONTO, ONTARIO
HYDERABAD, INDIA
BANGALORE, INDIA

V-Soft's Corporate Headquarters

101 Bullitt Lane, Suite #205
Louisville, KY 40222

502.425.8425
TOLL FREE: 844.425.8425
FAX: 502.412.5869

Denver, Colorado

6400 South Fiddlers Green Circle Suite #1150
Greenwood Village, CO 80111

TOLL FREE: 844.425.8425

Chicago, Illinois

5215 Old Orchard Road Suite #950
Skokie, IL 60077

TOLL FREE: 844.425.8425

Madison, Wisconsin

8401 Greenway Boulevard Suite #100
Middleton, WI 53562

TOLL FREE: 844.425.8425

Harrisburg, Pennsylvania

4813 Jonestown Road Suite #103
Harrisburg, PA 17109

TOLL FREE: 844.425.8425

Atlanta, Georgia

1255 Peachtree Parkway Suite #4201
Cumming, GA 30041

TOLL FREE: 844.425.8425

Cincinnati, Ohio

Spectrum Office Tower 11260
Chester Road Suite 350
Cincinnati, OH 45246

Email: sales@vsoftinfrastructure.com
Phone: 513.771.0050

Toronto, Canada

1 St. Clair Ave W Suite #902, Toronto, Ontario, M4V 1K6

TOLL FREE: 844.425.8425

Hyderabad, India

Incor 9, 3rd Floor, Kavuri Hills
Madhapur, Hyderabad – 500033 India

PHONE: 040-48482789

Bangalore, India

GINSERV, CA Site No 1, HAL
3rd Stage Behind Hotel Leela Palace
Kodihalli, Bangalore - 560008 India

State of AI on Android and iOS

State of AI on Android and iOS

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.

Setting Up ML Application on Andriod and iOS Platforms

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.)

Setup in Android

Below are the steps to be followed in setting up Andriod Machine Learning platform:

  1. Add TensorFlow lib as a dependency to your project.
  2. Identify the suitable pre-trained model. Model will be “.pb” file. It will come with a label file (.txt format). Drop them into the assets folder.
  3. Use the TensorFlowInferenceInterface that comes with the TF library. This class encapsulates the logic required to process the image and give the output label with confidence level.
  4. Process/display the label and confidence level. It'll be a value between 0 and 1.

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).

Setup in iOS

Below is the list of steps to be followed in setting up iOS Machine Learning platform:

  1. Here, we will have to use models in the .mlmodel format. This is an Apple-prescribed format. As this is a non-standard format, Apple actually provides some tools to convert other formats in to .mlmodel format, including from TensorFlow models.
  2. Identify a suitable model, drop it into Project Navigator and assign the target ownership correctly.
  3. If you click on the model object, it will directly show all details of the model like Input & output name.
  4. Now XCode will auto-generate a Swift class representing this model. This class will be your interface to provide input and get output from the model.
  5. Now, all we need to do is pass the input to the model object, and get the output.

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.

Free mobile app consultation


About Authors

Kunj Gupta1. Kunj Gupta is a Google Certified Senior Mobile Developer at V-Soft. He works on developing apps for Android and iOS platforms, following best practices to ensure that apps run efficiently with respect to memory, CPU, battery, and network. He is also an expert in DevOps side of mobile app development, especially on automated Unit Tests and UI Tests on the Continuous Integration pipeline. Currently, he is working on applying Machine Learning in mobile apps as well.

 

Shaik Ghouse Basha2. Shaik Ghouse Basha is a Mobile Lead at V-Soft. He works on developing apps for Android and iOS platforms, following best practices to ensure that apps run efficiently with respect to memory, CPU, battery, and network. He is also an expert in DevOps side of mobile app development, especially on automated Unit Tests and UI Tests on the Continuous Integration pipeline. He is researching on applying Machine Learning in mobile apps as well.

 


Topics: Technology, Mobile Apps, Machine Learning, Artificial Intelligence, AI

Get Weekly Updates

Mobile Apps