## 4 Results and Discussion
### lls4 ml  
Considering model accuracy and FNR, along with model size (in terms of the number of parameters and precision of input data), the first model implemented in lls4 ml is QCNN with full precision data, with capping value 8, referred to as QCNN_FP. It is compared with QCNN with 2-bit quantized input data, from now on referred to as QCNN_U2. The last model implemented in hls4 ml is QMLP with 2-bit quantized input data, named QMLP_U2E. It must be emphasized that because of some restrictions in Vivado/hls4 ml on the number of parameters, the input data are images covering just the CE-E part of the HGCAL. The FPGA implementation results for each of the models are reported in Table 16. It is important to bring attention to the fact that, in this case, (hls4 ml) models are not optimized in the sense that the precision is adjusted by layers. They use the precision defined at the model level, with settings necessary to preserve the accuracy of the QKeras model. It is clear that all models satisfy the required latency constraint (\(<\)12 us). FPGA resource usage metrics show flip-flop (FF) employment in all cases is under 2.5%, and lookup table (LUT) utilization is under 15%. For all models, the number of used digital signal processors (DSP) is two, which, compared to available DSPs (3072), makes 0.065%. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Model** & **acc** & **prec** & **rec** & **f1** & **AUC** & **fpr** & **fnr** \\ \hline QCNN & **0.9685** & **0.9766** & 0.9600 & **0.9682** & **0.9860** & 0.0230 & 0.0400 \\ QMLP & 0.9678 & 0.9730 & **0.9622** & 0.9676 & 0.9834 & **0.0267** & **0.0378** \\ \hline \hline \end{tabular}
\end{table} 
Table 15: Non uniform quantizer. \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Bit** & **acc** & **prec** & **rec** & **f1** & **AUC** & **fpr** & **fnr** \\ \hline
2 & **0.9676** & 0.9727 & 0.9622 & 0.9674 & 0.9844 & 0.0270 & 0.0378 \\
2 & 0.9598 & 0.9461 & 0.9752 & 0.9604 & **0.9825** & 0.0556 & **0.0248** \\
3 & 0.9711 & **0.9757** & **0.9663** & **0.9710** & **0.9870** & **0.0241** & **0.0337** \\
3 & **0.9633** & **0.9689** & 0.9574 & **0.9631** & 0.9816 & **0.0307** & 0.0426 \\
4 & 0.9672 & 0.9723 & 0.9619 & 0.9670 & 0.9789 & 0.0274 & 0.0381 \\
4 & 0.9593 & 0.9606 & **0.9578** & 0.9592 & 0.9791 & 0.0393 & 0.0422 \\
8 & 0.9339 & 0.9333 & 0.9289 & 0.9336 & 0.9573 & 0.0611 & 0.0711 \\
8 & 0.9330 & 0.9438 & 0.9207 & 0.9321 & 0.9635 & 0.0548 & 0.0793 \\ \hline \hline \end{tabular}  
* According to Table 14, models with 2 and 3 input data bit width outperform models with wider data precision.
* **Non-uniform quantizer.** The models based on non-uniformly quantized data with results in Table 15 show somewhat lower performances than models based on 2-bit uniformly quantized input.  
\end{table} 
Table 14: Uniform quantizer with different quantization levels, QCNN and QMLP (gray background) models. Using low precision settings can help reduce the FPGA resource usage of a model but may result in loss of model performance if chosen inappropriately. In addition to setting the model precision, hls4 ml allows per-layer optimization. The profiling tools in hls4 ml help to decide the appropriate model/layer precision. Each layer in the QNN is evaluated using the given test data, and the distribution of values is shown with a box and whisker diagram. The grey-shaded boxes show the range, which can be represented with the used hls4 ml configuration settings. When the test is performed with QCNN_U2, using default hls4 ml precision <16, 6>, there is a gap between QKeras (0.968148) and hls4 ml (0.9409259) accuracy. The profiling tool has shown that first-layer output precision has to be extended from the default (Figure 15(a)). With models' extended precision <18, 8>, accuracy is improved (0.9679629).