Hello,
I have been testing various architectures to classify ECG signals that are fed to my network as time series. When working with models composed only of convolutional and dense layers I had no problems deploying them to an Arduino Nano 33 BLE Sense: the results reported by the Edge Impulse platform matched the inferences produced by the Arduino using a “static_buffer”.
However, I recently deployed a model that combines convolutional layers with an LSTM layer on the same Arduino, and I started seeing different results between the Edge Impulse platform and the Arduino for the same input data. I trained the network on CPU to avoid issues related to GPU libraries, and I tried both the unoptimized (float32) and quantized (int8) models, as well as using both the EON Compiler and TensorFlow Lite. All this led me to believe the problem is closely related to the LSTM layer.
Has anyone experienced the same issue or knows what might be causing this?
Thanks in advance for your feedback.
Hi, @LucasMCabral !
LSTM support in tflite micro is quite experimental and there are strict requirements of what can and cannot be done (easily). Actually I remember Conv + LSTM being one of problematic things. The only LSTM variety supported is UnidirectionalSequenceLSTM - check your NN with Netron to see if this is what you have. Have you tried with only LSTM layer(s)?
To start debugging this, can you provide your project number?
FYI, next week I’ll be traveling, so expect delayed reply.
Thanks @AIWintermuteAI for your answer — it was very helpful. I just tried implementing a network made up of a single LSTM layer followed by a dense layer and it worked! The results produced by the model deployed on the Arduino Nano 33 BLE Sense matched those from the evaluation done in Edge Impulse (I implemented the unoptimized version). Knowing this, I’ll have to look for an alternative to TFLite Micro to deploy my model on the Arduino.
I’m sorry I can’t share the project ID — my supervisors asked me not to make it public at the moment.
Thanks again!