As Machine learning reaches the mainstream, new tools available to developers makes it possible to implement machine-learning features—voice, face, and image recognition; personalized recommendations; and more—in a mobile context.
TensorFlow Lite applies many techniques for achieving low latency; optimizing the kernels for mobile apps, pre-fused activations, and quantized kernels that allow smaller and faster (fixed-point math) models.
1. Machine Learning for Mobile Developers:
Tensorflow Lite Framework
Avid Farhoodfar, PhD, MSSW
Artificial intelligence applications in
Consumer Electronic Devices
1
2. Index
● Why Machine Learning directly on-device is important &
how it is different than what you may do on the server.
● What has been built with TensorFlow Lite.
● Some Demo
2
4. What’s a machine learning?
Use algorithms to learn from data (a.k.a Training)
Algorithms are known as models
Models perform prediction (a.k.a inference) Model
Output
“cat”
4
5. What’s a machine learning?
Use labeled data to improve models
labeled data = Input data + predictions
Errors used to improve the model
We need a Framework to make machine
learning predictions easier
Model
Output
“cat”
“cat”
Error
5
6. TensorFlow
TensorFlow is google’s framework for
machine learning.
It makes it easy to build and train
neural networks.
It is cross platform, works with CPUs, GPUs,
TPUs, as well as Mobile devices, and
Embedded Platforms.
Model
Output
“cat”
“cat”
Error
6
17. Many use cases
Speech Content
Classification
Prediction
Recognition
Text to Speech
Speech to Text
Object detection
Object Location
OCR Gesture
recognition
Facial modelling
Segmentation
Clustering
Compression
Super Resolution
Translation
Voice Synthesis
Video generation
Text generation
Audio generation
Text Image Audio
17
30. 30
GPU vs CPU Performance
At Google, they use
new GPU backend
which is accelerating
compute intensive
networks that enable
vital use cases for
the users.
41. This is about
Tiny models on tiny computers!
● Microcontrollers are everywhere
● Speech researchers were pioneers
● Models just tens of kilobytes
41
42. Here’s one I have in my pocket
Get ready for a live demo!
https://www.sparkfun.com/products/15170
384KB RAM, 1MB Flash, $15
Low single-digit milliwatt power usage
Days on a coin battery!
42
43. Why is this important?
(1) This is running entirely locally on the embedded chip.
We don’t need to have any internet connection
(2) The model itself is not quite 13 KB but it takes 20KB flash
storage on this device
(3) And the footprint of TensorFlow Lite for
Microcontrollers is only another 25 KB
43