# CrowdPower: A Novel Crowdsensing-as-a-Service Platform for Real-Time Incident Reporting
## 3 System Architecture and Design
### Benchmarking Sensors
While CrowdPower makes extensive use of the Sensor API, by itself, it does not provide access to all the sensors given in Table 4. This is because the Android OS has organized and divided its API. The 'Image/Video' and 'GPS' have their APIs, respectively. The application must collect data from these different APIs and combine them in a common format that is understood by the backend server. The backend provides a REST API that the application uses to upload sensor data over a network connection. Depending on the sensor type, there are two different end points to upload data. One is used for 'voluntary request,' and the other is for 'incidents.' The application converts the sensor data into JSON format. Sensors' quality benchmarking aims at comparing the quality of different brands of sensors of the same type (e.g., accelerometer sensors in different phones) to score their quality relative to each other. This enables the consideration of sensors' quality in participants' selection and recruitment for sensing tasks based on the quality level required. To benchmark a sensor, an initialization process is required. This process must be performed at least once per device before testing sensors. During initialization, the sensor is activated, and the device is moved for ten seconds, ideally in different directions and at different \begin{table}
\begin{tabular}{c c c} \hline \hline
**Name** & **Sensor Type** & **Description** \\ \hline
**Light** & Environmental & Ambient light level in SI lux units \\
**Accelerometer** & Motion & Measures the acceleration applied to the device \\
**Temperature** & Environmental & Ambient (room) temperature in degrees Celsius. \\
**Proximity** & Positional & Proximity sensor distance measured in centimeters \\
**GPS** & Positional & Detects the location of the mobile device in lat/long \\
**Video** & Environmental & Records a video feed from the camera \\
**Bazrometer** & Environmental & Atmospheric pressure in hPa (millibar) \\
**Gyroscope** & Motion & Measures angular speed around each axis \\
**Magnetic Field** & Positional & Measures the ambient magnetic field in micro-Tesla (uT) \\
**Linear Acceleration** & Motion & Records a three-dimensional vector indicating acceleration along each device axis \\
**Step Detector** & Motion & Detects when the user takes a step \\
**Step Counter** & Motion & Counts the total number of steps that the user has taken since the sensor was activated \\
**Image** & Environmental & Captures an image from the camera \\
**Gravity** & Motion & A three-dimensional vector indicating the direction and magnitude of gravity \\ \hline \hline \end{tabular}
\end{table} 
Table 4: CrowdPower supported sensors. movements speeds. At the end of initialization, the mean and standard deviation are calculated for each sensor axis (x, y and z) and the timestamps of the measured values per sensor. Following initialization, the sensor benchmark is performed based on six categories/metrics, according to the SensMark approach [39]. Each metric gives a partial score, and the final sensor score is the summation of all these partial scores. Certain metrics are applied to all sensors, whereas others are specific to certain sensors. If a metric is not valid for a sensor, it will simply have a score of 0. These metrics are the number of events, standard deviation, step increment, time continuity, count of unique values, and gravity accuracy. The number of events is the number of returned events during the benchmarking process. This will vary depending on the device and how long the sensor events are collected. Standard deviation is calculated for measured values across each sensor axis. To determine the score, a constant c with the fixed value 33 is divided by the standard deviation for each sensor axis. These partial results are added and finally divided by the number of axes, according to Equation (1), where '\(\sigma\)' is the standard deviation, '\(c\)' is the fixed constant value, and '\(a\)' is the number of axis for the sensor.