Book Image

Machine Learning for Mobile

By : Revathi Gopalakrishnan, Avinash Venkateswarlu
Book Image

Machine Learning for Mobile

By: Revathi Gopalakrishnan, Avinash Venkateswarlu

Overview of this book

Machine learning presents an entirely unique opportunity in software development. It allows smartphones to produce an enormous amount of useful data that can be mined, analyzed, and used to make predictions. This book will help you master machine learning for mobile devices with easy-to-follow, practical examples. You will begin with an introduction to machine learning on mobiles and grasp the fundamentals so you become well-acquainted with the subject. You will master supervised and unsupervised learning algorithms, and then learn how to build a machine learning model using mobile-based libraries such as Core ML, TensorFlow Lite, ML Kit, and Fritz on Android and iOS platforms. In doing so, you will also tackle some common and not-so-common machine learning problems with regard to Computer Vision and other real-world domains. By the end of this book, you will have explored machine learning in depth and implemented on-device machine learning with ease, thereby gaining a thorough understanding of how to run, create, and build real-time machine-learning applications on your mobile devices.
Table of Contents (19 chapters)
Title Page
Copyright and Credits
About Packt
Contributors
Preface
Question and Answers
Index

Solving the problem


In this section, we are going to see a practical implementation of a neural network. We will define the problem statement, then we will understand the dataset we are going to use to solve the problem, whereupon we will create the model in Keras to solve the problem. Once the model is created in Keras, we will convert it into a model that's compatible with Core ML. This Core ML model will be imported into an iOS application, and a program will be written to use this model and interpret the handwritten digits.

Defining the problem statement

We are going to tackle the problem of recognizing handwritten digits through a machine learning model that we'll implement in an iOS mobile application. The first step is to have the database of handwritten digits that can be used for model training and testing.

The MNIST digits dataset (http://yann.lecun.com/exdb/mnist/) provides a database of handwritten digits, and has a training set of 60,000 examples and a test set of 10,000 examples...