Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter
eBook - ePub

Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter

Build scalable real-world projects to implement end-to-end neural networks on Android and iOS

Anubhav Singh, Rimjhim Bhadani

  1. 380 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter

Build scalable real-world projects to implement end-to-end neural networks on Android and iOS

Anubhav Singh, Rimjhim Bhadani

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

Learn how to deploy effective deep learning solutions on cross-platform applications built using TensorFlow Lite, ML Kit, and Flutter

Key Features

  • Work through projects covering mobile vision, style transfer, speech processing, and multimedia processing
  • Cover interesting deep learning solutions for mobile
  • Build your confidence in training models, performance tuning, memory optimization, and neural network deployment through every project

Book Description

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.

What you will learn

  • Create your own customized chatbot by extending the functionality of Google Assistant
  • Improve learning accuracy with the help of features available on mobile devices
  • Perform visual recognition tasks using image processing
  • Use augmented reality to generate captions for a camera feed
  • Authenticate users and create a mechanism to identify rare and suspicious user interactions
  • Develop a chess engine based on deep reinforcement learning
  • Explore the concepts and methods involved in rolling out production-ready deep learning iOS and Android applications

Who this book is for

This book is for data scientists, deep learning and computer vision engineers, and natural language processing (NLP) engineers who want to build smart mobile apps using deep learning methods. You will also find this book useful if you want to improve your mobile app's user interface (UI) by harnessing the potential of deep learning. Basic knowledge of neural networks and coding experience in Python will be beneficial to get started with this book.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter di Anubhav Singh, Rimjhim Bhadani in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Computer Science e Neural Networks. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2020
ISBN
9781789613995
Edizione
1

Reinforced Neural Network-Based Chess Engine

Games have been provided with an entire section of their own on several online application stores and on almost every software store as well. The importance and craze of games cannot be overlooked, which is why developers all over the world keep trying to come up with better and more engrossing games.
In the world of popular board games, chess is one of the most competitive and complex games that is played all over the world. There have been several attempts to come out with strong automated programs for playing chess and competing against humans. This chapter will discuss the approach that's used by the developers at DeepMind who created Alpha Zero, a self-learning algorithm that taught itself to play chess so that it could beat the then best chess AI on the market, Stockfish 8, with a one-sided score in just 24 hours of training.
In this chapter, we will introduce the concepts that you need to understand in order to build such a deep reinforcement learning algorithm and then build a sample project. Note that this project will require that you have good knowledge of Python and machine learning.
We will cover the following topics in this chapter:
  • Introduction to reinforcement learning
  • Reinforcement learning in mobile games
  • Exploring Google's DeepMind
  • Alpha Zero-like AI for Connect 4
  • Underlying project architecture
  • Developing a GCP-hosted REST API for the chess engine
  • Creating a simple chess UI on Android
  • Integrating the chess engine API with a UI
Let's begin by discussing the usage and popularity of reinforcement learning agents in mobile games.

Introduction to reinforcement learning

In the last few years, reinforcement learning has emerged to be a prominent field of study among machine learning researchers. It has been increasingly used to build agents that learn to perform better in any given environment, in search of a better reward to the actions they have performed. This, in a nutshell, brings us to the definition of reinforcement learning in the field of artificial intelligence, this is when an algorithm aims to create virtual agents that perform actions at any given state within an environment to achieve the best possible reward after the sequence of actions has been performed.
Let's try to give this definition more structure by defining the variables associated with a common reinforcement learning algorithm:
  • Agent: A virtual entity that performs actions. It is the entity that replaces the designated user of the game/software.
  • Action (a): The possible actions that the agent can perform.
  • Environment (e): A set of scenarios available in the software/game.
  • State (S): A collection of all scenarios, along with the configurations available in them.
  • Reward (R): A value that's returned for any action that's performed by the agent, which the agent then tries to maximize.
  • Policy (π): The strategy that the agent uses to determine which actions have to be performed next.
  • Value (V): R is a short-term per-action reward, whereas value is the total reward expected at the end of a set of actions. Vπ(s) defines the expected total reward by following policy π under the state, S.
The flow of this algorithm can be seen in the following diagram:
While we didn't mention the observer in the preceding list of definitions, it is a necessity to have an observer or evaluator in order to produce rewards. Sometimes, the observer itself could be a complex piece of software, but often, this is a simple evaluation function or metric.
To get a more detailed idea of reinforcement learning, you can read the Wikipedia article at https://en.wikipedia.org/wiki/Reinforcement_learning. For a quick sample of a reinforcement learning agent in action, read the following DataCamp article: https://www.datacamp.com/community/tutorials/introduction-reinforcement-learning
In the next section, we will learn how reinforcement learning found its place in mobile games.

Reinforcement learning in mobile games

Reinforcement learning has gained popularity among developers who wish to build game-playing AIs for various reasons to simply check the capabilities of the AI, to build a training agent that helps professionals improve their game, and so on. From a researcher's point of view, games offer the best testing environment for reinforcement learning agents that can make decisions based on experience and learn to survive/achieve in any given environment. This is due to the fact that games can be designed with simple and precise rules, where the reaction of the environment to a certain action can be accurately predicted. This makes it easier to evaluate the performance of the reinforcement learning agents, and thereby facilitate a good training ground for the AI. With the breakthroughs in game-playing AIs taken into consideration, it has also been voiced that we're moving faster toward a general-purpose AI than what was expected. But how do reinforcement learning concepts map to games?
Let's consider a simple game, such as tic-tac-toe. Alternatively, if you're feeling quirky, just Google Tic-Tac-Toe and you'll be presented with a game right in your search results!
Consider you're playing Tic-Tac-Toe against the computer. The computer here is the agent. What is the environment, in this case? You guessed correctly the Tic-Tac-Toe board, along with the set of rules that govern the game in the environment. The already placed markers on the Tic-Tac-Toe board make the state the environment is in. The X or the O that the agent can put on the board are the actions they can perform, where a loss, a win, or a tie or advancing toward a loss, win, or a tie is the reward given back to the agent after they perform any action. The strategy that's followed by the agent to win the game is the policy it follows.
Hence, from this example, it is conclusive that reinforcement learning agents are highly suitable for building AI that learns to play any game. This has led to a number of developers coming up with game-playing AIs for several popular games besides chess, such as Go, checkers, Counter-Strike, and others. Even games such as Chrome Dino have found developers attempting to play them using AI.
In the next section, we will provide a brief overview of Google's DeepMind, one of the most popular companies in the field of game-playing AI makers.

Exploring Google's DeepMind

DeepMind is probably one of the most prominent names that comes up when you talk about the growth of self-learning artificial intelligence, owing to their groundbreaking research and achievements in the field. Acquired by Google in 2014, DeepMind is currently a wholly-owned subsidiary of Alphabet since the restructuring of Google in 2015. The most notable works of DeepMind include AlphaGo and its successor, Alpha Zero. Let's discuss these projects in greater depth and try to understand what makes them so important in the present day.

AlphaGo

In 2015, AlphaGo became the first piece of computer software to defeat a professional Go player, Lee Sedol, on a 19x19 board. The breakthrough was documented and released as a documentary movie. The impact of the victory over Lee Sedol was so great that the Korea Baduk Association granted an honorary 9-dan certificate, which essentially means a Go player whose skill of the game borders on divinity. This was the first time ever in the history of Go that an honorary 9-dan certificate had been provided, so the certificate th...

Indice dei contenuti

  1. Title Page
  2. Copyright and Credits
  3. About Packt
  4. Contributors
  5. Preface
  6. Introduction to Deep Learning for Mobile
  7. Mobile Vision - Face Detection Using On-Device Models
  8. Chatbot Using Actions on Google
  9. Recognizing Plant Species
  10. Generating Live Captions from a Camera Feed
  11. Building an Artificial Intelligence Authentication System
  12. Speech/Multimedia Processing - Generating Music Using AI
  13. Reinforced Neural Network-Based Chess Engine
  14. Building an Image Super-Resolution Application
  15. Road Ahead
  16. Appendix
  17. Other Books You May Enjoy
Stili delle citazioni per Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter

APA 6 Citation

Singh, A., & Bhadani, R. (2020). Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter (1st ed.). Packt Publishing. Retrieved from https://www.perlego.com/book/1443339/mobile-deep-learning-with-tensorflow-lite-ml-kit-and-flutter-build-scalable-realworld-projects-to-implement-endtoend-neural-networks-on-android-and-ios-pdf (Original work published 2020)

Chicago Citation

Singh, Anubhav, and Rimjhim Bhadani. (2020) 2020. Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter. 1st ed. Packt Publishing. https://www.perlego.com/book/1443339/mobile-deep-learning-with-tensorflow-lite-ml-kit-and-flutter-build-scalable-realworld-projects-to-implement-endtoend-neural-networks-on-android-and-ios-pdf.

Harvard Citation

Singh, A. and Bhadani, R. (2020) Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter. 1st edn. Packt Publishing. Available at: https://www.perlego.com/book/1443339/mobile-deep-learning-with-tensorflow-lite-ml-kit-and-flutter-build-scalable-realworld-projects-to-implement-endtoend-neural-networks-on-android-and-ios-pdf (Accessed: 14 October 2022).

MLA 7 Citation

Singh, Anubhav, and Rimjhim Bhadani. Mobile Deep Learning with TensorFlow Lite, ML Kit and Flutter. 1st ed. Packt Publishing, 2020. Web. 14 Oct. 2022.