## 5 Simulation and Results
### Results Sections  
The confusion matrix LM algorithm is shown in Table 2, in which 9564 traffic flows are correctly predicted as normal traffic while belonging to the normal traffic flows, and 3055 flows are predicted as attack traffic while belonging to the normal traffic flow. Similarly, 3925 traffic flows are predicted as normal traffic while these flows belong to attack traffic, and 28,456 traffic flows are correctly predicted as attack traffic while belonging to attack traffic. The overall prediction accuracy of the LM algorithm is 84.5% with a wrong prediction rate of 15.5%. Figure 6: Training performance of BR algorithm. Figure 7: Training performance of SCG algorithm. The confusion matrix of the BR algorithm is shown in Table 3, in which 10,621 traffic flows are correctly predicted as normal traffic flows while belonging to the normal traffic flow, and 1995 traffic flows are wrong predicted as attack traffic while belonging to the normal traffic. For the attack flow, the BR algorithm predicts 2834 traffic flows as attack traffic which actually belongs to the normal traffic, and 29,547 traffic flows are correctly predicted as attack traffic flows. The overall prediction accuracy of BR algorithm is 89.26% with a misclassification rate of 10.745%. The confusion matrix of the SCG algorithm is shown in Table 4, in which 11,746 traffic flows were correctly predicted as normal traffic, and only 870 traffic flows were mispredicted as attack traffic, which actually belonged to the normal traffic. For attack traffic flows, 2054 flows are wrong predicted as attack traffic, while 30,327 traffic flows are predicted as attack traffic while they belong to the attack traffic. The overall prediction accuracy of SCG algorithm is 93.5% and the misprediction rate is 6.5%. Federated Model: After getting the optimal weights, based on the ANN's training algorithms, the optimal weights are sent to the federated server, as shown in Figure 3, and then aggregated to each other. The federated model is given in Equations (29) and (30) for input to hidden and hidden to the output layer, respectively. \[FML_{IH}=0.25 LM_{IH}+BR_{IH}+0.005 SCG_{IH} \tag{29}\]  
\[FML_{HO}=0.25 LM_{HO}+0.020 BR_{HO}+3 SCG_{HO} \tag{30}\]  
The federated model of the input-hidden layer is given in Equation (29) by aggregating the received local client-trained models, in which \(LM_{IH}\), \(BR_{IH}\), and \(SCG_{IH}\) are assigned preference of 0.25, 1, and 0.005 respectively. Similarly in the hidden-output federated model \(LM_{HO}\), \(BR_{HO}\) and \(SCG_{HO}\) are assigned 0.25, 0.020, and 3 preferences respectively in Equation (30). The values of preferences are determined by the hit and trial method by doing extensive simulations. After aggregating all the locally trained models, the federated model is subjected to validation using the same validation data as used in the individual local client validation. The confusion matrix of the federated-based model is given in Table 5, in which 12,337 traffic flows are predicted as normal traffic, while actually belonging to the normal traffic, and only 279 traffic flows are mispredicted as attack traffic. Similarly, the prediction of attack traffic flow as normal traffic is very low, as only 325 attack traffic flows are predicted as normal traffic, and 32,146 traffic flows are predicted as attack traffic while \begin{table}
\begin{tabular}{c c c} \hline \hline  & **0 (Predicted Normal)** & **1 (Predicted Attack)** \\ \hline
**0 (Actual Normal)** & 11,746 & 870 \\
**1 (Actual Attack)** & 2054 & 30,327 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Confusion matrix of SCG algorithm \begin{table}
\begin{tabular}{c c c} \hline \hline  & **0 (Predicted Normal)** & **1 (Predicted Attack)** \\ \hline
**0 (Actual Normal)** & 10,621 & 1995 \\
**1 (Actual Attack)** & 2834 & 29,547 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Confusion matrix of BR algorithm belonging to the attack traffic.