Inspecting TensorFlow Lite image classification model

Inspecting TensorFlow Lite image classification model

What to know before implementing TFLite model in mobile app

In previous posts, either about building a machine learning model or using transfer learning to retrain existing one, we could look closer at their architecture directly in the code. But what if we get *.tflite model from an external source? How do we know how to handle it properly? In this blog post, we’ll look closer at what we can do to get enough knowledge for plugging-in TensorFlow Lite image classification model into Android application.

Continue reading

TensorFlow Lite classification on Android (with support for TF2.0)

TensorFlow Lite classification on Android (TF2.0 support)

Adding the first Machine Learning model into your mobile app

*** Edit, 23.04.2019 ***

TensorFlow 2.0 experimental support
In the repository, you can find Jupyter Notebook with the code running on TensorFlow 2.0 alpha, with the support for GPU environment (up to 3 times faster learning process). As this is not yet stable version, the entire code may break in any moment. The notebook was created just for the Colaboratory environment. It requires some changes to make it working on Docker environment described in the blog post.
The notebook is available here.

TensorFlow 2.0 experimental support
In the repository, you can find Jupyter Notebook with the code running on TensorFlow 2.0 alpha, with the support for GPU environment (up to 3 times faster learning process). As this is not yet stable version, the entire code may break in any moment. The notebook was created just for the Colaboratory environment. It requires some changes to make it working on Docker environment described in the blog post.
The notebook is available here.

— — —

This is my new series about using Machine Learning solutions in mobile apps. As the opposition to the majority of articles, there will be not much about building layers, training processes, fine-tuning, playing with Google TPUs and data science in general. 
Instead, we’ll focus on understanding how to plug in models into apps, use, debug and optimize them, and be effective in the cooperation with data scientists and AI engineers.

MNIST

For sure you saw countless examples of how to implement MNIST classifier. Therefore, for the sake of the series completeness, I decided to implement it one more time. Maybe it’s not very challenging from ML perspective, but it’s still a good example to show how to work with TensorFlow Lite models in a mobile app.

In this blog post, we’ll create a simple Machine Learning model that detects a handwritten number presented on an image. The model will be converted to TensorFlow Lite and plugged into Android application, step by step.

Continue reading