N
timesteps, our feature vector will be of size 5 x N.
Our DIY flex sensors, though, are not very precise. Relying on their absolute values alone could lead to bad results because they can vary based on the stretch force applied at rest state (e.g., how we wear the glove). This is why we are augmenting the input features by adding the cross-difference among each pair of fingers. The rationale behind this is to capture the relative position/movement of one finger from the others.
So, calling F1…F5 each finger’s reading, a single row in the feature vector will be made of:
N
depends on 2 factors:
Hand
class: this will encapsulate the actual reading and cross-difference calculations. We’re also adding exponential smoothing to eliminate high frequency fluctuations.
Create a file, I’ve called it hand.h
, with the following:
edge-impulse-data-forwarder
command line tool to import the data into Edge Impulse platform.
Here is the Sketch I’ve created:
Deployment
tab and download the project as an Arduino library. To run the model on our board, we’re going to leverage the EloquentArduino library, which makes this a breeze.
After you have imported the downloaded zip as a library in the Arduino IDE, compile and upload the following Sketch:
ImpulseBuffer
allows you to push values to a circular queue that will discard older values when new ones arriveQuorum
allows you to batch the latest N
predictions and check that at least N/2 + 1 of them agree on the same label. This helps smooth out prediction noise.