United States - Flag United States

Please confirm your currency selection:

Bench Talk for Design Engineers

Bench Talk

rss

Bench Talk for Design Engineers | The Official Blog of Mouser Electronics


Edge Impulse Fundamentals Part Four Mike Parks

Edge Impulse Fundamentals 4: Learning Blocks

(Source: putilov_denis- stock.adobe.com)

In our last entry in the Edge Impulse blog series, we began to deep dive into the Create Impulse workflow by learning about the types and purposes of processing blocks. As a quick reminder, processing blocks extract the unique features from the raw data that will, in turn, be fed into the learning blocks to generate a custom machine learning model that will eventually be deployed onto embedded systems for real-time edge inferencing. There are various types of processing blocks, each suited to different kinds of data, such as images, sounds, and accelerometer signals.

In this entry, we will look at learning blocks and the output block as the conclusion of the create impulse workflow. In Edge Impulse, learning blocks refer to the machine learning algorithms that are used to train models on preprocessed data. These algorithms are designed to discover patterns and relationships from the extracted features found in the data and to make predictions or classifications based on that discovery learning.

Various “pre-canned” learning blocks are available for Edge Impulse users that suit different use cases. They can also be stacked to create different outputs (Figure 1). Some of the main learning blocks available by default include:

  • Classification: Learns patterns from data and can apply these to new data to help predict discrete class labels. Great for categorizing movement or recognizing audio.
  • Anomaly Detection (K-means): Locates outliers in new data. Good for recognizing unknown states to complement classifiers. Works best with low dimensionality features like the output of the spectral features block.
  • Regression: Learns patterns from data and can apply these to new data to help predict quantities. Great for predicting continuous numeric values.
  • Transfer Learning (Images): Fine-tunes a pre-trained image classification model on your data. Good performance even with relatively small image datasets.
  • Object Detection (Images): Fine-tunes a pre-trained object detection model on your data. Good performance even with relatively small object datasets.
  • Transfer Learning (Keyword Spotting): Fine-tunes a pre-trained keyword spotting model on your data. Good performance even with relatively small keyword datasets.

Figure 1: The final two stages of Impulse Design are setting up the learning blocks and the output block. (Source: Green Shoe Garage)

As with processing blocks, users can create their own custom learning blocks in PyTorch, Keras, or scikit-learn and bring those into the Edge Impulse training pipeline. Edge Impulse supports a range of popular machine learning algorithms, including neural networks, decision trees, and support vector machines. Understanding the nuances of the various machine learning algorithms is crucial as Edge Impulse users can configure various parameters, which in turn can significantly impact the processing block’s performance. Here is a deep dive into the most common machine learning models:

  • Neural Networks: Popular machine learning algorithm modeled after the human brain's structure. They consist of layers of interconnected nodes that process input data and make predictions based on learned patterns. Edge Impulse provides a range of neural network architectures, including convolutional neural networks (CNNs), recurrent neural networks (RNNs), and fully connected networks.
  • Decision Trees: Type of algorithm that builds a tree-like model of decisions and their possible consequences. They are often used for classification tasks and are particularly useful when there are many features or when the relationships between features are complex. Edge Impulse provides a range of decision tree algorithms, including random forest and gradient boosting.
  • Support Vector Machines (SVMs): Type of algorithm that is particularly useful for classification tasks with complex, non-linear boundaries. They work by finding the optimal hyperplane that separates the input data into different classes. Edge Impulse provides a range of SVM algorithms, including linear SVM and radial basis function (RBF) kernel SVM.
  • k-Nearest Neighbors (k-NN): Type of algorithm that is used for classification and regression tasks. It works by finding the k data points closest to a given input and using the majority or average label of those points as the predicted label for the input. Edge Impulse provides a range of k-NN algorithms, including Euclidean distance k-NN and cosine distance k-NN.
  • Clustering: Type of algorithm that is used for unsupervised learning tasks, such as grouping similar data points together. Edge Impulse provides a range of clustering algorithms, including k-means clustering and hierarchical clustering.

Overall, the learning blocks of Edge Impulse provide a range of machine learning algorithms that are suitable for different types of input data and different use cases. As a result, users can create machine learning models optimized for their specific needs by selecting the appropriate learning block for a given task.

At this point, the impulse training pipeline has been designed. Now the training data can be used to train the neural network, and we can begin to ascertain the performance of our model (Figure 2). The following steps will vary depending on the learning blocks applied.

Figure 2: Each learning block added to an impulse can be analyzed and tweaked. In this example, the performance of an anomaly detection learning block is displayed. (Source: Green Shoe Garage)

In the next part of the Edge Impulse blog series, we will discuss how to use the Edge Impulse training pipeline to analyze spectral components of the raw data and generate features, anomaly detection, and classifiers.



« Back


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.


All Authors

Show More Show More
View Blogs by Date

Archives