Quantizing and testing the trained model with TensorFlow Lite
As we know from previous recipes, the model should be quantized to 8 bits to operate effectively on microcontrollers. Nonetheless, how do we know if the quantized model preserves the accuracy of the floating-point variant?
This question will be answered in this recipe, where we will show you how to evaluate the accuracy of the quantized model generated by the TensorFlow Lite converter. After this analysis, we will convert the TensorFlow Lite model to a C-byte array for deploying it on the Arduino Nano in the next recipe.
Getting ready
Quantization is an essential technique to reduce model size and significantly improve latency. However, adopting arithmetic with limited precision may alter a model’s accuracy. As a result, evaluating the quantized model’s accuracy is critical to ensure that the application performs as intended. Unfortunately, TensorFlow Lite does not provide a built...