Problems With Creating/Deploying a model For Arduino

Question/Issue:
Hello, I’ve recently built a model for a gesture recognizing AI, this will be deployed on the Arduino nano 33 BLE Sense. For testing i first exportet the Batch script for the device itself. Everything worked fine, the classification of the certain gestures I wanted to be recognized was what i was hoping for, moving on from the batch script i now wanted to have my own code use the model, I exported the .zip file for the Arduino libary, compile the code, and get an error.

#error "Invalid model for current sensor"

The secound last line of the example program of the libary throws an error.

I looked into this forum and just found one simular topic that was working out my current problem, the solution was really dissatisfying.

This forum post can be found here: Arduino BLE Sense libraries "invalid model for current sensor"

Following the advise on this forum, I went into the exportet libary and changed the line of code in the “model_metadata.h” file. This got the code to work, but only with the accelerometer data, which made the Model very inconsistant. Not being able to recognize any gestures at all.

This maby correlates with the fact that the model only has accelerometer data to work with and it would be good to also use the Gyroscope data. But everytime I’m trying to use more than accelerometer data the error “Invalid model for current sensor” is shown. I don’t know how to make it work, if someone needs more data provided on certain things, just ask me to provide them. Other than that I’m really thankful for any help.

Hello @Flomzey,

Can you share your project ID please so I can have a look at how your impulse is configured and test it on my side?
What kind of data have you been collected and used to train your model? Only accelerometer data or also gyroscope information?

Best,

Louis

Here Is my Project ID: 168888
I’m collecting the Data with my Arduino Nano33 Sense, with this it was only possible to sample data from every gesture-recognizing sensor(gyrxyz, accxyz, magxyz).

Thanks for the reply.

Hello @Flomzey,

Can you try to modify this line in the model_metadata.h:

#define EI_CLASSIFIER_FUSION_AXES_STRING         "accX + accY + accZ + gyrX + gyrY + gyrZ + magX + magY + magZ"

to

#define EI_CLASSIFIER_FUSION_AXES_STRING         "accX + accY + accZ + gyrX + gyrY + gyrZ"

I have the feeling that we automatically set the axis based on the axis on your dataset but not based on the ones used in your impulse.

I’ll check with the embedded team if that’s the case to make a fix.

Best,

Louis

Hello,

I’ve already tried doing that, because it somehow made sense to try that, but it didn’t work, the program showed me the same error as mentioned above.

But what ive found out is that in the model_metadata.h the line above

#define EI_CLASSIFIER_FUSION_AXES_STRING         "accX + accY + accZ + gyrX + gyrY + gyrZ"

defines a sensor for the classifier:

#define EI_CLASSIFIER_SENSOR                     EI_CLASSIFIER_SENSOR_FUSION

the sensor used seems to be called some kind of fusion of multiple sensors…

What i then noticed is, that when I coose the program to compile on my Arduino There are multiple to coose from.

I musthave overlooked it, but i always chose the accelerometer_continous example code, because i followed a tutorial.

It seems logical now, but i should’ve coosen the fusion example code, this code compiles now with no problem at all.

Thanks for the help.

@Flomzey what is the link to the tutorial you were following?

Maybe @louis can fix the tutorial or make it more clear as to what to do.

1 Like

I used this tutorial from Arduino for reference: https://docs.arduino.cc/tutorials/nano-33-ble-sense/edge-impulse

This is a tutorial about speech recognition, with the same arduino model i am using, because I did not find any tutorials with the specific use-case I needed, I opted to this one.