Deploy ML models to Arm edge devices using Edge Impulse and AWS IoT Greengrass
Introduction
Understand the Edge Impulse and AWS IoT Greengrass deployment architecture
Select and set up your edge device
Set up your Edge Impulse project
Install AWS IoT Greengrass on your Arm edge device
Store your Edge Impulse API key in AWS Secrets Manager
Create the Edge Impulse Greengrass component
Deploy the component to your edge device
Verify inference and view results
Next Steps
Deploy ML models to Arm edge devices using Edge Impulse and AWS IoT Greengrass
Introduction
Understand the Edge Impulse and AWS IoT Greengrass deployment architecture
Select and set up your edge device
Set up your Edge Impulse project
Install AWS IoT Greengrass on your Arm edge device
Store your Edge Impulse API key in AWS Secrets Manager
Create the Edge Impulse Greengrass component
Deploy the component to your edge device
Verify inference and view results
Next Steps
Create an Edge Impulse account
Create an Edge Impulse account, clone a pre-built project, build a deployment for your Arm device, and generate an API key. Edge Impulse is an ML platform for building, training, optimizing, and deploying models for edge devices.
To create an account:
Navigate to Edge Impulse Studio and select Sign Up:
Edge Impulse sign-up pageFill in the requested information and select Sign Up:
Complete the sign-up formAfter a successful sign-up, a confirmation message appears. Select Click here to build your first ML model:
Successful sign-up confirmationA wizard appears to help you create a default project:
New project wizardDismiss the wizard by selecting the - button. This reveals your new default project:
New default project
Now that your account is ready, clone an existing project that already has a trained model. You’ll use this model throughout the Learning Path.
Clone the project into your account
To clone a pre-built project into your Edge Impulse account:
Open the Cat and Dog Detector public project .
Public project pageSelect Clone this project. A dialog appears to confirm the clone:
Clone project dialogLeave the default settings and select Clone Project. The cloning process starts:
Cloning in progressThe cloning process takes about 12 minutes to complete. When cloning finishes, a completion message appears:
Clone completeSelect Dashboard to view the cloned project. The project should look similar to the following:
Cloned project dashboard
Build your project deployment
Edge Impulse Studio provides a workflow to build, train, optimize, and deploy ML models. Take a moment to explore the project dashboard:
Project dashboard overview
Central to Edge Impulse is the concept of an Impulse. An Impulse is a pipeline that defines how sensor data is processed, what model runs on it, and how results are interpreted.
Your cloned project already has an Impulse called Cat and Dog Detector. Select Create Impulse to see the three main parts: the pre-processing block, the model block, and the post-processing block:
Impulse pipeline structure
Select Object Detection to see details about the model used in the Impulse:
Object Detection model details
The Impulse in this project is already created, trained, and optimized. Edge Impulse provides examples and documentation to guide you through creating your own Impulse from scratch:
Edge Impulse documentation
Now, deploy the model to your specific edge device type. Depending on the hardware that you’re using, choose the matching deployment target:
Deployment target options
Select the appropriate target for your device and select Build. For example, if you’re using a Raspberry Pi 5 or a Graviton-based Amazon EC2 instance, choose Linux (AARCH64) to run the model on the CPU:
Build deployment
For edge device targets, select the int8 quantization option before selecting Build. The Linux (AARCH64) target is suitable for many Linux-class Arm-based 64-bit devices where the CPU runs the model.
When the deployment build completes, the browser automatically downloads your .eim file to ~/Downloads. From your desktop, copy the .eim file to your edge device. For example, if the file is named pet_detection-linux-aarch64-v137-cat-and-dog-detector.eim, run:
scp pet_detection-linux-aarch64-v137-cat-and-dog-detector.eim <username_on_edge_device>@<edge_device_ip_address>:.
Next, open an SSH session on your edge device:
ssh <username_on_edge_device>@<edge_device_ip_address>
mv *.eim /tmp/currentModel.eim
You’ll see /tmp/currentModel.eim on your edge device and use this file later.
Create your project API key
The Edge Impulse Linux Runner on your device uses an API key to authenticate with your project and download the model. The key connects the Greengrass component to your Edge Impulse project.
To create the key:
- Select Dashboard:
Project dashboard
- Select Keys:
Keys tab
- Select Add new API key.
- Enter a name for the key, set the role to admin, and confirm that Set as development key is selected.
- Select Create API key:
Create API key
The API key appears on the screen. Copy and save the key immediately — this is the only time that the full key is visible. You’ll store this key later in AWS Secrets Manager.
What you’ve accomplished and what’s next
You’ve created an Edge Impulse account and cloned a pre-built Cat and Dog Detector project. You’ve built a deployment for your Arm device and generated an API key.
Next, you’ll install AWS IoT Greengrass on your edge device.