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
550
GIDS18_SupriyaSrivatsa.pdf
Supriya Srivatsa
April 24, 2018
Tweet
Share
More Decks by Supriya Srivatsa
See All by Supriya Srivatsa
Forgotten Histories
supriyasrivatsa
0
610
The Story of Villagers, Marbles and Oh, A Blockchain!
supriyasrivatsa
0
580
Going Multiplatform With Kotlin
supriyasrivatsa
0
680
Mobile, AI and TensorFlow
supriyasrivatsa
0
560
Other Decks in Technology
See All in Technology
リセラー企業のテクサポ担当が考える、生成 AI 時代のトラブルシュート 2025
kazzpapa3
1
360
プロポーザルのコツ ~ Kaigi on Rails 2025 初参加で3名の登壇を実現 ~
naro143
1
250
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
14k
LLMアプリの地上戦開発計画と運用実践 / 2025.10.15 GPU UNITE 2025
smiyawaki0820
1
590
ビズリーチ求職者検索におけるPLMとLLMの活用 / Search Engineering MEET UP_2-1
visional_engineering_and_design
1
140
『バイトル』CTOが語る! AIネイティブ世代と切り拓くモノづくり組織
dip_tech
PRO
1
130
技育祭2025【秋】 企業ピッチ/登壇資料(高橋 悟生)
hacobu
PRO
0
110
いまからでも遅くない!SSL/TLS証明書超入門(It's not too late to start! SSL/TLS Certificates: The Absolute Beginner's Guide)
norimuraz
0
260
[Codex Meetup Japan #1] Codex-Powered Mobile Apps Development
korodroid
2
920
Node.js 2025: What's new and what's next
ruyadorno
0
370
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
5
43k
Click A, Buy B: Rethinking Conversion Attribution in ECommerce Recommendations
lycorptech_jp
PRO
0
100
Featured
See All Featured
How STYLIGHT went responsive
nonsquared
100
5.8k
For a Future-Friendly Web
brad_frost
180
10k
BBQ
matthewcrist
89
9.8k
Navigating Team Friction
lara
190
15k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
35
6.1k
Into the Great Unknown - MozCon
thekraken
40
2.1k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.4k
Balancing Empowerment & Direction
lara
5
690
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