Over a million developers have joined DZone.

Mobile Machine Learning Using TensorFlow Lite [Videos]

DZone 's Guide to

Mobile Machine Learning Using TensorFlow Lite [Videos]

In these videos, get an explanation of what TensorFlow Lite is and learn how to use TensorFlow Lite on Android.

· AI Zone ·
Free Resource

TensorFlow Lite is TensorFlow's lightweight solution for mobile and embedded devices. It enables on-device machine learning inference with low latency and a small binary size. TensorFlow Lite also supports hardware acceleration with the Android Neural Networks API.

Image title

It's designed to be low-latency, with optimized kernels for mobile apps, pre-fused activations, and much more. It's also really easy to use, and there's a great demo app that will get you up-and-running with image classification from the device camera on both Android and iOS.

It comes in two parts:

  • A set of tools that you can use to prepare your models for use on mobile. These let you freeze your model to make it smaller, and then optimize and convert it in a process also called flattening the model so that it will run happily on mobile.
  • A mobile runtime with an easy API that lets you pass data to the model and get classifications back.

If you haven't done so already I strongly recommend you try the TensorFlow for Poets codelab that teaches you the concepts of image classification using TensorFlow and MobileNets, including adding custom classifications for your images. Once you've done that, then you can look at Part 2, which teaches you the concepts of preparing the model to run on TensorFlow Lite.

In this video I explain TensorFlow Lite:

And in this one, you can see how it works on Android:

The code for this example is available on GitHub here. You don't need to Bazel build if you don't want to — just load the code into Android Studio, set your model and weights, and have fun!

ai ,mobile development ,machine learning ,tensorflow ,neural network ,api

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}