# Robust and Secure Data Transmission Using Artificial Intelligence Techniques in Ad-Hoc Networks
## 4 Proposed Work
### Use of ML Techniques
#### 4.4.2 Support Vector Machine (SVM)  
SVM is a supervised machine learning model known for its excellent performance in completing classification tasks with high-dimensional data [37; 38; 39; 40; 41]. Reference [13] stated that SVM is a better choice for the detection of a malicious node in the IDS system with high accuracy and minimum error. Therefore, the detection module considered in this study was developed by hybridizing learning models that are ANN and SVM. Here, SVM used RBF as a kernel function to select the best hyperparameters in this research work and we used the concept of RBF kernel function as a hyperparameter of SVM that is able to deal with polynomial data to create an optimal route from source to destination. A non-linear type kernel function is used in SVM to train the network and find the best route for data transmission in the network as a classifier or regression technique. Basically, it is a mapping function that is used to map the node data from one space (normal) to a new space (network with malicious nodes). The working of SVM is represented by the block diagram depicted in Figure 11.  
The node properties of the selected route using the ANN approach are passed as inputs to the SVM model. The attributes of nodes such as delay and energy consumption are passed to train the module. The training data were collected using the ANN structure for both normal and attacker situations. Based on the energy and delay level, the decision was taken as a BHA node or normal node [42]. The algorithm (Algorithm 3) shows that the system is first trained using SVM to select the most relevant features to form the input feature set in terms of Support Vectors (SVs). These SVs represent the most appropriate feature set which is then passed to the ANN for training which assures the best possible classification. Hence, the output of SVM is used as the input of the ANN as illustrated in Figure 12 to differentiate between the normal and the malicious nodes. The following test cases were generated to investigate the intruder as shown in the Table 3. \begin{table}
\begin{tabular}{c c c c} \hline \hline \multirow{2}{*}{**Test Case Count**} & \multicolumn{3}{c}{**Attributes**} \\ \cline{2-4}  & \(\text{Nda}=\frac{\text{node}}{\text{deployment area}}\) & Judgment Parameter & Analysis Parameter \\ \hline
7 & [0.1–2] & Throughput, Delay & Energy Consumption \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Test cases generation  
Figure 12: Information flow in ML model. ```
Input Parameters: FR \(\rightarrow\) Final Route ON\({}_{\text{PROP}}\)\(\rightarrow\) Optimized Nodes Properties as a Training Data (T), C \(\rightarrow\) In terms of communicative and non-communicating nodes, the target/category is Output: OR \(\rightarrow\) Optimized Route for discovering a route from T\({}_{\text{X}}\)-Node to R\({}_{\text{X}}\)-Node and Malicious Nodes (M-Nodes)
1. Start Training
2. Set up the SVM training data. With RBF as the Kernel function, ONP is the total nodes optimised property. 3. For I = 1 \(\rightarrow\) All Nodes
4. If Property of Node (I) == Real
5. Defined the Cat as a category of training data
6. Cat (1) = ON\({}_{\text{PROP}}\) (I)
7. Else
8. Cat (2) = ON\({}_{\text{PROP}}\) (I)
9. End--If
10. End--For
11. Train_Structure = SVMTRAIN (T, Cat, Kernel function)
12. OT= Train_Structure. Support-Vector /\(\top\)To find out the training data for ANN
13. Initialize the basic parameters of ANN--Number of Epochs (E) // Iterations used by ANN --Number of Neurons (N) // Used as a carrier in ANN --Performance: MSE, Gradient, Mutation, and Validation --Techniques: Levenberg Marquardt
14. Data Division: Random
14. For i = 1 \(\rightarrow\) OT
15. If T belongs to communicating nodes property
16. Group (1) = Properties of training data according to the real nodes
17. Else if T belongs to non-communicating nodes property
18. Group (2) = Properties of training data according to the non-real nodes
19. Else
20. Group (3) = Extra properties of training data
21. End--If
22. End--For
23.