# User Mobility Modeling in Crowdsourcing Application to Prevent Inference Attacks
## 4 Proposed Approach
### Data Preprocessing  
In crowdsourcing architecture, the worker must continuously share his/her location, allowing the platform to collect raw coordinates (latitude and longitude) and compare them with the requester's position when assigning tasks. However, when the worker accepts a task posted by a requester, the collected physical address provides a more precise position. We assume here the case where the worker continuously shares his/her location to improve data quality. The data preprocessing phase is essential for the development of our mobility model. It involves cleaning, structuring, and enriching raw location data to facilitate subsequent analysis, POI identification, and modeling. This phase ensures that the data are in a suitable format for further processing, leading to more accurate and meaningful insights. As shown in Figure 3, several intermediate steps for the preprocessing of user coordinates are adopted:  
* Noise reduction: A filtering is applied to the coordinates in order to reduce impulsive noise. This filtering consists of replacing each data point with the median of a set of neighboring points in a sliding window. This makes the data smoother and eliminates outliers without over-smoothing important details. In our study, we apply the Median filtering computed as follows: \[\text{filtered\_coordinate}[i]=\text{median}(\text{window}(\text{coordinates}[i-\frac{w}{2}:i+\frac{w}{2}]))\] where \(w\) is the size of the sliding window. This formula indicates that for each coordinate at position \(i\), the filtered coordinate is obtained by taking the median of the coordinates within the window centered around \(i\). * Metadata Extraction: For each coordinate, metadata are retrieved using an external API (Google Maps, OpenStreeMap, Salesforce Map, etc.). These metadata provide context to the coordinates, including details such as place names, addresses, categories (e.g., restaurant, park, store), etc. * Unimportant Location Removal: Not all locations recorded in the raw data are significant for the analysis. This step filters out locations that are deemed unimportant or irrelevant to the study. Predefined criteria are applied to identify and remove locations that do not contribute meaningful information. These criteria could include factors such as visit duration, location type, or frequency of visits. By removing these unimportant locations, the dataset becomes more focused and manageable. * Check Redundant Data: Duplicate entries can skew the analysis and lead to incorrect conclusions. This step ensures that redundant data points are identified and consolidated. Each location point is compared with the previous ones to detect duplicates. If a location point has the same metadata as a previous entry, it is considered a duplicate and is either merged with the existing entry or removed. This reduces redundancy and ensures that each location is unique in the graph. * Short Stays Removal: Short stays at locations often represent transient activities that are not significant for mobility modeling. This step filters out such short stays to focus on more meaningful visits. The duration of each stay at a location is examined. If the stay duration falls below a certain threshold, the location is removed from the dataset. This helps in focusing on locations where users spend significant amounts of time, which are more relevant for understanding mobility patterns. The pseudo-code of our preprocessing is provided in Algorithm 1. To illustrate it, Table 3 provides an example of input coordinates. This table includes a series of coordinates with their respective timestamps, representing raw location data that will be processed by the algorithm. The algorithm performs several key preprocessing steps. First, in line 7, median filtering (ApplyMedianFilter ) is applied to the list of locations \(L\) to reduce impulsive noise, ensuring that the data are smoothed without losing important details.