## 8 Results
### Stopping Condition
Moreover, we have reported the number of key candidates exceeding the 95% relative correctness. Those candidates are connected with clock cycles where leakage is present, i.e., during those clock cycles, some key-dependent operation is executed in hardware. Although the scikit-learn and tensorflow implementations of regularization are different, with the right choice of \(\lambda\), both frameworks achieved similar correctness, with scikit-learn's small advantage of discovering more key candidates with correctness higher than 95%. It took different numbers of iterations to achieve the stopping condition; therefore, we took a look at how many iterations were actually needed to achieve the same correctness as in the final iteration. We observed how the cumulative hamming distance changes between iterations for each implementation, monitoring the maximal correctness of each iteration at the same time. In Figure 6, we show the results of the analysis for the scikit-learn implementation reported in Table 3. We measured the cumulative hamming distance between two iterations in the following way: for each of the 54 key candidates, we checked the hamming distance between the initial key candidate, used for training in the \(n\)th iteration, and the resulting key candidate, resulting from the classification of the entire power or electromagnetic trace in the \(n\)th iteration of the framework. Since we were interested in finding the best stopping condition, we wanted to focus on the last iterations, not the first; therefore, we have limited the vertical axis when showing the cumulative hamming distance. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Analyzed Trace** & **Method** & **Max Score** & **Scores \textgreater{} 95\%** & **Iterations** \\ \hline \multirow{6}{*}{\begin{tabular}{c} Design\_seq \\ (FPGA) \\ EMT \\ \end{tabular} } & initial & 96\% & 1 & - \\ \cline{2-4}  & SVM C = 0.3 & 100\% & 4 & 1 \\ \cline{2-4}  & scikit-learn L2 \(\lambda\) = 10 & 100\% & 5 & 43 \\ \cline{2-4}  & tensorflow L2 \(\lambda\) = 1 & 100\% & 4 & 29 \\ \cline{2-4}  & tensorflow L1 \(\lambda\) = 0.01 & 100\% & 4 & 41 \\ \hline \multirow{6}{*}{\begin{tabular}{c} Design\_Seq \\ (FPGA) \\ \end{tabular} } & initial & 88\% & - & - \\ \cline{2-4}  & SVM C = 0.3 & 99\% & 1 & 1 \\ \cline{2-4}  & scikit-learn L2 \(\lambda\) = 10 & 98\% & 1 & 34 \\ \cline{2-4}  & tensorflow L2 \(\lambda\) = 1 & 98\% & 1 & 48 \\ \cline{2-4}  & tensorflow L1 \(\lambda\) = 0.01 & 90\% & - & 90 \\ \hline \multirow{6}{*}{\
\begin{tabular}{c} Design\_ultra \\ (ASIC) \\ EMT \\ \end{tabular} } & initial & 75\% & - & - \\ \cline{2-4}  & SVM C = 0.3 & 90\% & - & 1 \\ \cline{2-4}  & scikit-learn L2 \(\lambda\) = 10 & 97\% & 6 & 68 \\ \cline{2-4}  & tensorflow L2 \(\lambda\) = 1 & 98\% & 4 & 64 \\ \cline{2-4}  & tensorflow L1 \(\lambda\) = 0.01 & 79\% & - & 52 \\ \hline \multirow{6}{*}{
\begin{tabular}{c} Design\_ultra \\ (ASIC) \\ \end{tabular} } & initial & 74\% & - & - \\ \cline{2-4}  & SVM C = 0.3 & 89\% & - & 1 \\ \cline{1-1} \cline{2-4}  & scikit-learn L2 \(\lambda\) = 10 & 94\% & - & 97 \\ \cline{1-1} \cline{2-4}  & tensorflow L2 \(\lambda\) = 1 & 92\% & - & 39 \\ \cline{1-1} \cline{2-4}  & tensorflow L1 \(\lambda\) = 0.01 & 74\% & - & 56 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Attack results after letting the framework run until the cumulative hamming distance amounted to 0. In general, we can observe that the cumulative hamming distance decreases throughout iterations. This is not true for every pair of consecutive iterations, but a general trend is visible. Moreover, we observed that low regularization parameters (0.0001, 0.001, 0.01) resulted in just a repetition of the key candidates obtained during the horizontal attack. The ANNs were simply trained to repeat the candidates, trusting the labelling completely. If the labels do not change in the results of ANN training, it might be a good indicator that the regularization parameter is too low. Unfortunately, we do not have any similar recommendation for the upper bound of \(\lambda\).