# Federated Learning for Secure In-Vehicle Communication
## 5 Results Analysis
### Federated Learning-Based Intrusion Detection Performance
#### 5.1.2 Final Global Model Evaluation  
We present the accuracy and loss trends achieved by the two previously described methods across different numbers of training epochs. The evaluation is carried out after all federated rounds have been completed, where the final global model based on the last aggregated weights is used to test the local data set of each client. This approach ensures that the final performance metrics reflect the model's generalization ability across all participants. Figure 10 illustrates the accuracy history of FL-IVN-IDS-1E, FL-IVN-IDS-5E, FL-based LSTM-1E and LSTM-5E as a function of the number of rounds. We can notice that our proposed FL-IVN-IDS consistently demonstrates faster convergence and superior performance compared to the FL-based LSTM model, in both the one epoch and five epochs settings. However, FL-IVN-IDS-1E exhibits more stable and efficient convergence, whereas the LSTM-1E model shows inconsistent generalization. With five training epochs, both models achieve higher accuracy compared to the one epoch configuration, with our FL-IVN-IDS-5E model reaching 100% accuracy in fewer rounds. Figure 9: Loss Training History of distributed learning for Per-Round Evaluation. Figure 11 shows the loss history of FL-IVN-IDS-1E, FL-IVN-IDS-5E, FL-based LSTM-1E and LSTM-5E in federated learning rounds. We can notice that among all the models evaluated, FL-IVN-IDS-5E consistently achieves the lowest loss, indicating superior convergence and training stability in multiple rounds. When trained with only one epoch, FL-IVN-IDS-1E initially records a global loss of 1.206%; however, FL-IVN-IDS-1E demonstrates less loss reduction and better convergence than FL-based LSTM-1E which the last obtained 5.43%. With five training epochs, both models show improved performance, but FL-IVN-IDS-5E significantly outperforms LSTM-5E, achieving a minimal global loss of 0.095%, compared to 0.0085% for LSTM-5E. This improvement is attributed to the additional optimization iterations available in multi epoch training, which allow the model to better adjust its parameters and minimize the loss. In general, the consistently decreasing loss in FL-IVN-IDS-5E suggests effective learning without overfitting, while LSTM-5E exhibits unstable training behavior and poor convergence. Tables 6-9 present the classifying performance of all the models in FL, i.e., Precision, Recall, F1-Score, and the test sample number (Support). * The comparison between FL-based LSTM and FL-IVN-IDS across one and five training epochs highlights the consistent superiority of the FL-IVN-IDS model. After a single epoch, FL-IVN-IDS-1E achieves an accuracy of 99.73% with perfect F1-scores across  
Figure 11: Loss Training History of distributed learning for Final Global Model Evaluation. Figure 10: Accuracy Training History of Distributed Learning for Final Global Model Evaluation. all classes, outperforming FL-based LSTM-1E, which records 98.15% accuracy and slightly lower F1-scores for some classes (e.g., 0.96). * As previously explained, with five epochs of training, both models show improved performance, but FL-IVN-IDS-5E reaches 100% accuracy, compared to 99.96% for LSTM-5E. The output indicates that increased epochs of training yield better performance, but FL-IVN-IDS beats FL-based LSTM across all scores both when epochs are increased and when not. Figures 12 and 13 show the Confusion Matrix (CM) and Receiver Operating Characteristic (ROC) curve of our FL-IVN-IDS-5E model, clearly illustrating its exceptional classification performance on all four classes: Normal, Flooding, Fuzzy, and Malfunction. By evaluating the final global model obtained after all FL rounds we observe excellent results across all metrics, indicating that our approach successfully aggregated high-quality local models into a highly accurate global model. * The confusion matrix (CM) reflects the relationship between True Positives (TP), True Negatives (TN), False Positives (FP), and False Negatives (FN) of FL-IVN-IDS-5E and LSTM-5E models.