Machine Learning on PSoC™6 via Edge-Impulse

Set up Environment

Install Infineon CyProgrammer, Nodejs, and Edge-impulse

  1. Infineon CyProgrammer : Use to flash firmware images into the target.

  2. Install Nodejs v14 or higher on your computer.

Infineon CyProgrammer
Nodejs
  1. Install the CLI tools via:

npm install -g edge-impulse-cli --force

Board Connecting

Connect the board to your computer
  • You can use Infineon CyProgrammer to flash your CY8CKIT-062S2 Pioneer Kit with our base firmware image. To do this, first select your board from the dropdown list on the top left corner. Make sure to select the item that starts with CY8CKIT-062S2-43012:

Open Cypress program and select the board CY8CKIT-062s2-43012

Then select the base firmware image file you downloaded in the first step above (i.e., the file named firmware-infineon-cy8ckit-062s2.hex). You can now press the Connect button to connect to the board, and finally the Program button to load the base firmware image onto the CY8CKIT-062S2 Pioneer Kit.

Let's start with Edge-Impulse

That's all! Your device is now connected to Edge Impulse. To verify this, go to your Edge Impulse project, and click Devices on the left sidebar. The device will be listed there:

Device
Work flow in Machine learning Project

Collecting your first data

Collecting the dataset
  • Make sure your device is connected.

  • Go to the Data acquisition tab in the studio. This is where your raw data is stored.

  • Choose "Record new data."

  • Select your device and set the label to "updown."

  • Set the sample length to 10,000, which means recording for 10 seconds.

  • Choose the Built-in accelerometer as the sensor.

  • Set the frequency to 62.5Hz, which is how often data points are recorded per second.

Prepare all parameters before collecting the data.
Dataset result
Download Dataset

Use Prebuild Dataset

Training and Testing Data

Alternately, you can import this dataset to your Edge Impulse project using the Edge Impulse CLI Uploader. If you haven't done so, follow the Installation instructions.

  • Download the gestures dataset.

  • Unzip the file in a location of your choice.

  • Open a modus-shell and navigate to the place where you extracted the file.

modus-shell
Open a modus-shell and navigate to the place where you extracted the file.
$ edge-impulse-uploader --clean
  • Add training Dataset

$ edge-impulse-uploader --category training training/*.cbor
$ edge-impulse-uploader --category testing testing/*.cbor
After adding the dataset, you will see the Training and Testing data on Edge-Impulse.

Design an Impulse

In the studio go to Create impulse, set the window size to 2000 (you can click on the 2000 ms. text to enter an exact value), the window increase to 80, and add the 'Spectral Analysis', and 'Classification' blocks. Then click Save impulse.

Create Impulse
  • Go to Spectral features => Save parameters => Generate features

Spectral features

Training model

Classifier

Select Classifier, Add Number of training cycles, Start Training.
Training result

Live Classification

Select Device
Classification Result
Model Testing Result

Deploy the model

Model Deployer
Build Firmware for PSoC board
Built firmware successfully
Add ml firmware to PSoC using Cypress Program

We can connect to the board's newly flashed firmware over serial. Open a terminal and run:

$ edge-impulse-run-impulse
Real Time Classification

Ref: https://docs.edgeimpulse.com/docs/~/revisions/9dKGATK7EnFnYNRMlqcb/pre-built-datasets/continuous-gestures

Last updated

Was this helpful?