Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
GIDS18_SupriyaSrivatsa.pdf
Search
Supriya Srivatsa
April 24, 2018
Technology
0
580
GIDS18_SupriyaSrivatsa.pdf
Supriya Srivatsa
April 24, 2018
Tweet
Share
More Decks by Supriya Srivatsa
See All by Supriya Srivatsa
Forgotten Histories
supriyasrivatsa
0
640
The Story of Villagers, Marbles and Oh, A Blockchain!
supriyasrivatsa
0
610
Going Multiplatform With Kotlin
supriyasrivatsa
0
710
Mobile, AI and TensorFlow
supriyasrivatsa
0
600
Other Decks in Technology
See All in Technology
2025年の医用画像AI/AI×medical_imaging_in_2025_generated_by_AI
tdys13
0
110
ハッカソンから社内プロダクトへ AIエージェント ko☆shi 開発で学んだ4つの重要要素
leveragestech
0
240
20251219 OpenIDファウンデーション・ジャパン紹介 / OpenID Foundation Japan Intro
oidfj
0
510
MySQLとPostgreSQLのコレーション / Collation of MySQL and PostgreSQL
tmtms
1
1.3k
さくらのクラウド開発ふりかえり2025
kazeburo
2
1.2k
AI時代のワークフロー設計〜Durable Functions / Step Functions / Strands Agents を添えて〜
yakumo
3
2.3k
株式会社ビザスク_AI__Engineering_Summit_Tokyo_2025_登壇資料.pdf
eikohashiba
1
120
Amazon Connect アップデート! AIエージェントにMCPツールを設定してみた!
ysuzuki
0
140
20251203_AIxIoTビジネス共創ラボ_第4回勉強会_BP山崎.pdf
iotcomjpadmin
0
140
AI との良い付き合い方を僕らは誰も知らない
asei
0
270
投資戦略を量産せよ 2 - マケデコセミナー(2025/12/26)
gamella
0
460
ハッカソンから社内プロダクトへ AIエージェント「ko☆shi」開発で学んだ4つの重要要素
sonoda_mj
6
1.7k
Featured
See All Featured
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
1
410
HDC tutorial
michielstock
0
280
Reality Check: Gamification 10 Years Later
codingconduct
0
1.9k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
2
260
Tell your own story through comics
letsgokoyo
0
770
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
270
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
720
Facilitating Awesome Meetings
lara
57
6.7k
GraphQLとの向き合い方2022年版
quramy
50
14k
Transcript
TensorFlow for Mobile Machine Learning Supriya Srivatsa, Software Engineer, Xome
Overview • AI and Mobile – the Convergence • Inference
– Today and Tomorrow • TensorFlow Primer • TensorFlow in your Pocket – TensorFlow Mobile – TensorFlow Lite • PokéDemo • Applications and Case Studies • Q & A
AI AND MOBILE – THE CONVERGENCE
INFERENCE - TODAY AND TOMORROW
The “Transfer to Infer” Approach
Why On Device Prediction • Data Privacy • Poor Internet
Connection • Questionable User Experience
Why On Device Prediction Case Study: Portrait Mode
TENSORFLOW PRIMER
None
TensorFlow – Deferred Execution Model (Building the Computational Graph) import
tensorflow as tf num1 = tf.constant(5) num2 = tf.constant(10) sum = num1 + num2 print(sum) #O/P: Tensor("add:0", shape=(), dtype=int32)
TensorFlow – Deferred Execution Model (Running the Computational Graph) import
tensorflow as tf num1 = tf.constant(5) num2 = tf.constant(10) sum = num1 + num2 with tf.Session() as sess: print(sess.run(sum)) #O/P: 15
None
None
TENSORFLOW IN YOUR POCKET
Pick Your Weapon • Choose a pre-trained TF Model –
Inception V3 Model – MNIST – Smart Reply – Deep Speech • Build a TF Model
Sharpen your Sword • Retrain Model as required.
Neural Network and Transfer Learning
None
TENSORFLOW MOBILE VS TENSORFLOW LITE
TensorFlow Lite • Smaller binary size, better performance. • Ability
to leverage hardware acceleration. • Only supports a limited set of operators.
TensorFlow Mobile and TensorFlow Lite
TensorFlow Mobile and TensorFlow Lite
TensorFlow Mobile and TensorFlow Lite
Optimization • optimize_for_inference • Quantization
Quantization • Round it up • Transform: round_weights • Compression
rates: ~8% => ~70% • Shrink down node names • Transform: obfuscate_names • Eight bit calculations
Quantization – Eight Bit Calculations
Optimization – Before and After
TensorFlow Mobile and TensorFlow Lite
TensorFlow Mobile and TensorFlow Lite
TensorFlow Lite • TOCO – TensorFlow Lite Optimizing Converter –
Pruning unused nodes. – Performance Improvements. – Convert to tflite format. (Generate FlatBuffer file.)
ü Frozen ü Optimized, Quantized ü .tflite / FlatBuffer
How does it work?
Packaging App and Model
CODE AWAY J
Code Away – Gradle Files
Code Away :) Tflite = new Interpreter(<loadmodelfile>) tflite.run(giveInput, outputObject) •
Create Interpreter • Run model with input, fetch output.
POKÉDEMO!
PokéDemo
APPLICATIONS AND CASE STUDIES
Coca Cola
Google Assistant
Smart Reply
Q & A
Thank you