Book Image

Machine Learning Projects for Mobile Applications

By : Karthikeyan NG
Book Image

Machine Learning Projects for Mobile Applications

By: Karthikeyan NG

Overview of this book

Machine learning is a technique that focuses on developing computer programs that can be modified when exposed to new data. We can make use of it for our mobile applications and this book will show you how to do so. The book starts with the basics of machine learning concepts for mobile applications and how to get well equipped for further tasks. You will start by developing an app to classify age and gender using Core ML and Tensorflow Lite. You will explore neural style transfer and get familiar with how deep CNNs work. We will also take a closer look at Google’s ML Kit for the Firebase SDK for mobile applications. You will learn how to detect handwritten text on mobile. You will also learn how to create your own Snapchat filter by making use of facial attributes and OpenCV. You will learn how to train your own food classification model on your mobile; all of this will be done with the help of deep learning techniques. Lastly, you will build an image classifier on your mobile, compare its performance, and analyze the results on both mobile and cloud using TensorFlow Lite with an RCNN. By the end of this book, you will not only have mastered the concepts of machine learning but also learned how to resolve problems faced while building powerful apps on mobiles using TensorFlow Lite, Caffe2, and Core ML.
Table of Contents (16 chapters)
Title Page
Dedication
Packt Upsell
Contributors
Preface
Index

Age, gender, and emotion prediction


This chapter is going to cover a complete iOS application using Core ML models to detect age, gender, and emotion from a photo taken using an iPhone camera or from a photo in a user's phone gallery.

Core ML enables developers to install and run pre-trained models on a device, and this has its own advantages. Since Core ML lives in the local device, it is not necessary to call a cloud service in order to get the prediction results. This improves the communication latency and also saves data bandwidth. The other crucial benefit of Core ML is privacy. You don't need to send your data to a third party in order to get the results picked for you. The main downside of having an offline model is that the model cannot be updated, and so it cannot be improved with newer inputs. Furthermore, a few models might increase memory footprints, since storage is limited on a mobile device. 

Note

With Core ML, when you import the ML model, Xcode will help you to do the rest...