(Source: putilov_denis - stock.adobe.com)
The workflow for developing solutions that machine learning (ML) models can be complex. The workflow can be broken into three major phases:
At the heart of each phase is data. Data is the raw material that drives the development of ML models. That data can come from a wide variety of places, from enterprise systems to sensors that drive the Internet of Things (IoT), which will be the focus of this article. Without a large and accessible dataset to draw upon, it is impossible to train an ML model reliably.
That data must first be collected, cleansed, organized, and cataloged before it can be used to train ML models. While it is possible to use pre-trained models, their drawback is that they are likely generic and may need to be refined to work well for your particular use case or operating environment. For example, an audio detection model may have difficulty picking out desired sounds if it is not trained with data collected from the actual location it will be fielded. This is because differences in ambient background noises could affect the model.
Compounding all this is that IoT endpoint devices such as microcontrollers and FPGAs are often highly constrained in terms of memory and processing horsepower. Being able to generate a model that can run on such constrained architectures is an additional challenge. Much progress has been made recently in getting neural networks to run low-power devices with the advent of TensorFlow Lite for Microcontrollers CMSIS-NN from Arm®. Still, collecting new datasets and training new models has not been for the faint of heart. Fortunately, various services are emerging to simplify the data processing, model training, and deployment process as simply as possible. One such service is Edge Impulse, a company based in San Jose, California.
Edge Impulse is a cloud-based service that, in a nutshell, allows developers to connect a variety of embedded platforms to get sensor data from the cloud, use that data to train a TinyML model, and send the model back to the IoT device for inferencing (Figure 1). It does so intuitively using a handful of well-designed tools and workflows.
Figure 1: Edge Impulse is a cloud-based tool that significantly reduces the workflow complexity for embedded systems developers to add machine learning (ML) technology to their products. (Source: Edge Impulse)
Over the next year, we will explore the various software components of Edge Impulse and how they can be leveraged to simplify the development of machine learning algorithms for use in embedded systems. This blog will look at developing a rudimentary model that leverages the accelerometers aboard an Arduino Nano 33 BLE Sense development board.
Getting data from a sensor to the cloud has become a relatively trivial matter thanks to the proliferation of wireless internet connectivity and simplified programming tools such as Application Programmer Interfaces (API). Edge Impulse leverages these advancements to make data ingestion a snap (Figure 2).
Figure 2: Edge Impulse provides multiple ways to bring training and test data into their environment, including .csv files of raw data. (Source: Edge Impulse)
Edge Impulse provides three tools to assist in this first stage of the ML pipeline.
Figure 3: For development boards that lack native Internet connectivity, data can be sent to the Internet-connected host computer via USB and the host computer can send the data to Edge Impulse. (Source: Edge Impulse)
Lastly, for a handful of embedded development boards with onboard sensors, Edge Impulse offers pre-built firmware that sends all sensor data to their ingestion service with minimal setup. The firmware leverages the tools mentioned above. Then in the browser, you can pick out which data you want to use to build your model. We will explore this further in a future edition of Mouser’s Edge Impulse Fundamentals series.
Michael Parks, P.E. is the co-founder of Green Shoe Garage, a custom electronics design studio and embedded security research firm located in Western Maryland. He produces the Gears of Resistance Podcast to help raise public awareness of technical and scientific matters. Michael is also a licensed Professional Engineer in the state of Maryland and holds a Master’s degree in systems engineering from Johns Hopkins University.