Using the ML Partners Plugin with Edge Impulse

 Objective

This guide covers usage of the ML Partners Plugin with our design partner, Edge Impulse. From the ML Partners Plugin, it is possible to upload data to the Edge Impulse Studio, where it can be used to train and test ML models for classification, regression, and anomaly detection.

dv-ei.png

 Materials

Software Tools

The ML Partners Plugin and Data Visualizer are both plugins to MPLAB X IDE and are available to install in the plugins manager.

 Procedure

This section contains instructions for using the ML Partners Plugin with Edge Impulse, including uploading new data to the Edge Impulse Studio and viewing impulse classification results within the ML Partners Plugin for model testing. To learn more about how to use the Edge Impulse Studio to create machine learning solutions, check out one of our example applications: "Smart Dumbbell with Edge Impulse", "Keyword Spotting with Edge Impulse", "Sound Recognition with Edge Impulse."

This guide picks up where "The ML Partners Plugin User's Guide" left off. The following instructions require that data is already marked within MPLAB® Data Visualizer as described in the user's guide.

1

Login With Your Edge Impulse Credentials

When using Edge Impulse within the ML Partners Plugin you will be prompted to log in. This enables the plugin to upload data directly to your projects in the Edge Impulse Studio. If you still need to create an Edge Impulse account you can do so for free on the Edge Impulse registration page.

login.png
Figure 1: Login to the Edge Impulse Studio from the ML Partners Plugin

2

Upload New Data

After logging in, configure the upload by filling in the necessary fields. First select a project to upload to, and enter the name of the device where the data is being collected from. Next, choose the data source(s) to be uploaded and input the data sampling interval. Then select a destination for the data (i.e., Training, Testing), and enter a data label that describes the selected data segment.

upload.png
Figure 2: Upload new data to the Edge Impulse Studio

Sensor names and sampling intervals should remain consistent within each Edge Impulse Studio project. If adding more data to a project that already contains data, then be sure to keep these consistent.

3

Classify New Data

Once you have a trained impulse in the Edge Impulse Studio, it is possible to classify new data with it and view the results in the ML Partners Plugin. This feature uploads the selected data to the Testing endpoint and then displays the classification results of the uploaded sample.

test.png
Figure 3: Classify new data with a trained Impulse

The upload configuration remains the same except that the endpoint field is removed since this data will always be sent to the Testing endpoint. After clicking Classify Data, the sample will be uploaded and the classification results will be fetched from the Edge Impulse Studio for display. Classified samples are first segmented with a sliding window as it is configured in the selected project. Then the resultant window segments are fed into the impulse for inference. The ML Partners Plugin will display the frequency of each event type within the uploaded sample.

results.png
Figure 4: Impulse classification results displayed in the ML Partners Plugin

Uploaded samples must be at least the length of the window size used in the selected Edge Impulse project to produce at least one segment for classification.

Classification can also be tested by navigating to the Live Classification tab within the Edge Impulse Studio and then uploading new data to the Testing endpoint, at which point the Edge Impulse Studio will refresh to display the classification results for the new data. This is useful when more detailed results are needed.

results2.png
Figure 5: Impulse classification results displayed in the Edge Impulse Studio

The Edge Impulse Studio also supports batch testing in the Model Testing tab, which allows for quick testing of the entire test set while iterating on the Impulse configuration.

 Results

You now understand how to collect live sensor data from your target device and send it to the Edge Impulse Studio for developing ML solutions that can be used in your embedded application.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.