# Recommendation-Based Trust Evaluation Model for the Internet of Underwater Things
## 5 Recommendation Evaluation Process
### Initial Filtering Process  
In this work, we introduce a two-step filtering process that integrates the majority rules approach with the deviation technique to ensure thorough scrutiny of recommenders before subjecting them to a penalty process. The output of this process involves recommenders that deviate significantly from a given trust score, \(T_{ij}(t)\), and also appear as outliers when compared to other recommendations received.  
We first examined two methods of outlier detection: a simple method based on Median Absolute Deviation (MAD) and a more sophisticated yet computationally intensive method such as Local Outlier Factor (LOF) [34]. Upon isolating \(S_{1j}\), which includes potential outliers, each element within this list is compared against personal experience through the divination test on \(S_{2j}\). A noteworthy issue arises when \(T_{ij(t-e)}\) becomes outdated due to an extended period since the last valid interaction between nodes \(i\) and \(j\). This outdated value fails to provide a reliable baseline for testing deviation. To address this, we propose a deviation test that includes the temporal decay of trust, defined as follows:  
\[|T_{ij(t-e)}-T_{kj}|(1-d)\leq d_{h}, \tag{2}\]  
where \(T_{ij(t-e)}\) denotes the trust score stored by node \(i\) regarding node \(j\) at a previous time instance \((t-e)\), and \(T_{kj}\) denotes the trust recommendation received from node \(k\). The variable \(d\) is the decay factor, with more recent \(T_{ij}\) values resulting in a lower \(d\) compared to older values.  
Both outlier detection methods exhibit satisfactory accuracy, with the MAD method achieving approximately 90.59% accuracy and the LOF method achieving 92.5% accuracy when tested over 100 trials of dishonest recommendations. The selection of the appropriate outlier detection method is highly contingent upon the computational complexity requirements of the specific application in which it is deployed.  
We estimate the computational complexity of each method by first applying the outlier detection mechanism followed by the deviation test (as \(O\to D\)) as follows. Let \(n\) denote the size of the recommendation set \(|R|\), and let \(m\) denote the size of the filtered recommendation set \(|R^{\prime}|\), where \(m\leq n\). The computational complexity of the MAD method is estimated to be \(O(n\log n)\), whereas the complexity of the LOF method is approximately \(O(n^{2}\log n)\)[35]. In the proposed filtering approach, the overall computational complexity is estimated to be \(O(m)+O(n\log n)\) for MAD, or \(O(m)+O(n^{2}\log n)\) for LOF. For the remainder of the paper, we employed initial filtering using the MAD due to its simplicity (isOutlier).  
Following this, we initiate a monitoring system where each node's frequency of appearing as in \(S_{2j}\) is tracked. A counter is set up for each node to record the number of times it appears on the outlier list. If a node's appearance as a \(2_{j}\) exceeds a predefined threshold, indicative of consistently poor or suspicious recommending behaviour, a penalty is then applied to its trust score, \(T_{ki}(t)\), as outlined in Section 5.4. Algorithm 1 outlines the process of the algorithm.  
```
0: List of Received Recommendations \(R_{j}=\{T_{k_{1}j},T_{k_{2}j},\ldots,T_{k_{nj}}\}\)
0:\(d_{h}\) (Trust deviation threshold)
0:\(v_{h}\) (violation threshold)
1: Initialize evidence collection variable
2:for Each \(T_{kj(t)}\) in \(R_{j}(t)\)do
3:if\(T_{kj(t)}\) isOutlierthen
4:\(S_{1j}=S_{1j}\cup\{k_{m}\}\)
5:endif
6:endfor
7:for Each \(T_{kj}\) in \(S_{1j}\)do
8:if\(|T_{ij(t)}-T_{kj(t)}|(1-d)>d_{h}\)then
9:\(S_{2j}=S_{2j}\cup\{k_{j}\}\)
10: Initiate counter \(c_{k}(t)\) and increment by one.
11:if\(c_{k}\geq v_{h}\) AND \(B_{ij\gets k}(t)<Average(B_{ij\gets k^{\prime}}(t))\)then
12: penalty on \(T_{ki}\), based on Equation (11)
13:endif
14:endif
15:endfor
16:Evaluates the Belief Process \((B_{ij\gets k}(t))\).
```  
**Algorithm 1** Recommendation Evaluation Process