## 3 Proposed Framework (Fed-DTB)
### Federated Learning Algorithm  
The federated learning algorithm enables selected vehicles to train a global model together without compromising their local data. It builds upon the FedAvg algorithm [47] with security and efficiency improvements for IoV networks.  
Algorithm 3 takes as input the set of selected vehicles \(V_{s}\), the current global model \(GM(t)\), the local datasets \(\{D_{i}\}\), the trust scores \(\{\tau_{i}(t)\}\) at the current time step \(t\), the learning rate \(\eta\), the number of local training epochs \(E\), and the privacy parameters \(\epsilon\) and \(\delta\). It ensures that each step is performed securely and efficiently, as described below:  
```
1:Selected vehicles \(V_{s}\), global model \(GM(t)\), local datasets \(\{D_{i}\}\), trust scores \(\{\tau_{i}(t)\}\), learning rate \(\eta\), number of local epochs \(E\), privacy parameters \(\epsilon,\delta\)
2:Updated global model \(GM(t+1)\)
3:for each vehicle \(v_{i}\in V_{s}\)do
4: Train local model \(LM_{i}(t)=\text{LocalTraining}(GM(t),D_{i},E)\)
5: Compute local model update \(\Delta LM_{i}(t)=LM_{i}(t)-GM(t)\)
6: Apply differential privacy \(\Delta LM_{i}(t)^{DP}=\text{ApplyDifferentialPrivacy}(\Delta LM_{i}(t), \epsilon,\delta)\)
7: Send \(\Delta LM_{i}(t)^{DP}\) to the central server
8:endfor
9:Server performs secure aggregation of differentially private updates
10:\(GM(t+1)=GM(t)+\eta\cdot\text{WeightedAverage}(\Delta LM_{i}(t)^{DP},\{\tau_{i}(t)\})\)
11:return\(GM(t+1)\)
```  
**Algorithm 3** Federated Learning Algorithm  
Each selected vehicle \(v_{i}\) uses its local data \(D_{i}\) to train a local model \(LM_{i}(t)\), starting from the current global model \(GM(t)\). The training is performed for \(E\) epochs. The local model update \(\Delta LM_{i}(t)\) is computed as the difference between the local model \(LM_{i}(t)\) and the global model \(GM(t)\). To ensure privacy, differential privacy is applied to the local model update \(\Delta LM_{i}(t)\). This involves adding noise to the update using the privacy parameters \(\epsilon\) and \(\delta\), resulting in \(\Delta LM_{i}(t)^{DP}\). This step masks individual contributions and ensures that the model update does not reveal sensitive information about the local data.  
The differentially private model updates \(\Delta LM_{i}(t)^{DP}\) from all selected vehicles and sends them to the central server. The server aggregates these updates securely to compute an overall model update. This step ensures that the individual updates remain private and are only combined in an aggregated form. The global model \(GM(t+1)\) is updated by adding the weighted average of the differentially private model updates. The weights are the trust scores \(\{\tau_{i}(t)\}\) of the respective vehicles. This weighted update ensures that more trustworthy vehicles have a greater influence on the global model, improving its overall quality and robustness. The updated global model \(GM(t+1)\) is returned as the final output of the algorithm.  
This approach improves security and efficiency by incorporating trust scores in the global model update, adding differential privacy to local updates, and using secure aggregation to protect individual vehicles' data privacy [5]. It is important to note that privacy mechanisms (such as differential privacy) are applied exclusively to protect communication integrity and model confidentiality. They are not involved in the trust evaluation process. This modularity ensures that the trust computation remains unaffected by noise injection, maintaining the accuracy and interpretability of reliability assessments. The Fed-DTB offers a comprehensive solution for secure and efficient FL in IoV networks, capable of detecting and eliminating malicious or low-quality participants while allowing legitimate vehicles to contribute to the shared global model without compromising sensitive information.