Intelligent Mobile Projects with TensorFlow
Build 10+ Artificial Intelligence apps using TensorFlow Mobile and Lite for iOS, Android, and Raspberry Pi
Jeff Tang
BIRMINGHAM - MUMBAI
Intelligent Mobile Projects with TensorFlow
Copyright 2018 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor: Kunal Chaudhari
Acquisition Editor: Larissa Pinto
Content Development Editor: Flavian Vaz
Technical Editor: Akhil Nair
Copy Editor: Safis Editing
Project Coordinator: Devanshi Doshi
Proofreader: Safis Editing
Indexer: Rekha Nair
Graphics: Jason Monteiro
Production Coordinator: Aparna Bhagat
First published: May 2018
Production reference: 1160518
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78883-454-4
www.packtpub.com
To Lisa and Wozi, who showed me that unconditional love and support
can live in harmony with occasional need for attention.
mapt.io
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
PacktPub.com
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at service@packtpub.com for more details.
At www.PacktPub.com , you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Foreword
The past decade has seen the explosion of both machine learning and smartphones; today, these technologies are finally merging, and the result is an incredible variety of applications that you would have dismissed as far future Science Fiction just a few years ago. Think about it: you have already become accustomed to talking to your phone, asking it for directions, or telling it to schedule an appointment in your agenda. Your phone's camera tracks faces and recognizes objects. Games are becoming more interesting and challenging as the bots gets smarter and smarter. And countless apps use some form of artificial intelligence under the hood, in less obvious ways, such as recommending content that you will enjoy, anticipating your next trips to tell you when to leave, suggesting what to type next, and so on.
Until recently, all the intelligence happened on the server side, which meant that the user had to be connected to the internet, ideally with a fast and stable connection. The latency and service disruptions that this implied were show-stoppers for many applications. But today the intelligence is right there in the palm of your hand, thanks to tremendous hardware improvements and better Machine Learning libraries.
Most importantly, these technologies are now completely democratized: virtually any software engineer can learn to code an intelligent mobile application based on deep neural networks, using TensorFlow, Google's powerful and open source deep learning library. Jeff Tang's great and unique book will show you how to develop on-device TensorFlow-powered iOS, Android, and Raspberry Pi apps by guiding you through many concrete examples with step-by-step tutorials and hard-earned troubleshooting tips: from image classification, object detection, image captioning, and drawing recognition to speech recognition, forecasting time series, generative adversarial networks, reinforcement learning, and even building intelligent games using AlphaZero the improved technology built on top of AlphaGo that beat Lee Sedol and Ke Jie, the world champions of the game of Go.
This is going to be a super popular book. It's such an important topic, and it's hard to get good reliable information. So roll up your sleeves, you have an exciting journey ahead of you! What intelligent mobile application will you build?
Aurlien Gron
Former lead of YouTube's video classification team and author of the book Hands-On Machine Learning with Scikit-Learn and TensorFlow (O'Reilly, 2017)
Paris, May 11th, 2018
Contributors
About the author
Jeff Tang fell in love with classical AI more than two decades ago. After his MS in CS, he worked on Machine Translation for 2 years and then, to survive the long AI winter, he worked on enterprise apps, voice apps, web apps, and mobile apps at startups, AOL, Baidu, and Qualcomm. He developed a top-selling iOS app with millions of downloads and was recognized by Google as a Top Android Market Developer. He reconnected with modern AI in 2015 and knew that AI will be his passion and commitment for the next two decades. One of his favorite topics is to make AI available anytime anywhere and hence the book.
I'd like to thank Larissa Pinto for reaching out on the book idea, Flavian Vaz and Akhil Nair for all the feedback during content editing. Many thanks to Pete Warden, the TensorFlow mobile lead at Google, for his help before and after becoming a technical reviewer of the book, and to Amita Kapoor, another technical reviewer of the book, who also provided valuable feedback. Special thanks to Aurelien Geron, the best-seller author of the book Hands-On ML, for kindly responding to all my emails, sharing his insights, and writing the Foreword for the book from his packed agenda - Merci beaucoup, Aurelien.
I also truly appreciate the understanding and support by my family, other than Lisa and Wozi, during the holiday season and all the months while I had to work like crazy day and night on the book - thanks Amy, Anna, Jenny, Sophia, Mark, Sandy, and Ben.
Next page