# A Novel Multi-Server Federated Learning Framework in Vehicular Edge Computing
## 4 Proposed MS-FL Framework
### Inter-Server Model Aggregation
Algorithm 1, termed Sequential Aggregation (SA), describes how a server incrementally incorporates peer model updates in a time step t. In this algorithm, the server evaluates the baseline accuracy of its model using the function GetAccuracy (line 2). Then, it computes a candidate-updated model using (2) (line 3). The candidate model's accuracy is evaluated (line 4); if the new accuracy exceeds the baseline, the server adopts the candidate update; otherwise, it retains its current model (lines 5-7). This process is repeated sequentially for models from different peer servers. When a server receives multiple updates at once, it applies them in ascending order of \(\lambda\). Starting with low-\(\lambda\) updates ensures that models trained on smaller samples can still contribute; if high-\(\lambda\) updates (those based on larger datasets) are applied first, subsequent low-\(\lambda\) updates may no longer improve the model. * Binary Aggregation (BA)  
In the Binary Aggregation approach, each server first evaluates both its own model and the models received from peer servers using its validation dataset. The evaluation metric (e.g., accuracy) is computed for each model using (1), and the model achieving the highest performance is selected. This best-performing model is then disseminated to the server's clients for local training. This approach ensures that each server adopts the model that demonstrates the best performance on its validation set at each training round. * Dynamic Weighted Averaging Aggregation (DWAA)  
In Dynamic Weighted Averaging Aggregation, similar to SA and BA, each server first evaluates its own model and the models received from peer servers using its validation dataset. For each model, the server computes the accuracy by comparing the model's predictions with the true labels in the validation dataset. These accuracy values are then normalized to compute weights for each model, as follows:  
\[\gamma_{\text{s}}=\frac{\text{A}_{\text{s}}}{\sum_{\text{j=1}}^{\text{N}}\text {A}_{\text{j}}}, \tag{4}\]  
where \(\text{A}_{\text{s}}\) is the accuracy of model \(\text{w}^{(\text{s})}\). These weights \(\gamma_{\text{s}}\) reflect the relative performance of each model on the validation dataset. The server then updates its model as a weighted linear combination of all models, with each model weighted according to its respective accuracy using (5). \[\text{w}^{(\text{s})}(\text{t})\leftarrow\sum_{\text{s=1}}^{\text{N}}\gamma_{ \text{s}}\text{w}^{(\text{s})}(\text{t}). \tag{5}\]  
This method ensures that models with higher accuracy on the validation dataset contribute more to the server model, while lower-performing models have less influence. By dynamically adjusting the contribution of each model, this approach aims to optimize the aggregation process and improve the overall model performance. * Statistical Performance-Aware Aggregation (SPAA)  
In this method, each server evaluates both its own model and the models received from peer servers, using a Negative Log Likelihood Loss (NLLLoss) performance metric. The NLLLoss is calculated over the validation dataset available at each server and serves as the key criterion for assessing model performance. This approach prioritizes modelsthat produce high-confidence predictions for the correct classes, resulting in lower loss values \(L_{\rm s}\). For each batch of validation data, the NLLLoss is computed and accumulated to track the overall loss across the entire validation dataset. The total loss is then normalized by the number of samples to calculate the average validation loss for each model. The average validation loss is used to determine how much each model contributes to the final aggregated model at each server. Models with lower validation loss are assigned higher weights in the aggregation process, while those with higher validation loss are penalized using statistical weighting. This penalization helps to minimize the impact of poorly performing models in the aggregation process.