Machine Learning Projects for Mobile Applications
eBook - ePub

Machine Learning Projects for Mobile Applications

Build Android and iOS applications using TensorFlow Lite and Core ML

  1. 246 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Machine Learning Projects for Mobile Applications

Build Android and iOS applications using TensorFlow Lite and Core ML

About this book

Bring magic to your mobile apps using TensorFlow Lite and Core ML

Key Features

  • Explore machine learning using classification, analytics, and detection tasks.
  • Work with image, text and video datasets to delve into real-world tasks
  • Build apps for Android and iOS using Caffe, Core ML and Tensorflow Lite

Book Description

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.

What you will learn

  • Demystify the machine learning landscape on mobile
  • Age and gender detection using TensorFlow Lite and Core ML
  • Use ML Kit for Firebase for in-text detection, face detection, and barcode scanning
  • Create a digit classifier using adversarial learning
  • Build a cross-platform application with face filters using OpenCV
  • Classify food using deep CNNs and TensorFlow Lite on iOS

Who this book is for

Machine Learning Projects for Mobile Applications is for you if you are a data scientist, machine learning expert, deep learning, or AI enthusiast who fancies mastering machine learning and deep learning implementation with practical examples using TensorFlow Lite and CoreML. Basic knowledge of Python programming language would be an added advantage.

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Deep Diving into the ML Kit with Firebase

In this chapter, we are going to further explore the Google Firebase-based ML Kit platform for mobile applications.
Google launched Firebase ML Kit at I/O 2018. The ML Kit is a part of the Firebase application suite that enables developers to incorporate machine learning (ML) capabilities into mobile applications. The Firebase ML Kit Software Development Kit (SDK) comes with a few features that are common among mobile applications, helping Android and iOS developers irrespective of their familiarity with ML.
The concepts covered throughout the chapter are as follows:
  • Understanding the basics of the ML Kit
  • Learning to add Firebase to our applications
  • Creating multiple applications that can be used for face detection, barcode scanning, and on-device text recognition using Firebase
Here is a link to our repository for this chapter: https://github.com/intrepidkarthi/MLmobileapps/tree/master/Chapter4 and https://github.com/PacktPublishing/Machine-Learning-Projects-for-Mobile-Applications.

ML Kit basics

Of course, we can always do all the ML-based implementations without the help of Firebase. However, there are a few reasons why not everyone will be able to do this. The reason for this could be one of the following:
  • A very good mobile application developer may not be good at building an ML model. Building an ML model definitely takes time. This may vary on a case-by-case basis.
  • Finding the right set of data models that will solve your use case will be a very difficult problem. Let's say you want to detect age and gender classification on an Asian person's face. In this case, the existing models that are available may not be accurate enough for your use case.
  • Hosting your own model will be costlier and will require extra care on the server side of the application.
The ML Kit is a combination of Google Cloud Vision API, Mobile Vision, and TensorFlow Lite models on a local device:

Basic feature set

ML Kit comes with a ready-to-use code base for common use cases such as detecting faces from an image, barcode scanning, finding text in an image, and image labeling. By passing on the data to the API, we can get the answer to our query on basic use cases with a few lines of code.
The ML Kit provides both on-device as well as cloud APIs. Based on our requirements, we can use either one of these services. While on-device APIs work faster, cloud APIs will provide better accuracy.
Not all mobile applications fall under the default APIs provided with the ML Kit. We will always have our own case to solve through ML. ML Kit supports deploying our custom TensorFlow Lite model into a cloud and acts as a layer to interact with your model.
At the time of writing this book, ML Kit comes with the following capabilities in beta mode:
  • Text recognition
  • Face detection
  • Barcode scanning
  • Image labeling
  • Landmark detection
Depending on the use case, these capabilities can come with on-device and...

Table of contents

  1. Title Page
  2. Copyright and Credits
  3. Dedication
  4. Packt Upsell
  5. Contributors
  6. Preface
  7. Mobile Landscapes in Machine Learning
  8. CNN Based Age and Gender Identification Using Core ML
  9. Applying Neural Style Transfer on Photos
  10. Deep Diving into the ML Kit with Firebase
  11. A Snapchat-Like AR Filter on Android
  12. Handwritten Digit Classifier Using Adversarial Learning
  13. Face-Swapping with Your Friends Using OpenCV
  14. Classifying Food Using Transfer Learning
  15. What's Next?
  16. Other Books You May Enjoy

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Machine Learning Projects for Mobile Applications by Karthikeyan NG in PDF and/or ePUB format, as well as other popular books in Computer Science & Artificial Intelligence (AI) & Semantics. We have over one million books available in our catalogue for you to explore.