# Federated Learning for Secure In-Vehicle Communication
## 5 Results Analysis
### Federated Learning-Based Intrusion Detection Performance
#### 5.1.2 Final Global Model Evaluation
The CM in Figure 12 exhibits only diagonal entries, signifying that all instances were correctly classified with zero misclassifications. \begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Class** & **Precision** & **Recall** & **F1-Score** & **Support** \\ \hline Normal & 0.96 & 0.97 & 0.96 & 1203 \\ Flooding & 0.99 & 1.00 & 1.00 & 1148 \\ Fuzzy & 0.98 & 0.96 & 0.97 & 1177 \\ Malfunction & 0.99 & 1.00 & 1.00 & 1218 \\ \hline Accuracy (FL-based LSTM-1E) & \multicolumn{4}{c}{0.9815} \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Classification Report for FL-based LSTM-1E Model: Precision, Recall, F1-Score, and Support. \begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Class** & **Precision** & **Recall** & **F1-Score** & **Support** \\ \hline Normal & **1.00** & 0.99 & 0.99 & 1203 \\ Flooding & **1.00** & **1.00** & **1.00** & 1148 \\ Flovey & **1.00** & **1.00** & **1.00** & 1177 \\ Malfunction & **1.00** & **1.00** & **1.00** & 1218 \\ \hline Accuracy (FL-IVN-IDS-1E) & \multicolumn{4}{c}{0.9973} \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Classification Report for FL-IVN-IDS-1E Model: Precision, Recall, F1-Score, and Support. \begin{table}
\begin{tabular}{l c c c} \hline \hline
**Class** & **Precision** & **Recall** & **F1-Score** & **Support** \\ \hline Normal & **1.00** & **1.00** & **1.00** & 1203 \\ Flooding & **1.00** & **1.00** & **1.00** & 1148 \\ Fuzzy & **1.00** & **1.00** & **1.00** & 1177 \\ Malfunction & **1.00** & **1.00** & **1.00** & 1218 \\ \hline Accuracy (LSTM-5E) & \multicolumn{4}{c}{0.9996} \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Classification Report for LSTM-5E Model: Precision, Recall, F1-Score, and Support. \begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Class** & **Precision** & **Recall** & **F1-Score** & **Support** \\ \hline Normal & **1.00** & **1.00** & **1.00** & 1203 \\ Flooding & **1.00** & **1.00** & **1.00** & 1148 \\ Fuzzy & **1.00** & **1.00** & **1.00** & 1177 \\ Malfunction & **1.00** & **1.00** & **1.00** & 1218 \\ \hline Accuracy (LSTM-5E) & \multicolumn{4}{c}{0.9996} \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Classification Report for FL-IVN-IDS-5E Model: Precision, Recall, F1-Score, and Support. * Meanwhile, the ROC curves in Figure 13 reach 100% for every class, reflecting a True Positive Rate (TPR) of 1.0 and a False Positive Rate (FPR) of 0.0. This perfect separation between positive and negative cases confirms that the model achieves optimal detection accuracy. * The ideal diagonal pattern in the confusion matrix, combined with flawless ROC performance, reinforces the robustness and reliability of the FL-IVN-IDS-5E model in accurately identifying both attacks and normal in-vehicle traffic. Figures 14 and 15 show the CM and ROC curves of our LSTM-5E model. * Figure 14 represents the CM of LSTM-5E model containing only diagonal elements. All instances are correctly classified without any misclassifications. * This proves that for each class the model correctly identifies all instances TP and rejects all the other classes correctly TN instead in the Normal class, there is 2, which is a FN, leading to the near-perfect classification performance. * Figure 15 illustrates the ROC curve, where each class achieves a 100% score. This result signifies that the TPR is 1.0 and the FPR is 0, i.e., the model LSTM-5E classifies classes with perfect separation and no error. * A TPR of 100% guarantees that the model classifies all true occurrences of each class and an FPR of 0% signifies that there are no false alarms. Figure 12: Confusion Matrix of FL-IVN-IDS-5E Architecture. Figure 13: ROC of FL-IVN-IDS-5E Architecture.