# Distributed Reputation for Accurate Vehicle Misbehavior Reporting (DRAMBR)
## 5 DRAMBR Technical Implementation
### DRAMBR: Online Reporting
The posterior probability that \(\mathbf{x}\) belongs to component \(k\) is given by \[\gamma_{k}(\mathbf{x})=\frac{\pi_{k}\mathcal{N}(\mathbf{x}\mid\boldsymbol{\mu }_{k},\boldsymbol{\Sigma}_{k})}{\sum_{j=1}^{K}\pi_{j}\mathcal{N}(\mathbf{x} \mid\boldsymbol{\mu}_{j},\boldsymbol{\Sigma}_{j})}.\] (18)  
_Clustering Decision_  
* \(k=1\): Honest \(Rep_{\mathbf{vehs}}\). * \(k=2\): Malicious \(Rep_{\mathbf{vehs}}\). * \(k=3\): Erroneous\(Rep_{\mathbf{vehs}}\). Output: Labels for \(Rep_{\mathbf{vehs}}\): Honest, Malicious, Erroneous. 6. **Ensemble Random Forest and XGBoost** We use the Random Forest and XGBoost [38; 39] to refine the classification of MRs. These steps process the features generated during the earlier stages to provide a binary classification of MRs.  
_Previous Steps_  
* DBSCAN: Set the ground truth for the actual event and clusters of MRs based on spatial and temporal proximity. * Isolation Forest (iForest): iForest isolates potential anomalies within the identified clusters and flags suspicious reports. * GMM: Models the distribution probability of misbehavior, separating normal and abnormal patterns. These steps then provide the input feature set for this step, defined as  
\[R_{I_{\text{inc}}}=\{MR_{i}\mid I_{i}=I_{\text{inc}}\}\]0  
where: \(s(\mathbf{x},n)\): Relationships between the data points (e.g., report similarity). _Classification Models_  
* Random Forest: Random Forest aggregates predictions from multiple decision trees. Each tree \(T_{i}\) independently classifies the data, and the final decision is made via a majority vote: \[R_{I_{\text{inc}}}=\{MR_{i}\mid I_{i}=I_{\text{inc}}\}\]1 (20)
* XGBoost: XGBoost minimizes a custom loss function: \[R_{I_{\text{inc}}}=\{MR_{i}\mid I_{i}=I_{\text{inc}}\}\]2 (21) where the following:\(l(y_{i},\dot{y}_{i})\): Loss function (e.g., log loss) comparing predictions \(\dot{y}_{i}\) with actual labels \(y_{i}\);
* \(\Omega(f)\): Regularization term penalizing overly complex models, improving generalization. * Combined Prediction: Predictions from both models are combined using a weighted average: \[R_{I_{\text{inc}}}=\{MR_{i}\mid I_{i}=I_{\text{inc}}\}\]3 (22) where \(w_{\text{RF}}\) and \(w_{\text{XGB}}\) are the respective weights for Random Forest and XGBoost. Output: In this step, the final decision for each MR will be one of the following:
* Honest: The MR is correct, reflecting an honest behavior of the \(Rep_{\text{Veh}}\) and true \(Tar_{\text{Veh}}\) misbehavior. * Malicious: The MR is false, generated and submitted intentionally, reflecting malicious behavior of the \(Rep_{\text{Veh}}\) and false \(Tar_{\text{Veh}}\) misbehavior. * Erroneous: The \(MR_{f}\) is wrong because of mistakes in the \(Rep_{\text{Veh}}\) system. * **RV Update** Weighted Increment/Decrement Based on Decision. For each \(Rep_{vch(i)}\), update the \(RV_{i}\): \[RV_{Vi}^{\text{new}}= \begin{cases}RV_{Vi}+\Delta_{\text{pos}}&\text{if Honest }Rep_{\text{Veh}}\text{ (True Positive)},\\ RV_{Vi}-\Delta_{\text{neg}}&\text{if Malicious }Rep_{\text{Veh}},\\ RV_{Vi}&\text{if Erroneous Report}.\end{cases} \] (23) where \(\Delta_{\text{pos}}\) and \(\Delta_{\text{neg}}\) are predefined step sizes.