I am working on deploying a 1D CNN model on an STM microcontroller using STM32CubeMX with the X-CUBE-AI package to convert the TensorFlow Lite model into C code.
While testing the model, I noticed significant discrepancies in predictions:
- On Laptop: Using the quantized model for inference gives reasonable predictions.
- On Microcontroller: Using the same test data, the predictions differ substantially when validating the model on hardware.
Steps Taken:
- Ensured the test data was preprocessed identically for both laptop and microcontroller predictions.
- Used X-CUBE-AI to generate C code from the quantized TFLite model.
- Deployed the generated C code on the microcontroller for validation.
Questions:
- What could cause such prediction differences between the laptop and microcontroller?
- Could this issue be related to quantization or numerical precision differences during deployment?
- Are there any additional steps or configurations in X-CUBE-AI to ensure consistent performance between platforms?