# Privacy Preserving Classification of EEG Data Using Machine Learning and Homomorphic Encryption
## 4 Discussion and Conclusions
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline  & \multicolumn{6}{c}{**Precision Parameter (Number of Terms)**} \\ \cline{2-9}  & **35** & **32** & **29** & **26** & **23** & **20** & **17** & **14** \\ \hline Loss in accuracy & 0 & 0 & 0 & 0 & 0 & 0 & 0.41 \\ Runtime (hours) & 32.28 & 26.53 & 22.17 & 17.91 & 13.02 & 10.90 & 8.16 & 5.75 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Influence of the precision parameter on the loss of accuracy and on the computational time in the EEG-based predisposition to alcoholism detection use case. an equation. The equation that one would try to solve is \(1/X-den=0\), which provides the inverse of the denominator. The correctness of the result is dependent on the initial approximation. As the underlying information is secret, it is not possible to evaluate which initialization would guarantee convergence to the optimum value in a few iterations. On the other hand, because a comparison cannot be performed between encrypted numbers, a standard/fixed number of iterations needs to be performed. This approach is prone to errors that might occur because of an insufficient number of iterations, or because the plaintext domain is exceeded during the computations. In this use case, each data point is considered an individual feature (no temporal meaning is considered). Furthermore, although the model achieves good prediction performance, a baseline EEG analysis might be invalidated by downsampling the signal to 40 Hz. As mentioned in [34], a band-pass filter (that allows for frequencies between 0.53 and 40 Hz) was used to filter the signal after data acquisition. According to the Nyquists' theorem and considering the highest frequency of the EEG (40 Hz), to obtain a valid signal, the sampling rate should be at least 80 Hz. The overall performance for the five folds in this experiment (160 features: 80 original features and their squares) on the plaintext data lies between the experiments with 356 and 80 features, respectively. The time required for training on ciphertext data was approximated to be 27 h per fold if 256-bit encryption, 23 encoding terms and 2 processes in the parallelized version were considered. The computational overhead introduced through encoding and encryption represents another limitation of the method. As experiments have shown, a larger precision parameter and a larger encryption key lead to a higher computational time for the training phase. Regarding the precision parameter, we indicate that the number of terms required to ensure no loss in accuracy cannot be determined precisely based on the dataset dimensionality, as it also depends on the initial precision of the numbers contained within a certain dataset. The total number of operations performed on encoded and encrypted data is \(N_{op}=2 sf(f+1)\), where \(s\) is the number of training samples and \(f\) is the number of features. The computational time can also be predicted according to the number of samples, the number of features and the number of encoding terms \(n\) by computing \(T=T_{ad}\frac{N_{op}}{2}n+T_{mul}\frac{N_{op}}{2}n^{2}\), where \(T_{ad}\) and \(T_{mul}\) denote the average time in seconds required for an addition or a multiplication operation between two encrypted coefficients of the polynomial representation (1). The value of \(T\) is also expressed in seconds. The proposed method can be successfully employed in real-world scenarios. It allows for homomorphic addition, subtraction and multiplication on real numbers, while only requiring an encryption scheme capable of performing the addition and multiplication of small integers. Distributing the information between multiple ciphertext values (polynomial coefficients) allows for the encoding of real numbers of arbitrary sizes, but at the same time, a trade-off between the computational accuracy and the computational time is made. Conceptualization, A.B.P. and C.I.N. ; methodology, A.B.P., I.A.T., A.V., R.D., C.S. and L.M.I. ; software, A.B.P. and I.A.T. ; validation, C.I.N., A.V. and L.M.I; formal analysis, C.I.N.