Overview What is a Support Vector Machine? Train an SVM classifier with scikit-learn Implement your SVM with CMSIS-DSP What is a Bayesian estimator? Train your Bayesian estimator with scikit-learn Implement your Bayesian estimator with CMSIS-DSP What is clustering? Use CMSIS-DSP distance functions Miscellaneous new CMSIS-DSP functions Related information Next steps
Overview
Typically, when developers talk about machine learning (ML), they refer to neural networks (NNs). The great advantage of neural networks is that you do not need to be a domain expert and can quickly get a working solution. The drawbacks of neural networks are that they often require numerous memory and cycles, and that it is difficult to explain how they have reached their conclusion.
The field of machine learning includes technologies other than neural networks. Those other technologies might have been used under a different name, for example statistical machine learning. In this guide, we use the name classical machine learning to refer to the use of those other technologies in the CMSIS-DSP open-source libraries.
The CMSIS-DSP library is a rich collection of DSP functions that Arm has optimized for various Arm Cortex-M processors, for example the Cortex-M4, Cortex-M7, Cortex-M33, Cortex-M35, and the Cortex-M55 processors. The Arm Developer website includes more information and supporting resources for these processors.
CMSIS-DSP is widely used in the industry, and enables optimized C code generation from various third-party tools. Arm has recently added new functions to the CMSIS-DSP library for classical ML, including Support Vector Machine (SVM), naive gaussian Bayes classifier and distances for clustering.
This guide explains how to train the SVM and Bayes classifiers in Python, how to dump the parameters, and how to use the dumped parameters in CMSIS-DSP. It also explains how the distance functions can be used for building clustering algorithms.
These classifiers can be used for anomaly detection, sound classification, and image recognition. They will require the use of smart features, for example the output of a signal processing chain, an understanding of the domain, and will work with fewer classes than neural networks.
The classical ML functions provided in CMSIS-DSP are only available with float32.
Before you begin
To complete this guide, you should know how to build CMSIS-DSP.
You also need to have the following resources installed:
- A copy of CMSIS-DSP
- Python 3 with the scikit-learn package.
If you want to display pictures, you should also install matplotlib in Python.
Note: The new classical ML functions are not included by default in Arm Keil MDK or Arm Development Studio projects. To use those functions, you will have to rebuild the library and include them.
The new functions are contained in the following CMSIS-DSP folders:
- SVMFunctions
- BayesFunctions
- DistanceFunctions
- SupportFunctions
- StatisticsFunctions