# Robust and Secure Data Transmission Using Artificial Intelligence Techniques in Ad-Hoc Networks
## 4 Proposed Work
### Use of ML Techniques
#### 4.4.1 Artificial Neural Network (ANN)
\[\frac{\partial\text{E}}{\partial\text{x}_{\text{i}}}=-\sum_{\text{j=1}}^{\text {N}}\frac{\text{x}_{\text{j}}}{\text{R}_{\text{ij}}}-\sum_{\text{i=1}}^{\text {N}}\text{In}_{\text{i}} \tag{6}\]  
The trained ANN structure and error graph generated during the training process are presented in Figures 9 and 10, respectively. For both normal and pathological nodes, the ANN is trained using an optimized node's attributes. The attributes of nodes, such as the energy spent by nodes and the distance covered by nodes, are used as input parameters. If the result is not what is expected, the error is transmitted back to the hidden layer which adjusts the node attributes accordingly. In this method, the network is trained with the least amount of error possible. The network in Figure 9 is made up of N interconnected neurons, as indicated by the arrow. These neurons individually update each neuron's activation function. The mean square error is the error created by the ANN network during training, and it is depicted in Figure 10.  
Figure 8.0 Trained ANN. The MSE concerning epochs generated by the ANN algorithm is shown in Figure 8.1 The graph mainly consists of four different values as represented by different colors such as blue, green, red, and dotted lines, which represents the error values of the train, validation, test, and best-obtained solution, respectively. Here, the best-trained structure is obtained at the first epoch that carries an MSE of 2.0441. This is because RBF helps to reject the outermost properties of the nodes from the properties set and then SVM selects only support vectors as properties with minimum MSE [36]. The authors only run up to three epochs because the ANN targets are to fulfill the requirements in three epochs only and we achieved minimum MSE at three epochs, so there was no need for further epochs. We know that the training process of ANN is an iterative process and always depends upon the training parameters such as performances in terms of MSE, gradient, mutation, and validation check. From these parameters, if anyone fulfills the conditions of training then ANN automatically stops the training process. In Figure 10, it is clearly shown that the gradient parameter fulfills the training criteria of ANN, so ANN stops the training process. The model does not face the problem of overfitting because the system achieves better MSE in just three epochs, which means the model avoids the overfitting problem. The step used to overcome the overfitting problem is used to reduce the complexity of the training structure of ANN, which is performed by considering multiple hidden layers in the trained ANN structure. According to Figure 11, a total of 20 hidden layers are used with 20 neurons that help to minimize the overfitting problem of ANN. Basically, ANN faces overfitting problems when lots of irrelevant node properties are considered as training data which negatively impacts the performance of the network, and to solve these types of problems, the concept of ABC as an optimization technique is used. The aim of using ANN is to select the best route among the number of optimal routes obtained using AODV with the ABC approach. Now, the next step is to identify the black node if it is present in the selected route. To detect the node as a black hole node, the  
Figure 8.2 Block diagram of SVM. Figure 8.3 Mean square error (MSE). Support Vector Machine (SVM) approach is applied. The working of SVM is presented in Section 4.4.2.