FOMO: Real-Time
Object Detection on
Microcontrollers
Jan Jongboom
CTO
Edge Impulse
Leading development platform for machine
learning on edge devices
Launched two years ago... Now 240 new
projects daily (!)
40% of these are vision projects
Wait... What? Edge Impulse?
2
Two years ago
(1,163 projects)
Today
(82,069 projects)
Edge Impulse project count
© 2022 Edge Impulse Inc.
Object Detection
3
© 2022 Edge Impulse Inc.
Significantly Different Performance (Rpi4)
4
60 fps 2 fps
© 2022 Edge Impulse Inc.
But Why?
5
"The tiny version of YOLO only uses 516 MB of GPU memory"
© 2022 Edge Impulse Inc.
Object Detection (MobileNet SSD, YOLO)
6
© 2022 Edge Impulse Inc.
FOMO
7
Replace with single per-region class probability map
© 2022 Edge Impulse Inc.
Single Per-Region Class
Probability What?
Convolutional Image Classification Model
9
64x64 input
16x16 after conv
4x4 after conv
👨
1x1 output
High locality Zero locality
© 2022 Edge Impulse Inc.
FOMO
10
64x64 input
16x16 after conv
4x4 after conv
Loss function that forces
the top-left tile here to map to
16x16 top-left tile in the input
© 2022 Edge Impulse Inc.
Output = Heatmap
11
© 2022 Edge Impulse Inc.
Postprocessing in Software
12
Not constrained to just bounding boxes!
© 2022 Edge Impulse Inc.
Heatmap Ratio is Configurable
13
© 2022 Edge Impulse Inc.
Flexibility in Input / Output Resolution
14
320 x 320 input => 80 x 80 output
© 2022 Edge Impulse Inc.
Flexibility in Input / Output Resolution
15
96 x 96 input => 12 x 12 output
© 2022 Edge Impulse Inc.
Bounding boxes are an implementation detail
Most of the time you just want to know where and
how many objects there are
FOMO trains on the centroid of an object, w/ loss
function allowing some error
Convolutional network, so will still look around the
object, but lot less error prone against background
Centroids
16
© 2022 Edge Impulse Inc.
"Equal to an object detector, but bounding boxes are fixed
and always square"
Constrained object detection for constrained problems
Works best with similar sized objects, at similar distances
One activation per heat map cell, so objects overlapping
each other might be fused together
Few classes? Fine. 100s of objects across 60 classes? Use
YOLOv5.
Caveats
17
© 2022 Edge Impulse Inc.
Overlapping Objects?
18
Fixed and Always Square
19
Potential issue,
merge cells?
But... merging leads
to issue here
Centroids Should Have Meaning
20
© 2022 Edge Impulse Inc.
Demo (Rpi4 on CPU, 160x160 input, 60 fps)
21
© 2022 Edge Impulse Inc.
Demo (Cortex-M7, 96x96 input, 28 fps)
22
© 2022 Edge Impulse Inc.
Demo (M1, 160x160, 1000 fps)
23
© 2022 Edge Impulse Inc.
Add-on to any convolutional image network
(incl. transfer learning models), so highly
configurable
Fully convolutional, just the ratio is set
Can count objects
Can be a segmentation model
Performs much better on small objects than
YOLOv5 or MobileNet SSD
Other Cool Features of FOMO
24
© 2022 Edge Impulse Inc.
Cortex-M7 @ 480MHz: 30 fps (96x96 MobileNetV2 a=0.1)
Raspberry Pi 4: 60 fps (160x160 MobileNetV2 a=0.35)
Himax DSP @ 400MHz: 14 fps (96x96 MobileNetV2 a=0.35)
Cortex-M4F @ 156MHz: 5 fps (96x96 MobileNetV2 a=0.05)
My Macbook: 1000 fps :-)
(Can be bolted on other CNNs, e.g. MobileNetV1)
Performance
25
© 2022 Edge Impulse Inc.
• FOMO is available today for free:
https://edgeimpulse.com/fomo
• Very wide range of dev boards, from Cortex-M4F to Jetson Nano
• Deploy to any device that has a C++ compiler
• Or use your phone!
• Be one of today's 194 new projects!
Getting Started
26
© 2022 Edge Impulse Inc.
Vision is such a cool sense
Classification is cool, locality and count matters
Want a 30x increase in performance? Use FOMO!
edgeimpulse.com
Recap
27
© 2022 Edge Impulse Inc.
Full docs:
https://docs.edgeimpulse.com
FOMO
https://docs.edgeimpulse.com/docs/fomo-object-detection-for-constrained-devices
We're hiring!
https://edgeimpulse.com/careers
More questions:
forum.edgeimpulse.com / jan@edgeimpulse.com
Questions?
28
© 2022 Edge Impulse Inc.

“FOMO: Real-Time Object Detection on Microcontrollers,” a Presentation from Edge Impulse

  • 1.
    FOMO: Real-Time Object Detectionon Microcontrollers Jan Jongboom CTO Edge Impulse
  • 2.
    Leading development platformfor machine learning on edge devices Launched two years ago... Now 240 new projects daily (!) 40% of these are vision projects Wait... What? Edge Impulse? 2 Two years ago (1,163 projects) Today (82,069 projects) Edge Impulse project count © 2022 Edge Impulse Inc.
  • 3.
    Object Detection 3 © 2022Edge Impulse Inc.
  • 4.
    Significantly Different Performance(Rpi4) 4 60 fps 2 fps © 2022 Edge Impulse Inc.
  • 5.
    But Why? 5 "The tinyversion of YOLO only uses 516 MB of GPU memory" © 2022 Edge Impulse Inc.
  • 6.
    Object Detection (MobileNetSSD, YOLO) 6 © 2022 Edge Impulse Inc.
  • 7.
    FOMO 7 Replace with singleper-region class probability map © 2022 Edge Impulse Inc.
  • 8.
  • 9.
    Convolutional Image ClassificationModel 9 64x64 input 16x16 after conv 4x4 after conv 👨 1x1 output High locality Zero locality © 2022 Edge Impulse Inc.
  • 10.
    FOMO 10 64x64 input 16x16 afterconv 4x4 after conv Loss function that forces the top-left tile here to map to 16x16 top-left tile in the input © 2022 Edge Impulse Inc.
  • 11.
    Output = Heatmap 11 ©2022 Edge Impulse Inc.
  • 12.
    Postprocessing in Software 12 Notconstrained to just bounding boxes! © 2022 Edge Impulse Inc.
  • 13.
    Heatmap Ratio isConfigurable 13 © 2022 Edge Impulse Inc.
  • 14.
    Flexibility in Input/ Output Resolution 14 320 x 320 input => 80 x 80 output © 2022 Edge Impulse Inc.
  • 15.
    Flexibility in Input/ Output Resolution 15 96 x 96 input => 12 x 12 output © 2022 Edge Impulse Inc.
  • 16.
    Bounding boxes arean implementation detail Most of the time you just want to know where and how many objects there are FOMO trains on the centroid of an object, w/ loss function allowing some error Convolutional network, so will still look around the object, but lot less error prone against background Centroids 16 © 2022 Edge Impulse Inc.
  • 17.
    "Equal to anobject detector, but bounding boxes are fixed and always square" Constrained object detection for constrained problems Works best with similar sized objects, at similar distances One activation per heat map cell, so objects overlapping each other might be fused together Few classes? Fine. 100s of objects across 60 classes? Use YOLOv5. Caveats 17 © 2022 Edge Impulse Inc.
  • 18.
  • 19.
    Fixed and AlwaysSquare 19 Potential issue, merge cells? But... merging leads to issue here
  • 20.
    Centroids Should HaveMeaning 20 © 2022 Edge Impulse Inc.
  • 21.
    Demo (Rpi4 onCPU, 160x160 input, 60 fps) 21 © 2022 Edge Impulse Inc.
  • 22.
    Demo (Cortex-M7, 96x96input, 28 fps) 22 © 2022 Edge Impulse Inc.
  • 23.
    Demo (M1, 160x160,1000 fps) 23 © 2022 Edge Impulse Inc.
  • 24.
    Add-on to anyconvolutional image network (incl. transfer learning models), so highly configurable Fully convolutional, just the ratio is set Can count objects Can be a segmentation model Performs much better on small objects than YOLOv5 or MobileNet SSD Other Cool Features of FOMO 24 © 2022 Edge Impulse Inc.
  • 25.
    Cortex-M7 @ 480MHz:30 fps (96x96 MobileNetV2 a=0.1) Raspberry Pi 4: 60 fps (160x160 MobileNetV2 a=0.35) Himax DSP @ 400MHz: 14 fps (96x96 MobileNetV2 a=0.35) Cortex-M4F @ 156MHz: 5 fps (96x96 MobileNetV2 a=0.05) My Macbook: 1000 fps :-) (Can be bolted on other CNNs, e.g. MobileNetV1) Performance 25 © 2022 Edge Impulse Inc.
  • 26.
    • FOMO isavailable today for free: https://edgeimpulse.com/fomo • Very wide range of dev boards, from Cortex-M4F to Jetson Nano • Deploy to any device that has a C++ compiler • Or use your phone! • Be one of today's 194 new projects! Getting Started 26 © 2022 Edge Impulse Inc.
  • 27.
    Vision is sucha cool sense Classification is cool, locality and count matters Want a 30x increase in performance? Use FOMO! edgeimpulse.com Recap 27 © 2022 Edge Impulse Inc.
  • 28.