# User Mobility Modeling in Crowdsourcing Application to Prevent Inference Attacks
## 4 Proposed Approach
### POI Extraction
#### 4.5.2 Building Our Bayesian Network  
The structure of our Bayesian network, depicted in Figure 5, is designed to encapsulate and analyze user movement nuances from historical location data. It incorporates five variables: Day Index, Time Index, Category of Place, Visit Frequency, and Stay Duration. The first two variables are crucial to reveal patterns in the frequency and timing of visits. They allow the network to discern daily and hourly trends, impacting where and when visits occur. The Day Index (represents the day of the week) can have values of 1, 2, or 3, respectively representing the following: daily distinctions, week weekend holiday categorizations, or no specific day distinction--with the number of possible values varying according to the level of distinction (seven for daily and three for grouped days). Time Index (represents the time of day) partitions the day into equal intervals such that a specific time like 08:31 would fall into a predetermined time slot, such as the fourth interval in a system where each interval spans two hours. We retrieve the Day Index and the Time Index into the vector \(W\). These correspond to \(td\) and \(ts\), respectively. The variable Category of Place classifies locations into types such as restaurants, parks, or offices, evaluating their potential as POIs. The Visit Frequency measures how often a user returns to a particular location, providing insights into user preferences and routines, while Stay Duration gauges the length of each visit, offering clues about the site's appeal or significance. Figure 5: Influence diagram. To categorize visit frequencies and average stay durations in \(G\), we utilize Algorithm 3. This algorithm categorizes locations according to visit frequencies and stay durations within a user's historical location graph \(G\). We specify the number of categories \(k\), such as three for low, medium, and high. In line 1, the input graph \(G\) is defined. In line 2, the number of categories \(k\) is set. The algorithm initializes dictionaries \(F\) and \(S\) to store visit frequencies and stay durations for each vertex (line 3). It iterates through each vertex \(v\) in the graph's set of vertices \(\mathcal{V}\) (line 4). For each weight tuple \(\langle ts,td,fs,st\rangle\), the visit frequency \(fs\) and stay duration \(st\) are added to the dictionaries \(F\) and \(S\) for the vertex \(v\) (lines 7-9). After processing all vertices and edges, the algorithm computes quantiles for visit frequencies \(Q_{f}\) and stay durations \(Q_{s}\) using the function computeQuantiles (lines 10-11). It then iterates through each vertex \(v\) again (line 12) and each edge \(e\) where \(v\) is the source node (line 13). The weights for each edge are retrieved again (line 14). For each weight tuple, the algorithm determines the quantile category for the visit frequency and stay duration using getQuantileCategory (lines 15-16). Finally, the weight tuples are updated with these categories (line 17). The result is a categorized representation of locations based on visit frequencies and stay durations.