Skip to content

Commit

Permalink
Merge pull request #251 from dtischler/main
Browse files Browse the repository at this point in the history
RA6M5 Getting Started
  • Loading branch information
dtischler committed Jun 5, 2023
2 parents cef0da2 + 48c7f44 commit b94a409
Show file tree
Hide file tree
Showing 24 changed files with 27 additions and 27 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,4 @@
* [AI-Assisted Pipeline Diagnostics and Inspection with mmWave Radar](ai-pipeline-inspection-mmwave.md)
* [Renesas RZ/V2L DRP-AI Pose Detection](renesas-rzv2l-pose-detection.md)
* [Computer Vision for Product Quality Inspection with Renesas RZ/V2L](renesas-rzv2l-product-quality-inspection.md)
* [](renesas-ra6m5-getting-started.md)
* [Renesas CK-RA6M5 Cloud Kit - Getting Started with Machine Learning](renesas-ra6m5-getting-started.md)
52 changes: 26 additions & 26 deletions renesas-ra6m5-getting-started.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
description: A xxxxxxxxxx.
description: Getting Started with machine learning on the Renesas CK-RA6M5 Cloud Kit and Edge Impulse.
---

# xxxxxxxxx
# Renesas CK-RA6M5 Cloud Kit - Getting Started with Machine Learning

Created By:
Swapnil Verma
Expand All @@ -12,13 +12,13 @@ Public Project Link:

## Introduction

The [Renesas CK-RA6M5 Cloud Kit](https://www.renesas.com/us/en/products/microcontrollers-microprocessors/ra-cortex-m-mcus/ck-ra6m5-cloud-kit-based-ra6m5-mcu-group) enables users to securely connect to the cloud and explore the features of the Cortex-M33-based RA6M5 group of MCUs and cloud services. This development board can run machine-learning models and is [officially supported by Edge Impulse](https://docs.edgeimpulse.com/docs/development-platforms/officially-supported-mcu-targets).
The [Renesas CK-RA6M5 Cloud Kit](https://www.renesas.com/us/en/products/microcontrollers-microprocessors/ra-cortex-m-mcus/ck-ra6m5-cloud-kit-based-ra6m5-mcu-group) enables users to securely connect to the cloud and explore the features of the Cortex M33-based Renesas RA6M5 group of MCUs and cloud services. This development board can run machine-learning models and is [officially supported by Edge Impulse](https://docs.edgeimpulse.com/docs/development-platforms/officially-supported-mcu-targets).

This is a getting-started guide for the Renesas CK-RA6M5 board with the Edge Impulse. Here we will connect the board to the edge-impulse studio, collect sensor data directly from the board, Prepare a machine-learning model using the collected data, deploy the model back to the board and perform inference locally on the board. Let's get started!!
This is a Getting Started Guide for the Renesas CK-RA6M5 board with Edge Impulse. Here we will connect the board to the Edge Impulse Studio, collect sensor data directly from the board, prepare a machine learning model using the collected data, deploy the model back to the board, and perform inferencing locally on the board. Let's get started!

## Unboxing

The cloud kit comes with the following items in the box:
The Cloud Kit comes with the following items in the box:

- The CK-RA6M5 development board
- RYZ014A PMOD (CAT-M1 Cellular Module)
Expand All @@ -34,13 +34,13 @@ The cloud kit comes with the following items in the box:

Each CK-RA6M5 board comes preinstalled with a quick-start project. Let's run that quick-start project to verify our board is working properly.

- Make sure that (a) J22 is set to link pins 2-3 (b) J21 link is closed and (c) J16 Link is open.
- Make sure that (a) J22 is set to link pins 2-3 (b) J21 link is closed and (c) J16 link is open.
- Connect J14 and J20 on the CK-RA6M5 board to USB ports on the host PC using the 2 micro USB cables supplied.
- The power LED (LED6) on the CK-RA6M5 board lights up white, indicating that the CK-RA6M5 board is powered on.

![Board Connection](.gitbook/assets/renesas-ra6m5-getting-started/ra6m5-connection.jpg)

Immediately after the power ON, the four user LEDs will take on the following states:
Immediately after the power on, the four user LEDs will take on the following states:

![LED Status](.gitbook/assets/renesas-ra6m5-getting-started/led-status.gif)

Expand All @@ -57,15 +57,15 @@ Press the user button (S2) on the board to change the blinking frequency of the

## Updating the Firmware

In order to connect the CK-RA6M5 board with the Edge Impulse Studio, we need to upgrade the board's firmware. Please follow the official Edge Impulse guide to update its firmware.
In order to connect the CK-RA6M5 board to the Edge Impulse Studio, we need to upgrade the board's firmware. Please follow the official Edge Impulse guide to update its firmware:

> Firmware Update Guide - [https://docs.edgeimpulse.com/docs/development-platforms/officially-supported-mcu-targets/renesas-ck-ra6m5](https://docs.edgeimpulse.com/docs/development-platforms/officially-supported-mcu-targets/renesas-ck-ra6m5)
Once the board is flashed with Edge Impulse firmware, the real magic starts.

## Edge Impulse Project

We can do it in any order but before proceeding to the next step, it's best to create an Edge-Impulse account and a project in the Edge-Impulse studio. Please follow the below steps to do so.
To begin, you'll need to create an Edge Impulse account and a project in the Edge Impulse Studio. Please follow the below steps to do so:

- Navigate to the [Edge Impulse Studio](https://studio.edgeimpulse.com/login) and create an account. If you already have an account then please login using your credentials.

Expand All @@ -81,10 +81,10 @@ We can do it in any order but before proceeding to the next step, it's best to c

## Connecting Renesas CK-RA6M5 to Edge Impulse

The next step is connecting our Renesas CK-RA6M5 board to the Edge-Impulse studio so we can ingest sensor data for the machine-learning model. Please follow the below steps to do so.
The next step is connecting our Renesas CK-RA6M5 board to the Edge Impulse Studio, so we can ingest sensor data for the machine learning model. Please follow the below steps to do so:

- Connect the Renesas CK-RA6M5 board to the computer by following the steps mentioned in the Quick Start section.
- Open a terminal or command prompt and type edge-impulse-daemon. The [edge-impulse-daemon](https://docs.edgeimpulse.com/docs/edge-impulse-cli/cli-daemon) will start and prompt for user credentials.
- Connect the Renesas CK-RA6M5 board to the computer by following the steps mentioned in the _Quick Start_ section.
- Open a terminal or command prompt and type `edge-impulse-daemon`. The [Edge Impulse daemon](https://docs.edgeimpulse.com/docs/Edge Impulse-cli/cli-daemon) will start and prompt for user credentials.
- After providing user credentials, it will prompt you to select an Edge Impulse project. Please navigate and select the project created in the previous steps, using the arrow keys.

![Daemon](.gitbook/assets/renesas-ra6m5-getting-started/daemon.jpg)
Expand All @@ -93,35 +93,35 @@ The next step is connecting our Renesas CK-RA6M5 board to the Edge-Impulse studi

![Device Naming](.gitbook/assets/renesas-ra6m5-getting-started/naming.jpg)

- Now the board should be connected to the selected project. The edge-impulse-daemon will tell you which project the board is connected to. We can also verify by checking the devices tab of that project.
- Now the board should be connected to the selected project. The `edge-impulse-daemon` will tell you which project the board is connected to. We can also verify by checking the devices tab of that project.

![Device Connected](.gitbook/assets/renesas-ra6m5-getting-started/connected.jpg)

It will also list all the sensors available for data gathering.

## Data Gathering

Edge impulse provides multiple options for data acquisition. In this getting started guide, we will look at the direct data ingestion from the board using edge-impulse-daemon. Please follow the below steps for data acquisition.
Edge impulse provides multiple options for data acquisition. In this getting started guide, we will look at the direct data ingestion from the board using `edge-impulse-daemon`. Please follow the below steps for data acquisition:

- Navigate to the Data Acquisition tab in the Edge Impulse Studio.
- Navigate to the _Data Acquisition_ tab in the Edge Impulse Studio.

![Data Acquisition](.gitbook/assets/renesas-ra6m5-getting-started/data-acquisition.jpg)

- Here you will find the _Device_ we connected in the previous step and the sensor list. Please select the suitable sensor from the drop-down menu. For this project, I have selected the _Microphone_ sensor and used default parameters.
- Add a _Label name_ for the sample you are about to collect. I am collecting clap and whistle sounds therefore I will use _clap_ and _whistle_ as labels.
- Clicking _Start Sampling_ will start the sample collection process. Once the sample is collected, it will be automatically uploaded to the edge-impulse studio.
- Clicking _Start Sampling_ will start the sample collection process. Once the sample is collected, it will be automatically uploaded to the Edge Impulse Studio.

![Data Collection Process](.gitbook/assets/renesas-ra6m5-getting-started/data-collection.gif)

When enough samples are collected, [balance the data](https://docs.edgeimpulse.com/docs/edge-impulse-studio/data-acquisition#dataset-train-test-split-ratio) and if required [clean the data](https://docs.edgeimpulse.com/docs/edge-impulse-studio/data-acquisition#cropping-samples) as well.
When enough samples are collected, [balance the data](https://docs.edgeimpulse.com/docs/Edge Impulse-studio/data-acquisition#dataset-train-test-split-ratio) and if required [clean the data](https://docs.edgeimpulse.com/docs/Edge Impulse-studio/data-acquisition#cropping-samples) as well.

![Dataset Train/Test Split](.gitbook/assets/renesas-ra6m5-getting-started/split.jpg)

## Machine Learning Model Preparation

After data collection, the next step is machine learning model preparation. To do so, please navigate to the Impulse design tab and add relevant preprocessing and learning blocks to the pipeline.
After data collection, the next step is machine learning model preparation. To do so, please navigate to the _Impulse design_ tab and add relevant [preprocessing](https://docs.edgeimpulse.com/docs/edge-impulse-studio/processing-blocks) and [learning blocks](https://docs.edgeimpulse.com/docs/edge-impulse-studio/learning-blocks) to the pipeline.

- Edge Impulse Studio will automatically add an input block and it will recommend a suitable preprocessing and a learning block based on the data type. I have used the recommended ones in this project with default arguments.
- Edge Impulse Studio will automatically add an [input block](https://docs.edgeimpulse.com/docs/edge-impulse-studio/impulse-design#input-block) and it will recommend a suitable preprocessing and a learning block based on the data type. I have used the recommended ones in this project with default arguments.

![Impulse Design](.gitbook/assets/renesas-ra6m5-getting-started/impulse-design.jpg)

Expand All @@ -133,31 +133,31 @@ Click on the _Save parameters_ button, then navigate to the _Generate features_

![Feature Generation](.gitbook/assets/renesas-ra6m5-getting-started/feature-generation-2.jpg)

- After feature generation, please navigate to the _Learning Tab_ (Classifier in this case). Design the neural network architecture and use appropriate parameters. I have used the default architecture and parameters recommended by the edge-impulse studio. After selecting a suitable configuration, click on the _Start training_ button.
- After feature generation, please navigate to the _Learning Tab_ ([Classifier](https://docs.edgeimpulse.com/docs/edge-impulse-studio/learning-blocks/classification) in this case) to design the neural network architecture. I have used the default architecture and parameters recommended by the Edge Impulse Studio. After selecting a suitable configuration, click on the _Start training_ button.

![Classifier Design](.gitbook/assets/renesas-ra6m5-getting-started/classifier-design.jpg)

- Once the training is complete, please navigate to the [Model testing](https://docs.edgeimpulse.com/docs/edge-impulse-studio/model-testing) tab, and click _Classify all_ button.
- Once the training is complete, please navigate to the [Model testing](https://docs.edgeimpulse.com/docs/Edge Impulse-studio/model-testing) tab, and click _Classify all_ button.

![Model Testing](.gitbook/assets/renesas-ra6m5-getting-started/model-testing.jpg)

After testing is finished, the edge-impulse studio will show the model accuracy and other parameters.
After testing is finished, the Edge Impulse Studio will show the model accuracy, and other parameters.

> Even though it is a simple example, the Edge Impulse Studio prepared an excellent machine learning model just by using the default recommended parameters. That too in just couple of minutes.
> Even though it is a simple example, the Edge Impulse Studio prepared an excellent machine learning model just by using the default recommended parameters, in just a couple of minutes.
## Deployment

In this step, we will deploy our prepared model to the Renesas CK-RA6M5 board, so we can perform the inference locally on the board.

- Please navigate to the [Deployment](https://docs.edgeimpulse.com/docs/edge-impulse-studio/deployment) tab, select the Renesas CK-RA6M5 board using the search bar, and click on the _Build_ button.
- Please navigate to the [Deployment](https://docs.edgeimpulse.com/docs/Edge Impulse-studio/deployment) tab, select the Renesas CK-RA6M5 board using the search bar, and click on the _Build_ button.

![Deployment Tab](.gitbook/assets/renesas-ra6m5-getting-started/deployment.jpg)

- After the build is finished, the new firmware will be downloaded automatically to your computer and the Edge Impulse Studio will provide next-step instructions.
- After the _build_ is finished, the new firmware will be downloaded automatically to your computer, and the Edge Impulse Studio will provide next-step instructions.

![Next Steps](.gitbook/assets/renesas-ra6m5-getting-started/deployment-2.jpg)

- Please extract the folder and double-click the flash_<operating-system> file. This will flash the newly created firmware on the CK-RA6M5 board. This firmware contains the machine learning model we prepared in above steps.
- Please extract the folder and double-click the `flash_<operating-system>` file. This will flash the newly created firmware on the CK-RA6M5 board. This firmware contains the machine learning model we prepared in the above steps.

![Flashing Firmware](.gitbook/assets/renesas-ra6m5-getting-started/flashing.gif)

Expand Down

0 comments on commit b94a409

Please sign in to comment.