Full text
Membership Inference Attacks to Trajectory-Generative models Bachelor Thesis submitted to the Faculty of the Escola T` ecnica d’Enginyeria de Telecomunicaci´ o de Barcelona Universitat Polit` ecnica de Catalunya by Pol Irurre Mart ´ ınez In partial fulfillment of the requirements for the Bachelor’s degree in Telecommunications Technologies and Services Engineering Supervised by Javier Parra-Arnau, Jordi Forn´e and V´ıctor Rubio Barcelona, 06/2024
Contents List of Figures 3 List of Tables 4 List of Acronyms 5 Abstract 6 1 Introduction 7 1.1 Objectives............................... 8 1.2 Content ................................ 8 2 Background 9 2.1 Differential privacy on deep learning model . . . . . . . . . . . . 9 2.2 Synthetic trajectory generation with deep learning . . . . . . . . 9 2.3 Membership inference attack . . . . . . . . . . . . . . . . . . . . 11 2.3.1 Adversarial knowledge . . . . . . . . . . . . . . . . . . . . 11 2.3.2 Approach level . . . . . . . . . . . . . . . . . . . . . . . . 13 2.3.3 Algorithm level . . . . . . . . . . . . . . . . . . . . . . . . 14 2.3.4 Domainlevel ......................... 15 2.3.5 Training and validation loss in ML models . . . . . . . . . 15 2.3.6 MIA code implementations . . . . . . . . . . . . . . . . . 16 2.4 Kullback–Leibler and Jensen–Shannon . . . . . . . . . . . . . . . 17 2.5 Dimensionality reduction . . . . . . . . . . . . . . . . . . . . . . 17 2.6 K-Nearest neighbour . . . . . . . . . . . . . . . . . . . . . . . . . 18 2.7 Support vector machine . . . . . . . . . . . . . . . . . . . . . . . 19 2.8 Randomforest ............................ 20 3 State of the Art 21 4 RouteMIA 23 4.1 Dimensionality Reduction . . . . . . . . . . . . . . . . . . . . . . 23 4.2 Nearest neighbours . . . . . . . . . . . . . . . . . . . . . . . . . . 24 4.3 Classifier................................ 24 4.3.1 SVM binary classifier . . . . . . . . . . . . . . . . . . . . 25 4.3.2 RandomForest........................ 25 4.3.3 MinMax ........................... 26 5 Evaluation and Results 27 5.1 Datasets................................ 27 5.2 Metrics ................................ 27 5.3 Working environment . . . . . . . . . . . . . . . . . . . . . . . . 28 5.4 Evaluationmethod.......................... 28 5.5 Results................................. 29 1
6 Conclusions and Future Work 34 7 Sustainability and ethics analysis 35 7.1 Introduction.............................. 35 7.2 Sustainability matrix . . . . . . . . . . . . . . . . . . . . . . . . . 35 7.3 Sustainability matrix . . . . . . . . . . . . . . . . . . . . . . . . . 36 7.3.1 Risks and limitations . . . . . . . . . . . . . . . . . . . . . 37 7.4 Economic perspective . . . . . . . . . . . . . . . . . . . . . . . . 37 7.4.1 Risks and limitations . . . . . . . . . . . . . . . . . . . . . 38 7.5 Socialperspective........................... 38 7.6 Ethical implications . . . . . . . . . . . . . . . . . . . . . . . . . 39 References 42 2
List of Figures 1 Comparison of the original data and synthetic data after PCA, for different ϵvalues ......................... 9 2 Architecture diagram of a Generative adversarial network (GAN) 10 3 Overview of white-box Membership inference attack . . . . . . . 12 4 Overview of black-box Membership inference attack . . . . . . . 12 5 Taxonomy of attack models against GAN. Gen: generator; Dis: discriminator; z: latent code input to Gen. . . . . . . . . . . . . . 13 6 Overview of a MIA targeting a classification GAN by using shadow models. M is member and NM is non-member . . . . . . . . . . . 14 7 Overview of ML model classification for over-fitting and underfitting ................................. 15 8 Overview of KNN solution over a PCA. Red dots represent synthetic trajectories. Green dots represent a queried input . . . . . 19 9 Overview of SVM solutions . . . . . . . . . . . . . . . . . . . . . 19 10 Comparison of Scree graph and 2D-PCA projection for ϵ=20 and Il=0.01 ................................ 24 11 Overview of RBF SVM . . . . . . . . . . . . . . . . . . . . . . . 26 12 ROC AuC comparison for a certain configuration of RBF SVM andRandomForest ......................... 33 13 Comparison of the confusion matrix for 2 classifiers . . . . . . . . 33 3
List of Tables 1 MIA average processing times . . . . . . . . . . . . . . . . . . . . 29 2 RBF SVM performance for different distance metrics . . . . . . . 31 3 Random Forest performance for different epsilon values . . . . . 31 4 RBF-SVM performance for different epsilon values . . . . . . . . 31 5 RBF SVM performance for different dvvalues........... 32 6 Random Forest performance for different dvvalues . . . . . . . . 32 4
List of Acronyms AuC Area under curve. 21 COETC Col·legi Oficial d’Enginyeria de Telecomunicacions de Catalunya. 39 DL Deep learning. 9, 15 DP Differential privacy. 7–9, 21, 27, 34, 35, 37–39 DP-SGD Differentially private stochastic gradient descent. 9 GAN Generative adversarial network. 3, 8–10, 12–14, 17 GDPR General data protection regulation. 35 GPU Graphic processing unit. 28, 37 IDE Integrated development environment. 37 JS divergence Jensen–Shannon divergence. 17 KL divergence Kullback–Leibler divergence. 17 KNN K-Nearest neighbour. 1, 3, 18, 19 LSTM Long short-term memory. 10 MIA Membership inference attack. 1, 3, 6–8, 11–17, 21, 23, 32, 34, 35 ML Machine Learning. 1, 3, 7, 8, 11, 13–15, 17, 21, 34, 35 PCA Principal component analysis. 3, 18, 19, 23, 24 RF Random forest. 1, 20 SISCOM Smart Services for Information Systems and Communication Networks. 36 SVM Support vector machine. 1, 3, 19, 20, 25, 26, 33 VAE Variational autoencoder. 9 5
Abstract Synthetic trajectory generation is crucial in order to study and analyse many fields, such as urban mobility, autonomous driving, mobile communication protocols, computational epidemiology and urban planning. However, this task is complex due to the highly correlated and sequential nature of trajectory data, rendering synthetic data vulnerable to membership inference attacks. Efforts on the field of synthetic trajectory generation have leveraged deep learning models such as ϵ-Differential Privacy MoveSim, which will be put to the test in this project. We take on the role of an ethical security analyst and probe at various ϵ-Differential Privacy solutions for synthetic trajectory generation by developing a black-box type Membership Inference Attack that aims to asses if a datapoint was part of the original dataset and thus bypassing privacy protections. When successfully inferring membership of a queried datapoint we are showcasing that the trajectory generator’s configuration is not robust enough to sustain a membership inference attack. This project develops a Membership inference attack to target synthetic generation trajectories from a statistical approach requiring less computational power than current solutions. 6
1 Introduction Machine Learning (ML) has experienced a usage surge in a wide variety of application domains, these ML models rely on large volumes of training data and computational resources. The privacy concerns arise with the potential risk of leakage of privacy-sensitive information [1]. To counter these risks privacypreserving ML solutions are needed as exposed in Xu et al. [2]. Trajectory is an incredibly sensitive type of data as we can identify users from it [3], and afterwards obtain information about ethnicity, gender identity, sexual orientation or religious beliefs depending on the points the user has visited. Therefore, using trajectory data without any security concern increases the risk of exposing sensitive data of users contained in the database. Trajectories are sequential, high-dimensional, correlated vectors that are also bound to the physical layout. This makes working with this data problematic. Therefore, traditional masking and substitution techniques are difficult to implement without losing much utility [4]. The inception for privacy-protection in trajectories was the development of Machine Learning models that generated synthetic data such as [5], [6]. Synthetic data retains similar statistical properties to the real users which can help masking privacy features but fall short against certain attacks as disclosed in [7] and [8]. Therefore, additional privacy guarantees must be included in the synthetic data generation process in order to reduce the risk of exposing sensitive information. To achieve this, one spearheading solution is Differential privacy (DP), a framework for generating data with privacy-preserving capabilities, if a solution follows this principle it will be more secure against membership inference attacks. The next frontier is to analyse if these state of the art privacy-preserving ML solutions such as Rubio et al. [9] and Kim et al. [10] are capable of withstanding attacks on trajectories data or are still vulnerable as synthetic data generation was found to be in Xie et al. [11]. In particular we will analyse Membership inference attack (MIA) developed by Shokri et al. [12] for images and workaround it to develop a MIA for trajectories. In this thesis, our main goal is to test how robust are privacy-preserving trajectory generation ML solutions targeted by MIA. Through this work, we aim to contribute to the advancement of privacy-preserving synthetic data generation by helping implement more robust ML training configurations. 7
1.1 Objectives In order to define the scope of the thesis, and the milestones we want to achieve we have summarized the objectives of this work as the following list: •Understand how Machine Learning DP models works and how synthetic data is generated with and without privacy protection. •Understand and analyse how MIA works. •Develop a low resource intensive MIA to target trajectories data. •Test our MIA by targeting different privacy-preserving ML solutions with different ϵ-Differential privacy configurations. This thesis starting point is the continuation of V´ıctor Rubio’s Thesis [9] in which he developed a privacy-preserving ML solution by applying Differential privacy to MoveSim, a GAN model. We will develop a MIA that aims to infere if a trajectory was part of the training dataset, this MIA will target different ϵ−DP MoveSim configurations to discard the usage of those vulnerable to MIAs. 1.2 Content The content of this thesis is structured as follows: First, we introduce the topic of synthetic trajectory data and provide some context on how a Generative adversarial network works. Then we briefly delve into how Differential privacy solutions should be more privacy robust from a statistical point of view. Afterwards, we dive into the state of the art Membership inference attack, the different configurations and types of attacks to point out why we feel the attack developed fits our requirements and aims. Finally, we explain what our proposal how it varies from the standard MIA is and analyse the results obtained targeting different privacy-preserving ML solutions and conclusions of the work done and future improvements. 8
data to make the model more robust. This is called a Centralized algorithm level [12] [21] [22]. On the other side we have Federated learning, which relies on various attackers sharing an aggregator to perform different attacks, these have been very successful in inferring data but their buildup relies on sharing the attack model but not the data, which would make any malicious actor lose the edge to obtain privacy-sensitive data [23] [16]. 2.3.4 Domain level Tons of literature have been written on MIA targetting very diverse data. Before beginning our work we reviewed different papers to look for solutions that targeted location or trajectories data, what unfolded is the classification in domain levels of the types of data Membership inference attack target to date. •Computer vision: Used to target image classification [12], image segmentation [24] or image generation [25]. •Natural language processing: Used to target text classification [23], text generation [26] or word embedding [27] •Audio: Used to target speech recognition [28] The only mention of location or trajectory data was in Chen et Al. [29]. 2.3.5 Training and validation loss in ML models The training loss is a metric used to assess how a DL model fits the training/validation data. Computationally, the training/validation loss is calculated by taking the sum of errors for each example in the training/validation set. These will help us understand if a ML model suffers from under-fitting or overfitting. Figure 7: Overview of ML model classification for over-fitting and under-fitting 15
Understanding underfitting is straightforward. An underfitted model is unable to accurately capture the relationship between input and output variables. Consequently, its prediction accuracy is poor, performing inadequately on both new data and the training set itself, due to its overly simplistic nature. If the learning curves during training show high error values (high bias) on both the training and validation sets, it indicates an underfitted model. This often occurs when a linear model is used for non-linear data. To address underfitting, you can increase model complexity by adding more parameters or by relaxing regularization terms. Overfitting represents the opposite extreme: it occurs when a model becomes excessively complex, diminishing its effectiveness. During training, the model captures intricate details of the data. Consequently, it learns both the relevant information (signal) and irrelevant information (noise), overly tailoring itself to the target function. When the model interprets extraneous values and noise as meaningful patterns, its performance suffers, especially when confronted with new, unseen data. Models that suffer from over-fitting and under-fitting are specially vulnerable to MIA attacks as described in Shokri et al. [30]. 2.3.6 MIA code implementations The inception of this project was studying MIA related literature, focusing on those that had open-source code. However, the open-source code proved to be difficult to modify and run according to MIA nowadays standards. In most cases implementations relied on archaic libraries which now are far behind the current state of the art approaches as they were developed using very primitive versions of the now widely popularized shadow models. During this stage of the project I modified and tested GAN-Leaks MIA code implementation to work with trajectories. Actually, according to GAN- Leaks [29] their code can work with geolocation data, however, it turned out to be non-sequential geodata making in impossible to work with trajectories. Therefore, it was at this point the decision to develop our own Membership inference attack solution to target trajectories from scratch was made. Moreover, the idea of developing a low computational cost solution gained weight as explored in Yu et al. [31] and other MIA solutions. 16
2.4 Kullback–Leibler and Jensen–Shannon The Kullback–Leibler divergence (KL divergence) measures how different a probability distribution is from a reference one. It is used to assess the performance of generative models by calculating the extent to which synthetic data and real data have similar properties. Formally, given two discrete distributions Pand Qdefined on the same probability space, the KL divergence is: DKL(P||Q) = X x∈X P(x)log(P(x) Q(x)) (1) As we can see in Eq. 1, the KL divergence is non-negative and non-symmetric. When Pand Qare the same distribution, then DKL(P||Q) = 0. The Jensen–Shannon divergence (JS divergence) is used to assess similarity between two distributions, and is based in the KL divergence. In this case the JS divergence is symmetric, and ranges [0,1]. Formally, given two discrete distributions Pand Qdefined on the same probability space and M=1 2(P||Q), the JS divergence is defined as in Eq. 2. DJS(P||Q) = 1 2DKL(P||M) + 1 2DKL(Q||M) (2) Therefore we know that synthetic data GAN will aim to have JS divergence and KL divergence close to 0. That means that the training data and synthetic data must retain similar statistical properties, that’s why shadow models and other MIA solutions try to mimic the ML functioning. 2.5 Dimensionality reduction Trajectories are sequential, high-dimensional, correlated vectors that are also bound to the physical layout. There are various formats to work with GPS trajectories data such as GeoJSON [32]. Our standardised way of working with trajectories formats was inherited from Rubio et al. [9]. Therefore, the format used is storing datasets as matrices of routes, each route has ndatapoints and for each data point we obtain the coordinates, that is latitude and longitude. Dimensionality reduction techniques are used to simplify high-dimensional data while preserving its essential structure however this leads to information loss, a balance must be achieved. These techniques are invaluable for improving computational efficiency and aiding in data visualization. We studied the following to see which could best fit our needs: 17
•Principal component analysis (PCA) achieves this by identifying the principal components that capture the most variance in the data, reducing it to fewer dimensions. •Linear Discriminant Analysis, on the other hand, focuses on maximizing the separation between multiple classes by projecting the data onto a lower-dimensional space •t-Distributed Stochastic Neighbor Embedding is a non-linear method that excels in visualizing high-dimensional data by converting similarities between data points into probabilities and mapping them in a way that maintains these relationships in a lower-dimensional space 2.6 K-Nearest neighbour K-Nearest neighbour is a simple algorithm that finds Kclosest datapoints to a certain queried datapoint. To do so, a distance metric is calculated, which determines the closeness of the neighbors. There are different distance metric algorithms that can be used: •Manhattan distance: dM= k X i=1 |xi−yi| •Euclidean distance dE=v u u t k X i=1 (xi−yi)2 •Chebyshev distance dC= max i(|xi−yi|) These distances are chosen depending on the topology of our data and the needs of our model. To calculate the nearest neighbours between two trajectories can be tricky and prone to different interpretations. For instance, one can calculate for each xithe distance to the yi, but it’s also possible that a certain xiis closer to yn/n =iand it misrepresents how similar they are. Moreover, to perform KNN for k= 10 in a dataset with mtrajectories in which each trajectory has 49 datapoints the amount of computational power is immense. However, as we perform KNN to the trajectories after the dimensionality reduction we avoid this problem and just do a classic KNN solution. 18
s1 s3 s2 Principal Component nº1 Principal Component nº2 sx>k d1 d2 d3 dx Figure 8: Overview of KNN solution over a PCA. Red dots represent synthetic trajectories. Green dots represent a queried input 2.7 Support vector machine Support vector machine (SVM) is a supervised learning model used for classification and regression tasks. It works by finding the optimal hyperplane that best separates the data into different classes. The hyperplane is chosen to maximize the margin, which is the distance between the hyperplane and the nearest data points from each class, known as support vectors. Figure 9: Overview of SVM solutions 19
SVM can handle both linear and non-linear classification by using kernel functions to transform the data into a higher-dimensional space. This flexibility allows SVM to create complex decision boundaries, making it a powerful tool for various classification problems. 2.8 Random forest Random forest (RF) is an ensemble learning method that creates multiple decision trees during training and uses the majority vote of these trees to determine the class during testing. In RF, each tree is built from a sample drawn with replacement from the training set. When splitting a node, the algorithm selects the best split from a random subset of features. This introduction of randomness slightly increases the bias of the model, but the averaging of multiple trees significantly reduces its variance. 20
3 State of the Art There are few state of the art Membership inference attack that work on targeting synthetic data, although little has been studied in the targeting of synthetic trajectories such as Cai et al. [33], Pyrgelis et al. [34] or Zhang et al. [35] and there’s a total lack of literature analysing privacy leakage of synthetic trajectories. Furthermore to attack with state-of-the-art solutions the data must have undergone state-of-the-art defense, in this case Differential privacy is the go to privacy defense mechanism which has proven to be robust against some of these attacks. Still there are lots of Membership inference attack, the variations between these allow for more accurate targeting depending on adversarial knowledge, target model, approach, algorithm and domain level. This helps the ecosystem improve even if the papers are not strictly related to trajectories data such as Backes et al. [36] from 2017 which is centered on DNA genetics data but as it is similar to trajectories in the sense that it is correlated and sequential has been used to design MIA targeting trajectories. In Pyrgelis et al. [34], a first formalization of MIA against location data is performed using a ML classifier trained on prior knowledge of the adversary. The attack aims to know if a given user’s location is part of a larger group of locations, this white-box attack was highly effective reaching 83% Area under curve (AuC). When deploying the attack in black-box environment the AuC falls to 60%. In Zhang et al. [35], they develop LocMIA which is trained on a binary classifier to infer whether a specific victim’s location data are involved in the aggregation group, based solely on the data aggregation’s output (i.e., the statistical results). To this intent the dataset used is a location-based social networking website [37] which is differs quite a lot from our data. Both infere if a user is linked to a certain trajectory by embedding into the original dataset the user. This approach is slightly different than our idea because it infers user’s relation to certain trajectories. In Cai et al. [33], MIA are performed in the called TrajMIA that inferes if a trajectory was in the training data of the target model. These attacks follow the standard shadow model training and then query the victim’s model and shadow model to decide whether they are member or non-member. The most common metrics for test evaluation in MIA are accuracy, f-beta score and AuC. However, there’s intense debate on whether these metrics can be misleading and are cherrypicked to showcase the strenghts of a given MIA 21
while hiding false positives rates, etc. as stated in Hu et al. [15]. These are considered state-of-the-art because they are able to infere, even if in low numbers, the membership of datapoints and thus causing a privacy vulnerability to exploit. 22
4 RouteMIA In this section we will discuss the implementation of the MIA developed, the different steps it has and certain technical features of the code. In order to develop a Membership inference attack which relies on statistical analysis between synthetic generated data and their correlation to the training data from ϵ-DP MoveSim from Rubio et al. [9] and ϵ-DP LSTM-TrajGAN, the solution had to follow certain principles. The cornerstone of the MIA was to be a black-box attack, as explained previously these are the most common attacks and if they yield positive results the MIA has potential for inferring data. We developed a binary classifier, but as we won’t use shadow models the approach was different from that of Chen et al. [29]. Our algorithm is centralised, we have developed 5 different architecture models, but they don’t cooperate to obtain a solution and act as standalone models. The architecture of our solution is based on 3 axis: dimensionality reduction, nearest neighbours and a classifier. 4.1 Dimensionality Reduction It is accomplished through PCA by identifying the most significant features, we have used the pytorch library in this axis. We follow these steps: 1. Preprocess the datasets to clean them from duplicates. 2. Obtain the eigenvalues Sand eigenvector Vof the synthetic and test datasets through the singular value decomposition. 3. Calculate the cumulative variance for each component, which in our case is a given idatapoint out of ndatapoints in a trajectory. This step is idem to the conventional way of calculating the covariance matrix. 4. At this point we obtain a scree-graph that helps understand the information loss we will face. 5. We cap this information loss Ilwith a threshold and the code will dynamically select the number of top pprincipal components needed. This is idem to solving the equation: Cov(X)·V=S·V 6. These pprincipal components represent the eigenvectors of the original space that will generate the feature space W 23
7. Projection of our datasets on the new feature space set up by the principal components. X′=X·W We have now reduced the dimension of our trajectories for a given information loss. For example, given ϵ=20 and Il=0.01 we can represent the scree graph in Fig. 10a and PCA projection in Fig. 10b (a) Scree graph (b) 2D-PCA projection Figure 10: Comparison of Scree graph and 2D-PCA projection for ϵ=20 and Il=0.01 4.2 Nearest neighbours This is the next step, after reducing the dimension of each trajectory and represent them as a data point, datapoints that are close by in Fig. 10b are also similar in real topography. Therefore we want to know for a given trajectory fitted in Wspace feature which trajectories are similar to it. In our case we want to compare how similar synthetic trajectories from a dataset are to a mix of validation and synthetic trajectories dataset. This will allow us to obtain for each trajectory a distance and classify if it is synthetic or not, which will be used to train the classifier. We follow these steps: 1. Choose k. 2. Choose the distance metric between euclidean, squared euclidean, tchebychev and manhattan. 3. Obtain the distances diand indexes Siof the ktrajectories as in Fig. 8 4.3 Classifier After finding the kmost similar trajectories to a given trajectory and their distances. We need to classify which from these ktrajectories are indeed sim- 24
Euclidean Squared euclidean Chebyshev Manhattan ROC 0.54 0.51 0.52 0.52 Accuracy 0.60 0.58 0.60 0.59 Precision 0.13 0.14 0.15 0.14 Table 2: RBF SVM performance for different distance metrics The results are consistent across the table, the distance metric does not make a big difference on the classifier. That’s why we settled for euclidean distance, for the following results. We are now ready to perform the tests for each dataset of synthetic trajectories. The following tables are obtained with k=50, dv=0.99 and distance metric as euclidean. ROC Accuracy Precision Recall F1 Score Baseline 0.52 0.59 0.13 0.36 0.2 ϵ= 100 0.52 0.63 0.13 0.32 0.19 ϵ= 70 0.54 0.62 0.14 0.37 0.21 ϵ= 50 0.48 0.53 0.11 0.35 0.17 ϵ= 20 0.5 0.62 0.17 0.48 0.25 ϵ= 10 0.5 0.67 0.13 0.25 0.16 ϵ= 5 0.53 0.63 0.14 0.35 0.2 Table 3: Random Forest performance for different epsilon values ROC Accuracy Precision Recall F1 Score Baseline 0.6 0.71 0.22 0.44 0.29 ϵ= 100 0.61 0.78 0.28 0.4 0.33 ϵ= 70 0.59 0.76 0.24 0.36 0.29 ϵ= 50 0.47 0.56 0.12 0.36 0.18 ϵ= 20 0.62 0.7 0.22 0.51 0.31 ϵ= 10 0.5 0.73 0.14 0.19 0.16 ϵ= 5 0.55 0.78 0.21 0.23 0.22 Table 4: RBF-SVM performance for different epsilon values Overall the results are quite balanced for all datasets. The classifiers tend to be very good at predicting the non-members but fall behind when predicting members. Still we correctly infer the membership of a 20% to 30% of all original data, which means privacy is leaking in the ϵ−DP MoveSim Nonetheless, the key to decide if our MIA performs well or not is that it is able to do better predictions than a random guess, which it always does, as our 31
accuracy is found betwenn 0.59 to 0.8 and our ROC only in some instances falls below 0.5. It is also important to test our model on a well balanced dataset, that’s it has the same amount of synthetic and non-synthetic data, if not we can obtain much better metrics but the confusion matrix shows tons of false positive and true negatives. We had to balance our initial dataset but that forced us to have more non-members than members. Notice how epsilon=50 stands out from the rest of datasets, this might be caused because it is overfitted. Our last test is to analyze how dvaffects the MIA. We tested for SVM RBF: ROC Accuracy Precision Recall F1 Score dv=0.99 0.6 0.71 0.22 0.44 0.29 dv=0.975 0.59 0.75 0.23 0.37 0.29 dv=0.95 0.56 0.72 0.2 0.36 0.26 dv=0.92 0.52 0.75 0.17 0.22 0.19 Table 5: RBF SVM performance for different dvvalues ROC Accuracy Precision Recall F1 Score dv=0.99 0.52 0.59 0.13 0.36 0.2 dv=0.975 0.5 0.64 0.13 0.29 0.18 dv=0.95 0.5 0.62 0.13 0.32 0.18 dv=0.92 0.51 0.56 0.14 0.44 0.21 Table 6: Random Forest performance for different dvvalues Until now this might be the parameter that has more of an effect on the outcome of the MIA. We can clearly see that the more information we encode in the PCA the better outcome. However, even for as little as 1 principal component which is achieved for dv=0.92 the results are good. 32
Figure 12: ROC AuC comparison for a certain configuration of RBF SVM and Random Forest We also studied the confusion matrices, let’s analyse for k=50, dv=0.99, ϵ=10 and distance metric being euclidean. (a) Random Forest confusion matrix (b) SVM confusion matrix Figure 13: Comparison of the confusion matrix for 2 classifiers The confusion matrix helps us better understand how the classifier is performing. We have been able to unmask that certain configurations tend to give more predictions for membership and thus predict many false positives. In Fig. 13b we have tweaked the classifier to give little false positives. We finally can compare the ROC of each classifier in Fig. 12. 33
6 Conclusions and Future Work Trajectory data sensitive nature makes it stand as a paramount concern due to its increasing importance in many industries and the perils of privacy leakage. Therefore, the development of privacy-preserving solutions through the generation of ϵ-DP synthetic trajectories is key to tackle these risks. Synthetic trajectories were known to fall short against MIA targeting, in our work we uncovered that ϵ-Differential Privacy solutions although they are able to hold their ground better are still weak against certain MIA configurations. Looking back at out objectives, we can see that we have been able to understand how different privacy-preserving ML solutions work, researched on MIA literature and analysed what type of attack best suited the targetted model and developed such model obtaining promising results. The MIA based on RBF SVM classifier is a good fit to be introduced in ϵ-Differential Privacy generation of synthetic trajectories, to improve its privacy countermeasures to membership inference. Unfortunately, there is still a long way to go to achieve a more perfect balance for synthetic generation of trajectories. We have used a wide range of methods but each of these can have a wide range of configurations, a next step is to try more of these configurations to see if the attack can be optimized. It is also important to explore how the data obtained from our attacks can be pipelined to the training phase of privacy-preserving ML solutions such as ϵ-DP MoveSim and what has been the privacy gain compared to non DP synthetic trajectories. 34
7 Sustainability and ethics analysis 7.1 Introduction The sustainability and ethics report aims to analyze the environmental and social impacts the project presents as well as its economical viability. Nowadays Machine Learning models require huge datasets for training, these datasets are trained on real data, this data can contain sensitive information. The General data protection regulation implemented by the EU aims to safeguard data privacy and enforces public and private entities to ensure technical solutions are put in place to do so, yet it falls short on assessing or assisting with such task. Differential privacy is one such technical solutions which adds noise to the data making it more private while less useful, this dichotomy when designing such solutions may not fully guarantee privacy of the dataset. In this context, this project aims to put the white hat on and poke at different DP solutions for trajectory data by developing a Membership inference attack black-box type model that takes the synthetic data and aims to obtain the original data. In turn, the results of this project will result in a more secure solution by unmasking poorly securing DP configurations. The project is part of a wider solution funded by the NextGenerationEU funds’ in the Mobilytics Project, this project is meant to be a non-profit work. 7.2 Sustainability matrix The sustainability matrix showcases the impact and risks the project poses in economical, social and environmental. Development of BT Project Execution Risks and Limitations Environmental Perspective Environmental impact Environmental impact Environmental risks and limitations Economic Perspective Cost Viability analysis Economic risks and limitations Social Perspective Personal impact Social impact Social risks and limitations The metrics we will focus to assess the different perspectives will be: 35
Perspective Development of BT Environmental Perspective Energy consumption Economic Perspective Development costs Maintenance costs Implementation costs Social Perspective Risks and perks on data protection 7.3 Sustainability matrix We will analyze the amount of g/CO2emissions during the project development. The development has focused on lots of autonomous research, meetings both online and in university, some mailing, download and upload of huge databases and testing of different algorithms. I had the possibility to use SISCOM’s dedicated server to perform my work, but the approach chosen didn’t require such a computing capacity and I avoided the use of such energy intensive gadgets. Furthermore, to reduce the carbon footprint of the project, from the databases only a part of the data was useful for us, by selecting these files we only used: Total DB size = 6 datasets ·5.54 MB = 33.24 MB from an Original Total DB size = 6 datasets ·9.154 GB = 54.92 GB which means a 99.9% reduction from the jump in the data size. This reduction impacts directly the amount of g/CO2emissions when downloading the datasets, but also the time the algorithm will run, therefore further reducing its energy cost. Below we have an overview of the emissions. Quantity g/ CO2Total Mails without attachements 93 mails 0,3 g/ CO2/ mail 27,9 gCO2 Mails with attachements 20 mails 50 g/ CO2/ mail 100 gCO2 Online Meetings (3 people on average) 20h 0,164 g/ CO2/ pp·min 590 gCO2 File downloads 33,24 MB 3 kg / CO2/ GB 99,72 gCO2 File uploads 1 MB 3 kg / CO2/ GB 3 gCO2 820,62 gCO2 This is an underestimation as we should consider transportation, surfing the 36
web, etc. When it comes to the algorithm itself the energy consumption depends on the hardware it is run on, a common laptop can run the algorithm in under a minute without the need of GPU usage, which indicates that the algorithm is not computationally intensive. The project aims to determine DP configurations saves the need to perform multiple tests for each epsilon to find a good enough configuration by trial and error, which is the method widely used. 7.3.1 Risks and limitations The highlight of the project is to develop an effective algorithm that can be used in low tier devices, it is designed to be used when training DP configurations so its use is not to be continued after the configuration phase. In case a dynamic DP is developed and merges this algorithm it can work on a continuous basis without much environmental risks. The algorithm is up to date with the state of the art technologies and has a low environmental impact which poses very low risks and limitations to its use on an environmental basis. If I was to redo this project I would do the same steps but enlarge the scope of the project to include more technologies in the development enabling us to find more robust results. 7.4 Economic perspective The economic perspective of the project is rather simple as I have used my computer and an IDE. The project as it stands is ready to deploy and use, maintenance shouldn’t suppose an economical issue as I estimate the only needs that can arise are to update the code if the libraries used are modified, which happened once during the development phase. Time Cost Total Cost Developer 500h 10 e/h 5000 e The economic benefits of the project rely on saving time and money both in development and execution of larger DP projects. 37
This project was developed parallel to peer’s DP solutions which means they couldn’t use this solution but would have benefited from it, we were able to estimate . 7.4.1 Risks and limitations The economic risks of this project are null as it is not meant to be sold and requires close to no maintenance. ROI? 7.5 Social perspective The social implications of this project are the sole driving factor for it to be developed. As discussed in the introduction, DP is nowadays a widely used method for securing data that might be used in ML models or released for research purposes. To ensure this data is private is key; otherwise, bad actors can use it for a wide range of purposes. In most cases, the correlation between a trajectory and the user who made such a trajectory is vital to be able to harm them, but even without the identity of the user, it could be targeted. The data we aim to protect is trajectories. The following is a list of use cases in which trajectories might be used for detrimental intentions. We will point out the risks and the bad actors: •Discrimination, persecution, and targeting of activists, political rivals, and certain creeds: Trajectories can inadvertently reveal sensitive information such as a user’s homes, places of worship, working facilities, etc. •Healthcare-related discrimination: Insurance companies might use trajectory data to identify customers who visit specialized medical facilities, potentially leading to increased premiums or cancellation of policies under suspicion of expensive treatment diseases. •Wildlife conservation projects: Tracking technologies are crucial for protecting endangered species against poachers. However, data breaches on such applications, without adequate privacy protection, could provide poachers with an advantage. •Consumer behavior analysis: With the rise of Big Data, consumer trajectories have become valuable for targeted advertising by e-commerce corporations. 38
Our project will take on the responsibility of determining the appropriate configuration for DP so that it finds the best balance between privacy and utility. This will help mitigate problems related to non-optimal DP configuration’s privacy. Nonetheless, there are scenarios in which this project can be used in harmful ways, as discussed in the introduction. What we are doing is similar to how a black hat hacker would operate; the use of parts of this project can help in identifying the original data that has been synthesized. 7.6 Ethical implications The goal of this project is to help make DP more robust and secure while employing little computation power. The scope of the project was set by the author of the project together with V´ıctor Rubio, who developed the original DP solution. This project focuses on the Sustainable Development Goals of Peace, Justice and Strong Institutions by promoting 16.1 and 16.2. By developing a more secure environment for our data on the internet we are directly combating discrimination, persecution and targeting of activists, political rivals, and creeds as explained previously. This project adheres to the code of ethics of Col·legi Oficial d’Enginyeria de Telecomunicacions de Catalunya as well as to the guiding principles of UPC Code of Ethics and Research integrity. 39
References [1] Bo Liu et al. “When machine learning meets privacy: A survey and outlook”. In: ACM Computing Surveys (CSUR) 54.2 (2021), pp. 1–36. [2] Runhua Xu, Nathalie Baracaldo, and James Joshi. “Privacy-preserving machine learning: Methods, challenges and directions”. In: arXiv preprint arXiv:2108.04417 (2021). [3] Alameen Najjar and Kyle Mede. Trajectory-User Linking Is Easier Than You Think. 2022. arXiv: 2212.07081 [cs.CY]. [4] ` Alex Miranda Pascual et al. “SoK: differentially private publication of trajectory data.” In: Proceedings on Privacy Enhancing Technologies. Vol. 2023. Apr. 2023, pp. 496–516. doi:10.56553/popets-2023-0065.url:https: //doi.org/10.56553/popets-2023-0065. [5] Jinmeng Rao et al. LSTM-TrajGAN: A Deep Learning Approach to Trajectory Privacy Protection. 2020. arXiv: 2006.10521 [cs.LG]. [6] Jie Feng et al. “Learning to Simulate Human Mobility”. In: KDD ’20. Virtual Event, CA, USA: Association for Computing Machinery, 2020, pp. 3426–3433. isbn: 9781450379984. doi:10.1145/3394486.3412862. url:https://doi.org/10.1145/3394486.3412862. [7] Yingzhou Lu et al. “Machine learning for synthetic data generation: a review”. In: arXiv preprint arXiv:2302.04062 (2023). [8] R´emy Chapelle and Bruno Falissard. “Statistical properties and privacy guarantees of an original distance-based fully synthetic data generation method”. In: arXiv preprint arXiv:2310.06571 (2023). [9] V´ıctor Rubio Jornet. “Generation of synthetic mobility data with differential privacy guarantees”. MA thesis. Universitat Polit`ecnica de Catalunya, 2023. [10] Jong Wook Kim and Beakcheol Jang. “Deep learning-based privacy-preserving framework for synthetic trajectory generation”. In: Journal of Network and Computer Applications 206 (2022), p. 103459. [11] Liyang Xie et al. “Differentially private generative adversarial network”. In: arXiv preprint arXiv:1802.06739 (2018). [12] Reza Shokri et al. “Membership inference attacks against machine learning models”. In: 2017 IEEE symposium on security and privacy (SP). IEEE. 2017, pp. 3–18. [13] Cynthia Dwork. “Differential Privacy”. In: Proceedings of the 33rd Intl. Colloquium on Automata 2 (2006), pp. 1–12. doi:10.1007/11787006_1. [14] Martin Abadi et al. “Deep Learning with Differential Privacy”. In: Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security. ACM, Oct. 2016. doi:10.1145/2976749.2978318. url:https://doi.org/10.1145%2F2976749.2978318. 40