Machine Learning on a Raspberry Pi with Python or Node.js
Tags: node, machinelearning, programming, python
Published: 2021-04-15 06:16:00

<div class="modal-body">
<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TTOmixyGv8TWcZllggp2lQ.png"><figcaption>Source: <a href="https://www.edgeimpulse.com/blog/ei-extends-the-edge-to-embedded-linux-with-official-support-for-raspberry-pi-4">Edge&nbsp;Impulse</a></figcaption></figure><p>Typically, when you think about having to train a model for machine learning you think about needing a vast amount of processing power needed to perform the necessary operations. But small microcontroller’s like Raspberry Pi’s are becoming really popular and common in the classroom. Being able to use such a small device for machine learning gets the technologies in the hands of more people that could potentially do amazing things with it. Until now there haven’t been any options that target the Raspberry Pi. Owners of a raspberry Pi 4 can now use their device to train their own customer models using <a href="https://www.edgeimpulse.com/">Edge Impulse’s cloud development platform</a>.</p>
<p>There are four new machine-learning SDKs (Software development kits) for Raspberry Pi including support for <strong>C++, Go, Node.js, and Python</strong>. The benefit of this that because of the wide array of languages supported, most users won’t have to learn a new language just to learn how to program a ML. While learning and working with a new SDK can be daunting at first, Edge Impulse have good documentation that can help you get started fast, and getting your project compete before you realize&nbsp;it.</p>
<p>One of the applications of this technology is computer vision by connection a webcam to the Raspberry Pi. This can be accomplished by two ways: the first is to connect the camera directly into one of the USB ports. If you’re anything like you tend to keep these ports free if possible, for other peripherals. The second option is that attach the camera through the GPIO header pins that are soldered to the&nbsp;board.</p>
<p>With the computer vision system, that an engineer’s demonstrates in <a href="https://www.youtube.com/watch?v=dY3OSiJyne0">this video</a>, you can see that it is quite easy to get the system up and going. There looks to be a deploy process where you are building the ML pipeline through the web interface and then pushing the content to the Pi. In the video you can see that the machine vision system is capable of recognizing multiple objects through the web&nbsp;camera.</p>
<p>There are a variety of sensors that the SDK supports for <strong>collecting data including, accelerometers, magnetometers, motion sensors, humidity and temperature sensors</strong>. Really any sensor that provides a stream of data, you could input into the ML that you&nbsp;build.</p>
<p>The Raspberry Pi’s small form factor and affordability makes it a prime option for many engineering and DIY projects. Being able to apply the vast amount of use cases that machine learning is applicable to continues to make developing with a Pi the Jack of all&nbsp;trades.</p>
<p><strong>Thank you for reading this far. If you enjoyed this post, please share, comment, and press that ♥️&nbsp;!</strong></p>
<p><strong>Follow me on </strong><a href="https://twitter.com/maurerpwer"><strong>Twitter</strong></a><strong> and DEV for more developer related content&nbsp;content!</strong></p>
<img src="https://medium.com/_/stat?event=post.clientViewed&amp;referrerSource=full_rss&amp;postId=1fb2df3fd8a7" width="1" height="1" alt="">
</div>