Using the Machine Learning Partners Plugin with Edge Impulse

Last modified by Microchip on 2023/11/14 14:56

Objective

This guide covers the 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.Data Visualizer to Edge Impulse

Back to top

Materials

Software Tools

Information

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

Back to top

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."

Information

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

Back to top

 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 Screen

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

 

Back to top

 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 Screen

Figure 2: Upload new data to the Edge Impulse Studio

Information

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.

Back to top

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 screen

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 Screen

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

Information

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.

Second Results Screen

Figure 5: Impulse classification results displayed in the Edge Impulse Studio

Information

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.

Back to top

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.

 Back to top