SlideShare a Scribd company logo
4
Most read
5
Most read
8
Most read
TinyML: TFLite for
Microcontrollers
Robert John
GDE ML & GCP
@robert_thas
Machine Learning on Embedded Edge Devices
Why Machine Learning?
Learning from example: activity detection, pet
classification
● We can’t write rules for everything
● We produce enough data for our examples
● We have powerful machines for training
Why Embedded Edge Devices?
Some computers do only one thing!
● Placed in hard-to-reach places
● Run on batteries
● Replaced once a year or even longer
● No keyboard or mouse
● Rely on sensors or inputs from other microcontrollers
● Control other microcontrollers or other outputs
● Smart temperature example
Sensors on Edge Devices
More sensors than the average computer
● Motion sensors
● Biometric sensors
● Acoustic sensors
● Environmental sensors
● Force sensors
Constraints on Edge Devices
Can’t eat your cake and have it
Raspberry Pi Pico HP Chromebook
(Celeron)
Raspberry Pi 4
Classification Microcontroller Personal Computer Single-Board Computer
Microprocessor RP2040 Celeron BCM2711
Processor Designer Raspberry Intel Broadcom
ISA Family Arm Cortex-M0+ IA32 (32-bit x86) Arm Cortex-A72
Clock speed 133MHz 3.5 GHz 1.5 GHz
RAM 264 KB 4GB/8GB 2GB/4GB/8GB
Storage 2MB Flash HDD/SSD HDD/SSD
Inputs GPIO Serial Keyboard/Mouse Keyboard/Mouse
Outputs GPIO Serial Monitor/Speakers Monitor/Speakers
Edge ML Deployment Challenges
Inference is all you need!
● Pre-trained models are hard to fit into MCUs
● No OS to act as hardware buffer
● Mobile-optimized models might use instructions not present on MCU
● Need to understand the underlying ISA
● Floating-point arithmetic usually not present
● Model is task specific, no need classify 1000 images!
● Might need to start from scratch!!
● Need to know Python and C/C++
Keep It Simple!
You only need inference!
● The model should only be as large as it needs to be to guaranty the required
accuracy
● Leverage quantization-aware training to avoid model degradation
● Implement post-training quantization to shrink models from floating-point
(32-bit) to integer (8-bit)
● It’s okay to lose a little bit of context during inference
Learn More
Important Resources
● TensorFlow: https://www.tensorflow.org/
● TensorFlow Lite: https://www.tensorflow.org/lite
● TFLu: https://www.tensorflow.org/lite/microcontrollers
● TinyML Foundation: https://www.tinyml.org/
● TinyML Course on EdX:
https://www.edx.org/professional-certificate/harvardx-tiny-machine-learning
● Embedded Systems Essentials:
https://www.edx.org/professional-certificate/armeducationx-embedded-systems-essentials
●
Thank You!
Robert John
GDE ML & GCP
@robert_thas

More Related Content

PDF
Machine Learning Applications to IoT
PPTX
Artificial Intelligence in Small Embedded System
PDF
Introduction to AIoT & TinyML - with Arduino
PPTX
JETSON : AI at the EDGE
PPTX
Using arduino and raspberry pi for internet of things
PDF
IoT with Python
PPTX
Introduction to Internet of Things Hardware
PPTX
Applications of machine learning in Wireless sensor networks.
Machine Learning Applications to IoT
Artificial Intelligence in Small Embedded System
Introduction to AIoT & TinyML - with Arduino
JETSON : AI at the EDGE
Using arduino and raspberry pi for internet of things
IoT with Python
Introduction to Internet of Things Hardware
Applications of machine learning in Wireless sensor networks.

What's hot (20)

PDF
Introduction to TinyML - Solomon Muhunyo Githu
PDF
Lecture 1 - Introduction to IoT
PPTX
Convolutional Neural Network and Its Applications
PDF
Internet of things (IOT) connects physical to digital
PDF
Deep Learning for Computer Vision: Object Detection (UPC 2016)
PDF
A Reference Architecture for IoT
PDF
IoT, Careers, and Skills
PPT
Reinforcement Learning Q-Learning
PDF
"Quantizing Deep Networks for Efficient Inference at the Edge," a Presentatio...
PPTX
Performance trends and alerts with ThingSpeak IoT
PPTX
Internet of Things (IoT) - Introduction ppt
PPTX
Human activity recognition
PDF
Security in Cyber-Physical Systems
PDF
IoT Connectivity
PDF
Introduction to IoT Architectures and Protocols
PPTX
presentation on Edge computing
PPTX
01 IoT Development History and Overview.pptx
PPTX
Basics of embedded system design
PPTX
Eye phone .1
Introduction to TinyML - Solomon Muhunyo Githu
Lecture 1 - Introduction to IoT
Convolutional Neural Network and Its Applications
Internet of things (IOT) connects physical to digital
Deep Learning for Computer Vision: Object Detection (UPC 2016)
A Reference Architecture for IoT
IoT, Careers, and Skills
Reinforcement Learning Q-Learning
"Quantizing Deep Networks for Efficient Inference at the Edge," a Presentatio...
Performance trends and alerts with ThingSpeak IoT
Internet of Things (IoT) - Introduction ppt
Human activity recognition
Security in Cyber-Physical Systems
IoT Connectivity
Introduction to IoT Architectures and Protocols
presentation on Edge computing
01 IoT Development History and Overview.pptx
Basics of embedded system design
Eye phone .1
Ad

Similar to TinyML: Machine Learning for Microcontrollers (20)

PDF
Edge AI: Bringing Intelligence to Embedded Devices
PPTX
introductiontotinyml-solomonmuhunyogithu-230608174720-8f1bc8e4.pptx
PPTX
Arduino in TinyML with Edge Impulse
PDF
Smaller and Easier: Machine Learning on Embedded Things
PDF
ECML PKDD 2021 ML meets IoT Tutorial Part II: Creating ML based Self learning...
PDF
ECML PKDD 2021 ML meets IoT Tutorial Part I: ML for IoT Devices
PDF
Implementation of Tiny Machine Learning Models on Arduino 33 – BLE for Gestur...
PPTX
TinyML & EDGE AI explained easily for kids
PDF
Webinar: Machine Learning para Microcontroladores
PPTX
Machine learning and Deep learning on edge devices using TensorFlow
PPTX
Combining Machine Learning with Physical Computing - June 2023
PPTX
Machine-Learning-on-board-Robots-Implementing-AI-Directly-on-Hardware.pptx
PDF
A multi-microcontroller-based hardware for deploying Tiny machine learning mo...
PDF
EEP596-TinyML-Spring24-Slides detail description
PPTX
Combining Machine Learning with Physical Computing - June 2022
PDF
“TensorFlow Lite for Microcontrollers (TFLM): Recent Developments,” a Present...
PPTX
Teaching Machine Learning with Physical Computing - July 2023
PDF
On-device ML with TFLite
PDF
Tensorflow 2.0 and Coral Edge TPU
PDF
Machine Learning pada Perangkat Portabel - Nurendrantoro
Edge AI: Bringing Intelligence to Embedded Devices
introductiontotinyml-solomonmuhunyogithu-230608174720-8f1bc8e4.pptx
Arduino in TinyML with Edge Impulse
Smaller and Easier: Machine Learning on Embedded Things
ECML PKDD 2021 ML meets IoT Tutorial Part II: Creating ML based Self learning...
ECML PKDD 2021 ML meets IoT Tutorial Part I: ML for IoT Devices
Implementation of Tiny Machine Learning Models on Arduino 33 – BLE for Gestur...
TinyML & EDGE AI explained easily for kids
Webinar: Machine Learning para Microcontroladores
Machine learning and Deep learning on edge devices using TensorFlow
Combining Machine Learning with Physical Computing - June 2023
Machine-Learning-on-board-Robots-Implementing-AI-Directly-on-Hardware.pptx
A multi-microcontroller-based hardware for deploying Tiny machine learning mo...
EEP596-TinyML-Spring24-Slides detail description
Combining Machine Learning with Physical Computing - June 2022
“TensorFlow Lite for Microcontrollers (TFLM): Recent Developments,” a Present...
Teaching Machine Learning with Physical Computing - July 2023
On-device ML with TFLite
Tensorflow 2.0 and Coral Edge TPU
Machine Learning pada Perangkat Portabel - Nurendrantoro
Ad

More from Robert John (8)

PPTX
DevFest 2022 Nairobi - Considerations for Deploying ML Models on Edge Devices...
PPTX
DevFest 2022 - Nairobi ML Keynote.pptx
PPTX
Arduino Certification
PDF
Fundamentals of cloud computing
PDF
Baby Steps to Machine Learning at DevFest Lagos 2019
PDF
What is TensorFlow and why do we use it
PDF
What is Google Cloud Good For at DevFestInspire 2021
PDF
TinyML at DevFestLagos21
DevFest 2022 Nairobi - Considerations for Deploying ML Models on Edge Devices...
DevFest 2022 - Nairobi ML Keynote.pptx
Arduino Certification
Fundamentals of cloud computing
Baby Steps to Machine Learning at DevFest Lagos 2019
What is TensorFlow and why do we use it
What is Google Cloud Good For at DevFestInspire 2021
TinyML at DevFestLagos21

Recently uploaded (20)

PPTX
Nanokeyer nano keyekr kano ketkker nano keyer
PPT
Lines and angles cbse class 9 math chemistry
PPTX
ERP good ERP good ERP good ERP good good ERP good ERP good
PPTX
kvjhvhjvhjhjhjghjghjgjhgjhgjhgjhgjhgjhgjhgjh
PDF
Prescription1 which to be used for periodo
PDF
-DIGITAL-INDIA.pdf one of the most prominent
PDF
Core Components of IoT, The elements need for IOT
PDF
YKS Chrome Plated Brass Safety Valve Product Catalogue
PDF
Chapter -24-By Dr Sajid Ali Ansari 2021.pdf
PDF
How NGOs Save Costs with Affordable IT Rentals
PPTX
5. MEASURE OF INTERIOR AND EXTERIOR- MATATAG CURRICULUM.pptx
PPTX
executive branch_no record.pptxsvvsgsggs
PPTX
Embedded for Artificial Intelligence 1.pptx
PPTX
STEEL- intro-1.pptxhejwjenwnwnenemwmwmwm
PPTX
1.pptxsadafqefeqfeqfeffeqfqeqfeqefqfeqfqeffqe
PDF
Cableado de Controladores Logicos Programables
PPTX
了解新西兰毕业证(Wintec毕业证书)怀卡托理工学院毕业证存档可查的
PPTX
"Fundamentals of Digital Image Processing: A Visual Approach"
PDF
Smarter Security: How Door Access Control Works with Alarms & CCTV
PPTX
figurative-languagepowerpoint-150309132252-conversion-gate01.pptx
Nanokeyer nano keyekr kano ketkker nano keyer
Lines and angles cbse class 9 math chemistry
ERP good ERP good ERP good ERP good good ERP good ERP good
kvjhvhjvhjhjhjghjghjgjhgjhgjhgjhgjhgjhgjhgjh
Prescription1 which to be used for periodo
-DIGITAL-INDIA.pdf one of the most prominent
Core Components of IoT, The elements need for IOT
YKS Chrome Plated Brass Safety Valve Product Catalogue
Chapter -24-By Dr Sajid Ali Ansari 2021.pdf
How NGOs Save Costs with Affordable IT Rentals
5. MEASURE OF INTERIOR AND EXTERIOR- MATATAG CURRICULUM.pptx
executive branch_no record.pptxsvvsgsggs
Embedded for Artificial Intelligence 1.pptx
STEEL- intro-1.pptxhejwjenwnwnenemwmwmwm
1.pptxsadafqefeqfeqfeffeqfqeqfeqefqfeqfqeffqe
Cableado de Controladores Logicos Programables
了解新西兰毕业证(Wintec毕业证书)怀卡托理工学院毕业证存档可查的
"Fundamentals of Digital Image Processing: A Visual Approach"
Smarter Security: How Door Access Control Works with Alarms & CCTV
figurative-languagepowerpoint-150309132252-conversion-gate01.pptx

TinyML: Machine Learning for Microcontrollers

  • 1. TinyML: TFLite for Microcontrollers Robert John GDE ML & GCP @robert_thas Machine Learning on Embedded Edge Devices
  • 2. Why Machine Learning? Learning from example: activity detection, pet classification ● We can’t write rules for everything ● We produce enough data for our examples ● We have powerful machines for training
  • 3. Why Embedded Edge Devices? Some computers do only one thing! ● Placed in hard-to-reach places ● Run on batteries ● Replaced once a year or even longer ● No keyboard or mouse ● Rely on sensors or inputs from other microcontrollers ● Control other microcontrollers or other outputs ● Smart temperature example
  • 4. Sensors on Edge Devices More sensors than the average computer ● Motion sensors ● Biometric sensors ● Acoustic sensors ● Environmental sensors ● Force sensors
  • 5. Constraints on Edge Devices Can’t eat your cake and have it Raspberry Pi Pico HP Chromebook (Celeron) Raspberry Pi 4 Classification Microcontroller Personal Computer Single-Board Computer Microprocessor RP2040 Celeron BCM2711 Processor Designer Raspberry Intel Broadcom ISA Family Arm Cortex-M0+ IA32 (32-bit x86) Arm Cortex-A72 Clock speed 133MHz 3.5 GHz 1.5 GHz RAM 264 KB 4GB/8GB 2GB/4GB/8GB Storage 2MB Flash HDD/SSD HDD/SSD Inputs GPIO Serial Keyboard/Mouse Keyboard/Mouse Outputs GPIO Serial Monitor/Speakers Monitor/Speakers
  • 6. Edge ML Deployment Challenges Inference is all you need! ● Pre-trained models are hard to fit into MCUs ● No OS to act as hardware buffer ● Mobile-optimized models might use instructions not present on MCU ● Need to understand the underlying ISA ● Floating-point arithmetic usually not present ● Model is task specific, no need classify 1000 images! ● Might need to start from scratch!! ● Need to know Python and C/C++
  • 7. Keep It Simple! You only need inference! ● The model should only be as large as it needs to be to guaranty the required accuracy ● Leverage quantization-aware training to avoid model degradation ● Implement post-training quantization to shrink models from floating-point (32-bit) to integer (8-bit) ● It’s okay to lose a little bit of context during inference
  • 8. Learn More Important Resources ● TensorFlow: https://www.tensorflow.org/ ● TensorFlow Lite: https://www.tensorflow.org/lite ● TFLu: https://www.tensorflow.org/lite/microcontrollers ● TinyML Foundation: https://www.tinyml.org/ ● TinyML Course on EdX: https://www.edx.org/professional-certificate/harvardx-tiny-machine-learning ● Embedded Systems Essentials: https://www.edx.org/professional-certificate/armeducationx-embedded-systems-essentials ●
  • 9. Thank You! Robert John GDE ML & GCP @robert_thas