## 4 Proposed mmWave Assisted CR-IoV
### Dual Step Security Provisioning
#### 4.3.1 SSDF Attack Detection  
To detect the SSDF attack, we presented a new HK-SVM algorithm. Here, we have chosen an SVM classifier since SVM is a lightweight ML technique that shows better performance in Intrusion Detection Systems (IDSs) [51]. Due to its high-level accuracy and lower complexity, we adapted SVM for SSDF attack detection in the proposed work. In general, the SVM classifier mainly relies on the kernel function that separates normal SUs  
Figure 3: SSDF and PUE Attack Model.  
from malicious SUs. Generally, SVM uses linear or non-linear such as Radial Basis Function (RBF) kernel function upon classification problem nature. RBF and polynomials show better performance in IDS problems. To further improve the accuracy of SSDF detection, we have presented a hybrid kernel function. The proposed HK-SVM detects SSDF attacks based on the sensing reports collected from the SUs. The proposed HK-SVM is the binary classifier that maps the SUs into two classes, namely normal (\(+1\)) and malicious (\(-1\)). The proposed HK-SVM finds the optimum hyperplane between both classes by maximizing the margin and minimizing the classification error between the two classes. First, the input data sequence \(X=[x_{1},x_{2},..,x_{n}]\) is fed into the SVM classifier. Here, the input data sequence is the sensing report received from all SUs. For each input \(x_{i}\in X\), the output is given as \(y_{i}\in\{+1,-1\}\). This separation is performed by the hyperplane, which can be denoted as follows,  
\[w.x_{i}\ +\ b\ =0 \tag{1}\]  
Here, \(w\) is the normal vector and \(b\) is the position of the relative area. Further, this margin is optimized to its support vector through the kernel function. The kernel function can be denoted as \(K(x_{n},x_{i})\) and it transforms the original data space into a new higher dimension space. In this work, we have combined three important kernel functions in order to achieve better accuracy. The kernel functions are expressed in Table 2.  
Each function works better in some cases. To achieve higher performance, we combined all three kernel functions as a hybrid function in the HK-SVM algorithm. The hybrid kernel is expressed as follows,  
\[HK(x_{n},x_{i}\ )=\beta_{1}.(x_{n}.x_{i}\ )+\beta_{2}.exp\bigg{(}\ -\beta_{3}\ \ \ \frac{(-\gamma\|x_{n}-x_{i}\ \|^{2}+C)}{(\gamma(x_{n},x_{i}\ )+r)^{2}}\ \ \bigg{)} \tag{2}\]  
Here, the constant value \(\beta\) is used to mix all three kernel functions and it is selected as \(\beta_{1}+\beta_{2}+\beta_{3}=1\). The proposed hybrid kernel function separates the input data \(X\) as shown in Figure 4.  
The kernel function uses a distance measure to find the nearest vectors for classification. Conventionally, Euclidean distance is used in SVM for classification. In HK-SVM, we have proposed the Mahalanobis distance measure, which can be expressed as follows,  
\[D(x_{n},x_{i})=\sqrt{(\overrightarrow{x_{n}}-\overrightarrow{x_{i}})^{T}CM^ {-1}(\overrightarrow{x_{n}}-\overrightarrow{x_{i}})} \tag{3}\]  
Here, \(CM\) represents the covariance matrix. In this manner, the HK-SVM classifier classifies the SUs into normal and malicious based on received sensing reports. Processing collected sensing reports results in accurately detecting SSDF attacks in the network.  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Kernel Function** & **Expression** \\ \hline Linear & \(K(x_{n},x_{i})=(x_{n}.x_{i})\) \\ RBF & \(K(x_{n},x_{i}\ )=exp(-\gamma\|x_{n}-x_{i}\ \|^{2}+C)\) \\ Polynomial & \(K(x_{n},x_{i})=(\gamma(x_{n},x_{i})+r)^{2}\) \\ \hline \hline \end{tabular}
\end{table}
Table 2: Kernel functions for HK-SVM.