Book Image

Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter

By : Anubhav Singh, Rimjhim Bhadani
Book Image

Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter

By: Anubhav Singh, Rimjhim Bhadani

Overview of this book

Deep learning is rapidly becoming the most popular topic in the mobile app industry. This book introduces trending deep learning concepts and their use cases with an industrial and application-focused approach. You will cover a range of projects covering tasks such as mobile vision, facial recognition, smart artificial intelligence assistant, augmented reality, and more. With the help of eight projects, you will learn how to integrate deep learning processes into mobile platforms, iOS, and Android. This will help you to transform deep learning features into robust mobile apps efficiently. You’ll get hands-on experience of selecting the right deep learning architectures and optimizing mobile deep learning models while following an application oriented-approach to deep learning on native mobile apps. We will later cover various pre-trained and custom-built deep learning model-based APIs such as machine learning (ML) Kit through Firebase. Further on, the book will take you through examples of creating custom deep learning models with TensorFlow Lite. Each project will demonstrate how to integrate deep learning libraries into your mobile apps, right from preparing the model through to deployment. By the end of this book, you’ll have mastered the skills to build and deploy deep learning mobile applications on both iOS and Android.
Table of Contents (13 chapters)

Introducing reinforcement learning and NLP

In this section, we shall be studying the basic concepts of reinforcement learning and NLP. These are some very important topics in the field of AI. They may or may not use deep learning networks for their implementations, but they are quite often implemented using deep networks. Therefore, it is crucial to understand how they function.

Reinforcement learning

Reinforcement learning is a branch of machine learning that deals with creating AI "agents" that perform a set of possible actions in a given environment in order to maximize a reward. While the other two branches of machine learningsupervised and unsupervised machine learningusually perform learning on a dataset in the format of a table, reinforcement learning agents mostly learn using a decision tree to be made in any given situation such that the decision tree eventually leads to the leaf that has the maximum reward. 

For example, consider a humanoid robot that wishes to learn to walk. It could first start by shoving both of its legs in front of itself, in which case it would fall, and the reward, which, in this case, is the distance covered by the humanoid robot, would be 0. It will then learn to add a certain amount of delay between the previous leg being put forward and the next leg being put forward. Due to this certain amount of delay, it could be that the robot is able to take x1 steps before, once again, both feet simultaneously push outward and it falls down. 

Reinforcement learning deploys the concept of exploration, which means the search for a better solution, and exploitation, which means the usage of previously gained knowledge. Continuing our example, since x1 is greater than 0, the algorithm learns to put approximately the same certain amount of delay between the strides. Over time, with the combined effect of exploitation and exploration, reinforcement learning algorithms become very strong, and the humanoid, in this case, is able to learn not only how to walk but also run.


NLP is a vast field of AI that deals with the processing and understanding of human languages through the use of computer algorithms. NLP comprises several methods and techniques that are each geared toward a different part of human language understanding, such as understanding meaning based on the similarity of two text extracts, generating human language responses, understanding questions or instructions made in human languages, and the translation of text from one language to another. 

NLP has found vast usage in the current world of technology with several top tech companies running toward excellence in the field. There are several voice-based user assistants, such as Siri, Cortana, and Google Assistant, that heavily depend upon accurate NLP in order to perform their functions correctly. NLP has also found usage in customer support with automated customer support platforms that reply to the most frequently made queries without the need of a human representative answering them. These NLP-based customer support systems can also learn from the responses made by the real representative while they interact with customers. One such major system in deployment can be found in the Help section of the DBS DigiBank application created by the Development Bank of Singapore.

Extensive research is underway in this domain, and it is expected to dominate every other field of AI in the upcoming days. In the next section, let's take a look at what the currently available methods of integrating deep learning with mobile applications are.