# Effective Privacy-Preserving Collection of Health Data from a User's Wearable Device
## 4 Proposed Method
### Wearable Device Processing
Here, each linear line segment (represented by an orange line) is obtained by connecting two adjacent salient data. In the second step (lines 20-24), the algorithm compares the estimated error incurred by using LDP with \(FS_{cur}\) to the one with \(FS_{best}\). If \(err\) is less than \(err_{best}\), the best salient data set is updated with \(FS_{cur}\). The algorithm iteratively repeats this process until the number of salient data in \(FS_{cur}\) reaches the predefined \(\alpha\) (line 6), which implies that the number of salient data in the best salient data set \(FS_{best}\) is no greater than \(\alpha\). We now explain the function \(EstimateError\_by\_LDP()\) that estimates the error induced by the perturbation step of LDP (Algorithm 2). Algorithm 2 accepts the health data, \(S_{i}\), and the salient data set, \(FS\), as its input. In line 2, the algorithm generates \(\beta\) random noises sampled from a Laplace distribution with mean \(\mu=0\) and scale \(sf=\frac{\Delta s}{\epsilon/m}\), where \(\Delta s\) is the local sensitivity explained in Section 3.3, \(m\) is the number of salient data in \(FS\), and \(\beta\) is a predefined parameter. Then, in line 3, \(v_{noise}\) is computed by averaging the \(\beta\) random noises generated in the previous step. In the next steps, the noised salient data set \(FS_{noise}\) is generated by adding \(v_{noise}\) to each salient data in \(FS\) (line 4-7). Then, in line 8, the algorithm computes the nonlinear curve that best expresses the salient data in \(FS_{noise}\) by using polynomial regression. Finally, the distance (i.e., error) between the original health data \(S_{i}\) and the nonlinear curve obtained in the previous step is computed. For example, Figure 3 illustrates the method to compute the estimated error by the function EstimateError_by_LDP(). The original health data (i.e., \(S_{i}\)) is represented by the blue curve and each salient data in \(FS\) is represented by the red circle (Figure 3a). Here, the x-axis corresponds to the timestamps (i.e., \(t_{1},t_{2},\cdots,t_{n}\) of \(S_{i}\)) and the y-axis represents the values (i.e., \(x_{1},x_{2},\cdots,x_{n}\) of \(S_{i}\)). In Figure 3b, each noised salient datum, represented by the green circle, is obtained by adding \(v_{noise}\) to each salient data. Then, in Figure 3c, by using polynomial regression which finds the best-fitting curve by minimizing the sum of the deviations from each given data point (i.e., each green circle in this example) to the curve, the nonlinear curve (represented by the green curve) is computed. We also note that the best-fitting curve computed by using polynomial regression does not need to pass through existing given data points. Finally, the distance between the original health data and the best-fitting curve is computed in Figure 3d. ```
input:\(S_{i}=\left((t_{1},x_{1}),(t_{2},x_{2}),\cdots,(t_{n},x_{n})\right)\), \(FS\)
1\(m\leftarrow|FS|\);
2\(r_{1},r_{2},\cdots,r_{\beta}\leftarrow\) generate \(\beta\) random number \(\sim Lap(\frac{\Delta s}{\epsilon/m})\);
3\(v_{noise}\leftarrow\frac{1}{\beta}\times\sum_{h=1}^{\beta}r_{h}\);
4\(FS_{noise}\leftarrow\emptyset\);
5 foreach\((t_{f_{k}},x_{f_{k}})\in FS\)do
6\(FS_{noise}\gets FS_{noise}\cup(t_{f_{k}},x_{f_{k}}+v_{noise})\);
7
8 end fore
9\(p\leftarrow\) PolynomialRegression\((FS_{noise})\);
10\(dist\leftarrow\) ComputeDistance\((S_{i},p)\);
11 returndist
```  
**Algorithm 2**EstimateError_by_LDP()  
Figure 2: Example of computing the distance between the original health data and the salient data set. Once the salient data set is identified from the health data, the next step entails reporting the perturbed set to the data collection server under LDP. Let \(FS_{i}=\{(t_{f_{1}},x_{f_{1}}),(t_{f_{2}},x_{f_{2}})\cdots(t_{f_{m}},x_{f_{m}})\}\) be the salient data set, which consists of \(m\) salient data, extracted from \(S_{i}\), as explained in the previous phase.