Skip to main content

One Stop Model Training with Edge Impulse

Overview

In this wiki, we will teach you how to train your own AI model for your specific application with Edge Imoulse and then deploy it easily to the SenseCAP A1101 - LoRaWAN Vision AI Sensor. Let's get started!

tip

What is Edge Impulse?Edge Impulse is the edge AI platform for enterprise teams building optimized models on any edge device. Deliver value faster and achieve product innovation with advanced AI sensor features.

Hardware preparation

Seeed SenseCAP A1101 - LoRaWAN Vision AI Sensor is an image recognition AI sensor designed for developers. SenseCAP A1101 - LoRaWAN Vision AI Sensor combines TinyML AI technology and LoRaWAN long-range transmission to enable a low-power, high-performance AI device solution for both indoor and outdoor use.
This sensor features Himax's high-performance, low-power AI vision solution which supports the Google TensorFlow Lite framework and multiple TinyML AI platforms.

It is fully supported by Edge Impulse which means you will be able to sample raw data from the camera, build models, and deploy trained machine learning models to the module directly from the studio without any programming required. SenseCAP - Vision AI Module is available for purchase directly from Seeed Studio Bazaar.

  • SenseCAP A1101 - LoRaWAN Vision AI Sensor
  • USB Type-C cable
  • Windows/ Linux/ Mac with internet access

Software praparation

To set this A1101 up in Edge Impulse, you will need to install the following software:

  1. Edge Impulse CLI.
  2. On Linux:
    • GNU Screen: install for example via sudo apt install screen.
  3. Download the latest Bouffalo Lab Dev Cube
tip

Problems installing the Edge Impulse CLI? See the Installation and troubleshooting guide.

Connecting to Edge Impulse

With all the software in place it's time to connect the A1101 to Edge Impulse.

Note:

If you purchased the device after March 30, 2023, then you don't need to update the firmware of EI, please jump directly to STEP3 Setting keys. Please note that updating the firmware of EI will overwrite the default model.

Step 1. Update BL702 chip firmware

BL702 is the USB-UART chip which enables the communication between the PC and the Himax chip. You need to update this firmware in order for the Edge Impulse firmware to work properly.

  1. Get the latest bootloader firmware from here: tinyuf2-sensecap_vision_ai_xxx.bin.

  2. Connect the A1101 to the PC via a USB Type-C cable while holding down the Boot button on the A1101.

  1. Open previously installed Bouffalo Lab Dev Cube software, select BL702/704/706, and then click Finish.
  1. Go to MCU tab. Under Image file, click Browse and select the firmware you just downloaded.
  1. Click Refresh, choose the Port related to the connected A1101, set Chip Erase to True, click Open UART, click Creat & Download and wait for the process to be completed .

You will see the output as All Success if it went well.

note

If the flashing throws an error, try to click Create & Download multiple times until you see the All Success message.

Step 2. Update Edge Impulse firmware

The A1101 does not come with the right Edge Impulse firmware yet. To update the firmware:

  1. Download the latest Edge Impulse firmware and extract it to obtain firmware.uf2 file.

  2. Connect the A1101 again to the PC via USB Type-C cable and double-click the Boot button on the A1101 to enter mass storage mode.

  3. After this you will see a new storage drive shown on your file explorer as SENSECAP. Drag and drop the firmware.uf2 file to SENSECAP drive.

Once the copying is finished SENSECAP drive will disapper. This is how we can check whether the copying is successful or not.

Step 3. Setting keys

From a command prompt or terminal, run:

edge-impulse-daemon

This will start a wizard which will ask you to log in, and choose an Edge Impulse project. If you want to switch projects run the command with --clean.

Alternatively, recent versions of Google Chrome and Microsoft Edge can collect data directly from your A1101, without the need for the Edge Impulse CLI. See this blog post for more information.

Step 4. Verifying that the device is connected

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

Collecting data from A1101 - Vision AI

With everything set up you can now build and run your first machine learning model with these tutorials:

Frames from the onboard camera can be directly captured from the studio:

Finally, once a model is trained, it can be easily deployed to the A1101 – Vision AI Module to start inferencing!

Deploy model to A1101 - Vision AI

After building the machine learning model and downloading the Edge Impulse firmware from Edge Impulse Studio, deploy the model uf2 to SenseCAP - Vision AI by following steps 1 and 2 under Update Edge Impulse firmware section. Drag and drop the firmware.uf2 file from EDGE IMPULSE to SENSECAP drive.

When you run this on your local interface:

edge-impulse-daemon --debug

It will ask you to click a URL, then you will see a live preview of the camera on your device.

Configure your model on the SenseCap Mate

  • Under Config screen, select Vision AI Sensor
  • Press and hold the configuration button on the SenseCap A1101 for 3 seconds to enter bluetooth pairing mode
  • Click Setup and it will start scanning for nearby SenseCAP A1101 devices- Go to Settings and make sure Object Detection and User Defined 1 is selected. If not, select it and click Send

  • Go to General and click Detect

  • Click here to open a preview window of the camera stream
  • Click Connect button. Then you will see a pop up on the browser. Select SenseCAP Vision AI - Paired and click Connect
  • View real-time inference results using the preview window!

For example, as you can see above, the cat are being detected with bounding boxes around them. Here "0" corresponds to each detection of the same class. If you have multiple classes, they will be named as 0,1,2,3,4 and so on. Also the confidence score for each detected apple (0.72 in above demo) is being displayed!

Tech Support & Product Discussion

Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.

Loading Comments...