# CrowdPower: A Novel Crowdsensing-as-a-Service Platform for Real-Time Incident Reporting
## 5 Empirical Evaluation
### Evaluation of the Participant Selection Model
To analyze the quality of sensory data, we consider eight participants sending the temperature measured by their phone sensors to the CrowdPower platform in ten time slots ki. We used synthetic data to evaluate our model and analyze its validity. The data are randomly generated and are shown in Table 7. The average expected sensory data to be received was assumed to be about 46\({}^{\circ}\), but our data were adjusted so that the data of four random participants were randomly generated between 46\({}^{\circ}\)\(\pm\) 15\({}^{\circ}\). The empty cells indicate that the phones did not send in data, or the data did not reach the server in that time slot. To preprocess the data sent by each participant, we normalized it by either forward filling or backward filling the data, considering the mean of the distribution in each time slot, and the result is shown in Table 8. From a visible evaluation of the normalized data in the tables, we see that values of participants four and five are comparatively high, while the values of participants two and seven fluctuate widely. We aim to determine if our model described earlier would calculate the data quality as previously assumed, which would then contribute to calculating the reputation of participants and estimating any possible malicious intents. The Python code snippets, shown previously, describe how our model was implemented for calculating quality and determining the reputations, respectively (Box 1 and Box 2). \begin{table}
\begin{tabular}{c c c c c c c c} \hline  & **1** & **2** & **3** & **4** & **5** & **6** & **7** & **8** \\ \hline
**k1** & 47.5 & 40 & & & 42.5 & & 22 & 44 \\ \hline
**k2** & 48 & 39.3 & 44 & 67 & 57.6 & 46.2 & & 44 \\ \hline
**k3** & 45 & 23 & 43 & 44 & 58.6 & 45 & 23 & 45 \\ \hline
**k4** & 46 & 41.5 & & 67 & 56.5 & & 47 & 45 \\ \hline
**k5** & 47.4 & & 45 & 67 & 65.5 & 47.5 & 48 & \\ \hline
**k6** & & & & 44 & 56.6 & 45 & 48.6 & \\ \hline
**k7** & 48.2 & 49 & 47 & 67.1 & 56.3 & 45 & 33 & 48 \\ \hline
**k8** & & 39.2 & 49 & 44 & 54.2 & 46 & 46 & 48 \\ \hline
**k9** & 45.1 & 40.1 & 49 & 67 & & 45 & 23 & \\ \hline
**k10** & 48 & 51 & 50 & 67.1 & & & 45 & 48 \\ \hline \end{tabular}
\end{table} 
Table 7: Sample temperature from 8 phones in time slots k1 to k10. Figure 24 depicts the average quality of the temperatures provided by the participants in the sensing campaign. It is evident that our quality measurements can capture the inconsistencies in the data as we predicted. From the graphs, it is clear that the data provided by participants 2, 4, 5, and 7 are definitely of lower quality. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline  & **1** & **2** & **3** & **4** & **5** & **6** & **7** & **8** \\ \hline
**k1** & 47.5 & 40 & 46.7 & 59.3 & 42.5 & 45.7 & 22 & 44 \\ \hline
**k2** & 48 & 39.3 & 44 & 67 & 57.6 & 46.2 & 37.3 & 44 \\ \hline
**k3** & 45 & 23 & 43 & 44 & 58.6 & 45 & 23 & 45 \\ \hline
**k4** & 46 & 41.5 & 46.7 & 67 & 56.5 & 45.7 & 47 & 45 \\ \hline
**k5** & 47.4 & 39.3 & 45 & 67 & 65.5 & 47.5 & 48 & 46 \\ \hline
**k6** & 46.9 & 39.3 & 46.7 & 44 & 56.6 & 45 & 48.6 & 46 \\ \hline
**k7** & 48.2 & 40 & 47 & 67.1 & 56.3 & 45 & 33 & 48 \\ \hline
**k8** & 46.9 & 39.2 & 49 & 44 & 54.2 & 46 & 46 & 48 \\ \hline
**k9** & 45.1 & 40.1 & 49 & 67 & 56 & 45 & 23 & 46 \\ \hline
**k10** & 48 & 51 & 50 & 67.1 & 55.9 & 45.6 & 45 & 48 \\ \hline \end{tabular}
\begin{tabular}{l} [.] \\ \# _Convergence of the loop is when two consecutive quality estimation is below a threshold value_ \\ while sum(qikold - qik <= threshold)!= n: \\ ck = data[i][np.argmin(((ck - data[i])*2)?qik)] \# _Recalculating the centroid_ \\ dik = ((ck - data[i]) **2) \# _Calculate weighted squared distance between ck and data_ \\ lamda = sum(dik) \# _Sum of total errors_ \\ qik = (1/((dik/lamda)+e))/sum((1/(dik/lamda)+e))) \# _Quality output_ \\ qikold = qik \\ output[i] = qik \\ \end{tabular}
\end{table} 
Table 8: Sample temperature from 8 phones in time slots k1 to k10. Figure 24: Average quality of temperature sensed from eight participants.