1/17 Optimizing TensorFlow for mobile

Let’s look at a second scenario where hybrid models are necessary.

Earlier we explored how more and more applications are combining machine learning with mobile applications.

2/17 Optimizing TensorFlow for mobile

Take Google Translate, for example, which is composed of several models.

It uses one model to find a sign, another model to read the sign using optical character recognition, a third model to translate the sign, a fourth model to superimpose the translated text, and possibly even a fifth model to select the best font to use.

3/17 Optimizing TensorFlow for mobile

ML allows you to add some “intelligence” to your mobile apps, such as

4/17 Optimizing TensorFlow for mobile

image and voice recognition

5/17 Optimizing TensorFlow for mobile

translation

6/17 Optimizing TensorFlow for mobile

and natural language processing.

7/17 Optimizing TensorFlow for mobile

You can also apply machine learning to gain smarter analytics on mobile-specific data.

For example, to detect certain patterns from motion sensor data, or GPS tracking data.

8/17 Optimizing TensorFlow for mobile

This is all thanks to the fact that ML can extract meaning from raw data.

9/17 Optimizing TensorFlow for mobile

So, if you want to perform image recognition with your mobile app, the easiest way is to send the raw image to the cloud, and let the cloud service recognize the objects in the image.

However

10/17 Optimizing TensorFlow for mobile

if you have a neural network algorithm running on your mobile app, you can get labels of the objects and send them to the cloud.

It’s a more efficient way to collect the object labels on the cloud service.

11/17 Optimizing TensorFlow for mobile

Now let’s say you perform motion detection with your mobile app.

In this case, you can run a neural network algorithm to extract a feature vector from the sensor data.

12/17 Optimizing TensorFlow for mobile

The numbers in the feature vector represent the “signatures” of each motion.

This means you don’t have to send the raw motion data to a cloud service.

13/17 Optimizing TensorFlow for mobile

Also, by applying machine learning to mobile apps, you can

14/17 Optimizing TensorFlow for mobile

reduce network bandwidth

15/17 Optimizing TensorFlow for mobile

and get faster response times when communicating with cloud services.

16/17 Optimizing TensorFlow for mobile

It’s important to note that you often can’t use the microservices approach for mobile devices, as they can add unwanted latency.

Since you can’t delegate to a microservice, like you can when running in the cloud, you’ll now want a library, not a process.

17/17 Optimizing TensorFlow for mobile

In these types of situations, it’s best to train models in the cloud and do predictive modeling on a device.

This means embedding the model within the device itself.