## 2 Materials and Methods
### Post-Training Quantization  
Post-training quantization is a technique used to reduce LiteRT model size, making it lighter, faster, and less resource consuming. The LiteRT converter provides several post-training quantization options, as outlined in Google AI Edge's guide for deploying AI on mobile, web, and embedded platforms [77]. We followed the decision tree in Figure 3 to identify different quantization methods applicable for our use case on 32-bit or 8-bit microcontrollers. As shown in Table 1, these methods differ in the size of the tensors used: constant tensors (weights and biases), which remain unchanged during inference, determine the LiteRT model size, while variable tensors (inputs, outputs, and activations--intermediate results during forward propagation through the network) additionally influence the processing time. Figure 3 and Table 1 help to summarize the basic information on the LiteRT conversion methods used in this study:  
1. LiteRT models without quantization retain full model precision, typically using 32-bit floating-point (float32) data types. The inference speed is the slowest, with the largest model size and highest resource usage. 2. Dynamic range quantization (DynQ) reduces the LiteRT model size by converting the weights from float32 to 8-bit integers (int8). Since weights are constant tensors that remain unchanged during inference, their quantization scale is dynamically computed at runtime. This quantization is partial--biases, inputs, outputs, and activation streams remain in float32, which ensures minimal accuracy loss. Although \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**LiteRT DNN Model** & **RDS Use** & **Inputs** & **Outputs** & **Activations** & **Weights** & **Biases** \\ \hline Without quantization & No & float32 & float32 & float32 & float32 & float32 \\ Dynamic Range Quantization (DynQ) & No & float32 & float32 & float32 & int8 & float32 \\ Integer Quantization (IntQ) & Yes & float32 & float32 & int8 & int8 & float32 \\ Full-Integer Quantization (Full-IntQ) & Yes & int8 & int8 & int8 & int8 & int8 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Data types of various tensors used in LiteRT DNN models with and without post-training quantization. RDS: representative dataset for calibration. the model size is reduced, the floating-point activation computations result in high resource usage. 3. Integer Quantization (IntQ) with float fallback is a hybrid approach where the LiteRT model uses integer quantization for internal computations (activations) but keeps the inputs/outputs as float32 streams. This is particularly useful when working with floating-point inputs or data formats that require high diagnostic precision, such as sensor inputs (e.g., ECG signals). The biases remain in float32 format because they typically involve small adjustments that require high precision to avoid error accumulation, which could otherwise degrade the model's performance. Nevertheless, the weights and internal activations are quantized to int8 to reduce memory usage and computational requirements. Since internal activations are variable tensors, their float32-to-int8 conversion requires careful pre-inference calibration, as it is likely to impact model accuracy. 4. Full-Integer Quantization (Full-IntQ) involves quantizing all tensors of the LiteRT model entirely to 8-bit integers, minimizing memory usage and computational requirements, and achieving the fastest inference speed. The float32-to-int8 conversion of all variable tensors requires adequate pre-inference calibration because the accuracy of the Full-IntQ model is most significantly impacted by quantization. Notably, none of the above conversion methods require retraining, fine-tuning, or the use of training datasets or pipelines from the source framework. However, two of the integer quantizations (IntQ and Full-IntQ) require calibration of the variable tensors before the  
Figure 3: Flowchart of the conversion of LiteRT DNN models with and without post-training quantization.