# Side-Channel Power Analysis Based on SA-SVM
## 2 Materials and Methods
### Research Method  
#### 2.2.1. SVM Classifier  
[PERSON] et al. (1995) [PERSON] et al. (1995) proposed an SVM based on the VC dimensionality theory of statistical learning theory and the structural risk minimization (SRM) principle. SVM, a supervised learning machine learning method used to handle regression analysis and classification issues, sets the dataset as follows:  
\[D_{M}=\{(\mathbf{X}_{i},y_{i})\mid\mathbf{X}_{i}\in R^{n},y_{i}\in\{-1,+1\},i= 1,2,\ldots,M\} \tag{3}\]  
where \(\mathbf{X}_{i}\) denotes the input sample, \(n\) is the dimensionality of the input sample, and \(y_{i}\) denotes the corresponding label of the sample. SVM's fundamental model is a linear classifier for binary categorization issues. The idea is to map the input sample into higher-dimensional space. The distance between the two characteristics of the input sample is then optimized by establishing a maximum interval hyperplane in high-dimensional space. The larger the distance, the more effective the classification. The hyperplane is defined as follows:  
\[f(\mathbf{X})=\omega^{T}\Phi(\mathbf{X})+b \tag{4}\]  
where \(\Phi(\mathbf{X})\) is the nonlinear mapping function, \(\omega\) denotes the weight vector, and \(b\) denotes the offset vector. \[ \begin{split}\underset{\omega,b,\xi}{\min}\bigg{(}\frac{1}{2} \parallel\omega\parallel^{2}+C\sum\limits_{i=1}^{n}\xi_{i}\bigg{)},\\ \text{s. t. }y_{i}\big{(}\omega^{T}\Phi(\mathbf{X}_{i})+b\big{)} \geq 1-\xi_{i},\xi_{i}\geq 0,i=1,2,3,\ldots,M\end{split}  \tag{5}\]  
where \(C>0\) is a regularization parameter, also known as the penalty factor. It is used to control the degree of sample penalty. If \(C\) is too high, it will cause overlearning and affect the classifier's generalization ability. \(\xi_{i}\) denotes the relaxation factor. The Lagrange multiplier is introduced to transform the constrained problem of Equation (5) into a pairwise problem for a better solution, and the resulting equation is as follows:  
\[ \begin{split}\underset{\alpha}{\min}\frac{1}{2}\sum\limits_{i=1 }^{n}\sum\limits_{j=1}^{n}\lambda_{i}\lambda_{j}y_{i}y_{j}\mathbf{K}\big{(} \mathbf{X}_{i}\cdot\mathbf{X}_{j}\big{)}-\sum\limits_{i=1}^{n}\alpha_{i},\\ \text{s.t. }\sum\limits_{i=1}^{n}\lambda_{i}y_{i}=0,0\leq \lambda_{i}\leq C,i=1,2,\ldots,M\end{split}  \tag{6}\]  
where \(\lambda_{i}\) is the Lagrange multiplier. \(K\big{(}\mathbf{X}_{i},\mathbf{X}_{j}\big{)}=\Phi(\mathbf{X}_{i})^{\mathsf{T }}\Phi\big{(}\mathbf{X}_{j}\big{)}\) is the kernel function. Using the above formula, we can calculate \(\omega,b\) as follows:  
\[\omega^{*}=\sum\limits_{i=1}^{M}\lambda_{i}y_{i}\phi(\mathbf{X}_{i}) \tag{7}\]  
\[b^{*}=y_{j}-\sum\limits_{i=1}^{M}\lambda_{i}\ y_{i}K\big{(}\mathbf{X}_{i}, \mathbf{X}_{j}\big{)} \tag{8}\] \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Correlation (Absolute Value)** & \(\mathbf{R}\geq\mathbf{0.90}\) & \(\mathbf{R}\geq\mathbf{0.85}\) & \(\mathbf{R}\geq\mathbf{0.80}\) & \(\mathbf{R}\geq\mathbf{0.75}\) & \(\mathbf{R}\geq\mathbf{0.70}\) & \(\mathbf{R}\geq\mathbf{0.65}\) & \(\mathbf{R}\geq\mathbf{0.60}\) \\ \hline POIs & 4 & 14 & 20 & 29 & 53 & 84 & 117 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The absolute values of correlation and their number of POIs. According to Equations (7) and (8), the final SVM classification decision function is obtained as follows:  
\[f(\mathbf{X})=\text{sign}\Bigg{(}\sum_{i=1}^{M}\lambda_{i}y_{i}K(\mathbf{X}_{i}, \mathbf{X})+b^{*}\Bigg{)} \tag{9}\]  
The kernel function's purpose in training classification models for SVMs is to convert the incoming nonlinear data into high-dimensional kernel space. The kernel function, in essence, precomputes the input data in the lower dimension of this display and shows the classification impact in the upper dimension of this display. SVMs can avoid the issue of processing data in high-dimensional space by introducing suitable kernel functions. Five kernel functions were chosen for this article, among which the Morlet-RBF kernel was applied to side-channel power analysis for the first time.