Microcontrollers for Machine Learning and AI

Deep Learning and Machine learning. They have always been associated with big computers with fast CPUs and GPUs, big RAM size or running algorithms on the cloud.

However, imagining performing Machine Learning on a microcontroller powered by a single coin cell battery. Impossible you may think, but with today technology, the impossible is now possible with Microcontrollers.

Right now, the question in your heads may be now “But how?!” or “How good can it be?”. Well, no worries, we got the answers. Today we are going to talk about:

  • Why use Microcontrollers for Machine Learning and AI
  • Microcontrollers for Machine Learning
  • Comparison – Which Microcontroller is better for machine learning?

Why use Microcontrollers for Machine Learning and AI?

So, the big question is why even use Microcontrollers in the first place for machine learning and AI when it has so little memory for you to work with?

Despite little memory spaces, they have various advantages that outweigh this con. They are:

Low Energy Consumption

  • Due to their small size, at the cost of processing power, memory and storage, microcontrollers consume very little energy and are efficient.
  • Normally, a lot of power is required to power GPU and computers for machine learning which causes limitations and constraints.
  • However, for microcontrollers, it is a different story. Microcontrollers are normally not wired into main power and rely on batteries or energy harvesting. For example, a microcontroller can run on a single coin battery from weeks to even months.
  • This makes microcontrollers easy to install and implement as it does not require to be plugged into the main power.

Cost

  • Normally, for machine learning you have to spend a few thousands to build a high performance machine learning workstation.
  • However, with microcontrollers, you can easily get one at $200 and below which are also reliable.

Flexibility

  • Microcontrollers are very common. They are basically everywhere around us like our household appliances, toys, cars, etc. The possibilities are endless when we bring machine learning to microcontrollers
  • With microcontrollers, you can add AI to various devices without relying on network connectivity which are normally restrained by bandwidth, power and high latency.

Privacy

  • Normally for machine learning, you will have to string all your raw data to the cloud which could contain confidential or private information.
  • For microcontrollers, users do not have to worry about this problem as no data will have to leave the device.

Recommended Microcontrollers for Machine Learning

Here at Seeed, we offer various microcontrollers to suit your Machine Learning project needs. They are:

Coral Dev Board

  • The Coral Dev Board is a single-board computer with a removable system-on-module (SOM) that contains eMMC, SOC, wireless radios, and Google’s Edge TPU. It’s perfect for IoT devices and other embedded systems that demand fast on-device ML inferencing.
  • Specs:

Coral Dev Board
Core Speed NXP i.MX 8M SOC (Quad-core Cortex-A53, plus Cortex-M4F)
GPU Integrated GC7000 Lite Graphics
RAM 1 GB LPDDR4
Software Compatibility Support Tensorflow Lite – No need to build models from scratch.
Additional features -SOM can be removed from based board.
-Machine learning Accelerator – Google Edge TPU coprocessor
Price $149.99

NVIDIA® Jetson Nano™ Developer Kit

  • The NVIDIA® Jetson Nano™ Developer Kit delivers computing performance to run modern AI workloads at unprecedented size, power, and cost. Developers, learners, and makers can now run AI frameworks and models for applications like image classification, object detection, segmentation, and speech processing.
  • Specs:

NVIDIA® Jetson Nano™ Developer Kit
Core Speed Quad-core ARM A57 @ 1.43 GHz
GPU 128-core NVIDIA Maxwell™ GPU
RAM 4 GB 64-bit LPDDR4 25.6 GB/s
Software Compatibility Support Tensorflow, PyTorch, Caffe/Caffe2, Keras, MXNet, and others
Additional features -Multi-Stream Video Analytics – Process Up to 8 HD full-motion video streams in real time with NVIDIA’s
DeepStream SDK
Price -$99.00

Sipeed MAIX GO Suit (MAIX GO + 2.8 inch LCD + ov2640 with M12 lens)

  • MAIX is Sipeed’s purpose-built module designed to run AI at the edge. It delivers high performance in a small physical and power footprint, enabling the deployment of high-accuracy AI at the edge, and the competitive price make it possible embed to any IoT devices.
  • Specs:

Sipeed MAIX GO Suit
Core Speed RISC-V Dual Core 64bit, 400Mhz adjustable
GPU KPU (Neural Network Processor) inside, 64 KPU which is 576bit width and
APU (Audio Processor), support 8mics, up to 192KHz sample rate.
RAM 8MB high-speed SRAM,400MHz frequency(able to reach 800MHz)
Software Compatibility Supports Tiny-Yolo, Mobile Net-v1, Tensorflow, FreeRTOS and MicroPython
Additional features -Breadboard friendly board, and micropython available.
-Open source.
-On board JTAG&UART based on STM32F103C8, debug M1 without extra Jlink.
-Has lithium battery manager chip with power path management function allowing you to
use the board with lithium battery and usb power without conflict.
Price $40.90 for MAIX GO Suit which includes
– Sipeed MAIX GO Dev Board.
– 2.8 Inch LCD
– OV2640 with M12 4mm Lens
– Acrylic Case
– Wifi Antenna
– Type-C USB Cable
– Li-ion Battery
– Screw & Stud

Raspberry Pi 4 Computer Model B

  • The Raspberry Pi 4 Model B is the latest product in the popular Raspberry Pi range of computers. It offers ground-breaking increases in processor speed, multimedia performance, memory, and connectivity while retaining backwards compatibility and similar power consumption as the prior generation Raspberry Pi 3 Model B+.
  • Specs:
Raspberry Pi 4 Computer Model B 4GB
Core Speed Broadcom BCM2711, quad-core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz
GPU Broadcom VideoCore VI
RAM 1GB, 2GB or 4GB LPDDR4(depending on model)
Software Compatibility -Compatible with TensorFlow (Has documentation and courses for the RPi 4)
Additional Features – Compatible with Coral USB Accelerator to further speed up the
RPi 4 machine learning capabilities
– Compatible with Google’s Artificial Intelligence Yourself (AIY) kits.
Price 4GB – $55
2GB – $45
1GB – $35

ROCK Pi 4 Model B 4GB

  • The ROCK PI is a Single Board Computer (SBC) in an ultra-small form factor that offers class-leading performance while leveraging outstanding mechanical compatibility. The ROCK PI offers makers, IoT enthusiasts, hobbyists, PC DIY enthusiasts and others a reliable and extremely capable platform for building and tinkering their ideas into reality.
ROCK Pi 4 Model B 4GB
Core Speed Dual Cortex-A72, frequency 1.8Ghz with quad Cortex-A53, frequency 1.4Ghz
GPU Mali T860MP4 GPU, supports OpenGL ES 1.1 /2.0 /3.0 /3.1 /3.2, Vulkan 1.0, Open CL 1.1 1.2, DX11.
RAM 64bit dual channel LPDDR4@3200Mb/s, 4GB, 2GB or 1GB depending on model
Software Compatibility – Compatible with Tensorflow (Similar to Raspberry Pi 4)
Additional features – Industrial standard MIPI CSI connector makes it easy to connect existing cameras to ROCK Pi and R
OCK Pi also supports industrial standard MIPI DSI for LCD and touch screen.
– ROCK Pi supports mainstream AI stack with GPU acceleration.
– A dedicated hardware NPU accelerator that is currently developing, will boost complex Machine Learning algorithm and reduce the power.
Price 4GB – $75
2GB – $59
1GB – $49

Which Microcontroller is the best for Machine Learning?

Unfortunately, nothing is ever the best at something. The same goes for microcontrollers! Each microcontroller and single board computers each have their Pros and Cons and unique features that makes them stand out from each other. Do not worry as we have highlighted each of their Pros and Cons so you will know which board to buy to suit your project the most!

Best Performance / Wattage: Coral DevBoard

  • Pros:
    • As the Coral DevBoard has the newest chip the
      NXP i.MX 8M SOC (Quad-core Cortex-A53, plus Cortex-M4F), it is also the most efficient out of all the microcontrollers.
    • Supports Wifi and Bluetooth.
    • On board TPU is capable of performing 4 trillion operations (tera-operations) per second (TOPS), using 0.5 watts for each TOPS (2 TOPS per watt).
    • Has video processing units and a Vivante GC700 lite GPU which can be used for traditional image and video processing. It also has a Cortex-M4F low power micro-controller which can be used to talk to other sensors like temperature sensor, ambient light sensor etc.
  • Cons:
    • Only compatible and you can only use TensorFlow Lite as your deep learning framework, inflexible and unable to use any other software.
    • Most Expensive out of all the other developer boards at $149.99.

Best Flexibility: Jetson Nano

  • Pros:
    • Better and more support for deep learning frameworks like
      Tensorflow, PyTorch, Caffe/Caffe2, Keras, MXNet, and many more.
    • Good Library support.
    • Has Video Encoder and decoder unit and also supports NVidia TensorRT accelerator library for FP16 inference and INT8 inference.
    • Floating-point GPU acceleration.
  • Cons:
    • Weaker core than Coral Dev Board, however, it offers decent performance but not as efficient.
    • Requires an additional external wifi dongle for Wifi.

Cheapest: Sipeed MAIX GO

  • Pros:
    • It is probably the cheapest development board you can get out in the market currently compared to the other 3 at a price of $40.90 for the entire suit which comes with case, touch LCD, camera lens, wifi antenna, USB type-C cable, Li-ion battery with screw & studs.
    • Provides end-to-end hardware + software infrastructure for facilitating users AI-based solutions
    • At a size of 88x60mm, it is small which allow it to be embedded at the edge to any IoT device.
    • Able to run microphython on the board.
  • Cons:
    • Documentation and Support is not as developed compared to the other development boards at this stage.
    • Libraries support is not as developed compared to the others.

Best Support: Raspberry Pi 4

  • Pros:
    • Cheap option for an SBC starting at $35 for 1GB.
    • Good CPU processing power with its Broadcom BCM2711, quad-core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz.
    • Recommended for beginners as it has one of the biggest communities and support for debugging. It also has many detailed tutorials and projects for the Raspberry Pi 4. It also has good documentation.
    • Compatible with the Coral USB Accelerator at a price of $74.99 to further improve its machine learning capabilities.
  • Cons: 
    • Weaker GPU compared to the other boards.
    • Combining it with the Coral USB accelerator increases the overall cost to $100 and above.
    • Requires additional heatsink and fan for sustained inference to prevent overheating.

Struggling with overheating problems with your Raspberry Pi 4? No worries we got you covered with our:

Blink Blink ICE Tower CPU Cooling Fan for Raspberry Pi

  • It has a Tower structure with a 5mm copper tube, multi-layer heat sinks and 7 powerful fan blades which can reduce the temperature of the Raspberry Pi from 80℃ to 40℃.

Alternative for Raspberry Pi 4: ROCK Pi 4 Model B

  • Pros:
    • Has a better performing CPU and GPU for machine learning.
    • Able to run Android OS officially
    • Supports mainstream AI stack with GPU acceleration which is good for computer vision application, robotics, etc.
  • Cons:
    • Community and support is not as robust compared the Raspberry Pi as the community is smaller. Debugging may be a problem for beginners and novice users as documentation may not be as good.
    • Not as many accessories available for the Rock Pi 4 compared to the Raspberry Pi 4 as some accessories are not compatible with the Rock Pi 4.
    • More expensive at a price of $49 to $75 compared to the Raspberry Pi 4 at $35 to $55.
    • Fewer operating systems are supported for the Rock Pi 4 compared to the Raspberry Pi.

Summary

That’s about it for machine learning and AI on microcontrollers! Hope the guide is helpful in helping you select a microcontroller for your project needs!

If you have little or no knowledge on Artificial intelligence as a maker, you can check out our other blog on Introduction to Artificial Intelligence for Makers to find out more before you move on to make your very own machine learning project!

Interested in more machine learning microcontrollers and accessories for your development boards? Check out our Bazaar here to find out more!

About Author

1 thought on “Microcontrollers for Machine Learning and AI

  1. How can we inpupt a signal (image or audio) to a microcontroller and read the prediction from an output port?

Comments are closed.

Calendar

October 2019
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031