Question/Issue:
[Recent deployment of the same model keeps printing wrong/default values]
Project ID:
[686078]
Context/Use case:
[I have collected datasets from a custom sensor and trained both a DNN and CNN model for a regression task, to predict respiratory rate.
In the past the model is able to work on the Edge Impulse Studio and on the microcontroller, but however recently after training my model with new data and deploying it to the microcontroller, the model does not seem to be working fine
I have chosen to deploy as an cubeMX CMSIS pack. Once i import into my project, and run in debug mode, the model prints out the feature vector (which changes based on the sensor) but the predicted value from the model on the microcontroller is a constant value of 0.13487, no matter what i do… And this value is not within the expected range of 6 to 22 bpm
Wierd thing is, if i copy the feature vector printed on the screen and paste in edge impulse to simulate model testing, the model seems to run fine… even with feature vector i copied from the terminal for which the model has failed to predict correctly on the microcontroller
We’re able to reproduce the issue. We’ve created a ticket and will work on a prompt solution.
As a temporary work around (if applicable), you may want to deploy a unquantized model.
After further investigation. I’ve found the source of the issue is due to the dataset in your project. In both the training and test set I’ve found data in ranges [0,1], but also in [-500,300].
As a result the generated quantized model get’s incorrect quantization (input) parameters.
This also evident with the large lost in Model Testing page when using the quantized model.
Try removing the “faulty” data and maintain a coherent input data range, for example remove all input data with ranges outside of [0,1]. Retrain and retry the quantized model and let me know if that helps.
I was able to fix your project. I removed the fault data. Regenerated the features and retrained the model. Now I was able to get good accuracy on Model Testing with the quantized model. Moreover on the device, the results are no longer fixed.
I versioned your project before removing the data so that you can always roll back to that version. See the Version page in your project.