scieee AI-readable full text Open interactive document viewer

Towards a privacy-preserving distributed machine learning framework

Brito, Cláudia Vanessa Martins

Abstract

A Aprendizagem Máquina (AM) tornou–se uma técnica essencial para vários sectores (p.ex., saúde, finanças) que pretendem extrair novas informações dos seus dados. No entanto, estes tendem a conter informações sensíveis, levantando preocupações sobre a privacidade e segurança e levando ao desenvolvimento de soluções de Aprendizagem Máquina com Preservação da Privacidade (AMPP). Isto é particularmente relevante quando esses dados, assim como a computação feita sobre eles, precisam de ser transferidos para infraestruturas de terceiros (i.e., computação em nuvem) ou diretamente processados no dispositivo móvel do utilizador. Nesta tese, mostramos que as soluções atuais apresentam várias limitações, sendo apenas aplicáveis a casos de uso específicos, exigem que os utilizadores reimplementem os seus algoritmos de AM ou comprometem significativamente o desempenho das cargas de trabalho. Para responder a estes desafios e melhorar a adoção prática de soluções AMPP, propomos três contribuições. Primeiro, introduzimos o Soteria, um novo sistema que aproveita a escalabilidade e a fiabilidade do Apache Spark e da sua biblioteca ML (MLlib). Este garante que as operações críticas são realizadas exclusivamente em enclaves seguros fornecidos por Ambientes de Computação Confiáveis (ACC). Isto significa que os dados sensíveis a ser processados só existem em claro dentro do enclave, estando cifrados no resto do fluxo de dados (i.e., rede, armazenamento). Esta solução assegura a privacidade dos dados durante o treino e inferência. Embora o Soteria se revele uma solução prática de AMPP para AM genérica, este não suporta outros tipos de dados, como é o caso dos dados genómicos. Assim, propomos o Gyosa, uma nova solução de computação distribuída para estudos de associação do genoma (GWAS) com preservação da privacidade. Diferente de outras soluções, o Gyosa oferece uma diferenciação fina entre informação sensível e não sensível processada por GWAS num ambiente distribuído. Finalmente, o TAPUS, centra–se no compromisso entre precisão e privacidade para ambientes de AM distribuída sem acesso a hardware especializado. Para tal, combinamos a Aprendizagem Federada e a Privacidade Diferencial (PD) e avaliamos o impacto de diferentes algoritmos baseados em PD sobre o desafio de compreender as preferências dos utilizadores em termos de modalidades de transporte. Com estas contribuições, melhoramos o atual estado da arte dos sistemas de aprendizagem automática distribuídos e com preservação da privacidade.

Full text

Universidade do Minho Escola de Engenharia Cláudia Vanessa Martins de Brito Towards a Privacy-Preserving Distributed Machine Learning Framework março de 2024 UMinho | 2024 Cláudia Brito Towards a Privacy-Preserving Distributed Machine Learning Framework Cláudia Vanessa Martins de Brito Towards a Privacy-Preserving Distributed Machine Learning Framework Tese de Doutoramento Doutoramento em Informática Trabalho efetuado sob a orientação de João Tiago Medeiros Paulo Pedro Gabriel Dias Ferreira Universidade do Minho Escola de Engenharia março de 2024 COPYRIGHT AND TERMS OF USE OF THIS WORK BY A THIRD PARTY This is academic work that can be used by third parties as long as internationally accepted rules and good practices regarding copyright and related rights are respected. Accordingly, this work may be used under the license provided below. If the user needs permission to make use of the work under conditions not provided for in the indicated licensing, they should contact the author through the RepositoriUM of Universidade do Minho. License granted to the users of this work Creative Commons Attribution 4.0 International CC BY 4.0 https://creativecommons.org/licenses/by/4.0/deed.en Acknowledgements Este documento marca o fim de um ciclo e a todos os que de alguma forma fizeram parte desta caminhada, o meu obrigada. Começo por agradecer aos meus orientadores pelas inúmeras discussões durante estes últimos 5 anos e por me terem orientado neste percurso que por vezes pareceu interminável. O meu obrigada ao Prof. Dr. João Paulo e ao Prof. Dr. Pedro Ferreira. Não posso, ainda, deixar de salientar e agradecer ao João Paulo pois durante 5 anos acreditou mais em mim do que o que eu alguma vez consegui fazer. Obrigada João por me teres dado abertura para crescer academicamente e por me teres ajudado a definir o meu caminho na investigação. Espero que esta parceria continue por mais algum tempo. Quero também agradecer a todos os meus coautores por todo o tempo despendido nos documentos que conseguimos produzir em conjunto para o sucesso deste percurso. Adicionalmente, o meu obrigada ao Bernardo Portela por todas as discussões, iterações e modificações durante os 4 anos de submissões do sistema base desta tese (além das provas de segurança). Estendo o meu agradecimento a todos os membros e ex-membros do HASLab que acompanharam parte ou toda esta jornada: Ana Alonso, Beatriz Cepa, Bernardo Portela, Catarina Fernandes, Carlos Baquero, Daniel Cruz, Diogo Ribeiro, Fábia Pereira, Fábio Coelho, Francisco Cruz, Francisco Maia, Francisco Neves, João Dias, João Marco, José Orlando Pereira, Luís Meruje, Mariana Miranda, Miguel Peixoto, Nuno Machado, Paula Rodrigues, Pedro Moreira, Ricardo Macedo, Ricardo Vilaça, Rogério Pontes, Rui Monteiro, Rui Ribeiro, Rui Carlos Oliveira, Susana Marques, Tânia Esteves e Vítor Enes, bem como todo o corpo docente e todos aqueles com quem tive o privilégio de trabalhar desde 2017. Obrigada também a todos os alunos de mestrado a quem tive o privilégio de co-orientar e que me ajudaram a crescer academicamente. Deixo aqui também o meu agradecimento e reconhecimento ao Grupo de Storage , João, Ricardo e Tânia pela integração de uma incógnita no vosso grupo, apesar de continuarem sem saber onde me colocar. Contudo, espero um dia deixar de ser apenas a pessoa do ML ou a pessoa de biocenas eque realmente encaixe por lá. Tânia, foi um prazer partilhar estes últimos 5 anos contigo assim como as dores do crescimento académico. Ricardo, obrigado por teres sido o primeiro a ver além do ML e por me teres introduzido a um mundo de storage que eu não tinha tido oportunidade de conhecer. Obrigada aos três. Um agradecimento especial ao Prof. Dr. António Sousa pela oportunidade dada há 7 anos, pela amizade e por me ter dado sempre um porto seguro onde ele não existia. Ao meu Apostulado , juntamente com Chica, Patrícia e Reizinho, que me acompanham há cerca de 11 anos, obrigada por me ajudarem a manter a sanidade mental (ou a falta dela). À Inês, obrigada por me teres ensinado a diferença entre adenosina, adrenalina e atropina. Assim como pelos últimos 15 anos de amizade, apoio, partilha de traumas e mais recentemente as viagens aos mercados de Natal. iii Finalmente, o meu obrigada à minha família. Os últimos anos foram, no mínimo, desafiantes e, em especial, um obrigada à minha mãe que sempre me apoiou e ensinou desde cedo a perseverança e resiliência mesmo quando o mundo parece estar contra nós. Agradeço também ao meu irmão, cunhada, madrinha, afilhado e avô que sempre me apoiaram e incentivaram neste percurso. Não posso deixar de dedicar este documento a três daqueles que partiram antes do fim. À minha avó, uma segunda mãe, que me impulsionou a seguir este sonho. Ao meu avô que sempre me ensinou a lutar por aquilo em que acredito. Ao meu pai que fora todos os valores incutidos, também me ensinou a ouvir boa música. A todos eles, o meu obrigada. Para todos os que possam entender: agradeço mais do que tudo ao meu Tico e Teco, foram eles os percursores de tudo. Adicionalmente, os meus agradecimentos às instituições que apoiaram o trabalho aqui apresentado. A Fundação para a Ciência e Tecnologia (FCT) apoiou este trabalho através da bolsa de doutoramento SFRH/BD/146528/2019. O Departamento de Informática da Universidade do Minho, o HASLab, e INESC TEC ofereceram-me as condições necessárias para o desenvolvimento deste trabalho. iv STATEMENT OF INTEGRITY I hereby declare having conducted this academic work with integrity. I confirm that I have not used plagiarism or any form of undue use of information or falsification of results along the process leading to its elaboration. I further declare that I have fully acknowledged the Code of Ethical Conduct of the Universidade do Minho. Braga March 4th, 2024 , (Cláudia Vanessa Martins de Brito) v Resumo Rumo a uma Plataforma Para Aprendizagem Máquina Privada e Distribuída AAprendizagem Máquina (AM) tornou–se uma técnica essencial para vários sectores ( p.ex. , saúde, finanças) que pretendem extrair novas informações dos seus dados. No entanto, estes tendem a conter informações sensíveis, levantando preocupações sobre a privacidade e segurança e levando ao desenvolvimento de soluções de Aprendizagem Máquina com Preservação da Privacidade (AMPP). Isto é particularmente relevante quando esses dados, assim como a computação feita sobre eles, precisam de ser transferidos para infraestruturas de terceiros ( i.e., computação em nuvem) ou diretamente processados no dispositivo móvel do utilizador. Nesta tese, mostramos que as soluções atuais apresentam várias limitações, sendo apenas aplicáveis a casos de uso específicos, exigem que os utilizadores reimplementem os seus algoritmos de AM ou comprometem significativamente o desempenho das cargas de trabalho. Para responder a estes desafios e melhorar a adoção prática de soluções AMPP, propomos três contribuições. Primeiro, introduzimos o Soteria , um novo sistema que aproveita a escalabilidade e a fiabilidade do Apache Spark e da sua biblioteca ML (MLlib). Este garante que as operações críticas são realizadas exclusivamente em enclaves seguros fornecidos por Ambientes de Computação Confiáveis (ACC). Isto significa que os dados sensíveis a ser processados só existem em claro dentro do enclave, estando cifrados no resto do fluxo de dados ( i.e. , rede, armazenamento). Esta solução assegura a privacidade dos dados durante o treino e inferência. Embora o Soteria se revele uma solução prática de AMPP para AM genérica, este não suporta outros tipos de dados, como é o caso dos dados genómicos. Assim, propomos o Gyosa , uma nova solução de computação distribuída para estudos de associação do genoma ( GWAS ) com preservação da privacidade. Diferente de outras soluções, o Gyosa oferece uma diferenciação fina entre informação sensível e não sensível processada por GWAS num ambiente distribuído. Finalmente, o TAPUS , centra–se no compromisso entre precisão e privacidade para ambientes de AM distribuída sem acesso a hardware especializado. Para tal, combinamos a Aprendizagem Federada e a Privacidade Diferencial (PD) e avaliamos o impacto de diferentes algoritmos baseados em PD sobre o desafio de compreender as preferências dos utilizadores em termos de modalidades de transporte. Com estas contribuições, melhoramos o atual estado da arte dos sistemas de aprendizagem automática distribuídos e com preservação da privacidade. Palavras-chave: Ambientes de Computação Confiáveis, Aprendizagem Máquina, Computação Distribuída, Privacidade, Privacidade Diferencial vi Abstract Towards a Privacy-Preserving Distributed Machine Learning Framework Machine Learning (ML) has become an essential technique for several sectors ( e.g. ,Healthcare,Finances) that wish to extract novel insights from their data. Nonetheless, such data tends to contain sensitive information, which raises concerns about privacy and security and leads to the development of privacy–preserving machine learning (PPML) solutions. This is particularly relevant when such data, along with the computation done over it, need to be outsourced to third–party infrastructures ( i.e., cloud computing, HPC) or directly performed in the user’s mobile device. In this thesis, we show that the current state–of–the–art solutions still pose several limitations as these are only applicable to specific use cases, require users to reimplement their ML algorithms, or significantly compromise the performance of these workloads. To answer these challenges and improve the practical adoption of PPML solutions, we propose three main contributions. First, we introduce Soteria , a novel system that leverages the scalability and reliability of Apache Spark and its ML library (MLlib). It ensures that critical operations are exclusively performed in secure enclaves provided by Trusted Execution Environments (TEEs). This means the sensitive data being processed only exists in plaintext inside the enclave and is encrypted in the remainder of the dataflow ( i.e. , network, storage). This solution enables robust security guarantees, ensuring data privacy during ML training and inference. While Soteria proves to be a practical PPML solution for generic ML, it does not support other types of data or workloads that may benefit from privacy–preserving guarantees, which is the case of genomic data. Therefore, we propose Gyosa , a novel distributed computing solution for privacy–preserving genome–wide association studies. Different from other solutions, Gyosa offers a fine–grained differentiation between sensitive and nonsensitive information processed by GWAS in a distributed environment. Finally, TAPUS , focuses on the trade–offs between accuracy and privacy for distributed ML setups that do not have access to specialized hardware. This is done by combining federated learning and differential privacy and evaluating the impact of different DP–based algorithms over the challenge of understanding users’ transportation modality preferences. With these contributions, we improve the current state–of–the–art of privacy–preserving and distributed machine learning systems. Keywords: Differential Privacy, Distributed Computing, Machine Learning, Privacy–preserving, Secure Enclaves vii List of Tables 2.1 Summary of main strategies for distributed machine learning. ............. 21 2.2 Operation comparison between the three types of homomorphic encryption. ...... 28 2.3 Overview of PPML solutions resorting to Secure Multi-Party Computation and Homomorphic Encryption. ...................................... 31 2.4 Overview of PPML solutions resorting to Differential Privacy. .............. 34 2.5 Overview of PPML solutions resorting to Trusted Execution Environments. ....... 39 3.1 Comparison between state-of-the-art solutions and Soteria regarding the safety against ML attacks. ........................................ 51 3.2 Representation of each ML algorithm’s tasks, time complexity, and data sizes for different workloads. ...................................... 61 3.3 Mean CPU usage (in %) for ALS, PCA, GBT, LR, Naive Bayes, LDA, and Kmeans algorithms with the Huge workload. ................................ 65 3.4 Mean Memory usage (in %) for ALS, PCA, GBT, LR, Naive Bayes, LDA, and Kmeans algorithms with the Huge workload. ................................ 65 3.5 Mean Network usage (in MB/s) for ALS, PCA, GBT, LR, Naive Bayes, LDA, and Kmeans algorithms with the Huge workload. .......................... 65 3.6 Taxonomy of Related Work systems. .......................... 70 4.1 Taxonomy of Related Work systems. .......................... 87 5.1 Accuracy results for ten clients with variance in the noise multiplier ( i.e., 0.1, 0.2, 0.3, 0.4 and, 0.5). ....................................... 106 A.1 Summary of attacks against Soteria. .......................... 157 xiv List of Algorithms 2.1 Gradient Descent .................................. 13 3.1 Pseudocode of Linear Regression in Soteria-P. ................... 56 3.2 Pseudocode of untrusted functions of Linear Regression in Soteria-P. ........ 57 5.1 Pseudocode of DP-FedAVG. ............................. 95 5.2 Pseudocode of DP-FedSGD. ............................ 95 xv Acronyms 2PC two-party computation 29,30 3PC three-party computation 29 4PC four-party computation 30 ACC Ambientes de Computação Confiáveis vi AI Artificial Intelligence 10,89,91,99,112,114 AM Aprendizagem Máquina vi AMPP Aprendizagem Máquina com Preservação da Privacidade vi API Application Programming Interface 46,71 AWS Amazon Web Services 1 CPU Central Processing Unit 10 DL Deep Learning 7, 10,13,19,21,22,34,37,38,69,71,100,104,105,109 DML Distributed Machine Learning 1, 2, 3, 9, 14,21,113 DNN Deep Neural Network 18,35,37,69 DP Differential Privacy vii, 2, 3, 4, 5, 6, 7, 25,30,31,32,33,34,41,86,90,91,92,94,99, 100,102,103,105,106,110,113,114 DT Decision Trees 30,33,37 EPC Enclave Page Cache 47 ERM Empirical Risk Minimization 32 ETL Extract, Transform and Load 14 FHE Fully Homomorphic Encryption 27,28 xvi ACRONYMS FL Federated Learning 1, 3, 4, 5, 7, 15,19,21,32,33,34,35,88,90,91,92,93,96,97,98, 99,100,102,103,104,105,109,110,113,114 GC Garbled Circuits 25,26,29,40 GCP Google Cloud Platform 1, 103 GHG Greenhouse Gas 89,96,97,99,101,103,109,110 GPU Graphics Processing Unit 1, 10,22,114 GWAS Genome-Wide Association Studies vi, 4, 5, 6, 7, 9, 37,71,74,75,76,79,80,81,82,88, 112 HE Homomorphic Encryption 2, 3, 25,27,29,30,34,35,40,41,86 HPC High-Performance Computing vii,1,112 IOT Internet of Things 3, 41,88,91,113 LCA Life Cycle Assessment 96,97,101,109 LibOS Library Operating System 36 LLM Large Language Model 114 LR Linear Regression 4, 30 MCC MedCloudCare 8 ML Machine Learning vii, 1, 2, 3, 4, 5, 6, 7, 9, 10,11,12,13,14,15,17,20,21,22,23,25, 29,31,33,34,40,41,43,44,45,46,49,50,51,52,53,54,55,56,57,58,59,60,62, 66,67,68,69,70,71,78,88,90,92,96,97,98,100,104,109,110,112,113,114, 147,149,150,151,154 MPI Message Passing Interface 18 NFS Network File System 103 NN Neural Network 29,30,37,105 OS Operating System 46,47 OT Oblivious Transfer 25,26,37,38 PATE Private Aggregation of Teacher Ensembles 33 PD Privacidade Diferencial vi PHE Partially Homomorphic Encryption 27,28 PPDL Privacy-Preserving Deep Learning 29 xvii ACRONYMS PPDML Privacy-Preserving Distributed Machine Learning 2, 3, 4, 5, 41,42,43,44,45,70,71,74, 112,113,114 PPFL Privacy-Preserving Federated Learning 4, 5, 7, 9, 90,91,109,110,111 PPML Privacy-Preserving Machine Learning vii, 2, 3, 5, 9, 10,32,37,38,39,68,112,113 PS Parameter Server 15 SGD Stochastic Gradient Descent 13 SGX Software Guard Extensions 3, 35,37,38,44,46,88 SIMD Single Instruction Multiple Data 28 SMPC Secure Multi-party Computation 2, 3, 25,29,30,34,35,37,86,87,110 SS Secret Sharing 25,26,29 SVM Support Vector Machine 30,32,37 SWHE Somewhat Homomorphic Encryption 27,28 TCB Trusted Computing Base 35,36,40,41,44,74 TEE Trusted Execution Environments vii, 2, 3, 4, 6, 25,35,37,38,40,41,42,44,47,68,74, 86,87,91,111,112,113 UDF User-Defined Function 38 VANET Vehicular Ad hoc Networks 110 VCF Variant Call Format 4, 82 VM Virtual Machine 103 WtW Well-to-Wheel 101,109 ZKP Zero-Knowledge Proof 30 xviii 1 Introduction In the era of digitalization and ubiquitous connectivity, data has emerged as the cornerstone of modern technological progress. Combined with Machine Learning (ML), large-scale data analysis has revolutionized industries ranging from healthcare to finance, enabling insights and predictions that were previously unimaginable [218]. Nonetheless, the exponential data increase has led to a paradigm shift in how this data is processed. The traditional processing approach in a single machine is no longer feasible. Instead, data is distributed across different nodes, and the computation is parallelized to decrease the execution time. This distribution of data and computation has led to the emergence of Distributed Machine Learning (DML), which aims to provide a scalable solution to process large volumes of data while resorting to ML techniques. Briefly, DML enables training models across different nodes in a collaborative and distributed manner. However, the task of processing large volumes of data still poses several challenges. Although it distributes the load to improve the runtime performance, DML still requires efficient computation nodes ( e.g., with Graphics Processing Units(GPUs), high-speed network, and storage) to process the data. This often leads to the necessity of outsourcing the computation to third-party infrastructures, such as cloud providers ( e.g., Google Cloud Platform (GCP), Amazon Web Services (AWS), Azure [1, 21,60]) or High-Performance Computing (HPC) facilities, or the strict collaboration between different entities ( e.g., hospitals, financial institutions). For example, several entities may collaborate to train a centralized model that will profit from several data sources. The computation is done on each entity’s premises, and only the resulting values from the trained model ( i.e., gradients) are shared with a centralized server that aggregates this information to update the centralized model. This is a common setting in Federated Learning (FL)[27], which is particularly relevant in the healthcare domain. In this area i) the amount of data is increasing exponentially, and ii) patterns or insights on rare diseases, i.e. , patterns within small subsets of data from different healthcare facilities, need to be found. If the first problem can be solved by outsourcing the computation to third-party infrastructures, the second can be solved by collaborating with other entities to train a model that would profit from distinct data sources [67]. However, this shift towards distributed data-driven decision-making in untrusted third-party infrastructures has brought to the forefront a critical concern: preserving privacy in the face of ever-increasing data 1 CHAPTER 1. INTRODUCTION sharing and the outsourcing of data processing. The risk of inadvertent data exposure or unauthorized access increases as data is shared between multiple entities or computed in third-party infrastructures [131, 279]. Indeed, the ML pipeline can be complex as it encompasses several stages, which go from data collection and preprocessing to model training and inference, each with its distinct computational load ( e.g., regarding data and computation workflow). In detail, the data preprocessing stage depends on the data format and the transformations ( e.g., data cleaning or pruning, image rotation, oversampling) performed on it as these often require human judgment. On the other hand, the model training and inference depend on the model’s complexity and the amount of data used to train it. This extensive pipeline when outsourced becomes susceptible to a broad spectrum of attacks, such as adversarial attacks , model extraction and inversion and reconstruction attacks [89,286,296]. By aiming to extract sensitive information, these attacks can compromise the integrity and confidentiality of the data ( e.g., model inversion) and the model ( e.g., model extraction). As such, these attacks hinder the outsourcing ML tasks to untrusted third-party infrastructures, such as cloud providers [131]. Furthermore, data privacy regulations are tightening globally, and public awareness of personal data’s value is surging [118,295]. Addressing these challenges is of paramount importance to enable the adoption of DML solutions in highly sensitive domains, such as healthcare, finances or urban mobility. Although acknowledging the importance of these privacy concerns, traditional distributed computation frameworks like Apache Spark [314] lack security guarantees to protect the data or the models against these attacks. To overcome these challenges, an extensive compendium of privacy-preserving solutions has been proposed in the literature, which has led to the emergence of Privacy-Preserving Machine Learning (PPML). This new subfield of ML aims at providing privacy guarantees to ML systems. Most of these privacypreserving solutions can be decomposed into two main categories: PPML and Privacy-Preserving Distributed Machine Learning (PPDML) . The former refers to applying privacy-preserving techniques to a single machine learning model being trained by a single server residing at an untrusted infrastructure. The latter refers to using privacy-preserving techniques in a distributed architecture. Moreover, these distributed and privacy-preserving approaches can be further decomposed into collaborative learning ,where the goal is to train a model using data from different sources and within each entity’s premises. In distributed computation the goal is to outsource the training or inference of a model to third-party premises which will distribute the computation, by parallelizing and consequently, decreasing the execution time of these tasks. Solutions to PPDML range from the usage of Homomorphic Encryption (HE)orSecure Multi-party Computation (SMPC)[32,97] to the exploration of Trusted Execution Environments (TEE)( i.e., to allow data computation to be securely handled and processed in a secure environment) [126,129,153]and even the application of Differential Privacy (DP)[3, 266]. The broad spectrum of solutions and the different cryptographic primitives used to protect data and computations have led to a wide range of trade-offs between privacy, performance, and utility. 2 1.1. PROBLEM STATEMENT AND OBJECTIVES 1.1 Problem Statement and Objectives Despite the growing interest in PPML, current solutions are either too restrictive or performance-wise inefficient. Also, they can require changes in how users interact with the system. HE and SMPC schemes impose a significant performance toll that restricts their applicability to practical scenarios [231]. When shifting the focus to TEEs, such as Intel Software Guard Extensions (SGX), these environments provide a more efficient alternative to protect sensitive data and computations. Nonetheless, the need to resort to specific hardware and SGX’s memory limitations that impose high performance overhead still hinder its broad usage [120]. In detail, confidentiality is guaranteed by the hardware when resorting to a TEE ( i.e., through trusted regions known as enclaves). Based on this, current SGX-based solutions typically deploy full ML workloads inside these enclaves [126,129,153]. As the amount of computational and I/O operations performed at the enclaves increases, the performance of ML training and inference is noticeably affected by hardware limitations, limiting the design’s applicability in practice [73]. This shows that the trade-off of TEEs is made between privacy and performance. Computation partitioning ( i.e., splitting the computation between trusted and untrusted environments) has been studied as an alternative approach to performing this processing more efficiently but applied to different types of computation such as SQL processing, distributed coordination, or MapReduce [36,135,321]. ML workloads have different security requirements and processing logic than the ones found for these workloads. As such, the trade-offs between privacy and performance may differ from each use case. The need to use specific hardware limits the applicability of TEE-based solutions to environments where such hardware is not available ( e.g., mobile, Internet of Things (IOT)). DP has been widely explored and applied in the context of DML,namelyinFederated Learning (FL). However, this solution lingers on the trade-off between data privacy and utility since introducing noise or perturbation to the data or the parameters may restrict the model’s accuracy and convergence time ( i.e., model’s utility) [15]. This trade-off should be carefully studied to understand where to apply DP-based algorithms and how much noise to add. Similarly to the previous primitive, these trade-offs may differ from each algorithm or use case. The balance between utility, performance, and privacy is a fundamental challenge in PPML. Exploring different cryptographic techniques strives to balance the competing demands of data utility and individual privacy. Moreover, there is still a gap between the solutions focusing only on one of the two final stages of the ML pipeline ( i.e., model training and inference) and the ones that focus on both the most computational expensive stages or even in the entire pipeline. For this, we argue that a comprehensive PPML system should answer the following question: Is it possible to balance privacy, performance, and utility in a PPDML solution? With this in mind, the main goal of this thesis is to explore the intricate interplay between distributed machine learning and privacy preservation and to dissect the underlying mechanisms of existing privacypreserving techniques. We further split this goal into three main objectives. 3 CHAPTER 1. INTRODUCTION First, by leveraging third-party infrastructures with access to TEE, we aim to understand the tradeoffs between privacy and runtime performance in a PPDML solution. This solution must comply with the following: i) applicable to different ML algorithms, ii) have no impact on the accuracy of the models, and iii) should be resilient against the attacks mentioned above. Our first objective builds upon the idea that computation can be balanced between the enclaves created by TEE and an untrusted environment. This can be achieved by reducing the number of operations done at enclaves, therefore reducing the runtime performance of ML tasks. Nonetheless, this balance must be carefully studied as the computation to split and balance may differ from each use case, as seen in the work depicted in the following chapters. Our second objective is to apply such a solution to a different use case, where data privacy is critical, for instance, the human genomic data. In detail, by focusing on different data formats, namely Variant Call Format (VCF) and several tasks such as GWAS and Linear Regression (LR)forGWAS, one must consider the different requirements and define a particular balance between the trusted and untrusted code. The demand for this new balance comes from the different data formats and operations performed on each of the algorithms’ implementations. Although having the same mathematical intuition, the LR applied genomic data, differs in implementation when compared to financial data as it must be able to address different types of data, find correlations and also provide new insights related to the predicted p-values . Finally, our third objective focuses on environments where TEEs are not available, and several entities collaborate for a central model ( i.e., in typical FL environment). As such, we focus on the applicability of DP in a FL setting to the transportation and urban mobility domain, where the data is heterogeneous, the privacy requirements are different, and the hardware availability is limited. With this, we aim to offer a solution to privacy-preserve data while training a model to understand users’ mobility patterns and transportation modes in mobile environments. The main goal is to understand the trade-offs between privacy and utility in a real-world use case defined for and by smart cities following a Privacy-Preserving Federated Learning (PPFL) architecture. These three objectives intend to provide a comprehensive answer to the question stated above. 1.2 Contributions The following contributions achieve the goals above-mentioned: Soteria. The first contribution of this dissertation focuses on delivering a secure approach applied over Apache Spark’s ML library, MLlib, which already provides both the scalability and the fault tolerance of a distributed system. Our solution relies on the features of Apache Spark as a distributed system and the security guarantees of TEEs to promote a privacy-preserving distributed approach. The key insight of Soteria is that ML runtime performance could be improved by reducing the number of operations done at enclaves. In fact, 4 1.2. CONTRIBUTIONS this insight is backed up by previous work exploring the partitioning of computation across trusted and untrusted environments, but in contexts with different security requirements and processing logic than those found in ML workloads ( e.g. , SQL processing [321], MapReduce [135], distributed coordination [36]). Understanding and defining the set of trusted and untrusted ML operations is a challenging task. Ideally, these operations should significantly reduce the enclaves’ overall computational and I/O load for different ML workloads, and doing so should not leak critical sensitive information during the execution of ML workloads. In summary, Soteria introduces a new computation partitioning scheme for Apache Spark’s MLlib, Soteria-P, that offloads non-critical statistical operations from the trusted enclaves to untrusted environments. By providing a security proof and a comprehensive experimental evaluation, we show that Soteria-P reduces the runtime of ML algorithms by up to 41% compared to previous related work. Gyosa. While the problem of PPDML can be solved with Soteria, applying such a solution to other types of data, such as genomic data, requires the adaptation of the analysis pipeline since genomic data relies on different algorithms. Despite Soteria providing a generally applicable solution for ML algorithms, one must be able to support these application-specific algorithms when dealing with genomic data. With a focus on Genome-Wide Association Studies (GWAS), Gyosa offers a scalable, distributed, and privacy-preserving solution for GWAS analysis. While Soteria relies on Apache Spark’s MLlib, Gyosa relies on Glow [99], a framework for genomic data analysis. The intricacies of genomic data and the different algorithms applied lead to a different approach regarding the hybrid computation scheme. Results show that Gyosa is able to privacy-preserve genomic analysis while maintaining the original results of GWASes. As expected, there is a trade-off between runtime computation and the level of privacypreserving guarantees similar to Soteria. Gyosa shows a runtime execution overhead ranging from 2.5× for -2statistic tests to 10×on regression-based algorithms. These results highlight that it is possible to effectively reduce the computation runtime overhead by distributing the computation across multiple nodes while still offering privacy guarantees for sensitive data. TAPUS. As the final contribution, we explore how to ensure PPML for collaborative distributed environments where TEEs are not available. With this in mind, we focus on a use case related to smart cities and propose TAPUS. TAPUS is a prototype that explores users’ geolocation information to understand their mobility patterns and transportation modes while promoting sustainable travel behaviors and preserving the privacy of this data. This solution resorts to FL to provide a mobile prototype that averages the gradients from several users to train a model that can be used to understand their mobility patterns and transportation modes. Privacy is preserved by following a PPFL architecture and applying DP, where noise is added in two different ways: i) directly to the data (using local DP), or ii) to the gradients (by leveraging two different algorithms DP-FedAVG and DP-FedSGD ). The trade-offs between privacy and utility are evaluated by comparing the accuracy of the model with and without the application of DP for the three cases. The results show the feasibility of using both DP-FL algorithms and local DP mechanisms to protect 5 CHAPTER 2. PRIVACY-PRESERVING MACHINE LEARNING BACKGROUND •Semi-Supervised Learning merges supervised and unsupervised learning; labeled data is used to train the models, and unlabelled data is used to predict or validate the outcome. This method can be used for all kinds of applications if correctly applied when in the presence of training datasets. •Reinforcement Learning focuses on finding y by reaching an approximation function from an initial linear function, with x and z being the input and the action performed in the system, respectively. This is accomplished based on a sequence of actions, observations, and rewards. The overall goal is to produce a policy for acting in the environment and adapting itself to new conditions introduced to the environment. Reinforcement learning agents can learn by experience [26]. 2.1.2 Algorithms, Loss Functions, and Optimizers An ML algorithm is used to find patterns and correlations within the data. With a broad spectrum of available methods, their complexity degree varies accordingly, but their goal is to reach, within the available data, the task proposed by the user. In accordance with each task ( e.g., classification, dimensionality reduction, regression) to perform, different algorithms are suitable for it, and that is the main criterion on how to choose the correct algorithm [137]. Although having different purposes and characteristics, most algorithms aim to find the best objective function for the task according to its training dataset. These functions are optimized recurring to optimization algorithms, which intend to minimize or maximize the loss functions [324]. The objective function is a mathematical function that learns the internal parameters of the model being trained. These parameters are learned and updated based on the optimization algorithm. As such, optimization algorithms have a leading role in the training process of the machine learning models [102, 324]. For instance, with input samples (-1,~1)...(-=,~=),where-8∈R<,~8∈Rin a linear model function, defined as, 5F,1(G)=F)G+1,(2.1) where F∈R<represents the set of parameters and 1is the intercept [307]. The parameters are found by iteratively reducing the training error. This is done by resorting to the Loss Function. This function is a mathematical method to measure how well the algorithm behaves for the given task. It allows quantifying how far the predictions are based on the predicted values and true values and depends on the algorithms used. However, three commonly used functions are Mean Squared Error (!2), Mean Absolute Error (!1), and Cross Entropy. For example, a linear regression model, such as 2.1, can use Mean Square Error as its cost function, 1 = = ’ 8=1 (~8−(F)G8+1))2,(2.2) 12 2.1. MACHINE LEARNING where N is the total number of data points, ~8is the actual value and F)G8+1is the predicted value [185, 244]. The flow at which the loss function is minimized depends on the optimizer. The optimizer will aid in the search for the best coefficients or weights. The Stochastic Gradient Descent (SGD) is a standard optimization algorithm used both in ML algorithms or when training DL models. This optimization algorithm minimizes a function by iteratively moving to the lowest point. In ML, the gradient descent relies on the loss function to calculate the partial derivatives for the data points. With the partial derivatives, it is possible to learn the slope of the loss function and to know in which direction the coefficients or the weights should be updated. Algorithm 2.1 presents the overall functioning of Gradient Descent. In brief, a gradient is a vector consisting of the partial derivatives of a function. These derivatives will point to the direction in which the weights should be shifted [116,326]. Algorithm 2.1: Gradient Descent 1: Initialize weights randomly 2: while not convergence do 3: Compute gradient, m(,) m, 4: Update weights, W ←,−[m(,) m, 5: end while return Weights The optimization algorithms rely on the knowledge of gradients, which, as said before, are partial derivatives. These gradients represent a measure of change and can point to which direction the coefficients or the weights should be updated to lower the loss function. In Deep Learning, it is also essential to understand the concept of the learning rate , represented by [in Algorithm 2.1. The learning rate allows taking small steps into updating the weights to make the model converge [165,326]. One of the main concerns of the optimizer and the learning rate is being stuck in a local minimum and unable to find the global minimum, allowing it to converge. This usually happens in high dimensional data, where it is common to find several local minima, thus becoming increasingly difficult to reach the global minimum. With this in mind, the learning rate aids the optimizer in updating the weights. However, the steps shall not be too small or too large, as the first hypothesis will not be able to converge to an optimum, and the second may end up in a local minimum [116,165]. A last concept regarding the optimizers is the regularization , which is added as a hyperparameter in deep learning to prevent model overfitting1. The regularization value allows imposing a penalty when the model presents large weights even though its prediction may be correct. This prevents the model from memorizing the training data while allowing it to learn how to generalize [165]. These ML algorithms typically follow a workflow, which is discussed below. 1Overfitting is a common challenge in machine learning where the model memorizes the training data and can predict well for this dataset. However, this trained model performs poorly in new and unforeseen data. 13 CHAPTER 2. PRIVACY-PRESERVING MACHINE LEARNING BACKGROUND 2.1.3 Pipeline The machine learning pipeline is composed of several stages. From data collection to deploying trained models in the wild, each stage has its toll on performance and its own resources necessities for the runtime environment. In detail, the main stages of a machine learning pipeline are as follows. The first stage of any ML pipeline is the collection and generation of data, which goes through the process of Extract, Transform and Load (ETL) to be suitable as the input of the remaining workflow (Figure 2.1-). After this transformation, the data is set as a dataset and works as the input for the chosen model. These datasets are usually decoupled into two smaller ones, the training and the testing dataset (Figure 2.1-À). While the first is used for training the model (Figure 2.1-Õ), the second one should present new data to the trained model and intends to test how the trained model behaves with previously unseen data (Figure 2.1-Œ). Alongside the creation of the two datasets, there is also the need to define the ML model/algorithm to be trained (Figure 2.1-Ã). Figure 2.1: A Common machine learning pipeline and workflow, describing the train and inference approaches. 2.2 Distributed Machine Learning The increasing generation of data, limited by the computational power of a single machine, has led to the development of DML systems. Similar to other distributed processing frameworks, these systems’ main goal is to distribute the computation across several machines, decreasing the computation time. Challenges. Distributing machine or deep learning presents several problems inherent to distributed systems. In brief, there are three goals to developing an architecture for distributed machine learning that meets the standards of distributed computing: •Efficiency: The efficiency of distributed machine learning systems or distributed computing overall can be evaluated by its communication and computational costs. When dealing with distributed 14 2.2. DISTRIBUTED MACHINE LEARNING computing, higher communication overhead and higher costs of machine synchronization are expected. This provides a huge opportunity for the development of new and improved optimization algorithms; •Ease of Use: The trade-off between simplicity, flexibility, and utility is one crucial factor determining if the system will be used and further developed. When using distributed machine learning systems, the standard developer may seek an easy-to-use and centralized interface to provide the necessary information regarding its application, leaving on the background information like task partitioning and resource allocation as well as data communication. However, if information regarding resource allocation or the method used for task partitioning is subsequently required, the developers can easily access it and propose new optimizations; •Fault Tolerance: A machine may fail at any given time, and the job that such a machine was performing may be lost. It is vital to safeguard the computation that this machine was performing. Nevertheless, it is essential to notice that the number of failures increases with the number of available machines and computation time. ML is a time-consuming task ( e.g., training a machine learning model may take several hours or even days). If the system does not implement a faulttolerant mechanism, its usage becomes impractical. Indeed, when focusing on distributed machine learning, one may find two different approaches by which the computation can be parallelized: i) model parallelism and ii) data parallelism. These two approaches differ in the tasks performed; however, the main goal is the same: it is intended to find the model that better suits the data within the minimum time possible. This goal redirects the research to choose the best methodology for each approach since there are different ways to combine the models, gradients, and weights. While we focus our efforts on ML algorithms, in this setting, the distribution follows a typical architecture of several workers computing over-datasets and broadcasting the gradients, parameters, or other information to a master node or parameter server. Nonetheless, one can follow several strategies to achieve this architecture, and each strategy has advantages and disadvantages [186, 230,293]. 2.2.1 Strategies Over the years, there have been many procedures developed and implemented to optimize the behavior of common algorithms used in distributed machine learning, which can be decomposed into five main solutions: i) MapReduce, ii) Parameter Server (PS), iii) Gossip Learning, iv) All-Reduce and, v) Federated Learning (FL). The common goal of these solutions is to provide a scalable and fault-tolerant system that can be used to train machine learning models. Moreover, besides Gossip Learning , these solutions typically follow a similar distributed setting with a master and several workers. The nomenclature of the master may be 15 CHAPTER 2. PRIVACY-PRESERVING MACHINE LEARNING BACKGROUND different, but the main goal is to aggregate the information from the workers and to provide the necessary information to the workers. Next, each of these solutions is briefly described. 2.2.1.1 MapReduce The emergence of big data dictated the need to distribute the computation across several nodes to decrease its execution time. MapReduce’s programming model was developed to facilitate data distribution and the parallelization of the computation across several nodes while providing fault tolerance and load balancing [70]. Figure 2.2: Example of a MapReduce architecture. The master "selects a set of workers ,to perform the computation. The master "is responsible for distributing the data across the workers ,and aggregating the results. The workers ,are responsible for the computation of the map function (,"=)and the reduce function (,'8). This model is the basis of Apache Hadoop [114] and comprises two main functions: the map function and the reduce function. The map function is responsible for the data distribution across the nodes, and the reduce function is responsible for the aggregation of the computation. The map function is applied to each data point, and the reduce function is applied to the output of the map function. While this model is usually applied to batch processing, and it is unsuitable for iterative algorithms, such as machine learning algorithms, there are some adaptations of this model to support these algorithms, such as in Spark [314]. This paradigm follows a master/worker architecture, where a master "selects a set of workers , to perform the computation. The master "is responsible for distributing the data across the workers ,and aggregating the results. The workers ,are responsible for the computation of the map function and the reduce function. The master "is responsible for the fault tolerance of the system and the load 16 2.2. DISTRIBUTED MACHINE LEARNING balancing of the system, and it can redistribute the computation to another worker,if the current worker ,is overloaded or in any point failed [70]. 2.2.1.2 Parameter Server The Parameter Server is a technique that provides an efficient mechanism for aggregating and synchronizing model parameters and statistics between workers. Figure 2.3: Example of a Parameter Server architecture. The parameter server sends a model replica to all its workers, and the workers send the gradients back to the parameter server to be aggregated or averaged. The new gradients are sent to the workers to compute over the model once again until it reaches convergence. These gradients are depicted as small boxes in the figures. In ML, this strategy follows a simple structure where the parameter server sends a model replica to all its workers, and the workers send the gradients back to the parameter server to be aggregated or averaged, depending on the algorithm used, see Figure 2.3. The new gradients are sent to the workers to compute over the model once again until it reaches convergence. Depending on the methodology followed, synchronous or asynchronous, the parameter server should wait or not for all the workers to calculate the new gradients and update the model. In other words, the parameter server is a distributed shared memory system from which the worker can access the global model parameters with a key-value interface. It is possible to create a cluster of parameter servers while each manages its cluster of workers [69,158,270, 300,306]. 2.2.1.3 Gossip Learning Fully decentralized machine learning is starting to be adopted as the de facto standard for collaborative learning. Since 2006, Gossip algorithms have been proposed to increase the opportunity to perform machine learning over distributed data. Known as peer-to-peer communication, Gossip relies on asynchronous communication between entities [33]. In machine learning, each worker is a data owner who chooses a fixed number of workers with whom they want to exchange the gradients, with the intent to 17 CHAPTER 2. PRIVACY-PRESERVING MACHINE LEARNING BACKGROUND disseminate the gradients across all workers, see Figure 2.4. Gossip learning has several advantages, such as the possibility of creating a fully decentralized system and being fully asynchronous [215]. Figure 2.4: Example of a Gossip Learning architecture with a randomized algorithm. Each worker is a data owner who chooses a fixed number of workers with whom they want to exchange the gradients (in this example, this choice is random) to disseminate the gradients across all workers. This setting has several requirements, such as i) the robustness of the model, once it has to still be accurate in a scenario with multiple failures, ii) the need for low communication complexity, and iii) it must allow the local use of the models for inference. These three design requirements promote the distributed setting where data owners can profit from other data owners with the same type of data without sharing any raw data [64,215]. Without the need for strong consistency, several gossip-based SGD algorithms have been proposed, which were able to achieve both convergence and faster performance than All-Reduce SGD [64,136, 240]. 2.2.1.4 All-Reduce The acknowledgment of All-Reduce algorithms relies on the knowledge of parallel computing and the fact that these processes can be modeled as directed acyclic graphs (DAG). These graphs are represented by the computations (vertices) and the data dependencies (edges). Conversely, most machine or deep learning computations can be modeled as operations on tensors, creating graphs. In distributed deep learning, these graphs are partially computed in different workers, and all the workers communicate to perform a reduction operation. These operations are based on the combination of values from all processes or workers and the distribution of the results to all processes [226]. The All-Reduce approach, used in Deep Neural Networks(DNNs) and introduced in 2015 by Baidu [305], removes the server concept. This setting usually resorts to the Message Passing Interface (MPI), and the first results, using InfiniBand switches, were promising. 18 2.2. DISTRIBUTED MACHINE LEARNING Figure 2.5: Example of an All-Reduce architecture with scatter and reduce phases. Each worker computes over their training data with their model replica and maintains a subset of parameters, here represented as small boxes. In the last communication round, all workers have the aggregated parameters. This algorithm is commonly applied on GPU processors, and each GPU core is seen as a worker. As seen in figure 2.5, the All-Reduce algorithm follows a simple architecture, where each worker computes over their training data with their model replica and maintains a subset of parameters, i.e., each worker computes its local gradients. Afterward, all workers communicate in a ring-like pattern to compute an aggregate gradient and update their models. This process is repeated until the model converges. 2.2.1.5 Federated Learning Federated Learning’s (FL) primary assumption relies on the fact that it works without the user sending its data to the cloud, providing a distributed mindset with some privacy guarantees. This technique is intended to train a high-quality centralized model while the training is distributed over many clients, who present an untrustworthy and relatively slow network connection, and also highly unbalanced and Non-IID data [27]. As a federated computation environment, this computation scheme has a server coordinating all the devices participating in computing aggregations of its private data. Federated computation can also be seen as a MapReduce setting for decentralized data with privacy aggregation built-in. The main difference between typical MapReduce computation performed at a data center is that, in this particular case, the system has limited computation, intermittent compute node availability, and intermittent data availability [145,189]. This setting is known to be highly distributed once the training data is stored across many devices. FL settings allow the usage of other implementation methods such as Split Learning . This methodology implies splitting DL models by their layers to different worker nodes, keeping part of the model in the parameter server [282]. Nonetheless, we consider this methodology orthogonal to the work developed in this thesis and highlight that it is in its early stages of development. 19 CHAPTER 2. PRIVACY-PRESERVING MACHINE LEARNING BACKGROUND Figure 2.6: Federated Learning architecture. Similar to the parameter server architecture, the server coordinates all the devices participating in computing aggregations of its private data. The devices may choose to participate in the computation or decline the request. The gradients shared between the devices and the server are depicted as small boxes in the figure. 2.2.2 Summary Each of these strategies works for different environment settings and requirements. With a growing number of distributed machine learning frameworks, understanding each strategy’s advantages and disadvantages is vital. Table 2.1 summarizes the pivotal features of each strategy, namely its distribution, efficiency, fault tolerance, privacy, scalability, and applicability. The distribution feature can be split into distributed computation per definition or collaborative computation. In the first case, distributed computation stems from the goal of decreasing the training or inference time of an ML algorithm by leveraging distributed resources ( e.g., from cloud services). Second, in a collaborative computation setting, several nodes from different entities collaborate to train a standard model, each resorting uniquely to their data. The efficiency feature relates to the computation and communication overheads such a strategy may incur. The fault tolerance feature relates to the strategy’s ability to withstand failures. In detail, MapReduce presents itself as the most scalable, fault-tolerant, and simple framework. Although its usage can be hindered by its native implementation, optimizations to this architecture model, which are available, for instance, in Apache Spark , changed its core and led to in-memory computation. This novel approach removed its bottleneck on batch processing or iterative algorithms and improved its latency by reducing disk-based I/O operations. Regarding fault tolerance, MapReduce has been improving this feature over the years, proposing different alternatives to complete the jobs and not affecting its completion time while currently being resilient to byzantine failures [191]. Although these optimizations 20 2.2. DISTRIBUTED MACHINE LEARNING Table 2.1: Summary of main strategies for distributed machine learning. Strategy Distribution Efficiency Fault Tolerance Privacy Scalability Applicability MapReduce D↑ # ↑A, ML, DL Parameter Server D↑# # ↑ML, DL Federated Learning H↑H# ↑DL All-Reduce D↓H# #↑DL Gossip Learning H↓H# G# ↓DL Distribution Efficiency Fault Tolerance Privacy Scalability Applicability D - Distributed ↑- Efficient - Byzantine -Yes ↑- Scalable ML -ML Algorithms H - Collaborative ↓- Not Efficient H# - Crash G# - Partial ↓- Not Scalable DL - DL Algorithms #- No #- No A - Analytics (Queries, Stats) have improved its performance and resilience, one of the drawbacks of this approach is the lack of privacy guarantees. Similarly, Parameter Server presents a simple architecture that is easy to use and implement. However, the parameter server itself can be seen as a single point of failure, and with the increasing number of workers, it can become the scalability bottleneck. With this, research works have been proposed to remove the single point of failure such as the one by Li et al. [157], which proposes having multiple nodes working as parameter servers. While mainly applied on mobile settings, Federated Learning have shown promising results, being applied in production in systems such as GBoard from Google. This emphasizes its prevalence in the DML field. However, the hardware limitations, unstable communication, and intermittent compute node availability are seen as the main drawbacks of this approach [139]. Also, this is a setting where privacy is a focal concern since the data is collected directly on the user’s device, and sensitive information cannot leave the user’s premises. On the other hand, Gossip Learning relies on peer-to-peer communication protocols, which are fully decentralized and asynchronous. However, the communication overhead and the low convergence rate are seen as the main drawbacks of this approach, and its current fault-tolerant mechanisms do not prevail in the presence of byzantine failures, which is a feature shared with FL. Regarding privacy, FL assumes a threat model where data is not shared among other devices. Similarly, Gossip Learning is typically applied in a setting where the entities have some degree of trust. This trust can be improved by resorting to a gossip protocol that provides some degree of privacy. However, the privacy guarantees of these strategies may not suffice as they may not mask the shared gradients or limit the type of computation performed. Finally, All-Reduce is a scalable strategy that reaches high convergence rates. Nonetheless, it can present a bottleneck when the number of workers increases since it is based on a ring-like communication pattern. This issue stems from the increasing communication and synchronization times. In regard to fault tolerance, MPI-based algorithms do not natively provide this property. Nonetheless, recent works have been proposed to tackle this challenge by providing mechanisms that allow for executing a global 21 CHAPTER 2. PRIVACY-PRESERVING MACHINE LEARNING BACKGROUND Partially Homomorphic Encryption (PHE). This primitive is limited to some operations, such as addition and multiplication, and is only able to perform one of the operations. There are three main PHE cryptosystems: RSA, ElGamal, and Paillier. The first two cryptosystems present a multiplicative homomorphism while the last one has additive homomorphism [79,216,249]. In brief, this cryptosystem allows additions over encrypted data, providing a good solution for e-voting schemes, among others [216]. Somewhat Homomorphic Encryption (SWHE). Similarly, SWHE is limited to a specific number of operations or even some circuits. This terminology depicts homomorphic schemes that allow evaluating Boolean and arithmetic circuits [7]. The scheme proposed by [309], where the function to compute is described as a Boolean circuit , enables two parties, A and B, to jointly compute this function over their private inputs without revealing anything except the output of the function. Additionally, the SWHE scheme proposed by Boneh, Goh, and Nissim was considered the first step towards an FHE scheme and allowed to do one multiplication and many additions while keeping the ciphertext size constant [7, 30]. Fully Homomorphic Encryption (FHE). Finally, FHE follows the same pattern as the other two approaches. FHE schemes allow a boundless number of evaluation operations to be performed on top of the encrypted data while guaranteeing that the results are within the ciphertext space. Currently, FHE algorithms are not yet practical for real-world applications, but FHE schemes developed for specific applications ( e.g., to handle the computation of large numbers, to perform Single Instruction Multiple Data (SIMD) operations) show its practicality [184]. Table 2.2: Operation comparison between the three types of homomorphic encryption. Primitive Operations Schemes PHE Addition or Multiplication RSA ElGamal Paillier FHE Searching, Sorting, Max, Min, AND, OR, NOT Gentry SWHE Circuits (AND, OR, NOT), Addition, Multiplication Garbled Circuits BGN PHE: Partially Homomorphic Encryption FHE: Fully Homomorphic Encryption SWHE: Somewhat Homomorphic Encryption These three types of primitives present different characteristics, being employed according to the operations they enable to perform (Table 2.2). However, although there were several approaches to make FHE a realistic solution for practical implementation, it is still challenging to employ such a technique since it is extremely slow to compute. According to Acar et al. [7], the performance of any encryption scheme should be evaluated by its security degree, speed, and simplicity. As such, homomorphic encryption schemes must be able to ensure that an attacker cannot obtain any information using any attack while being fast and transparent. The last feature is its simplicity, which allows these cryptosystems to be used in other systems, such as multi-party computation. 28 2.3. PRIVACY PRESERVING MACHINE LEARNING Current Solutions Currently, SMPC and HE are usually combined to deliver secure and private solutions. In this sense, Ma et al. [179] recently proposed a promising new framework for privacy-preserving ML where the obtained results have surpassed previously state-of-the-art solutions. This work shows the feasibility of running both homomorphic encryption and secure multi-party computation for collaborative machine learning. Nonetheless, it is important to notice that similar to other solutions, this framework focuses on specific machine learning algorithms, such as Neural Networks(NNs). In a different setting, Li et al. [159] uses different keys between the clients and the servers to keep data encrypted but be able to compute over it. The multi-key schemes this work uses present high privacy guarantees, where the sensitive data is privacy-preserved, as well as the intermediate results and the trained model. However, using fully homomorphic schemes has shown low-efficiency results, increasing the computational requirements in the system. In a multi-party computation environment, the SecureML [198] framework enables multiple clients to share their data between two non-colluding servers in a two-party computation (2PC). These servers train different models on the joint dataset of all clients without learning any information beyond the trained models. This approach can scale to two or three servers and relies on GCs, HE,andSS. This procedure allows performing arithmetic computations on shared decimal numbers. However, it cannot compute non-linear functions, which are present in NNsas activation functions. ABY3 [197] is an extension of the previous work, SecureML , by focusing on three-party computation (3PC) which incurs several changes and improves the runtime performance when compared with its 2PC counterpart ( i.e., SecureML). Phong et al. [231] create a new version of the Privacy-Preserving Deep Learning (PPDL) methodology with additively homomorphic encryption and asynchronous stochastic gradient descent. They also prove that the approach used by Shokri and Shmatikov [266] is not the best approach to privacy-preserve local data. They achieve a good balance between security and accuracy, being the only trade-off in the increased communication between the learning participants and the cloud server. So, their approach magnifies the trade-off between efficiency/privacy and not accuracy/privacy. Alternatively, Gupta and Raskar [112] proposes a multi-party computation approach without cryptographic primitives, relying only on the lack of sensitive information the encoded representations exhibit. In this method, two entities, Alice and Bob, with Bob being a High-Performance Computer, perform a twoparty computation. Alice and Bob initiate their computation at the same time with random parameters. Alice iterates over its dataset and transmits encoded representations to Bob while Bob then computes losses and gradients and sends them back to Alice. Ryffel et al. [255] offer the first reliable general framework for privacy-preserving deep learning ( PySyft ). While proposing a standardized protocol for communication between workers, the authors focus their efforts on the federated learning setting. Built over PyTorch, this framework aims to create a chain abstraction model on tensors to override operations while also allowing the implementation of differential privacy and secure MPC primitives. 29 CHAPTER 2. PRIVACY-PRESERVING MACHINE LEARNING BACKGROUND By following the previous approaches, BLAZE [227]and FLASH [41] are two frameworks that employ SMPC to allow the execution of LR, Logistic Regression, and NNs. These frameworks main goal is to optimize previous solutions, such as SecureML [198], ABY3 [197]and ASTRA [52]. More recently, these solutions were extended to support four-party computation (4PC)in Tetrad [147]and Trident [53]. The evolution to 4PC allows for a more efficient dot product computation and also the usage of simpler protocols for communication between parties. The applicability of most of these solutions is still limited to specific machine learning algorithms, such as LR, Logistic Regression, DTs, Support Vector Machine (SVM)and NNs[6, 65]. Although novel and more efficient protocols are currently being proposed and made available at the time of writing, a thorough overview of each independent system is yet to be made as it may introduce new insights regarding the limitations and potential of each protocol. Nonetheless, as seen in the previous approaches, one of the limitations of SMPC-based solutions is the number of entities that can participate in the protocols. Most of these solutions are based on 2PC to 4PC protocols, which hinders the scalability of these solutions. Regardless, these solutions do not focus on the scalability per se but on the privacy guarantees offered. For a further overview of these state-of-the-art solutions regarding SMPC and HE, please refer to Table 2.3. These systems are categorized by the cryptographic primitives they rely on, the machine learning stage they are applied to, the algorithms they support, and the protocol they follow. The latter is translated to the number of parties that can participate in the protocol, which is mainly applied to SMPC. Also, a thorough overview of the current state-of-the-art solutions focusing on these cryptographic primitives can be seen in the recent work from Qin et al. [238]. A different cryptographic primitive that follows the same principles of SMPC and HE is the use of Zero- Knowledge Proof (ZKP). However, we see this work to be orthogonal to the work that is being developed in this thesis, and the current state of the art is in its early stages [172,319]. 2.3.2.2 Differential Privacy and Federated Learning The intuition behind Differential Privacy (DP) relies on the fact that changing any individual points on the input data will not change the query result, and an attacker cannot deduce private information with high confidence [76]. In this sense, Dwork and Roth [78] were able to compare machine learning and differential privacy as having the same goal: to extract new insights from data without memorizing any individual data points. DP is commonly used when two requirements are met, namely: i) the data to be processed is sensitive, and ii) the adversaries want to recover this sensitive data. Formally, aiding the anonymization of data, differential privacy introduces randomness or noise in data, limiting the leakage of private information [78]. In 2006, Dwork et al. [77] proposed the concept of Y-differential privacy to define privacy loss when collecting data from a private database. The intuition behind this definition is the same as differential privacy. If one of the elements is removed from the dataset, the analysis returns the same result. Although 30 2.3. PRIVACY PRESERVING MACHINE LEARNING Table 2.3: Overview of PPML solutions resorting to Secure Multi-Party Computation and Homomorphic Encryption. Systems Crypt. Primitives ML Stage Algorithms Protocol SecretFlow-SPU [179] DL 2, 3, = SecureML [198] ,H# ML, DL 2 ABY3 [197] ,H# G# ML, DL 3 Gupta and Raskar [112] – DL = Abspoel, Escudero, and Volgushev [6] ML 3 Tetrad [147] G# ML,DL 4 FLASH [41] G# ML,DL 4 Trident [53] ,H# G# ML,DL 4 BLAZE [227] G# ML, DL 3 ASTRA [52] # ML 3 Damgård et al. [65] # ML = PySyft [255]#, # DL ? DeepSecure, CryptFlow [242,251] ,G# # DL 2 XONN, SIRNN [241,245] ,G# # DL 2 Phong et al. [231]#G# DL – Li et al. [159]#G# DL – Helen [322]# ML – GAZELLE [138]# # DL – Bost et al. [32]# # ML – Cryptographic Primitives ML Stage Algorithms Protocol #-HE - Training ML - Machine Learning #- Number of Parties G# -OT #-Inference DL - Neural Networks H# -GC G# - Both -SS this is a valuable technique, this abstraction from specific data points may be difficult to achieve when there are limited and distinct data points. For instance, the application of this technique to the medical context can be harsh to abstract when dealing with rare conditions and these distinct data points [78]. Currently, DP algorithms can be defined by how and where the noise is added. The how can be defined by the noise distribution mechanisms such as e.g., Laplace, Gaussian, or Exponential. Each of these mechanisms applies noise differently and accordingly to a distribution. The where can be defined by the location where the noise is added, e.g., the input, the gradients, or the output, which in the ML pipeline translates to adding DP-based algorithms on the data treatment stage, the training stage or the inference stage (prediction phase), as seen in Figure 2.9. In sum, as defined in Ponomareva et al., the common goal of each of these approaches is to protect the original training data [235]. One of the critical concepts in DP is the notion of n, which is the privacy parameter or the privacy budget [235]. The ndefines the level of privacy, and smaller values represent stricter privacy levels. The nis inversely related to the noise added to the data, and the lower the n, the higher the noise added to the data. Similarly, this concept increases the trade-off between privacy and accuracy [235]. 31 CHAPTER 2. PRIVACY-PRESERVING MACHINE LEARNING BACKGROUND Figure 2.9: Differential privacy application on the machine learning pipeline. The noise can be added to the input data here referred to as Local DP, the gradients as Training DP, or the output as Prediction DP. In contrast, FL, although not directly depending on differential privacy, may also apply DP-based noise to the data to protect the privacy of the users. In its common usage, FL does not offer strong security guarantees. By resorting to known protocols, such as FedProx [162], or FedAVG [189], data is not directly shared between the clients and the server. However, the clients need to broadcast their model gradients. Other protocols follow the same principle as seen in Li et al. [160]. In brief, protocols such as FedProx and FedAVG are based on an initial protocol FedSGD .Themain difference between these protocols is the addition of a proximal term to the loss function in FedProx and the addition of a weighted average of the gradients in FedAVG [189]. The proximal term in FedProx allows the addition of a regularization term to the loss function, which is a common technique to avoid overfitting [162]. The weighted average of the gradients in FedAVG allows the addition of a weighted average of the gradients, which is a common technique to avoid the divergence of the model. However, these techniques do not hinder membership inference or model inversion attacks. With this, and as attacks rise to enable the usage of gradients to reconstruct original data, the interplay between DP and FL has been the focus of recent approaches that aim to privacy-preserve data in these settings [160]. Current Solutions In general, when focusing on PPML, differential privacy is applied on the gradients that are broadcasted between clients and the parameter server to mitigate the leakage and the inversion of the models. One of the first approaches was introduced by Rubinstein et al. [254]toSVMs. This approach was based on the addition of noise to the output classifier. Similarly, Chaudhuri, Monteleoni, and Sarwate [54] proposed a differentially private ERM classifier. This approach was based on the addition of noise to the gradient of the objective function. Shokri and Shmatikov [266] proposed a selective stochastic gradient descent, allowing the selection of which parameters would be broadcast. However, their second solution allowed them to combine this 32 2.3. PRIVACY PRESERVING MACHINE LEARNING selective process with DP. In sum, this method suggested a new distributed training technique based on selective stochastic gradient descent with differential privacy. On the same note, Abadi et al. [3] proposed the combination of differential privacy with the stochastic gradient descent, although suggesting that other optimization algorithms could be used, i.e., by adding a specific noise to the computation. A significant contribution of this work was the development of the “ moment accountant ”algorithm,whichcantrack and analyze the privacy loss in these systems. In the same line of work, Rényi Differential Privacy was introduced by Mironov [195] as a new privacy definition that allows the analysis of the privacy loss in a more accurate way. With this in mind and with FL not providing the security guarantees needed to perform secure training, McMahan et al. [190] introduced several changes to the federated algorithm proposed previously and implements the DP-FedAVG , which adds DP-noise to the parameters computed by the clients before sending them to the parameter server. On the other side, Papernot et al. [219] proposed a new algorithm, Private Aggregation of Teacher Ensembles (PATE), with strong privacy guarantees to train models with disjoint datasets. These trained models are known as teachers, and the student model learns by the major voting among all the teachers. An interesting aspect of this approach is that when the teachers agree on a trained model, it is guaranteed that the models found a general pattern and did not memorize the data. The student will then learn by the major voting among all the teachers and cannot access an individual teacher or its parameters or data, protecting both the training dataset and the several teacher models. A different approach is proposed in Mao et al. [183]. In this work, the authors split the model between the clients and the server, with the clients being edge devices. As such, the model is split on the first convolutional layer and sent to the mobile device. At the end of the computation, the model’s output on the user side is privacy-preserved, using Gaussian noise. This output is then used as the model’s input on the server side. All the intermediate results are hidden for each side. A different approach was taken by Lecuyer et al. [154], which introduced PixelDP . The goal of this solution was to add noise to the input data and any intermediate layer of the model to increase the robustness of the models to adversarial samples. Unlike the other works, this work shows the feasibility of using DP to increase the models’ robustness, providing groundbreaking information for further solutions. Regarding Decision Trees (DT), several works resorting to DP have been proposed, and an encompassing overview of these solutions can be seen in Fletcher and Islam [87]. The preliminary results date to 2009 and evaluate how the implementation of DP in DT affects the accuracy of the model. In addition, the medical field has also been a target for the application of DP in ML models, which show the applicability of these solutions to reduce the risk of privacy leakage [9, 123,260]. These systems differ from the previous ones as they do not propose new algorithms but rather discuss the performance of the current state-of-the-art solutions in a medical setting or apply Gaussian noise by implementing an algorithm similar to DP-SGD . Other works have been able to provide a taxonomy for the implementation of DP in ML as seen in Liu et al. and Gong et al. [101,170]. Similarly, the shortcomings of the usage of DP are mainly focused on 33 CHAPTER 2. PRIVACY-PRESERVING MACHINE LEARNING BACKGROUND Table 2.4: Overview of PPML solutions resorting to Differential Privacy. Systems Algorithm Distribution Applicability Noise Stage Shokri and Shmatikov [266] DP-SGD D DL #H# Abadi et al. [3] DP-SGD C DL H# McMahan et al. [189,190] DP-FedAVG F DL PATE [222] – D DL #H# Mao et al. [183] ? aS DL G# NbAFL [301] DP-SGD F DL H# Triastcyn and Faltings [287] BayesianDP-FedSGD F DL G# DP-SCAFFOLD [206]SCAFFOLD F ML,DL H# Adnan et al. [9] DP-SGD F DL H# PixelDP [154] PixelDP C DL ? b G# Sawhney et al. [260] DP-SGD C DL H# Splitfed [282] PixelDP S DL H# H# Distribution Applicability Noise Stage C - Centralized ML - Machine Learning - Gaussian - Input D - Distributed DL - Neural Networks #- Laplace #- Output F -Federated H# -Other H# - Training S - Split G# -Mix a The authors do not specify the algorithm used. b The authors do not specify the noise distribution used. the trade-off between accuracy and privacy, which is still a challenge to be addressed. Finally, there are several recent surveys worth mentioning. Zhang, Lu, and Liu [317] provide a systematic review of the current state-of-the-art solutions regarding the application of DP in FL, while Demelius, Kern, and Trügler [71] highlights the works on the convergence of DL with DP. In accordance with SMPC and HE, the fusion of FL and DP is growing exponentially with the evolution and development of FL and new thorough works are expected to be made available. In table 2.4, we highlight some works that are relevant to the current state-of-the-art regarding the application of DP in ML. These works are categorized by the base algorithm they build upon, the system’s distribution and applicability, the noise mechanism they follow, and the stage in which DP is added. The different noise mechanisms are categorized by the type of noise they add, e.g., Gaussian, Laplace, or other ( e.g., Exponential, Poisson). The stage in which DP is added is categorized by the stage in the ML pipeline, e.g., input, training, or inference/output. The mix category is used when the noise is added in more than one stage. The distribution and the applicability of the system are categorized by the learning distribution that the system follows, e.g., centralized, federated, distributed or split, and to which type of learning algorithms it has been applied, e.g., ML or DL. In sum, most of these works are focused on a DL setting and the training of DL algorithms, which may hinder the broad usage of these solutions in other settings. Nonetheless, the application of DP in ML is still a growing field with several open challenges to be addressed. Although some of these works are categorized as being distributed, the main difference from the FL ones is based on the fact that they do 34 2.3. PRIVACY PRESERVING MACHINE LEARNING not rely on typical and defined FL protocols, such as FedProx or FedAVG . 2.3.2.3 Trusted Execution Environments The increasing number of hardware-based solutions has potentiated the shift in the paradigm of using only software-based cryptographic techniques. Trusted hardware came to mitigate the still-existing problems with in-memory storage protection. These components can isolate sensitive code and data by providing an isolated environment, protecting this information from any malicious attacker who intends to modify or perform reverse engineering to the code and data sent to this trusted environment. Trusted Execution Environments (TEEs) provide an alternative to SMPC and HE, tapering the costs of performing such expensive computation and allowing the outsourcing of data and code to an untrusted system with trusted hardware. Some hardware-based solutions have been proposed, with two being the most relevant: Intel’s Software Guard Extensions (SGX) [188]and ARM’s TrustZone [14]. These solutions are based on the same principles, although they differ in the implementation and the hardware they are deployed on. Also, AMD’s Secure Encrypted Virtualization [261] is a hardware-based solution that allows the creation of encrypted virtual machines and is comparable with Intel’s Trust Domain Extensions (TDX). Academic approaches have also been proposed, such as Sanctum [63]and Sanctuary [34]. These solutions have already been thoroughly compared in recent literature [134,320]. In brief, SGX resorts to the intuition of enclaves ,a region isolated from any other code in the system and is applied to personal computers or servers, similar to SEV [105,134]. As for Trustzone , although built for multi-platforms, its development has been focused on mobile devices similar to Sanctuary [134]. Although these hardware-based solutions have shown their advantages and trade-offs between performance and security, the following works focus mostly on SGX due to its broad availability and documentation. Generic Applications on TEEs While offering an isolated environment where computation can be performed, solutions have been proposing a method where all the data processing is done inside these environments. Solutions such as SCONE [17], RYOAN [127], Gramine [289], SGX-LKL [237], and Panoply [265] have shown the feasibility of execution full applications ( e.g., DNN[129], BWA [303]) inside TEEswithoutincurringinexponential performance overheads. These works can be decomposed into two main categories: i) sandbox and ii) minimal Trusted Computing Base (TCB)/host interface solutions. Sandbox solutions such as SCONE [17]orRYOAN[127] allow the seamless introduction of a nonsecure application to TEEs. SCONE presents itself as a portable tool to run applications inside trusted execution environments without the need to modify the application’s source code. This tool allows the creation of a secure container, which is then deployed in a trusted execution environment where the 35 CHAPTER 2. PRIVACY-PRESERVING MACHINE LEARNING BACKGROUND application can be executed. On the other side, RYOAN presents a sandbox utility that allows the attestation of a module to be computed in the trusted execution environment. This solution can also be applied to a distributed setting similar to a federated learning one. Nonetheless, it still relies on the assumption that all the computation is performed inside the enclave and that each entity has SGX-enabled hardware. In the same sense, Enarx [83]and Veracruz [292] emerged as alternative solutions that provide users with a sandboxing environment to run their applications. Systems like Gramine [289], SGX-LKL [237], Occlum [264]or Panoply [265] offer a solution for running unmodified applications inside a trusted execution environment to reduce the host interface or the TCB. Both Gramine , Occlum and SGX-LKL follow a similar approach by deploying partially or fully the Library Operating System (LibOS) inside the enclaves, trying to minimize the host interface. While the latter aims to use a complete LibOS, including network stacks and file system, inside the enclave, the first only deploys a partial LibOS and supports multiprocess applications as it relies on the hosts’ threading implementations. On its own, Occlum is a lightweight LibOS that provides a secure environment for running legacy Linux applications. Also, by resorting to Rust, this solution is more resilient to memory-safety bugs. On the other side, Panoply follows a different approach since it delegates all the C library calls to the host and exposes a larger host interface[265]. Although reducing the TCB, this approach may lead to the leakage of sensitive parameters [237]. However, both Panoply and SGX-LKL are no longer maintained as opposed to Gramine , which Intel and other universities are currently backing. Both Veracruz and Occlum are based on Apache Teaclave ’s confidential computing platform [16]. Computation Partitioning on TEEs Performing all the computations inside enclaves is a costly operation due to the increased TCB. This issue has been addressed by solutions resorting to computation partitioning, i.e., partitioning the computation between trusted and untrusted code/environments. Nevertheless, this partitioning is not a trivial task and requires a thorough analysis of the application to be deployed. For instance, computation partitioning leads to the execution of code inside and outside of enclaves. With this, it is vital to analyze the data and the code to be executed to guarantee that sensitive data is not disclosed to untrusted entities or malicious adversaries. Uranus [135]and Montsalvat [313] propose computation partitioning between the trusted execution environment and the untrusted environment. This approach allows non-sensitive computation to be performed in a non-secure environment while sensitive data is processed inside the trusted execution environment. Glamdring [168] proposes a static analysis tool that infers a partition between trusted and untrusted code in an application. It tries to achieve a balanced distribution of partitions to minimize the number of edges crossing between components. Another approach, Civet [290], focuses solely on partitioning Java applications. It provides an annotation-based approach for partitioning Java applications and ensures inter-object communication and consistent garbage collection across the partitioned components. Finally, Uranus [135]and Montsalvat [313] propose two automatic partitioning tools. Uranus [135] 36 2.3. PRIVACY PRESERVING MACHINE LEARNING addresses the challenges of automatic partitioning between trusted and untrusted code in Intel SGX enclaves. However, unlike Glamdring , Uranus tries to enforce the trusted and untrusted code partition at runtime. Conversely, Montsalvat [313] provides an automatic partitioning tool for GraalVM images that automatically annotates trusted and untrusted code to be computed inside trusted execution environments. More recently, SecV [312] extends the previous work proposed in Yuhala et al. [313] and creates a polyglot solution that, based on GraalVM , allows the partitioning of trusted and untrusted code for different programming languages. Current solutions Although the usage of TEEs has increased to deliver PPML solutions, it is commonly deployed in three learning settings: i) centralized; ii) collaborative; and, iii) distributed learning. The first approach focuses on performing the computation securely in each entity’s premises or outsourcing it to cloud environments that perform the computation in a centralized manner. The second one follows the same principles of SMPC where each entity performs its computation and exchanges the results with the other entities. The third approach aims to decrease the execution time of the computation by distributing it among different nodes. With the increasing usage of TEEs, with a focus on SGX, the applicability of these solutions ranges from simple SQL queries [321] to more complex machine learning algorithms [155]. Outsourcing computation to a third party typically follows a centralized approach, as seen in solutions like SGX-BigMatrix , Slalom , MaskAl , Privado , SkSES and TensorScone [110,144,150,152,263,285]. Slalom and Privado [110,285] focus on protecting the inference of neural networks by outsourcing it to TEEs. Slalom presents one of the first solutions of partitioning DNNs for inference. This solution is based on the partitioning of the DNN into two parts, one that is executed inside the enclave and another that is executed outside the enclave. As for Privado , the authors focused their efforts on showing that DNN inference inside SGX is feasible but is vulnerable to access pattern attacks. With this, the authors present a solution that allows the inference of DNNs inside SGX while mitigating the access pattern leakage. This mitigation is achieved by resorting to OT protocols, which create an input-oblivious solution. MaskAl [152]and SkSES [144] target the genomic analysis pipeline for two different tasks, i.e., read mappings and GWAS, respectively. They use distinct approaches as the first masks data with filters before refining alignment score inside the TEEs while the second re-implements GWAS algorithms and -2tests to be executed inside the secure environments. Finally, TensorScone relies on the Scone technology to deploy a secure environment for the execution of DL model and is implemented on top of TensorFlow. In the collaborative learning setting, Ohrimenko et al. [210] present their data-oblivious version of five of the most used machine learning algorithms, creating an alternate version of K-Means, SVM, NNs, DTs, and matrix factorization. These modified algorithms provide strong privacy guarantees while preventing the exploitation of side channels induced by memory, disk, and network accesses. In brief, this framework 37 CHAPTER 3. PRESERVING PRIVACY IN DISTRIBUTED MACHINE LEARNING significant performance toll that restricts their applicability to practical scenarios [231]. Nonetheless, since early 2016, several works have been building on top of each other to mitigate this performance penalty while offering higher security guarantees [32,97,147,197,198,227]. These solutions have been able to support a wide range of ML algorithms, in most cases with the added need to re-implement them. However, they still impose a significant performance penalty, which can be prohibitive for some applications. To circumvent this performance penalty, another line of research is that of exploring hardware technologies enabling Trusted Execution Environments TEEs, such as Intel SGX [188]. These technologies allow the execution of code within isolated processing environments ( i.e., enclaves) where data can be securely handled in its original form ( i.e. , plaintext) at untrusted servers. Initial approaches resorting to SGXs focused on deploying the full ML workload inside the enclaves. However, as the amount of computational and I/O operations performed at the enclaves increases, the performance of ML training and inference is noticeably affected by hardware limitations, limiting the design’s applicability in practice. This is also true for the increasing TCB size, which incurs higher performance penalties regarding execution time and the attack surface ( i.e., increasing TCB leads to an increase attack surface as discussed in Section 2.3.2.3)[73]. To tackle the aforementioned issue, solutions have been proposed based on the insight that ML runtime performance could be improved by reducing the number of operations done at enclaves. In fact, this insight is backed up by previous work [36,135,321] exploring the partitioning of computation across trusted and untrusted environments, but in contexts with different security requirements and processing logic ( e.g. , SQL processing, MapReduce, distributed coordination) than the ones found for ML workloads. As such, since ML workloads present different processing logic and security requirements, the partitioning of computation across trusted and untrusted environments must be rethought. Therefore, the key challenge addressed by our solution is to understand and define the set of ML operations to run inside/outside TEEs. Ideally, these operations should significantly reduce the enclaves’ overall computational and I/O load for different ML workloads, and doing so should not leak critical sensitive information during the execution of ML workloads. Our reasoning is twofold: i.) the majority of current attacks on the ML pipeline are only successful if the attacker has some knowledge about the datasets and/or models being used [35,89]; and ii.) previous work shows that such knowledge cannot be inferred from the information leaked by statistical operations, such as the calculation of confidence results, table summaries, ROC/AUC curves, and probability distributions for classes, without additional knowledge regarding the dataset or the model [50]. As a result, these operations are ideal candidates to be offloaded from enclaves. We support these claims by analyzing the security and performance implications of different ML workloads and attacks. Contributions. Based on the previous challenges and current issues, we propose Soteria, a PPDML system. Soteria aims to answer the following questions: i) How can we design a PPDML solution that is efficient, secure, and practical ; ii) How can we reduce computation performed inside the TEEstoimprove 44 3.1. KEY TECHNOLOGIES the efficiency of such a PPDML solution? Soteria is an open-source system for distributed privacy-preserving ML that leverages the scalability and reliability of Apache Spark and its ML library (MLlib) [38]. Unlike previous solutions [109,263], Soteria supports a wide variety of ML algorithms without changing how users build and run these within Spark. Further, it ensures that critical operations, which enable existing attacks to reveal sensitive information from ML datasets and models, are exclusively performed in secure enclaves. This means that the sensitive data being processed only exists in plaintext inside the enclave and is encrypted in the remainder of the dataflow ( e.g. , network, storage). This solution enables robust security guarantees, ensuring data privacy during ML training and inference. Soteria introduces a new computation partitioning scheme for Apache Spark’s MLlib, Soteria-P, that offloads non-critical statistical operations from the trusted enclaves to untrusted environments. Soteria-P is accompanied by a formal security proof for how data remains private during ML workloads and an analysis of how this guarantee ensures resilience against various ML attacks. Furthermore, Soteria offers a baseline scheme, Soteria-B, where all ML operations are done inside trusted enclaves without a finegrained differentiation between critical and non-critical operations. Soteria-B provides a performance and security baseline for comparison against our new partitioned scheme. Evaluation. We compare experimentally both approaches with a non-secure deployment of Apache Spark and a state-of-the-art solution, namely SGX-Spark [109]. Our experiments, resorting to the HiBench benchmark [130] and including seven different ML algorithms, show that Soteria-P, while considering a more significant subset of ML attacks, reduces training time by up to 41% for Gradient Boosted Trees workloads and up to 4.3 hours for Linear Regression workloads when compared to SGX-Spark. Also, compared to Soteria-B, Soteria-P reduces execution time by up to 37% for the Gradient Boosted Trees workloads and up to 3.3 hours for the Linear Regression workloads. 3.1 Key Technologies This section highlights the key technologies and concepts that work as building blocks for our solution. 3.1.1 Apache Spark Apache Spark is a distributed cluster computing framework that supports Extract, Transform, and Load (ETL), analytical, ML, and graph processing workloads over large volumes of data. Spark can be deployed on a cluster of servers, at a private infrastructure, or in the cloud and supports different data sources ( e.g. , HBase, HDFS) to read the data to be processed and store the corresponding output and logs. The framework performs most of the computation in-memory, thus promoting better performance for dataintensive applications when compared to Hadoop’s MapReduce [315]. Spark follows a master-worker distributed architecture similar to Hadoop and its MapReduce topology. Users interact with the master node by submitting jobs ( i.e. , processing workloads) and collecting the 45 CHAPTER 3. PRESERVING PRIVACY IN DISTRIBUTED MACHINE LEARNING Figure 3.1: Typical ML workflow for data engineers and scientists. This workflow has five different stages: data treatment, dataset creation, algorithm or model choice, algorithm or model training, and model persistence or inference. corresponding outputs. The master is responsible for submitting jobs to the worker nodes by resorting to a job scheduler and resource negotiator named Spark Driver. This driver splits the jobs into tasks ( i.e. , map phase) and defines which workers will compute a given set of tasks. Finally, each worker performs the designed task(s) and reports the resulting output to the master, which then aggregates ( i.e. ,reduce phase) and forwards the response back to the user. Further details about Spark’s flow are discussed in Section 3.3.1 as SYSA follows its flow. The ML library of Apache Spark ( MLlib )[192] enables Spark users to build end-to-end ML jobs. Its workflow is similar to the one found in other ML solutions, with the addition of an initial data treatment stage, which is enabled by Spark’s core Application Programming Interface (API). The library also provides a set of tools and utilities for feature extraction and model persistence. Figure 3.1 shows the typical ML workflow for data engineers and scientists. The first stage is typically known as the process of ETL, where data is collected and extracted in a pre-determined format, treated accordingly, and loaded in the needed format ( e.g. , CSV, Parquet, Text File). In the second stage, data is split into train and test datasets, and a given ML algorithm is chosen. The third stage is the training stage, where data is iterated to deliver an optimized trained model at the fourth stage. In the fifth stage, the trained model can be saved (persisted) and loaded (accessed) for inference. 3.1.2 Intel Software Guard Extensions As a trusted execution environment, SGX is a set of new instructions available in an Intel processor that applications can use to create protected memory regions within their space. These regions (enclaves) are isolated from any other code in the system, allowing only the code inside the enclave to access data in the enclave [188,210]. This also includes the isolation from higher privilege users, host Operating System (OS), hypervisor, and BIOS. The integrity and the results, as well as the identity of the parties, can be attested with the remote attestation provided by SGX, ensuring the computation was correctly executed 46 3.1. KEY TECHNOLOGIES [285]. Since SGX protects code and data from privileged access, sensitive plaintext data can be processed at the enclave without compromising its privacy. The computation with unencrypted data and code allows diminishing the execution time compared to other cryptographic techniques ( e.g. , searchable encryption, homomorphic encryption) [58,210]. Nonetheless, even though the second generation of SGX has improved the size of the protected memory region, it still defines the Enclave Page Cache (EPC) to 128MB per CPU [120]. Memory swapping occurs when such a limitation is met, which is a performance-costing mechanism [73]. Thus, SGX-based solutions must balance the number of I/O operations, the amount of data handled by enclaves, and the Trusted Computing Base (TCB) to optimize performance. For this work, we chose Intel SGX over other TEE’s ( e.g. , ARM TrustZone [14]) due to its general use in academia [135,153,321] and industry [20], availability, as well as its security guarantees and computing reliability. However, our solution is generic and can be applied to other TEE technology that follows similar design principles to SGX. 3.1.3 Gramine Porting existing source code into TEEs is a non-trivial and error-prone task. Initially, the application’s source code needed to be rewritten in C/C++ to run inside enclaves, thus requiring manual intervention. This inefficient approach led to the proposal of solutions to port unmodified applications to run inside TEEs automatically. In this work, we resort to Gramine [289] (previously named Graphene-SGX ), an open-source library OS designed to run unmodified applications inside Intel SGX enclaves. Gramine’s architecture (Figure 3.2) is based on Drawbridge’s picoprocess [236], which provides an isolated address space. Its architecture contains three main components: i) the unmodified binary application and corresponding libraries, to be ported into SGX; ii) the LibOS, a custom OS implemented by Gramine; and iii) the Enclave Platform Adaptation Layer (PAL). PAL. This is a core component of Gramine, which acts as an intermediary between the LibOS and the underlying hardware platform to provide the necessary abstractions and interfaces that enable Gramine to run efficiently [108]. In detail, this layer: • Abstracts the low-level hardware details, allowing Gramine to be portable across different hardware platforms without requiring extensive modifications to its core codebase. • Handles the initialization and management of the SGX enclaves and sets up the enclave memory layout. • Facilitates communication between the Gramine enclave and the host system. 47 CHAPTER 3. PRESERVING PRIVACY IN DISTRIBUTED MACHINE LEARNING Figure 3.2: Gramine’s architecture based on [289]. The enclave includes an OS shield, a library OS, libc, and other user binaries. • Provides mechanisms for securely passing data and invoking system calls from the enclave to the host and vice versa. • Manages the resources allocated to the enclave, ensuring it has access to the necessary memory, CPU, and other resources. Manifest File. Through this configuration file, developers specify the application libraries to be deployed inside a secure enclave, the paths for files that the enclave will need to access securely, and trusted system libraries. It also contains the environment’s specifications ( e.g. , the CPU and memory resources for each enclave) [107]. In sum, the Gramine library works similarly to a paravirtualization environment, taking advantage of the standard virtualization benefits such as security isolation, host platform compatibility, and migration while mapping high-level APIs onto a few paravirtual interfaces to the host kernel [289]. By resorting to this framework, one can take full advantage of the application’s native performance while potentiating the use of trusted execution environments. Moreover, with a growing community focused on confidential computing with Intel SGX, Gramine is supported by Intel and several universities [106]. 48 3.2. THREAT MODEL AND ML ATTACKS 3.2 Threat Model and ML Attacks To fully understand the security requirements of Soteria, we first need to understand the threat model of our solution and the attacks that such an ML system may face. We follow this with a comparison of Soteria with state-of-the-art solutions, which is summarized in Table 3.1). 3.2.1 Soteria Threat Model Soteria enables the secure outsourcing of ML training and inference workloads. These are scenarios where the data owner holds sensitive information (a private dataset and/or model) and wants to perform some ML workload on it using an external cloud provider. Our deployment model is depicted in Figure 3.3 and is as follows. The client (data owner) will be trusted and provide input for ML tasks. Then, a Spark master node and #worker nodes will be deployed in an untrusted environment (cloud provider) equipped with Intel SGX technology. Externally, we also consider a distributed data storage backend. The protocol assumes an implicit setup where the client securely stores its input data within this backend, which is also considered untrusted throughout the protocol execution. Figure 3.3: Soteria deployment model. We consider semi-honest adversaries, meaning that security is defined according to a threat that attempts to break the confidentiality of data and model but will not actively deviate from the protocol specification. This is a good fit for cloud-based systems, where data breaches are common and malicious entities can read internal processing data temporarily [131]. In brief, our security goal is to allow clients to provide input data for training and inference in a way that is not vulnerable to confidentiality breaches. 3.2.2 ML Workflow Attacks Throughout this work, we consider the black-box setting proposed by [56], which is as follows. When an adversary is given black-box access to a model, it means that it can query any input Gand receive the predicted class probabilities %(~|G)for all classes ~. This allows the adversary to interact with the trained model without retrieving additional information, e.g. , computing the gradients. Ensuring security against 49 CHAPTER 3. PRESERVING PRIVACY IN DISTRIBUTED MACHINE LEARNING attacks under this threat model entails including countermeasures against a wide array of attack vectors, further detailed in §2.3.1. Figure 3.4 extends the previous Figure 3.1 by correlating the attacks to the stages at which they occur in the ML pipeline. Given this, we further detail pervasive attacks on the ML pipeline, correlate them with the several stages, and establish their adversarial assumptions. Figure 3.4: ML pipeline attacks and their correlation with the stages of the ML pipeline. Typically, adversarial attacks occur between the first and second stages, reconstruction attacks occur in the third stage, model extraction, and model inversion in the fourth stage, and membership inference attacks occur in the fifth stage. Adversarial Attacks. These attacks occur between the first and second stages, where data is being treated and prepared for training. They are characterized by injecting malicious data samples to manipulate the model and disclose information about the original data being used for training or inference purposes. Successful attacks in the literature require the attacker to have direct access to the training dataset (data poisoning, transfer-based, and gradient-based attacks), the model and gradients (gradient-based attacks), or the full results ( i.e., the output of inference) and class probabilities (score-based attacks) [35, 151]. Reconstruction attacks. The goal of this attack is to reconstruct raw data used for training the model. To be successful, some attacks require the adversary to have model-specific information, namely feature vectors ( e.g., Support Vector Machines or K-Nearest Neighbor) [253], others only require black-box access to the model [258]. Nonetheless, in this setting, the attacker needs to have access to another dataset with the same distribution as the original training dataset ( i.e., local dataset and training dataset are subsets from a larger dataset). These attacks occur in the third stage while models are training. Model Extraction. These attacks aim at learning a close approximation to an objective function of the trained model and are deployed in the fourth stage alongside model inversion. This approximation is based on the exact confidence values and response labels obtained by inference. To obtain the desired result, the attacker must know the dimension of the original training dataset (equation-solving attacks), the dimension of the decision trees, the data features, and the final confidence values (path-finding attacks) or hold real samples from the training dataset (class-only attacks and data-free knowledge distillation (DFKD)) [50, 286,288]. 50 3.2. THREAT MODEL AND ML ATTACKS Model Inversion and Membership Inference. These attacks target the recovery of values from the training dataset. Both consider an adversary that queries the ML system in a black-box fashion, and both are currently based on ML services, which publicly disclose their trained models and confidence values. In model inversion attacks, the adversary must have partial knowledge of the training dataset’s features to infer and query the model with specific queries [89,286]. Membership inference aims to test whether a specific data point 3was used as training data and requires the adversary to know a subset of samples used to train the model (that does not contain 3)[267]. Model inversion attacks occur alongside model extraction attacks, while membership inference attacks occur in the last stage of the pipeline. Table 3.1: Comparison between state-of-the-art solutions and Soteria regarding the safety against ML attacks. Attacks Systems [126][129][263][109]* Soteria Gradient-based 7 7 3 7 3 Score-based 7 7 3 7 3 Transfer-based 7 7 3 7 3 Adversarial Decision-based 7 7 3 7 3 Model Extraction Equation-solving 337 3 3 Path-finding 337 7 3 Class-only 337 7 3 DFKD 337 3 3 Model Inversion 3 3 ?3 3 Reconstruction Attacks 333 3 3 Membership Inference 7 7 7 7 3 *Data encryption is not provided on the open-source version. 3-Protected;7- Non-protected;?-Not disclosed. Summary. Unlike previous works [109,126,129,263], which typically consider a small subset of ML attacks, our proposal aims at providing mechanisms that cover the full range of the exploits mentioned above. Table 3.1 presents relevant state-of-the-art solutions, the security attacks covered by these, and the attacks addressed by Soteria. Intuitively, the resilience of our system is the result of combining several mechanisms, which are only partially ensured by other systems: i) authenticity verification of inputs excludes injections necessary for adversarial attacks ; ii) isolation guarantees of our protocol ensure that malicious workers gather no additional information other than statistical data, an essential aspect for preventing most attacks, and iii) query input via a secure channel prevents the adversary from performing arbitrary queries to our system, which is also a central requirement for model inversion or reconstruction attacks . This is analyzed in detail in Section 3.3.5. TEE-related security issues such as side-channel and memory access pattern attacks are considered orthogonal and complementary to our design goals. Indeed, mechanisms such as ObliviousRAM [273] 51 CHAPTER 3. PRESERVING PRIVACY IN DISTRIBUTED MACHINE LEARNING can be layered over Soteria to address these at the cost of additional performance overhead [211]. 3.3 Soteria Soteria is a distributed privacy-preserving machine learning system that avoids changing the architecture and processing flow of Apache Spark and MLlib, retaining its usability, scalability, and fault tolerance properties. It is built under the assumption that ML runtime performance can be improved if one can diminish the number of operations done inside secure enclaves. Thus, Soteria proposes a partitioning scheme to split the computation to be performed inside and outside these and builds upon four core principles: General Applicability for ML workloads. Soteria aims to offer an encompassing solution for several ML algorithms by relying on Apache Spark’s MLlib. Privacy-by-design. In Soteria, sensitive data is only on plaintext inside the enclaves, being encrypted in the remaining workflow. This is achieved by resorting to trusted execution environments and encryption mechanisms that safeguard data privacy. Balanced overhead. Soteria offers a partitioning scheme that balances the imposed performance overhead of the privacy measures and the leakage of such a solution. Low intrusiveness. Both the processing flow of Apache Spark and the user’s interaction with the system remain unchanged or require minor changes. 3.3.1 Architecture and Flow As depicted in Figure 3.5, Apache Spark’s operational flow is as follows. Before submitting ML tasks ( e.g. , model training, and/or inference operations) to the Spark cluster, users must load their local datasets and models to a distributed storage backend. Users can then submit ML processing tasks, specified as ML task scripts, to the Spark client, which is responsible for forwarding these scripts to the master node. At the master node, tasks are forwarded to the Spark Driver, which generates a Spark Context that then distributes the tasks to a set of worker nodes. As workers may be executing different steps of a given task, they need to be able to transfer information among each other through the network. For instance, in a distributed ML training task, this information can contain model parameters that must be exchanged across workers. After finishing the desired computational steps, workers return their outputs to the master node, which merges the outputs and replies to the client. Similar to the regular flow of Apache Spark, Soteria can be divided into two main environments or sides: the Soteria Client, trusted side, and the Soteria Cluster, untrusted side ( e.g., cloud environment). Next, we describe the main modifications required by Soteria to the original Apache Spark’s design, depicted in Figure 3.5 by the white boxes. 52 3.3. SOTERIA Figure 3.5: Soteria architecture and flow of operations, the latter represented by the numbers. The client encrypts its data and sends it to the distributed data storage backend (¿-¡). The client also sends the ML task script and the Manifest file to the master node (-À). The master node then distributes the ML task script to the worker nodes (Ã). The workers fetch the data and process the ML task script (Õ-Œ) and send the results back to the master node (œ), which merges the results and sends them back to the client (–). 3.3.2 Client Users use Soteria’s client module for three main operations: i) loading data into the distributed storage backend, ii) sending ML training tasks to the Spark cluster, and iii) sending ML inference tasks to the Spark cluster. Soteria does not change how users typically specify and perform the previous operations. The only exception is that users need to provide additional information in a Manifest configuration file, as described next. Data Loading. First, the user must specify the data to be loaded to the storage backend for the first operation. However, such data has to be encrypted before leaving the trusted user premises. This step is done by extending Spark’s data-loading component with a transparent encryption module (Figure 3.5-¿). This module encrypts the data being loaded into the distributed storage backend with a symmetric-key encryption scheme (Figure 3.5-¡). Tasks submission. ML training and inference operations include two main files: the ML task script and the Manifest file. The transparent encryption module also integrated within MLlib, is used to encrypt the ML task script (Figure 3.5-), which contains sensitive arguments ( i.e., model parameters) and the ML’s workload processing logic, and to decrypt the outputs ( e.g. , trained model or inference result) returned by Spark’s master node to the client. The Manifest file contains the libraries to be used by the ML task script, as well as the path at the storage backend where the training or inference data for that specific task is kept (Figure 3.5-À). Briefly, and as explained in the following sections, this file ensures that different Spark components can attest to 53 CHAPTER 3. PRESERVING PRIVACY IN DISTRIBUTED MACHINE LEARNING 1. How does Soteria impact the execution time of ML workloads? 2. How does the Soteria-P scheme compare, in terms of performance, with state-of-the-art approaches ( i.e. , Soteria-B and SGX-Spark)? 3. Can Soteria efficiently handle different algorithms and dataset sizes? We split our evaluation into three different stages to present our results more clearly. In detail, Subsection 3.4.1 presents the methodology used for the testbed, Subsection 3.4.2 summarizes the main evaluation observations, and Subsection 3.4.3 analyzes these observations and provides key insights. 3.4.1 Methodology 3.4.1.1 Environment The experiments use a cluster with eight servers, a 6-core 3.00 GHz Intel Core i5-9500 CPU, 16 GB RAM, and a 256GB NVMe. The host OS is Ubuntu 18.04.4 LTS, with Linux kernel 4.15.0. Each machine uses a 10Gbps Ethernet card connected to a dedicated local network. We use Apache Spark 2.3.0 and version 2.6 of the Intel SGX Linux SDK (driver 1.8). The client and Spark master run on one server, while Spark workers are deployed on the remaining seven servers. Moreover, due to hardware limitations, the memory of the enclaves was defined as 4GB. 3.4.1.2 Workloads As depicted in Table 3.2, we resort to the HiBench benchmark [130] for evaluating seven ML algorithms that are broadly used and natively implemented on top of MLlib. Further, the benchmark suite offers different workload sizes for each algorithm ranging from Tiny to Gigantic configurations. Next, we describe each of the algorithms in more detail. Alternating Least Squares (ALS). ALS is an algorithm mainly used in recommendation systems, such as the ones used by Amazon and Facebook, among others. The algorithm is usually formulated as the factorization of an <x=matrix ',where<can be seen as the users and =the items. In this setting, the items’ ratings given by the users are not all filled, and the ALS algorithm is used to fill those blank spaces, recommending new items to the users. According to [117], the time complexity of this algorithm is dependent on m, n, and hidden k dimension, which results in a complexity of $((<+=):3+<=:2). Linear Regression (LR). Linear Regression is broadly used in statistics to understand the correlation between one dependent variable and one or more independent variables. The outcome of this algorithm is supposed to follow a Gaussian distribution. The computation of a Linear Regression algorithm is based on matrix multiplications and inversions in a matrix of <x=,where<is the number of samples and =is the number of features, the time complexity equals $(<∗=2+=3)[75]. 60 3.4. EVALUATION K-means clustering (K-means). K-means is an algorithm used in clustering tasks (unsupervised learning tasks). Giving a dataset '(G1,...,G <), data should be grouped into clusters. For each data point G8,a feature vector is given with no labels ~8. Here, for each data point, the goal is to predict :centroids and the label ~8. For this matter, K-means has a quadratic time complexity, $(=2), with =being the size of the input dataset [217]. Gradient Boosted Trees (GBT). With a fundamental basis in decision trees, GBT merges decision trees with gradient boosting. Overall, an ensemble of trees is used for predicting the target label. A first model is created and followed by a second model that should surpass the first one’s results. Combining the best model with the previous models should minimize the error [91]. For each tree, there is a time complexity dependent on the number of training samples, =, and the number of labels, ~,$(=~=CA44B)[268]. Latent Dirichlet Allocation (LDA). As a dimensionality reduction algorithm, the goal of LDA is to lower the high-dimensional space, recurring to eigenvalue decomposition, increasing the usability of data and the feasibility of other algorithms. The complexity of this algorithm is given as $(<=C +C3),wheremis the number of samples, n is the number of features, and C=<8=(<,=)[43]. Principal Components Analysis (PCA). Being a classic method for dimensionality reduction, PCA, in a dataset of n observations and m variables, tries to compute a target dimensionality ~based on the eigenvalue decomposition of its covariance matrix [328]. The time complexity of PCA, as similar to other algorithms, depends on the size of matrix =x<,$(=< ∗<8=(=,<)+<3)[80]. Sparse Naive Bayes (Naive Bayes). Used for multi-class classification tasks, Naive Bayes is a highly efficient algorithm that only needs to compute one time over the dataset where, given a matrix of =training examples and <attributes, the time complexity is $(=<)[81]. Table 3.2: Representation of each ML algorithm’s tasks, time complexity, and data sizes for different workloads. Algorithms Tasks Time Complexity Workloads Tiny Large Huge Gigantic ALS RS $((<+=):3+<=:2)[117]193KB 345MB 2GB 4GB PCA DR $(=< ∗<8=(=,<)+<3)[80]256KB 92MB 550MB 688MB GBT P$(=∗~∗=CA44B)[268]36KB 46MB 92MB 183MB LR C+P $(<∗=2+=3)[75]11GB 134GB 335GB 894GB Naive Bayes MC $(=<)[81] - - 5GB - LDA DR $(<=C +C3)[43] - - 2GB - K-means Cl $(=2)[217] - - 56GB - RS: Recommendation Systems DR: Dimensionality Reduction P: Prediction C: Classification MC: Multi-class Classification Cl: Clustering. 61 CHAPTER 3. PRESERVING PRIVACY IN DISTRIBUTED MACHINE LEARNING 3.4.1.3 Setups and Metrics To validate Soteria’s performance and the benefits of fine-grained differentiation of secure ML operations, we compare the implementations of our system with the Soteria-B and Soteria-P schemes. These setups are compared with a deployment of Apache Spark that does not offer privacy guarantees (Vanilla). Moreover, we test SGX-Spark [109], a state-of-the-art SGX-based solution that protects both analytical and ML computation done with Apache Spark. It is designed to process sensitive information inside SGX enclaves, so it can be considered the most similar system to Soteria. However, SGX-Spark can only guarantee that User Defined Functions (UDFs) are processed in secure enclaves. This decision leaves a large codebase of Spark outside the protected memory region and, consequently, limits the users to only being able to execute privacy-preserving ML algorithms based on UDFs2. For each experiment discussed in the next section, we include the average algorithm execution time and standard deviation for three independent runs. The dstat monitoring tool was used to collect the CPU, RAM, and network consumption at each cluster node. 3.4.2 Performance Overview Figure 3.7 shows the execution time of all the setups for the seven algorithms when using a huge-sized workload configuration. Moreover, Figures 3.8b,3.8c,3.8a and 3.8d present the performance evaluation for PCA , GBT , ALS and LR algorithms for different workload sizes. Next, we list our main observations to aid in the characterization of these results. Unless stated otherwise, the performance overhead values discussed in this section correspond to the number of times that the algorithm’s execution time increases for a given setup when compared to the Vanilla Spark deployment results. Observations 1 to 8 correspond to Figure 3.7, whilst Observations 9 to 12 refer to Figure 3.8. Observation 1. Vanilla Spark’s execution times for ALS, PCA, LR, and GBT algorithms are 55, 655, 657, and 189 seconds. Observation 2. The execution time for ALS increases by 3.62x and 4.35x for Soteria-P and Soteria-B, respectively. SGX-Spark incurs an execution overhead of 4x. Thus, the three setups have similar results, requiring approximately 150 seconds more processing time than the vanilla deployment. Nevertheless, Soteria-P performs slightly better than the other two approaches. Observation 3. For PCA, Soteria-B and Soteria-P have an execution overhead of 3.67x and 2.85x, while SGX-Spark increases the computational time by 3.95x. When compared to SGX-Spark, Soteria-P decreases the execution time by 12 minutes (27.8%). Observation 4. For LR, Soteria-B and SGX-Spark exhibit an overhead of 27.31x, while Soteria-P reduces this value to 18.2x. This reduction of 29.6% allows Soteria-P to complete this workload 1.4 hours earlier. 2Another similar solution to Soteria is Uranus [135]. Although Uranus is open-source, it currently does not provide enough information on how Apache Spark and all the tested ML algorithms could be deployed using this system, limiting a possible comparison against Soteria. 62 3.4. EVALUATION 0 50 100 150 200 250 Execution Time (seconds) ALS LDA Kmeans PCA Bayes LR GBT 52s 401s 155s 655s 33s 13s 189s 0 1500 3000 4500 6000 7500 Execution Time (seconds) ALS LDA Kmeans PCA Bayes LR GBT 52s 401s 655s 33s 13s 189s 0 340 680 1020 1360 1700 Execution Time (seconds) ALS LDA Kmeans PCA Bayes LR GBT 52s 401s 655s 33s 13s 189s 0 540 1080 1620 2160 2700 Execution Time (seconds) ALS LDA Kmeans PCA Bayes LR GBT 52s 401s 655s 33s 13s 189s 0 50 100 150 200 250 Execution Time (seconds) ALS LDA Kmeans PCA Bayes LR GBT 52s 401s 655s 33s 13s 189s 0 5000 10000 15000 20000 Execution Time (seconds) ALS LDA Kmeans PCA Bayes LR GBT 52s 401s 655s 33s 13s 189s 0 300 600 900 1200 1500 Execution Time (seconds) ALS LDA Kmeans PCA Bayes LR GBT 52s 401s 655s 33s 13s 189s Figure 3.7: Execution time for each algorithm with Huge workload. The legend is as follows: Vanilla Spark; Soteria-B; Soteria-P; SGX-Spark. Observation 5. With the GBT algorithm, Soteria-B shows similar execution times compared to SGX- Spark, with a 7.04x and 6.64x increase, respectively. Soteria-P outperforms both approaches, with an overhead of 4.79x, 27.8% less than SGX-Spark. Observation 6. The LDA algorithm exhibits higher execution overhead of 17.40x, 8.89x, and 15.08x for Soteria-B, Soteria-P, and SGX-Spark setups, respectively. Soteria-P outperforms SGX-Spark by a difference of 41.5 minutes ( i.e. , reduces execution time by 41%). Observation 7. When compared with the vanilla deployment, Soteria-B increases execution time of KMeans by 9.37x and Soteria-P by 6.68x. SGX-Spark has an overhead of 9.7x, which means that, in comparison with Soteria-P, it requires an additional 468 seconds (7.8 minutes) to execute, i.e. , Soteria-P is 31% faster. Observation 8. With Huge workload and Naive Bayes, Soteria exhibits an overhead of 6.24x for Soteria-B, which is higher than the 5.33x observed for SGX-Spark. Also, Soteria-P presents a lower overhead (3.58x) compared to SGX-Spark. The absolute difference in execution time between Soteria-P and Soteria-B is 88 seconds, while, with SGX-Spark, Soteria-P decreases execution time by 61 seconds (34%). Observation 9. For Tiny and Large workloads with the PCA algorithm, Soteria performs similarly for our two schemes while outperforming SGX-Spark. With larger workload sizes, the overhead imposed by our solutions increases. However, Soteria continues to show better performance than SGX-Spark. Soteria-B has an overhead of 1.96x to 5.15x for Tiny and Gigantic workloads, whilst Soteria-P incurs an overhead of 1.72x to 3.79x. When compared with SGX-Spark, the results show an absolute difference of 4 seconds and 7 minutes (7%) for Soteria-B and 7 seconds and 33 minutes (19% and 31%), respectively, for Soteria-P. Observation 10. Regarding the GBT algorithm, and the Tiny workload, the overhead of Soteria-B, Soteria-P, and SGX-Spark are similar. However, the difference between the three approaches is more 63 CHAPTER 3. PRESERVING PRIVACY IN DISTRIBUTED MACHINE LEARNING 0 10 20 30 40 50 Execution Time (seconds) Tiny Large Huge Gigantic 31s 52s 148s 0 50 100 150 200 Tiny Large Huge Gigantic 31s 52s 148s 0 50 100 150 200 250 Tiny Large Huge Gigantic 31s 52s 148s 0 200 400 600 800 Tiny Large Huge Gigantic 31s 52s 148s (a) ALS. 0 10 20 30 40 50 60 Tiny Large Huge Gigantic 115s 655s 1128s 0 100 200 300 400 500 Tiny Large Huge Gigantic 115s 655s 1128s 0 600 1200 1800 2400 3000 Tiny Large Huge Gigantic 115s 655s 1128s 0 1500 3000 4500 6000 7500 Tiny Large Huge Gigantic 115s 655s 1128s (b) PCA. 0 10 20 30 40 50 Execution Time (seconds) Tiny Large Huge Gigantic 110s 189s 266s 0 100 200 300 400 500 Tiny Large Huge Gigantic 110s 189s 266s 0 200 400 600 800 1000 1200 1400 Tiny Large Huge Gigantic 110s 189s 266s 0 500 1000 1500 2000 2500 3000 Tiny Large Huge Gigantic 110s 189s 266s (c) GBT. 0 50 100 150 200 250 Tiny Large Huge Gigantic 141s 657s 1936s 0 500 1000 1500 2000 2500 Tiny Large Huge Gigantic 141s 657s 1936s 0 5000 10000 15000 20000 Tiny Large Huge Gigantic 141s 657s 1936s 0 13000 26000 39000 52000 65000 Tiny Large Huge Gigantic 141s 657s 1936s (d) LR. Figure 3.8: Runtime execution for PCA, GBT, ALS, and Linear Regression for Tiny , Large , Huge and Gigantic workloads. The legend is as follows: Vanilla Spark; Soteria-B; Soteria-P; SGX-Spark. visible when increasing the workload size. Soteria-P ( Tiny-2.13x and Gigantic-5.88x ) outperforms both approaches, while Soteria-B ( Tiny-2.18x, Gigantic-9.35x ) and SGX-Spark ( Tiny-2.3x, Gigantic-10.34x ) have similar results. Soteria-P surpasses SGX-Spark’s execution time in the Gigantic workload by up to 41%. Observation 11. With ALS, Soteria-P shows an execution time overhead of 2.04x and 3.28x, for the Tiny and Gigantic workloads, respectively. Soteria-P achieves lower overhead than Soteria-B and SGX-Spark for all dataset sizes, with the execution time decreasing by 8 seconds (9%) for the Tiny and 191 seconds (27%) for the Gigantic workloads. Observation 12. For LR, with the Tiny workload, Soteria-B and Soteria-P increase execution time by 14.39x and 12.95x, respectively. As for the Gigantic workload, Soteria-B incurs an overhead of 30.04x and Soteria-P of 23.89x. Compared to SGX-Spark, Soteria-P decreases the execution time by 43 seconds for the Tiny workload and by 4.31 hours for the Gigantic workload (22.6%). Observation 13. The overall CPU usage for all the experiments is similar for Vanilla, Soteria-B, Soteria- P, and SGX-Spark. In more detail, Soteria-B with LR presents the upper-bound limit for CPU, showing an increase of 9% compared with Vanilla (20,7% CPU usage) as seen in Table 3.3. The standard deviation is never above 10%. Observation 14. The mean memory consumption for each algorithm is similar across the different setups. As depicted in Table 3.4, Soteria-B presents an increase of ±20% when compared to the Vanilla 64 3.4. EVALUATION Table 3.3: Mean CPU usage (in %) for ALS, PCA, GBT, LR, Naive Bayes, LDA, and Kmeans algorithms with the Huge workload. Soteria-B shows an increase of up to 9% compared to Vanilla. CPU (%) Algorithms Vanilla Soteria-B Soteria-P SGX-Spark ALS 19.7 23.8 22.6 23.1 PCA 19.1 25.5 24.5 27.1 GBT 23.0 28.3 27.5 26.7 LR 20.7 29.7 29.1 33.1 Naive Bayes 18.3 24.6 22.3 23.9 LDA 20.0 28.3 23.3 26.4 K-Means 18.6 26.9 24.5 29.0 Table 3.4: Mean Memory usage (in %) for ALS, PCA, GBT, LR, Naive Bayes, LDA, and Kmeans algorithms with the Huge workload. Soteria-B shows an increase of up to 20% compared to Vanilla. Memory (GB) Algorithms Vanilla Soteria-B Soteria-P SGX-Spark ALS 3.2 3.8 3.5 3.6 PCA 4.8 5.5 5.1 5.5 GBT 4.2 4.8 4.5 4.5 LR 5.4 6.1 5.9 7.7 Naive Bayes 4.0 4.5 4.3 4.7 LDA 3.6 4.5 4.3 4.6 K-Means 5.5 6.1 5.9 6.6 setup, which is explained by the extra memory needed when fetching data to the enclaves. The standard deviation is never above 9%. Table 3.5: Mean Network usage (in MB/s) for ALS, PCA, GBT, LR, Naive Bayes, LDA, and Kmeans algorithms with the Huge workload. Soteria-P shows a slight increase in network usage. Network (MB/s) Algorithms Vanilla Soteria-B Soteria-P SGX-Spark ALS 60.3 65.3 62.3 63.3 PCA 133.0 147.7 139.0 142.3 GBT 48.0 52.7 50.0 53.7 LR 121.7 130.7 133.7 130.0 Naive Bayes 95.0 100.7 103.3 101.3 LDA 80.7 87.7 89.3 93.0 K-Means 106.7 115.0 115.3 116.3 Observation 15. The network shows an upper-bound increase of 10% in Soteria-B with PCA due to extra encrypted data paddings being sent between Spark workers, as seen in Table 3.5. Vanilla Spark shows an upper-bound network usage of 133MB/s for the PCA algorithm. Interestingly, it is possible to see a slight 65 CHAPTER 3. PRESERVING PRIVACY IN DISTRIBUTED MACHINE LEARNING increase (±3 MB/s) in the network bandwidth usage on the Soteria-P scheme when compared to vanilla and Soteria-B, which is explained by the extra communication between SGX-executors and non-secure executors. The standard deviation is never above 10%. Observation 16. Soteria does not impact the accuracy of ML workloads. For all experiments, we measured the corresponding accuracy metrics ( e.g. , accuracy, root mean square error, or ROC). The results corroborate that both Soteria-B and Soteria-P show accuracy values similar to the vanilla Spark setup. 3.4.3 Analysis We split the following analysis into three topics, i) dataset size; ii) algorithm complexity; iii) size of trusted computing base (TCB). 3.4.3.1 Dataset size Figure 3.8 shows the performance degradation for the PCA, GBT, ALS, and Linear Regression algorithms with increasing dataset sizes. Results show that, for PCA, GBT, and ALS workloads with smaller datasets, Soteria-B and Soteria-P perform similarly. However, as the size of the datasets increases, more operations and data must be transferred to the SGX enclave, thus having a more noticeable toll on the overall performance. Indeed, the page swapping mechanism of SGX, which occurs due to its memory limitations, incurs a significant performance penalty [73,318]. For example, when compared to the vanilla setup, the PCA algorithm overhead for Soteria-B varies between 1.96x for Tiny workload and 5.15x for Gigantic workload. While for Soteria-P, the execution time increases by 1.78x in the Tiny workload and 3.79x in the Gigantic workload. Linear Regression is the most expensive algorithm in terms of performance as it processes more data for the distinct workload sizes (Table 3.2). Compared with SGX-Spark, Soteria-P deals better with the data volume increase. Indeed, as seen in Observations 9-12 , we reduce the execution time from 9% up to 41% when compared to SGX-Spark. Also, compared with our baseline, Soteria-P achieves up to 33% less execution time. 3.4.3.2 Algorithm Complexity The execution times of ALS and LDA algorithms are very different even though their dataset size is similar. The computational complexity of each algorithm explains these results. For ALS, the synthetic workload data generated by the benchmark has a low hidden k dimension with a low ranking of 10, simplifying the required computation and decreasing execution time. For the LDA algorithm, the computational complexity, and consequently the execution time, are increased due to the higher number of dependencies between values at the generated synthetic workload data. Observations 2 and 6 emphasize the performance of these two algorithms for a similar workload size. Like LDA, Observations 3 and 9 show that PCA complexity and performance overhead increase with the processed data volume. Commonly classified as 66 3.4. EVALUATION regression and classification algorithms, Bayes and GBT have similar performance, as seen in Observation 8 and Observation 5 . The data sizes of these two algorithms are entirely different, where GBT uses 91.7MB, and Bayes has 5.2GB. However, the Bayes algorithm iterates over the data only once, while GBT iterates over several decision trees to find its best model. Kmeans’ performance is highly dependent on the chosen dataset size. This is also true for the Linear Regression algorithm ( Observations 4 and 12 ). 3.4.3.3 Size of TCB The results discussed in Section 3.4.2 show that SGX-Spark outperforms Soteria-B for some of the evaluated algorithms ( Observation 2, 4-6, 8 ). As SGX-Spark only protects UDFs, the performance overhead imposed by our solution’s larger trusted computing base is naturally higher. Nevertheless, when compared to SGX-Spark, Soteria-B covers a wider range of machine learning attacks while keeping performance overhead below 1.59x. Indeed, for algorithms such as PCA and Kmeans, Soteria-B has a similar or slightly inferior execution time ( Observations 3 and 7 ). This happens because, for these algorithms, both SGX- Spark and Soteria-B perform similar computations at the secure enclaves, while the UDF mechanism is not the most optimized choice for running some of these workloads. Finally, due to the TCB reduction by our second scheme, Soteria-P consistently outperforms SGX-Spark and Soteria-B ( Observations 2-12 ). The results show that this solution can reduce the training time by up to 41%, namely for the LDA algorithm with the Huge workload ( Observation 6 ). Although the statistical information outsourced from secure enclaves differs for each algorithm, in general, Soteria-P outperforms Soteria-B from 1.1x to 1.9x ( Observation 6 and 10 ). In detail, for GBT with the Tiny workload, the gains of Soteria-P over Soteria-B are low, 1.1x. The small difference in gain is due to the dataset size but also because the computation offloaded from the enclave ( i.e. , Absolute Error for calculating the model’s loss) is only executed once after the entire tree is constructed ( Observation 10 ). Conversely, when running LDA with both Soteria-B and Soteria-P with workload Huge , we observe a gain in performance by Soteria-P of 1.9x. In this particular case, the optimization of LDA, which resorts to the EM algorithm and is done outside of the trusted enclave, is performed in several stages of the model training process. This further shows the performance impact of offloading different amounts of statistical computation from secure enclaves. 3.4.3.4 Discussion The results show that Soteria-P outperforms other state-of-the-art approaches, namely SGX-Spark, for all the considered ML algorithms. Also, Soteria-P achieves better performance than the Soteria-B setup while offering similar security guarantees when considering distinct ML attacks (Section 3.3.5). This is made possible by filtering key operations to be done outside enclaves. In detail, when compared to Soteria-B, Soteria-P reduces ML workloads’ execution time by up to 37%. When compared with SGX-Spark, the execution time is reduced by up to 41%. Interestingly, for the LR algorithm using a Gigantic workload ( 894GB ), Soteria-P decreases computation time by 4.3 hours and 3.3 67 CHAPTER 3. PRESERVING PRIVACY IN DISTRIBUTED MACHINE LEARNING hours when compared with SGX-Spark and Soteria-B, respectively. The performance overhead of Soteria-P for the four different algorithms ranges from 1.7x to 23.8x when compared to Vanilla Spark. 3.5 Related Work This section is split into two subjects. First, we compare Soteria with other solutions for deploying generic applications on trusted execution environments (§3.5.1). Then, we discuss solutions targeting privacypreserving ML and analytics on TEEs (§3.5.2). 3.5.1 Trusted Execution Environments The challenges associated with deploying applications on TEEs have been studied since this technology became available, as exposed in §2.3. In brief, Soteria differs from the solutions that deploy full applications inside TEEs, as it does not aim to offer a generic solution to deploy applications at enclaves. Namely, our system is focused on ML workloads running on top of Apache Spark, which, as shown in Section 3.3, enables specific optimizations in terms of computation partitioning that allow reducing performance overhead. Second, regarding the partitioning of computation between trusted and untrusted environments, our solution does not aim to propose a generic partitioning tool to this end. Namely, Soteria proposes a specific partitioning scheme optimized to balance the security and performance trade-offs for workloads using Apache Spark’s MLlib. 3.5.2 Privacy-Preserving Machine Learning and Analytics on TEEs For this work, we classify PPML solutions into four main groups based on the techniques being used: i) encryption-based [32,97,231], ii) secure multi-party computation [171,198], iii) differential privacy [3, 266] and, iv) trusted execution environments (TEEs) [126,129,210,285]. Soteria is included in group iv) . 3.5.2.1 Privacy-preserving ML with TEEs Chiron [126] enables training ML models on a cloud service without revealing information about the training dataset. Also, once the model is trained, only the data owners can query it. It supports launching multiple enclaves while each operates on different shards of training data, keeping the enclaves synchronized via a parameter server to ensure they all collaboratively converge to the same model. Besides providing a privacy-preserving approach, this framework also provides data parallelism based on a parameter server to train the model faster. Myelin [129] offers a similar solution to Chiron while adding differential privacy and data oblivious protocols to the algorithms to mitigate the exploits from side-channels and the information leaked by the model parameters. Soteria differs from these works as it can cover both the training 68 3.5. RELATED WORK and inference phases while providing additional protection against adversarial samples , reconstruction , and membership inference attacks (Table 3.1). In Ohrimenko et al., five ML algorithms are re-implemented with data oblivious protocols3. Combined with TEEs, these protocols ensure strong privacy guarantees while preventing exploiting side-channel attacks that observe memory, disk, and network access patterns to infer private information. Unlike this solution, Soteria aims to support all ML algorithms built with MLlib transparently. 3.5.2.2 Privacy-preserving analytics with TEEs TEEs have also been used to ensure privacy-preserving computation for general-purpose analytical frameworks [263]. In comparison to SGX-Spark [109], detailed in Section 3.4.1, Soteria supports a broader set of algorithms ( i.e. , any algorithm that can be built with the MLlib API) while protecting users from a more complete set of ML attacks (Table 3.1). Opaque [321], and Uranus [135] resort to SGX to provide secure general-purpose analytical operations while only supporting a restricted set of ML algorithms. Opaque combines SGX with oblivious protocols and requires the re-implementation and rewriting of the default Apache Spark UDF operators. This solution tries to mitigate the access pattern leakage by sorting and shuffling the entire database, representing a performance overhead of 1.6-46x when adding obliviousness to the system. Uranus is also based on porting UDF processing to SGX enclaves but includes a single ML workload. Differently, Soteria is targeted at ML and is not limited by UDF-based algorithms that, compared with MLlib-based ones, exhibit lower performance for some ML workloads [68]. Therefore, the design, implementation, and security requirements are distinct compared to Soteria. Like the above solutions, SGX-BigMatrix [263] also relies on SGX to deliver a framework to process large encrypted datasets while hiding their access patterns. This solution proposed a new processing framework based on a generic language optimized for data analytic tasks. Unlike this work, Soteria relies on a widely-used framework, namely Apache Spark, maintaining its easy-to-use interface while increasing its privacy guarantees. 3.5.2.3 Privacy-preserving deep learning with TEEs TEEs have also been applied to the training and inference of DNNs[110,150,155,285]. However, there is a substantial difference between the internals of ML and DL frameworks and algorithms, thus requiring significantly different privacy-preserving designs for each scenario. Since MLlib does not natively support DL workloads, the focus of Soteria is solely on ML algorithms. 3A data oblivious algorithm guarantees that its control flow and memory access patterns are non-dependent of the input data [196]. 69 CHAPTER 4. PRIVACY-PRESERVING MACHINE LEARNING FOR GENOME-WIDE ASSOCIATION STUDIES Figure 4.2: A genomic processing pipeline representing the several steps of the genomic analysis. From the collection of the genomic data to its storage, analysis, and public release. It also represents the several stages where data is most vulnerable -Ã. Biocenter1or at third-party ( e.g. , cloud computing infrastructures) premises according to the imposed regulations over such data (Figure 4.2-). Data Analysis. Data is analyzed to derive useful information. This stage is particularly vulnerable to attacks since the data is usually analyzed in plaintext, which means data is fully open to malicious users while being processed (Figure 4.2-À). This analysis may include several tasks, such as Short-read Sequence Alignment, Genome Imputation, Variant Call, and Genome-Wide Association Studies (GWAS). Data Sharing. In this stage, the data is shared with the patient or the healthcare provider. This stage is vulnerable since data is often shared in an open format and already provides the association between the patient identity and the genetic information (Figure 4.2-Ã). The existence of sensitive data in a plaintext format at different pipeline steps makes it particularly vulnerable to different types of attacks. We now define these vulnerabilities and address the most common attacks that can be performed in the different stages. 4.1.3 GWAS Although the genomic pipeline may include several analysis tasks, this work focuses only on GWAS,which tests the correlation between an SNP’s allele frequency and the presence or intensity of a certain phenotype. Such studies have been performed for a large number of phenotypes, including many diseases. Tested individuals are separated into case and control groups, and to achieve significant and robust results, large sample sizes are required [291]. 4.1.3.1 Statistical Methods To evaluate the performance of Gyosa, we illustrate its practical application by employing two machine learning (ML) algorithms, Logistic and Linear Regression, and test the association with continuous and 1We define a Biocenter as any entity that gathers/collects genomic data (e.g., Hospitals, Medical Research Centers). 76 4.1. KEY CONCEPTS binary phenotypes. Following the approach in [144], we used the -2test to evaluate the scalability of Gyosa and its performance for different workloads with an increasing number of workers. The choice of such algorithms is corroborated by the current state-of-the-art, which shows that these algorithms are widely used to perform GWASes [291]2. Next, we analyze the computational complexity of these algorithms using the Big-$notation. Linear Regression. Such an algorithm is broadly used to fit the relation between one dependent continuous variable ( e.g. , weight or blood pressure) and multiple independent variables. The algorithm is efficiently implemented based on matrix multiplications and inversions. For a matrix of <x=dimensions, where <is the number of samples and =is the number of features, the time complexity approximates $(<∗=2+=3)[75]. Logistic Regression. This algorithm performs binary classification based on dependent variables to be able to distinguish between case and control cases [291]. The time complexity of Logistic Regression can be decomposed into 3as the size of the phenotype vector and =as the covariates or features of the phenotype, $(=3)[276]. -2Test. These tests evaluate if the observed and the expected frequencies (allele counts) in the casecontrol groups differ significantly. The test can be defined as follows: -2=’(>1B4AE438−4G?42C438)2 4G?42C438 (4.1) , in which we find the observed and the expected frequency of the 8C⌘ SNP. The time complexity of the chi-squared test is $(=),where=is the number of samples [233]. Differently from the previous statistical methods, which intend to test for associations, the -2focuses solely on the frequency of the alleles. P-values. P-values are a statistical metric used to quantify the differences and incompatibility between the observed results and the null hypothesis. In general, if the P-value is very small, it would be unlikely to observe the data under the null hypothesis. Therefore, the null hypothesis is either not true, or an outlier has been encountered [234]. Indeed, the resulting output of the Linear and Logistic Regression are the p-values. 4.1.4 Apache Spark and Glow While being built based on the design principles of Soteria, Gyosa also resorts to Apache Spark to enable the distribution of computation. As discussed in §3.1.1, Spark promotes the seamless distribution of computation across multiple servers. It also provides a set of tools and utilities for feature extraction and model persistence. Alongside, Spark’s modularity allows easy integration with several third-party 2We acknowledge the usage of Principal Component Analysis (PCA), commonly deployed for population stratification. Although addressed in §3.4 for a different use case, PCA is not currently implemented in Glow, and its privacy requirements may differ from the Gyosa current implementation due to its increasing data exchange and convergence rate. 77 CHAPTER 4. PRIVACY-PRESERVING MACHINE LEARNING FOR GENOME-WIDE ASSOCIATION STUDIES applications. Solutions such as TensorflowOnSpark [308], Glow [99], or ADAM [8] have been built on top of Spark. For this work, we focus our efforts on the Glow framework, which provides a set of tools for genomic data analysis. In brief, Glow offers a solution for performing GWAS at scale while supporting different data formats, including VCF, BGEN, and Plink, by internally converting them into Spark’s DataFrames. This framework already includes regression-based algorithms, statistical tests, and population stratification methods to perform GWAS easily [99]. 4.2 Threat Model and Genomic Attacks Like the common ML pipeline, the genomic pipeline is vulnerable to several attacks. In this section, we discuss the most common attacks and the threat model employed in Gyosa. 4.2.1 Attacks on the Genomic Pipeline When deploying a pipeline, such as the one in Figure 4.2, to a distributed environment, the attack surface will increase. This challenge arises since sensitive data storage and processing are now deployed across multiple servers. However, the critical attacks possible in a distributed pipeline are similar to those in a centralized pipeline ( i.e., when data and computation are outsourced to third-party infrastructures). The three most common attacks are Membership Inference , Re-identification ,and Data Poisoning . Membership Inference. These attacks intend to disclose the usage of a specific individual’s data in the analysis. An adversary with access to the data and the results usually performs the attack. This adversary then tries to infer which individuals were used in the analysis. This is usually done by querying the analysis results for a specific individual and comparing those from others. If the results differ, the adversary can infer that the individual was not used in the analysis. Specifically, Homer’s attack and its variations leverage the background information of the human genome that is currently available in the public domain to query models regarding a specific individual [122,298]. Re-identification. Such attacks try to reveal the identities of the individuals whose data has been anonymized and used in the analysis. Recent studies have shown that demographic information could be linked to public genomic data and databases. Similarly, it was shown that this could be achieved by linking the genomic data with genealogical databases [181]. Data Poisoning. This attack occurs when malicious users want to poison the data to produce false results or contaminate the final analysis, usually by adding false data. Data poisoning in the context of genomic data and, more specifically, GWAS, can lead to false assumptions and associations that can create bias and release false insights [200]. 78 4.3. GYOSA 4.2.2 Threat Model Gyosa adopts the standard SGX threat model. We consider a scenario where a client seeks to use large amounts of sensitive genomic data and perform computation on top of it at third-party infrastructures. In this model, the client and the hardware are deemed trustworthy, whereas the third-party infrastructure’s other components ( i.e., host OS, hypervisor) are regarded as untrusted. This assumption represents an honest-but-curious adversary model. In this model, the presupposition is that the adversary is honest and adheres to the protocol but is also curious and seeks to obtain maximum information. This is supported by existing research [74,132,144]. We highlight that solutions addressing concerns such as Denial of Service (DoS) , side-channel attacks, or memory access patterns can be employed in Gyosa [211]. However, we consider this research orthogonal to the one proposed here. 4.3 Gyosa Gyosa is a privacy-preserving distributed GWAS-focused solution. It builds on top of Soteria [38]and resorts to Apache Spark and Glow for delivering a distributed genomic analysis framework. To achieve the proposed security guarantees, Gyosa uses Intel SGX (further detailed in §3.1.2), which provides secure memory regions as enclaves. 4.3.1 Design Goals Gyosa is split into the client module, deployed on a trusted infrastructure, and the cluster module, deployed on an untrusted site (Figure 4.3). The client module encompasses the encryption of the genomic data and the submission of the GWAS to the untrusted infrastructure. The cluster module includes a distributed Apache Spark and Glow cluster to which the client module will submit the genomic analysis. 4.3.1.1 Client Module The client module includes three main operations. First, it allows the encryption of VCF files based on authenticated encryption. This mechanism is added to Glow by providing a new class to encrypt this data type. Sensitive data is transparently encrypted before leaving the trusted premises. No changes in the implementation of the analysis scripts are required, thus avoiding any changes to the way users implement or specify their GWAS. Second, it handles the secure outsourcing of the GWAS requests issued by users to the Glow/Spark Cluster. The third operation allows the decryption of the analysis results when returned to users, which are encrypted to avoid revealing sensitive information. To perform a GWAS, users must specify a task script file where the analysis steps and all the required parameters are defined. This file contains sensitive information about the analysis task that cannot be 79 CHAPTER 4. PRIVACY-PRESERVING MACHINE LEARNING FOR GENOME-WIDE ASSOCIATION STUDIES Figure 4.3: A schematic representation of Gyosa architecture. The workflow is as follows. A Biocenter encrypts and sends its data to distributed data storage (¿-¡). The Biocenter sends the GWAS task script and the Manifest file to the master node (-À). The master node then distributes the tasks to the worker nodes (Ã). The workers fetch the data (Õ) and process the task script between the secure and non-secure workers (Œ-œ) and send the results back to the master node (–), which merges the results and sends them back to the client (—). leaked or tampered by malicious adversaries. Thus, the encryption module encrypts the task script, which can be sent via unprotected network channels. The manifest is a predefined file that contains the libraries to run the Glow pipeline and the path for the dataset. To ensure data security and integrity when exchanging this file, a secure channel between the client and the Glow/Spark Cluster is created at the analysis bootstrap phase. This secure channel is also used to transmit the user’s encryption key, which is then used by SGX enclaves. 4.3.1.2 Cluster Module The cluster follows Spark’s workflow on the untrusted site, with a master and #workers running on distinct servers. The master is deployed inside an SGX enclave at the untrusted server since the Spark Driver and Spark Context modules require reading plaintext information from the task script to distribute the processing tasks to the workers. We follow the previous approach (§3.3) and deploy a secure and non-secure worker at each of the remaining cluster servers. The secure worker runs inside an SGX enclave and handles all the computation over sensitive data, while the non-secure worker handles non-sensitive data and runs outside of SGX. The exchange of sensitive information between secure workers and the master and between secure workers is done via secure network channels (Figure 4.3). 4.3.1.3 Partitioned design Since Soteria targets Machine Learning workloads, which significantly differ from GWAS, Gyosa must redefine how computation is partitioned across secure and non-secure workers. 80 4.3. GYOSA In Gyosa, non-sensitive computations include the residual values ( e.g. , matrix calculation of metadata or calculations over single genotype information) and the correction of statistical tests, which in Glow are based on the Firth’s approximation algorithm [187]. In detail, this last step is performed as a score test, which compares the predicted values with the observed values to validate the resulting P-values. All the remaining operations ( e.g. , read operations on top of the VCFs, dataframe transformations, and regression operations, among others) are done over sensitive data and performed in SGX enclaves at the secure workers. Note that all this sensitive information remains fully encrypted when transmitted and stored outside of secure workers to ensure its privacy. In summary, Gyosa differs from Soteria by considering a different processing pipeline, namely a genomic pipeline for performing GWAS. This implies supporting a new framework ( i.e. , Glow), including transparent encryption of a new type of dataset file format ( i.e. , VCF files), and redefining the sensitive analysis steps that must be performed inside secure enclaves. Next, we detail the flow of operations in Gyosa. 4.3.2 Workflow of Gyosa In Gyosa, the client resorts to Gyosa’s encryption module to encrypt the VCF files at the trusted premises (Figure 4.3-¿). Then, encrypted data is sent to a distributed data storage shared by various servers on the untrusted infrastructure (Figure 4.3-¡). Similarly, the client specifies the studies it wants to run as task scripts and encrypts these before sending them to the untrusted infrastructure (Figure 4.3-). The default usage of Gyosa assumes a bootstrapping phase between the client and master in which a secure channel is established and used to share the manifest file and the client’s key, which was used to encrypt the VCF files and tasks’ scripts. This key is also used to decrypt the final results (Figure 4.3-À). Following a master–worker architecture, the master, running inside an SGX-enabled server, receives the task the client wants to perform and the path (within the manifest file) for the encrypted dataset. The former is sent encrypted through an insecure channel, while the latter is forwarded inside the previously established secure channel. After decrypting the task script inside the secure enclave, the master forwards specific sub-tasks to each secure worker through secure channels established between their enclaves (Figure 4.3-Ã). With these sub-tasks, secure workers can fetch the required data from the distributed storage backend and perform the computation. Since data is encrypted at the storage backend, it must be fetched and decrypted at each secure worker enclave to be processed in plaintext (i.e., inside an SGX enclave) (Figure 4.3-Õ). Following a distributed computation paradigm, workers broadcast intermediate results between them (Figure 4.3-Œ). In addition, following the partitioning of computation, secure workers broadcast metadata to non-secure workers. Again, after performing their computation, the non-secure workers broadcast the information back to the secure workers (Figure 4.3-œ). Sensitive information shared across secure workers is done through secure channels established between their enclaves. In the final worker-related stage, a consensus regarding the result is reached and sent to the master’s enclave through a secure channel 81 CHAPTER 4. PRIVACY-PRESERVING MACHINE LEARNING FOR GENOME-WIDE ASSOCIATION STUDIES (Figure 4.3-–). Final results are aggregated and encrypted by the master, with the client’s key, and sent to the client for transparent decryption at the trusted premises (Figure 4.3-—). 4.3.3 Security Analysis Gyosa combines different mechanisms to safeguard users from attacks, see §4.2.1 for more details on these attacks. It provides transparent authenticated encryption, which protects sensitive data from being disclosed to unwanted parties and ensures anti-tampering properties for clients’ data stored in untrusted infrastructures. This feature protects users from poisoning attacks by limiting access to the plaintext data and not allowing the addition of poisoned data. Membership inference and re-identification attacks are subject to an attacker’s previous knowledge of the genomic data. By ensuring that private data, while at rest and in transit, is always encrypted and that any sensitive computation is performed on secure SGX enclaves, Gyosa avoids disclosing such knowledge to attackers. Partitioning the computation across the enclaves and non-secure environments enables performance improvements but increases the attack surface. However, previous work shows that genomic data cannot be inferred from the information leaked from sharing metadata and statistical information [205]. Given this assumption, and by not changing the main security protocol specified by Soteria, Gyosa can keep the information leakage contained to avoid the success of the aforementioned attacks. 4.3.4 Implementation Gyosa’s prototype is built on top of Apache Spark 3.2.1 and implemented using both Java, Scala and Python. Spark’s data loading library was extended to include Gyosa’s transparent encryption module for VCFs. Similar to Soteria’s encryption module, this module also resorts to AES-GCM-128 authenticated encryption cipher mode, to offer data privacy and integrity guarantees. The prototype supports both Linear and Logistic Regression for GWAS with the -2being defined inside the Logistic Regression algorithm. With this, the implementation of Glow was decoupled into two sublibraries, one with the statistical processing (to be executed outside SGX) and another with the remaining computational logic of the algorithms (to be executed inside SGX). This separation allows the non-sensitive operations to be performed outside SGX, while the sensitive operations are performed inside SGX enclaves. Also, by following Soteria, in Gyosa, Gramine 1.0 was used for the overall management of Intel SGX enclaves’ life cycle, for specifying the computation ( i.e. , internal Spark and Glow library) to run at each enclave, and for establishing secure channels ( i.e. , with the TLS-PSK protocol) between the enclaves at the master and worker nodes [289]. Gyosa’s manifest file was also provided by Gramine. 82 4.4. EVALUATION 4.4 Evaluation Gyosa was evaluated to understand the impact of adding security guarantees on top of the application stack composed by Apache Spark and Glow. Two main questions were asked in this evaluation: 1. How does the execution time of Gyosa compares with the non-secure vanilla setup? 2. How does Gyosa behave when increasing the size of the workload and the number of workers? 4.4.1 Methodology 4.4.1.1 Dataset For the benchmark, we used the data generated by the Genome in a Bottle Consortium [327], with genomes sequenced as part of the Human Genome Project. Data from the Ashkenazim Trio family (father, mother, and son) were used in our experiments. The dataset does not contain phenotype data, so additional information was simulated with the PhenotypeSimulator [193]. The algorithms were tested for different workloads by scaling the original dataset by several factors to reach sizes of 1, 4, 16, and 32 GB. Moreover, for the scalability tests, we generated a synthetic dataset consisting of 80,000 VCF files with 1∗106unique SNPs, each VCF file representing one individual. We define the workload size as 20k, 40k, 60k, and 80k individuals. 4.4.1.2 Experimental Setup Tests were performed in a cluster of 4 servers with OS Ubuntu 18.04.4 LTS and Linux kernel 4.15.0. Each machine has a 10Gbps Ethernet card connected to a dedicated local network and 16 GB of memory. Gyosa uses Apache Spark 3.2.1 and was deployed with version 2.6 of the Intel SGX Linux SDK with driver 1.8, with 4 GB of memory. The client and Spark master run on one server, while Spark workers are deployed on the remaining servers. 4.4.2 Secure GWAS To assess the impact of Gyosa’s security mechanisms on the execution time of the algorithms, we compare the results with the ones for the baseline setup. Figure 4.4 shows the Linear Regression and Logistic Regression algorithm results. In detail, in Figure 4.4a, for a workload of 1 GB, the runtime overhead of the linear regression algorithm is around 4.5x. For 32 GB, the overhead of Gyosa reaches the maximum for the performed tests, with 10x compared to the baseline setup. The comparison of probability values ( p-values ) between the two approaches shows negligible differences (see Figure 4.4b). The slightly different values observed may result from the final approximation since it deals with small values and reverts them to −;>610 (?−E0;D4). Similarly, for the 83 CHAPTER 4. PRIVACY-PRESERVING MACHINE LEARNING FOR GENOME-WIDE ASSOCIATION STUDIES 0.1 1 10 100 1000 10000 Runtime Execution (s) Workload Size 32Gb16GB4GB1GB (a) (b) 0.1 1 10 100 1000 10000 Runtime Execution (s) Workload Size 32Gb16GB4GB1GB (c) Figure 4.4: The impact of Gyosa on variable workloads (1GB, 4GB, 16GB, and 32GB) with the Linear Regression and Logistic Regression algorithm compared to baseline. a) Execution time of Linear Regression in logarithmic scale; b) Comparison of p-values between approaches for Linear Regression; c) Execution time of Logistic Regression in logarithmic scale. The legend is as follow: Vanilla Glow; Gyosa. Logistic Regression algorithm and workload size of 1 GB and 32 GB, Gyosa shows a runtime overhead of 4x and 9.5x (see Figure 4.4c). For the Logistic Regression algorithm and workload size of 1 GB and 32 GB, Gyosa shows a runtime overhead of 4x and 9.5x. Gyosa can be used in a cluster setup with multiple servers, each including one secure worker and one non-secure worker. Figure 4.5a shows the results of the overhead imposed for the -2frequency test. Gyosa leverages the scalability offered by Apache Spark and Glow, as shown by the experiments with up to 3 servers. We verify a linear decrease in the runtime execution when increasing the number of servers for both Gyosa and baseline setups. Namely, when comparing the execution time obtained by running this experiment over 80,000 VCF files with one and three servers, the runtime execution decreases up to 2.7X or up to 2.4 hours. Regarding the security guarantees, the runtime overhead ranges from 1.3x to 3x for a workload of 40k individuals with three servers. 0 2 4 6 8 2 3 4 5 6 7 8 Runtime Execution (hours) Number of Individuals (x105) 1S Glow 2S Glow 3S Glow 1S Gyosa 2S Gyosa 3S Gyosa (a) 0 20 40 60 80 100 Memory usage (%) 1 GyosaGlow 2 GyosaGlow 3 20k 40k 60k 80k GyosaGlow (b) Figure 4.5: Runtime execution (hours) and Memory usage (%) of the -2statistic test for 1 to 3 worker nodes and 20k to 80k number of individuals from the synthetic dataset. The setup is represented by M: Master and W: Worker ( e.g. , 1M+1W represents one Master node with one Worker node). a) Runtime Execution for -2statistical test in hours; b) Memory Usage in percentage (%) for -2statistical test. 84 4.5. RELATED WORK 4.4.3 Analysis The discussion focuses on the performance and scalability of Gyosa. Performance and Scalability Analysis. By increasing the number of servers, one can distribute and parallelize GWAS computations and substantially reduce the runtime and memory usage, as observed for the -2test in Figure 4.5a and 4.5b. Figure 4.5b shows that despite Glow being a memory-intensive solution [99], increasing the number of servers leads to a decrease in the mean memory usage. Compared with other SGX-based solutions, namely [55], Gyosa shows comparable runtime overhead. Notably, Gyosa distinguishes from all these state-of-the-art solutions [74,144] by allowing distributed computation across several servers in a cloud environment. High-end servers used by state-of-the-art solutions ( e.g. , a configuration with >40 cores, >2.0TB of physical memory, and 10TB of disk space [74]) are not widely available and require substantial resources for their setup and maintenance. A cost-efficient alternative is to use cloud environments that allow the distribution of computation by relying on several servers, reducing the execution time of genomic analysis. In Google Cloud [60] with 391.35§per month, one could opt for i) one server with 16 cores and 64 GiB of memory or ii) four servers with four cores each and 16 GB of memory. While solution i) provides 730 h of computation, solution ii) provides a total of 2,920 monthly hours of computation [103]. Currently, the second generation of SGX includes a page cache with 128 MB. Data that does not fit on this cache must be swapped to/from an encrypted memory region, leading to a performance penalty [73, 120]. Also, in our setup, the amount of encrypted memory attributed to SGX is limited to 4GB in each server. For memory-intensive GWAS algorithms, this means additional swapping to/from disk [120,188]. Note that this SGX technological limitation cannot be solved by simply upgrading the server’s hardware but is addressed by Gyosa’s distributed design. Namely, by distributing computation across multiple servers, our solution can leverage the aggregated page cache and encrypted memory sizes of multiple servers, which justifies the decreased runtime execution observed for Gyosa in Figure 4.5a. Our benchmarks show that to deliver a practical privacy-preserving solution, the performance penalty in Gyosa is proportional to the data size, both for regression and classification tasks. Notably, the addition of security guarantees in Gyosa does not alter the results, and therefore, Gyosa presents itself as a viable option for privacy-preserving genomic analysis. 4.5 Related Work This section is split into three stages. The first two stages present the related work on privacy-preserving genomic analysis that: i resorts to software-based cryptographic primitives (§4.5.1); and, ii) resorts to hardware-based cryptographic primitives (§4.5.2). Finally, the third stage (§4.5.2) presents a summary and taxonomy of the related work. 85 CHAPTER 5. PROTECTING USER’S MOBILITY PATTERNS WITH DIFFERENTIAL PRIVACY 5.1 Key Concepts and Technologies This Section overviews the key concepts and technologies leveraged in this Chapter. We start by defining a standard protocol for FL, we formalize DP and the algorithms implemented, and then detail the FranchetAI methodology, which provides the building blocks and the use case for this work. 5.1.1 Federated Learning Following the enormous amounts of collected data from different sources, ML has become the de facto solution for analyzing and extracting insights from it. Nonetheless, new regulations ( e.g. , GDPR) impose new approaches for analyzing data that may contain sensitive information. FL has emerged as a new ML paradigm targeting Non-Independent and Identically Distributed (Non- IID) data [27,161], typically generated on the edge, local servers, and mobile devices. Specifically, FL is a type of distributed ML in which models are trained with data from different users, but sensitive information never leaves each user’s premises. In this setting (see Figure 5.1 and 5.2), a centralized server has an initial trained model "8and broadcasts "8to every user (Fig. 5.1-). Typically, "8is trained on previously collected, open-source, or private data, resulting in a collection of parameters and hyperparameters. On the user side, the device trains the model based on the user’s data (Fig. 5.1-À). At each iteration, the centralized server asks #users for their new model parameters (Fig. 5.1-Ã). Each user can define whether to participate or not in a given round, and similarly, the centralized server can decline the parameters broadcasted from the decentralized users (Fig. 5.1-Õ). At the end of this cycle, the server calculates the average of all obtained parameters (Fig. 5.1-Œ) and broadcasts new parameters to every user, which updates locally its own model (Fig. 5.1-œ)[27,161]. This protocol follows the flow of operations depicted in Figure 5.2. The mobile device joins the FL protocol, and the centralized server replies with the initial or the last model ( i.e., if the protocol has been initiated before, the server sends the last model obtained; otherwise, it sends the initial one). The mobile device trains the model with its local data and sends the updated version to the centralized server. The server aggregates the models and sends the updated one to the mobile device. This process is repeated until the model converges or a predefined number of iterations is reached. Although these protocols do not require the centralized server to have access to the users’ data, they still require the server to have access to the users’ model parameters. This is a significant limitation, as the server can still infer sensitive information from the users’ data [302]. To address this limitation, FL can be combined with DP to provide stronger privacy guarantees. 5.1.2 Differential Privacy To further strengthen data privacy guarantees, FL may resort to MPC or DP as discussed in Section 5.6.3. In this work, we focus on the latter. The intuition behind DP relies on the fact that changing any individual 92 5.1. KEY CONCEPTS AND TECHNOLOGIES Figure 5.1: An overview of the Federated Learning protocol. The centralized server is responsible for broadcasting the initial model to the users, starting the protocol, aggregating the models, and broadcasting the updated model to the users (,Ã,Œ-œ). The devices are responsible for training the model with their local data and broadcasting the updated model to the centralized server (À,Õ). point on the input data will not change the query result but will limit the attacker’s capabilities for deducing private information from data with high confidence. To this end, DP anonymizes private information by introducing randomness or noise in the original data [78]. Formally, a randomized algorithm Mis (n+X)-differentially private if for all datasets ⇡1and ⇡2that differ in a single element, and for all subsets of the output space O, the following holds: P[M(⇡1)∈O]≤4n×P[M(⇡2)+X∈O](5.1) Adding noise to sensitive training data increases privacy-preserving guarantees and the models’ error rate. In this sense, the trade-off between privacy and accuracy is crucial when using DP [190]. To reduce the error rate, one can apply optimizations such as adaptive clipping [15], which continuously adapts the amount of noise introduced in each individual training sample. Nonetheless, this work does not consider such optimizations, focusing on standard DP algorithms. In an FL setting, DP can be applied directly to users’ data or the parameters being broadcast across users and the centralized server. In both cases, the goal is to guarantee that no private information is leaked when the trained model is queried by third-party entities ( e.g., cities, municipalities). Two different strategies can be used to apply DP in FL: (i) adding noise to the users’ data before training the model [62], (ii) adding noise to the parameters being broadcasted to the centralized server [190,206]. The first strategy is more straightforward to implement but may lead to a higher error rate ( i.e., lower accuracy results and longer times to convergence). The second strategy is more complex to implement but allows for a more fine-grained control of the noise introduced in the training process and a lower accuracy impact. 93 CHAPTER 5. PROTECTING USER’S MOBILITY PATTERNS WITH DIFFERENTIAL PRIVACY Figure 5.2: An example of the flow of operations in a Federated Learning protocol. The mobile device joins the FL protocol, and the centralized server replies with the model. The mobile device trains the model and sends the updated version to the centralized server. The server aggregates the models and sends the updated one to the mobile device. This process is repeated until the model converges or a predefined number of iterations is reached. Focusing on the noise added to the gradients, the DP-FedAvg strategy [190] is a popular choice. It introduces noise to the aggregated gradients, ensuring that the model does not remember the data it was trained with. This strategy is based on the Federated Averaging algorithm, which calculates the average of the aggregated gradients of the model’s parameters and broadcasts them to the centralized server. The noise is added to the gradients before the averaging process, ensuring that the model’s parameters are not leaked to third-party entities. In brief, in DP-FedAvg (see Algorithm 5.1), each client computes its gradient based on its local data, and then these gradients are aggregated using a secure averaging mechanism to update the global model parameters Additionally, the DP-FedSGD algorithm was also proposed with the same intuition. In DP-FedSGD (see Algorithm 5.2) each client needs to use the stochastic gradient descent (SGD) directly to update its local model with its noisy-local gradients. As stated by Noble, Bellet, and Dieuleveut, the main difference regarding the usage of DP between both algorithms relies on the fact that DP-FedAvg typically adds noise to the aggregated gradients and, in contrast, DP-FedSGD adds noise directly to the model parameters during updates (this is highlighted in orange in both algorithms 5.1 and 5.2). As the updates can be randomly defined, and a client may not be 94 5.1. KEY CONCEPTS AND TECHNOLOGIES Algorithm 5.1: Pseudocode of DP-FedAVG. 1: Input: Local datasets ⇡1,⇡2,...,⇡ =on =devices, learning rate [, target privacy budget Y, noise scale f 2: Initialization: Initialize global model parameters \randomly 3: for each communication round C=1,2,...do 4: Sample noise from Laplace or Gaussian distribution: N(0,2@ =Y ) 5: Broadcast \to all devices 6: for each device 8=1,2,...,=do 7: Compute local gradient: ∇58(\)on dataset ⇡8 8: Add noise to the local gradient: ∇5′ 8(\)←∇58(\)+N(0,2@ =Y ) 9: end for 10: Aggregate noisy gradients: ˆ6←1 =Õ= 8=1∇5′ 8(\) 11: Update global model: \←\−[⋅ˆ6 12: end for 13: Output: Trained global model parameters \ Algorithm 5.2: Pseudocode of DP-FedSGD. 1: Input: Local datasets ⇡1,⇡2,...,⇡ =on =devices, learning rate [, target privacy budget Y, noise scale f 2: Initialization: Initialize global model parameters \randomly 3: for each communication round C=1,2,...do 4: for each device 8=1,2,...,=do 5: Sample noise from Laplace or Gaussian distribution: N(0,2@ =Y ) 6: Broadcast \to device 8 7: Compute local gradient: ∇58(\)on dataset ⇡8 8: Add noise to the local gradient: ∇5′ 8(\)←∇58(\)+N(0,2@ =Y ) 9: Update local model: \8←\−[⋅∇5′ 8(\) 10: end for 11: Aggregate updated models from all devices: \←1 =Õ= 8=1\8 12: end for 13: Output: Trained global model parameters \ selected to participate in a given round, the noise added to the parameters also depends on the algorithm. This randomness of choosing clients may lead to higher privacy-preserving guarantees from the DP-SGD algorithm as each iteration of the model is updated with the noisy gradients, even if they are not updated with gradients from other clients. 5.1.3 FranchetAI Methodology FranchetAI provides a digital rewarding solution for people opting for sustainable mobility options ( e.g. , public transportation, electric vehicles), ensuring transparency and trustworthiness between the user and the different stakeholders creating the incentives. Such a solution aims to educate citizens about their carbon 95 CHAPTER 5. PROTECTING USER’S MOBILITY PATTERNS WITH DIFFERENTIAL PRIVACY footprint while offering traveling alternatives and rewards for traveling more sustainably. The methodology proposed by FranchetAI and depicted in Figure 5.3 has the end goal of reducing CO2emissions. To achieve this, one can split the methodology into several steps. First, a centralized server allows deploying a web platform that processes and visualizes, for instance, traffic flow, road topologies, and public transit networks (Fig. 5.3-). Second, a mobile application is deployed on each user’s mobile device (Fig. 5.3-À). This application collects itineraries from GPS, accelerometer, and gyroscope (Fig. 5.3-Ã). It also allows users to input additional info on vehicle usage and parameters ( e.g., year, class, fuel type) (Fig. 5.3-Õ). Information collected by the mobile app and the web platform is the input for a transportation model. This model, based on AI, infer users’ transportation mode by using personal information from their trips and public information from public transit networks (Fig. 5.3-Œ). The collected user data is also used to retrain the model to improve its accuracy. This is done in a privacy-preserving manner by resorting to federated learning and guaranteeing that private users’ data remain on their premises ( i.e., their mobile devices). The output of the previous model’s inference is leveraged by an Life Cycle Assessment (LCA)model that estimates GHG emissions (Fig. 5.3-œ). These GHG emissions will then be leveraged for generating daily and weekly carbon digest reports for each user. All these stages are important for the final user to understand the impact of their mobility choices on the environment. Furthermore, the FranchetAI encompasses other stages, for clarity of presentation not here depicted, that aim to increase users’ engagement with the application and with greener alternatives. 5.2 Threat Model and Attacks The FL pipeline follows the same principles as the one in a common ML pipeline but with the added complexity of training models on non-IID data and distributed clients. This pipeline is susceptible to the same attacks as the common ML pipeline, such as poisoning attacks ( i.e., adversarial attacks) and membership inference attacks. In this section, we discuss the attacks on the FL pipeline and the threat model used in this work. 5.2.1 Attacks on the FL Pipeline There are two main types of attacks on the FL pipeline: poisoning attacks and membership inference attacks [275]. Also, a new taxonomy for these attacks on FL has recently been proposed by Rodríguez- Barroso et al. [250]. Figure 5.4 shows the different attacks on the FL pipeline, namely on the centralized server or the client’s side, which are further detailed in the following sections. 96 5.2. THREAT MODEL AND ATTACKS Figure 5.3: Pipeline of the FranchetAI’s methodology. Two application services are deployed: a web platform and a mobile application (-À). The mobile application deploys feeds the transportation model (Ã). It also allows users to input additional info on vehicle usage and parameters (Õ). The collected data is used to train a transportation mode model (Œ). The output of the transportation mode model is leveraged by a LCA model that estimates GHG emissions (œ). 5.2.1.1 Poisoning Attacks Poisoning attacks can be decomposed into two main subgroups: data poisoning ( i.e., during local data collection) and model poisoning ( i.e., during local model training) [178,199,299]. Data Poisoning. Data poisoning attacks are a common threat to the ML/FL pipeline. As defined in Section 2.3.1, these inject malicious data into the training stage. In the FL setting, this can be done by poisoning the data of several devices and manipulating the global model. With this, a malicious adversary may be able to control the training process and steer the model towards a specific direction ( i.e., this is defined as a targeted data poisoning attack) [178,182,199,275,283,299]. Such attacks can be mitigated by identifying the malicious users based on their model updates, for instance, by removing outliers [93]. Nonetheless, this is still a challenging and open research problem. Model Poisoning. Farther from the previous goal of controlling the training stage by injecting poisoned data and, ultimately, the global model, model poisoning attacks aim directly at the global model. This targeting is done by manipulating the local model’s parameters and gradients, which are then broadcasted to the centralized server [22,85,178,182,199,299]. 97 CHAPTER 5. PROTECTING USER’S MOBILITY PATTERNS WITH DIFFERENTIAL PRIVACY Figure 5.4: Attacks on the FL pipeline. The attacks can be performed on the centralized server (À)orthe client’s side (). 5.2.1.2 Membership Inference Similar to the membership attacks to the ML pipeline, these attacks, in the FL setting, intend to infer the membership of a specific user in the training dataset. This attack is done by querying the global model and analyzing the model’s outputs. If the adversary can infer that a specific user’s data was used to train the model, this user’s privacy is compromised. In the context of FL, the adversary aims to deduce whether a given sample belongs to the confidential training data of a specific client or of any client [178,182,250]. 5.2.2 Threat Model In this work, we consider an honest-but-curious adversary. This adversary adheres to the FL protocol yet endeavors to extract confidential data about other clients from the exchanged information. This adversary is not malicious and does not aim to disrupt the training process. We acknowledge that this threat model may not hold for all use cases, as it is challenging to ensure that all participants in the FL pipeline are honest. However, this is a common assumption in the literature, and we aim to provide a baseline for the privacy-preserving guarantees of the TAPUS system. In this sense, we highlight that works focusing on byzantine failures and malicious adversaries are still an open research problem and could be employed in TAPUS [178,250]. 5.3 TAPUS Based on the underlying problems, TAPUS was built to provide a privacy-preserving solution for the FranchetAI mobile application. This system is designed to protect users’ mobility patterns while providing accurate and explainable models for transportation and emissions. 98 5.3. TAPUS 5.3.1 Architecture and Flow TAPUS consists of two main components: the AI component and the GHG component. The former is responsible for choosing and training the models in a privacy-preserving manner. The latter is responsible for estimating the GHG emissions of the users based on the models’ predictions. The architecture of TAPUS is depicted in Figure 5.5. It is composed of three main stages: (i) the training of the AI models; (ii) the inference of the AI model; and (iii) the estimation of the GHG emissions. The flow of TAPUS is as follows. First, an AI model and the GHG estimation function are deployed to each user’s mobile device inside the mobile application. Then, the user’s sensor-collected data is used to train the local model (Figure 5.5-). After the model is trained, the user’s data is used to infer the transportation mode (Figure 5.5-À). The AI model is trained in a privacy-preserving manner by resorting to FL and DP. Namely, the FL protocol employed allows the local training and then the broadcast to the centralized server of the trained gradients (Figure 5.5-Ã). The server then aggregates the gradients (Figure 5.5-Õ) and broadcasts the updated model parameters back to the users (Figure 5.5-Œ). Finally, the GHG emissions are estimated based on the user’s transportation mode inferred from the AI model, sensorcollected data ( i.e., distance, velocity), and other user input-based data (Figure 5.5-œ). This estimation is performed locally on the user’s mobile device, and the report is provided to the user on the mobile application (Figure 5.5-–). Figure 5.5: Architecture of TAPUS. The system comprises two main components, the AI model and the GHG estimation function. The AI model communicates with the centralized server (which aggregates the parameters Õ), reports to the mobile app and trains with local data (-À,Ã,Œ). The GHG estimation function leverages the output of the AI model and reports to the mobile app (œ-–). 99 CHAPTER 5. PROTECTING USER’S MOBILITY PATTERNS WITH DIFFERENTIAL PRIVACY 5.3.1.1 AI Component Our AI approach is decoupled into two main stages. First, we define the training dataset and how data is preprocessed. Then, we choose the ML models and DL architectures to train with the previous dataset while defining the FL framework. As explained in Section 5.1 and depicted in Figure 5.6, TAPUS follows the same principles as the common FL protocol. Nonetheless, for increasing the privacy-preserving guarantees, we resort to DP- based algorithms, such as DP-FedAVG and DP-FedSGD and local DP ( i.e., random noise applied directly on the users’ premises after the collection of data). Each DP-based algorithm is deployed independently ( i.e., each strategy is used separately). By relying on a highly distributed and privacy-preserving approach, TAPUS can train models on top of sensitive data without sharing it with third-party entities. This is crucial for the FranchetAI mobile application, ensuring users’ data is not leaked to third-party entities. Moreover, it allows both ML models and DL architectures to be trained over distributed data. We focused on the three main crucial parts of the FL pipeline for introducing the noise ( i.e., input, gradients, and output). In brief, the input noise is added to the users’ data before training the model (Figure 5.6-), while the gradient noise is added to the parameters being broadcasted to the centralized server ( i.e., the added noise to the gradients is performed by leveraging the DP-FedSGD algorithm, Figure 5.6-À). The output noise is added to the model’s parameters, and the model is updated with the aggregated noisy parameters ( i.e., by resorting to DP-FedAVG , Figure 5.6-Ã). Figure 5.6: Architecture of TAPUS’s AI component. The DP-based algorithms are used to introduce noise in the input and gradients(-Ã). 100 5.3. TAPUS 5.3.1.2 GHG Component The methodology adopted for estimating GHG and air pollution emissions is based on the tank-to-wheel stage of the Well-to-Wheel (WtW)LCA model, which only considers the operation of the vehicle, reducing the information that the user needs to provide to the model [113]. In more detail, emissions are estimated based on the CORe INventory AIR emissions (CORINAIR) system, i.e. , the method approved by the European Environment Agency (EEA). CORINAIR adheres to the Intergovernmental Panel for Climate Change (IPCC) guidelines [51] used globally by environmental protection agencies for national and regional evaluations. According to the IPCC Guidelines for greenhouse gasses, a compiler from the CORINAIR system builds a decision tree to select the appropriate methodology with different complexities and data requirements. As input to the compiler, we apply the Tier 3 methodology from EMEP/EEA emission inventory guidebook [82]. Moreover, the GHG estimations are based on the ultimate CO2emissions, which result from different processes ( i.e., combustion of fuel, combustion of lubricant oil, and addition of carbon-containing additives in the exhaust). This results in equation 5.2: ⇢8: =48: (E)⋅0:,(5.2) where ⇢8: is the exhaust emissions of pollutant 8induced by a vehicle technology :(in grams); 48: is the emission factor as a function of the vehicle driving speed (in grams per kilometer); 0:is the transport activity in vehicle kilometers traveled for vehicle technology :. The emissions are calculated individually for each user of the FranchetAI mobile application by considering the average driving speed of the road links that constitute an individual trip. The previous AI model(s) provides the information on traffic data (transportation mode, distance, and traveling speed) necessary to calculate clients’ emissions from traffic activity. This information results from the inference of the models trained in the previous stage, and all the calculations are done on the user’s mobile device. Also, information on vehicle technology is required, i.e. , the Euro Standard information, accessed by considering the age of the vehicle. Therefore, a user is asked to give this detailed information; otherwise, a default technology is used (Euro 4) . In detail, the final emissions model requires the following information: i) mean velocity of the trajectory; ii) type of fuel of the car; iii) category of the vehicle ( i.e. , passenger, bus, heavy duty and, motorcycle); iv) the total distance of the trip; and v) the year of the vehicle. The year and category are further used to define the Euro Standard. Still, when the user does not disclose such information, the GHG emissions are estimated based on Euro 4, while the previously trained AI models define the vehicle category. Figure 5.7a presents an example of using our emissions model. For instance, for a user commuting for 30 min at 30km/h, totaling a distance of 15 Km, one may analyze the CO2induced by different vehicle modes ( e.g. , diesel/gasoline car or bus) in kilograms per vehicle. Also, by assuming that an urban bus will have an occupancy of 20 people, the impact of using such a more environmentally friendly vehicle is presented in Figure 5.7b. 101 CHAPTER 5. PROTECTING USER’S MOBILITY PATTERNS WITH DIFFERENTIAL PRIVACY sensitive personal information from devices like mobile phones [177]. Therefore, one must also ensure that users’ data is not disclosed to unwanted third-parties. With this, state-of-the-art solutions can be decomposed into three main subgroups: i) mobility patterns and transportation mode, ii) carbon footprint assessment, and iii) federated learning for mobility. 5.6.1 Mobility Patterns and Transportation Modes Mobility pattern studies typically focus on how citizens use urban transportation and how it might be enhanced to better serve their needs and those of communities. Data collected from several sources ( e.g. , GPS traces, weather conditions, traffic status) can be leveraged to deliver solutions with different purposes [274]. Currently, mobility patterns are classified into two main types: prediction and generation. Regarding mobility pattern prediction, studies have focused on the following topics: Next-location prediction. It aims to understand the future locations of users based on their previous behavior and historical mobility data. Such information can be beneficial for improving public health, reducing traffic congestion, and providing better travel recommendations. Additionally, it can help urban and public transportation planning, as cities can leverage this information to upgrade their road systems, urban infrastructure, and public transportation systems [177,213]. Crowd flow prediction. It assists cities in pinpointing areas of possible traffic congestion and infrastructural improvement based on crowd behavior. Once more, these studies are based directly on users’ information and how they move around cities. However, they leverage the flow of the crowd itself and do not intend to predict an individual’s next geographical position [177,213]. Mobility pattern generation studies also follow two different approaches: Trajectory generation. This approach is based on individual GPS traces and trajectories, and the goal is to generate synthetic trajectories that follow distinct traveled distances and predictable human mobility patterns. Generating these trajectories may aid in urban planning and avoid collecting citizens’ geographical positions [177,316]. Flow generation. This approach gathers crowd flow information for a specific geographical region based on users’ exact location. This is a crucial process for transport planning and epidemic spread patterns [177,316]. The prediction and classification of mobility patterns can also be leveraged to define the transportation mode of users. For instance, recent studies have used GPS traces for transportation-mode detection, classification, and prediction. These studies have shown high confidence in defining several classes of transportation ( e.g. , walk, run, bike, car, bus, train) by using Machine and Deep Learning algorithms 108 5.6. RELATED WORK (ML/DL) [124,166,297]. Other solutions explore using multiple sensors to detect transportation modes alongside the GPS traces ( i.e., accelerometers, gyroscopes, and/or magnetometers). Further, to improve the accuracy of these models, one can rely on additional information from public transportation networks and urban infrastructure ( e.g. , roads, streets, highways, etc.). The interplay of these new variables allows for enhancing the output of these prediction and classification models [124]. 5.6.2 Carbon Footprint Assessment Calculating and inferring the carbon footprint of an individual user is complex as it requires the collection of several data points and integrating distinct models [100]. LCA models allow the calculation of the carbon footprints for the entire life cycle of a specific transportation mode, from the manufacturing of the vehicle to its usage and maintenance and, finally, to its disposal ( cradle-to-grave model). Such models provide a holistic view of vehicles’ full life cycle and their impact on the environment [133,272]. On the other hand, the WtW concept provides an alternative LCA model that focuses only on transport fuels and vehicles’ usage. Well-to-wheel differs from cradle-to-grave , as it does not consider energy and emissions involved in building facilities and the vehicles, nor end-of-life aspects of the latter. The model analysis is often broken down into two stages entitled well-to-tank and tank-to-wheel . The first stage, known as upstream stage , incorporates fuel production, processing, and delivery, while the downstream stage deals with vehicle operation. The WtW analysis is commonly used to assess total energy consumption or the energy conversion efficiency and emissions impact of different transport modes [294]. However, when used alone, these models cannot estimate a specific user’s daily carbon footprint. By knowing the transportation mode being used by a given user and by combining information about the user’s trajectory ( e.g., distance traveled, mean velocity, vehicle class, fuel type) with an LCA model, one can infer the carbon footprint of a commuter [86,148,175]. Alternatively, researchers are using ML and DL models to automate the estimation of GHG emissions. These models have achieved high accuracy rates and have been able to infer the carbon footprint of a user based solely on the transportation mode and traveled distance [164]. 5.6.3 Federated Learning with Differential Privacy for Mobility FL is a paradigm that allows ML models to be trained over distributed data without sharing it with third-party entities [189]. FL has been used in several domains, such as healthcare, finance, and transportation. While FL is based on the assumption that no user data is outsourced to third-party infrastructures, most algorithms do not contemplate attacks that intend to infer sensitive data from the parameters or the trained model. PPFL has emerged to tackle such a challenge. Recent algorithms employ DP as a privacy measure to ensure that sensitive data and gradients are not disclosed to third-party entities [78]. 109 CHAPTER 5. PROTECTING USER’S MOBILITY PATTERNS WITH DIFFERENTIAL PRIVACY Alongside, SMPC algorithms, namely secure aggregation, is an alternative algorithm applied to FL [28]. While DP trades off accuracy for privacy, MPC trades off performance for privacy. As an open research problem, the trade-off between privacy and accuracy is crucial when using DP. To reduce the error rate, one can apply optimizations such as adaptive clipping [15], which continuously adapts the amount of noise introduced in each training sample. This is also the case for recently published works such as the one from Guo et al. [111]. This work leverages local DP and a proactive alarming mechanism to increase the resiliency to byzantine attacks and inference attacks in FL. Although crucial, these works are orthogonal to the one proposed here as the aim of TAPUS is to validate the feasibility of employing FL in a transportation field with the added goal of preserving users’ data privacy by resorting to DP. On the transportation field, recent works such as the one proposed by Sakho and Othman [257], resort to Vehicular Ad hoc Networks (VANETs) to create a novel approach to predict trajectories based on a FL architecture. Nonetheless, the focus of this solution is on the vehicles’ data, not the users’. Furthermore, only a small subset of works has been proposed to tackle the specific problem of predicting or classifying the transportation mode of users based on GPS traces [46,311]. We highlight that there are some interesting works to evaluate the possible data leakage from the gradients [302] or to audit if the protocol is truly differentially private [146]. However, TAPUS does not focus on these aspects of PPFL. Summary. In general, no solution holistically comprises all the previous three main topics. Specifically, in this chapter, we focused on the detection of the transportation modes and the estimation of the carbon footprint of each individual citizen while promoting the preservation of users’ data privacy. In contrast to the work proposed in this chapter, there are a few FL solutions that leverage federated algorithms on the mobility use case without the additional privacy measures mentioned above. Moreover, these approaches do not extend further from the transportation mode classification or explore the calculation of GHG emissions. 5.7 Summary TAPUS is a privacy-preserving FL solution that allows users to train ML models locally while preserving their privacy to find mobility patterns and more efficient transportation alternatives. The results show that the model’s accuracy decreases as the number of clients and the noise increase. Although TAPUS is a preliminary work, it shows that FL can be used to train transportation models while preserving users’ privacy. Moreover, it opens two different paths for future work. First, TAPUS shows that an extensive evaluation of the different FL algorithms with the addition of DP is necessary to understand the trade-offs between privacy and accuracy. Furthermore, other techniques that combine the different DP-based solutions could be explored such as the recent work of Girgis et al. [98]. Second, it opens the 110 5.7. SUMMARY possibility of using real-world datasets in a real-world scenario for transportation mode identification of users. Contrary to Soteria and Gyosa which are dependent on the hardware, TAPUS presents a PPFL alternative that does not rely on TEEs. It emphasizes the feasibility of offering privacy-preserving alternatives without the need to resort to specific hardware. 111 6 Conclusion PPML has a key role in the future of AI applications, offering the possibility of leveraging sensitive data in third-party infrastructures ( i.e., cloud computing, HPC) or directly in the user’s mobile devices. However, as stated in the previous chapters, there are several trade-offs between performance, privacy, and applicability that have been limiting the adoption of these solutions. In this thesis, we present three contributions that aim to address these limitations and improve the adoption of PPDML solutions. First, we propose Soteria, a novel system that leverages the scalability and reliability of Apache Spark and its ML library (MLlib). This system ensures that critical operations, which enable existing attacks to reveal sensitive information from ML datasets and models, are exclusively performed in secure enclaves provided by Trusted Execution Environments (TEEs). This means that the sensitive data being processed only exists in plaintext inside the enclave and is encrypted in the remainder of the dataflow ( i.e. , network, storage). This solution enables robust security guarantees, ensuring data privacy during ML training and inference. Soteria introduces a new computation partitioning scheme for Apache Spark’s MLlib, Soteria-P, that offloads non-critical statistical operations from the trusted enclaves to untrusted environments. To highlight the contributions of this novel scheme, Soteria also offers a baseline scheme, Soteria-B, where all ML operations are done inside trusted enclaves without a fine-grained differentiation between critical and non-critical operations. Soteria-B provides a performance and security baseline for comparison against our new partitioned scheme. Our experiments, resorting to the HiBench benchmark [130] and including seven different ML algorithms, show that Soteria-P, while considering a more significant subset of ML attacks, reduces training time by up to 41% for Gradient Boosted Trees workloads and up to 4.3 hours for Linear Regression workloads when compared to SGX-Spark, a state–of–the–art PPML system for Apache Spark. Also, compared to Soteria-B, Soteria-P reduces execution time by up to 37% for the Gradient Boosted Trees workloads and up to 3.3 hours for the Linear Regression workloads. While Soteria provides a generic PPDML approach for ML workloads, it is not directly suited for other types of data and studies, such as genomic data, namely GWAS, which can also greatly benefit from PPDML. Therefore, we propose Gyosa, a novel distributed computing solution for privacy-preserving genome-wide association studies. This solution is based on Soteria but is tailored to the specificities of 112 6.1. FUTURE WORK genomic data. By resorting to Glow, Gyosa allows the extension of the current genomic analysis pipeline, in which one can add new tasks ( e.g. , new statistical tests, genomic imputation, and querying). Built upon the same principles as Soteria, Gyosa enables fine-grained differentiation between sensitive and nonsensitive information processed by GWAS. With this, by offloading sensitive information to a secure environment, we show that it is possible to run GWAS-based algorithms for large datasets while keeping critical information safe from being leaked by attackers. First, the results show the feasibility of offering a privacy-preserving genomic analysis solution that preserves the original results of GWASes. As anticipated, there is a trade-off between runtime computation and the level of privacy-preserving guarantees. Gyosa shows a runtime execution overhead ranging from 2.5-for -2statistic tests to 10-on regression-based algorithms. Importantly, the results highlight that it is possible to effectively reduce the computation runtime overhead by distributing the computation across multiple nodes while offering privacy guarantees for sensitive data. Although both Soteria and Gyosa are designed to provide a PPML solution for different use cases, these solutions rely on specific hardware, namely TEEs. Nonetheless, the lack of these trusted environments in IOT or mobile devices is a limitation that must be addressed. As such, our final contribution, TAPUS, focuses on the trade-offs between accuracy and privacy for DML environments without specialized hardware. By combining Federated Learning and Differential Privacy, we propose a prototype for understanding users’ transportation modality preferences while preserving their privacy and reporting their carbon footprint. To provide privacy-preserving guarantees, TAPUS resorts to DP mechanisms to protect users’ data. This is done by adding noise to the gradients of the model’s parameters before sending them to the server or adding noise directly to the collected data before performing any computation. This is a vital feature of TAPUS, as it ensures that the user’s data is not leaked during training. The results show the feasibility of using both DP-FL algorithms and local DP mechanisms to protect users’ data distinctly. In sum, the results show a decrease of up to 25% of the accuracy when using Local DP with an nof 0.5. When evaluating the scalability of TAPUS, we show that the system can handle several clients while preserving users’ data privacy. In these experiments, we show that the system can handle up to 50 clients with up to 16% decrease in accuracy. With the contributions presented in this thesis, we demonstrated that it is possible to develop privacypreserving and distributed ML systems that can be used to train and infer ML models while preserving the privacy of the data owners. As such, we believe these contributions are a stepping stone towards a wider adoption of privacy-preserving and distributed ML systems. 6.1 Future Work The field of PPDML is still in its early stages, and there is still a long way to go. The work presented in this thesis opens several avenues for future work. Adding privacy-preserving mechanisms to any ML algorithm is challenging, and the work presented 113 CHAPTER 6. CONCLUSION in this thesis is no exception. An interesting future work direction is to target the development of new privacy-preserving mechanisms that can be used entirely agnostic to the ML algorithm and framework, which would allow the adoption of PPDML in a broader range of applications and use cases. Alongside and as seen in some recent works, there should be a focus on combining hardware and software-based cryptographic primitives to improve the security guarantees and balance the trade-offs of both approaches. Namely, both Soteria and Gyosa could leverage data oblivious primitives to improve their security against side-channel attacks. Also, the combination of different DP-based strategies, both local and global, could be used to improve the privacy guarantees of TAPUS. These additional primitives would influence, in both cases, the balance between performance, applicability, and privacy, nonetheless, a novel counterbalance should be found as it would foster collaboration between different entities with sensitive data ( e.g., hospitals, financial institutions, user’s mobile devices). Additionally, although this thesis proposed a new overview to the field of PPDML, we acknowledge that the AI field is growing in plain sight with Large Language ModelsLLMs being proposed almost every day ( e.g. , LLaMA, BLOOM, BERT, Falcon 180B [12,72,284,304]). As these models are being developed, it is crucial to understand their complexity and what new concerns regarding data privacy they may bring [66]. Modern infrastructures are also evolving, and new hardware is being developed to support the growing computational and storage needs of AI applications ( i.e., persistent memory, new GPUs). As such, it is essential to understand how this new hardware can be leveraged to provide privacy guarantees to the data owners. Concerning FL protocols, it is vital to acknowledge the research community effort to tackle byzantine attacks. Although the work presented in this thesis does not address this issue, it is important to understand how these attacks can be prevented and mitigated in a privacy-preserving manner. In conclusion, increasing quantities of data and its complexity, new hardware, and new algorithms always introduce new challenges that need further addressing. Any PPDML system must endure these growing challenges and provide privacy guarantees to the entities that own personal and sensitive data. 114 Bibliography [1] Amazon Web Services (AWS). Cloud Computing Services .https:/ /aws. amazon. com/. (Accessed on 02/06/2023). [2] World Economic Forum (WEF). Shaping the Future of Mobility .https://www.weforum.org/ communities/gfc-on-urban-mobility-transitions/. (Accessed on 15/02/2024). 2024. [3] Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. “Deep learning with differential privacy”. In: Proceedings of the 2016 ACM SIGSAC conference on computer and communications security . 2016, pp. 308–318. doi: 10.1145/29 76749.2978318. [4] Martín Abadi, Paul Barham, Jianmin Chen, Zhifeng Chen, Andy Davis, Jeffrey Dean, Matthieu Devin, Sanjay Ghemawat, Geoffrey Irving, Michael Isard, Manjunath Kudlur, Josh Levenberg, Rajat Monga, Sherry Moore, Derek G. Murray, Benoit Steiner, Paul Tucker, Vijay Vasudevan, Pete Warden, Martin Wicke, Yuan Yu, and Xiaoqiang Zheng. “Tensorflow: A system for large-scale machine learning”. In: 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI 16) . 2016, pp. 265–283. [5] ABCI. AI Bridging Cloud Infrastructure .https://abci.ai/. (Accessed on 02/06/2023). [6] Mark Abspoel, Daniel Escudero, and Nikolaj Volgushev. “Secure training of decision trees with continuous attributes”. In: Proceedings on Privacy Enhancing Technologies 1 (2021), pp. 167– 187. doi: 10.2478/popets-2021-0010. [7] Abbas Acar, Hidayet Aksu, A. Selcuk Uluagac, and Mauro Conti. “A Survey on Homomorphic Encryption Schemes: Theory and Implementation”. In: vol. 51. 4. New York, NY, USA: ACM, July 2018, 79:1–79:35. doi: 10.1145/3214303. [8] ADAM. ADAM User Guide — bdgenomics.adam 0.23.0-SNAPSHOT documentation .https:// adam.readthedocs.io/en/latest/. (Accessed on 05/02/2023). 115 BIBLIOGRAPHY [9] Mohammed Adnan, Shivam Kalra, Jesse C Cresswell, Graham W Taylor, and Hamid R Tizhoosh. “Federated learning and differential privacy for medical image analysis”. In: Scientific reports 12.1 (2022), p. 1953. doi: 10.1038/s41598-022-05539-7. [10] Bill Aiello, Yuval Ishai, and Omer Reingold. “Priced oblivious transfer: How to sell digital goods”. In: International Conference on the Theory and Applications of Cryptographic Techniques . Springer. 2001, pp. 119–135. doi: 10.1007/3-540-44987-6_8. [11] Algorithmia | DataRobot AI Platform .https://www.datarobot.com/algorithmia/. (Accessed on 08/31/2023). [12] Ebtesam Almazrouei, Hamza Alobeidli, Abdulaziz Alshamsi, Alessandro Cappelli, Ruxandra Cojocaru, Mérouane Debbah, Étienne Goffinet, Daniel Hesslow, Julien Launay, Quentin Malartic, Daniele Mazzotta, Badreddine Noune, Baptiste Pannier, and Guilherme Penedo. “The Falcon Series of Open Language Models”. In: (2023). arXiv: 2311.16867 [cs.CL]. [13] João Alves, Beatriz Soares, Cláudia Brito, and António Sousa. “Cloud-Based Privacy-Preserving Medical Imaging System Using Machine Learning Tools”. In: EPIA Conference on Artificial Intelligence . 2022, pp. 195–206. doi: 10.1007/978-3-031-16474-3_17. [14] Tiago Alves. “Trustzone: Integrated hardware and software security”. In: White paper (2004). [15] Galen Andrew, Om Thakkar, Brendan McMahan, and Swaroop Ramaswamy. “Differentially private learning with adaptive clipping”. In: Advances in Neural Information Processing Systems 34 (2021), pp. 17455–17466. [16] Apache Teaclave .https://teaclave.apache.org/. (Accessed on 21/11/2020). [17] Sergei Arnautov, Bohdan Trach, Franz Gregor, Thomas Knauth, Andre Martin, Christian Priebe, Joshua Lind, Divya Muthukumaran, Dan O’Keeffe, Mark L. Stillwell, David Goltzsche, Dave Eyers, Rüdiger Kapitza, Peter Pietzuch, and Christof Fetzer. “SCONE: Secure linux containers with intel SGX”. In: 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI 16) . 2016, pp. 689–703. [18] Aref Asvadishirehjini, Murat Kantarcioglu, and Bradley Malin. “A Framework for Privacy-Preserving Genomic Data Analysis Using Trusted Execution Environments”. In: 2020 Second IEEE International Conference on Trust, Privacy and Security in Intelligent Systems and Applications (TPS-ISA) . IEEE. 2020, pp. 138–147. doi: 10.1109/tps-isa50397.2020.00028. [19] Giuseppe Ateniese, Luigi V Mancini, Angelo Spognardi, Antonio Villani, Domenico Vitali, and Giovanni Felici. “Hacking smart machines with smarter ones: How to extract meaningful data from machine learning classifiers”. In: International Journal of Security and Networks 10.3 (2015), pp. 137–150. doi: 10.1504/ijsn.2015.071829. [20] Microsoft Azure. Azure Confidential Computing .https://azure.microsoft.com/enus/solutions/confidential-compute/. (Accessed on 22/10/2022). 116 BIBLIOGRAPHY [21] Microsoft Azure. Cloud Computing Services .https://azure.microsoft.com/en-us. (Accessed on 01/08/2024). [22] Eugene Bagdasaryan, Andreas Veit, Yiqing Hua, Deborah Estrin, and Vitaly Shmatikov. “How To Backdoor Federated Learning”. In: Proceedings of the Twenty Third International Conference on Artificial Intelligence and Statistics . Ed. by Silvia Chiappa and Roberto Calandra. Vol. 108. Proceedings of Machine Learning Research. PMLR, 26–28 Aug 2020, pp. 2938–2948. url: https: //proceedings.mlr.press/v108/bagdasaryan20a.html. [23] Raad Bahmani, Manuel Barbosa, Ferdinand Brasser, Bernardo Portela, Ahmad-Reza Sadeghi, Guillaume Scerri, and Bogdan Warinschi. “Secure multiparty computation from SGX”. In: International Conference on Financial Cryptography and Data Security . Ed. by Aggelos Kiayias. Springer. Cham: Springer International Publishing, 2017, pp. 477–497. isbn: 978-3-319-70972-7. doi: 10.1007/978-3-319-70972-7_27. [24] Reda Bellafqira, Thomas E Ludwig, David Niyitegeka, Emmanuelle Genin, and Gouenou Coatrieux. “Privacy-Preserving Genome-Wide Association Study for Rare Mutations-A Secure FrameWork for Externalized Statistical Analysis”. In: IEEE Access 8 (2020), pp. 112515–112529. doi: 10.110 9/access.2020.3002966. [25] Daniel J Beutel, Taner Topal, Akhil Mathur, Xinchi Qiu, Titouan Parcollet, Pedro PB de Gusmão, and Nicholas D Lane. “Flower: A friendly federated learning research framework”. In: arXiv preprint arXiv:2007.14390 (2020). [26] Christopher M Bishop. Pattern recognition and machine learning . springer, 2006. [27] Keith Bonawitz, Hubert Eichner, Wolfgang Grieskamp, Dzmitry Huba, Alex Ingerman, Vladimir Ivanov, Chloé Kiddon, Jakub Konečný, Stefano Mazzocchi, Brendan McMahan, Timon Van Overveldt, David Petrou, Daniel Ramage, and Jason Roselander. “Towards Federated Learning at Scale: System Design”. In: 1 (2019). Ed. by A. Talwalkar, V. Smith, and M. Zaharia, pp. 374–388. url: https://proceedings.mlsys.org/paper_files/paper/2019/file/7b770da63 3baf74895be22a8807f1a8f-Paper.pdf. [28] Keith Bonawitz, Vladimir Ivanov, Ben Kreuter, Antonio Marcedone, H Brendan McMahan, Sarvar Patel, Daniel Ramage, Aaron Segal, and Karn Seth. “Practical secure aggregation for federated learning on user-held data”. In: arXiv preprint arXiv:1611.04482 (2016). [29] Keith Bonawitz, Vladimir Ivanov, Ben Kreuter, Antonio Marcedone, H Brendan McMahan, Sarvar Patel, Daniel Ramage, Aaron Segal, and Karn Seth. “Practical secure aggregation for privacypreserving machine learning”. In: Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security . ACM. 2017, pp. 1175–1191. doi: 10.1145/3133956.31339 82. 117 BIBLIOGRAPHY [97] Ran Gilad-Bachrach, Nathan Dowlin, Kim Laine, Kristin Lauter, Michael Naehrig, and John Wernsing. “Cryptonets: Applying neural networks to encrypted data with high throughput and accuracy”. In: International Conference on Machine Learning . PMLR. 2016, pp. 201–210. [98] Antonious Girgis, Deepesh Data, Suhas Diggavi, Peter Kairouz, and Ananda Theertha Suresh. “Shuffled Model of Differential Privacy in Federated Learning”. In: Proceedings of The 24th International Conference on Artificial Intelligence and Statistics . Ed. by Arindam Banerjee and Kenji Fukumizu. Vol. 130. Proceedings of Machine Learning Research. PMLR, 13–15 Apr 2021, pp. 2521– 2529. url: https://proceedings.mlr.press/v130/girgis21a.html. [99] Glow. An open-source toolkit for large-scale genomic analysis .https://projectglow.io/. (Accessed on 02/06/2023). [100] Fahimeh Golbabaei, Tan Yigitcanlar, and Jonathan Bunker. “The role of shared autonomous vehicle systems in delivering smart urban mobility: A systematic review of the literature”. In: International Journal of Sustainable Transportation 15.10 (2021), pp. 731–748. doi: 10.1080/155 68318.2020.1798571. [101] Maoguo Gong, Yu Xie, Ke Pan, Kaiyuan Feng, and Alex Kai Qin. “A survey on differentially private machine learning”. In: IEEE computational intelligence magazine 15.2 (2020), pp. 49–64. [102] Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep learning . MIT press, 2016. [103] Google. Google Cloud Pricing Calculator .https : / / cloud . google . com / products / calculator. (Accessed on 02/23/2023). [104] Google. Google’s differential privacy libraries. https://github.com/google/differentialprivacy. (Accessed on 02/10/2024). [105] Christian Göttel, Rafael Pires, Isabelly Rocha, Sébastien Vaucher, Pascal Felber, Marcelo Pasin, and Valerio Schiavoni. “Security, performance and energy trade-offs of hardware-assisted memory protection mechanisms”. In: 2018 IEEE 37th Symposium on Reliable Distributed Systems (SRDS) . IEEE. 2018, pp. 133–142. doi: 10.1109/SRDS.2018.00024. [106] Gramine. Gramine Library OS with Intel SGX Support .https://github.com/gramineproject/ gramine. (Accessed on 01/08/2023). [107] Gramine. Manifest syntax .https://gramine.readthedocs.io/en/stable/manifestsyntax.html. (Accessed on 01/08/2023). [108] Gramine. PAL host ABI .https://gramine.readthedocs.io/en/stable/pal/hostabi.html. (Accessed on 01/08/2023). [109] Large-Scale Data & Systems (LSDS) Group. SGX-Spark .https://github.com/lsds/sgxspark. (Accessed on 22/10/2022). 124 BIBLIOGRAPHY [110] Karan Grover, Shruti Tople, Shweta Shinde, Ranjita Bhagwan, and Ramachandran Ramjee. “Privado: Practical and secure DNN inference with enclaves”. In: arXiv preprint arXiv:1810.00602 (2018). [111] Hanxi Guo, Hao Wang, Tao Song, Yang Hua Ruhui Ma, Xiulang Jin, Zhengui Xue, and Haibing Guan. “SIREN+: Robust Federated Learning with Proactive Alarming and Differential Privacy”. In: IEEE Transactions on Dependable and Secure Computing (2024). doi: 10.1109/TDSC.2024 .3362534. [112] Otkrist Gupta and Ramesh Raskar. “Distributed learning of deep neural network over multiple agents”. In: Journal of Network and Computer Applications 116 (2018), pp. 1–8. [113] S Gupta, V Patil, M Himabindu, and RV Ravikrishna. “Life-cycle analysis of energy and greenhouse gas emissions of automotive fuels in India: Part 1–Tank-to-Wheel analysis”. In: Energy 96 (2016), pp. 684–698. [114] Apache Hadoop. https://hadoop.apache.org/. (Accessed on 24/02/2021). [115] Inken Hagestedt, Yang Zhang, Mathias Humbert, Pascal Berrang, Haixu Tang, XiaoFeng Wang, and Michael Backes. “MBeacon: Privacy-Preserving Beacons for DNA Methylation Data.” In: 26th Annual Network and Distributed System Security Symposium, NDSS 2019, San Diego, California, USA, February 24-27, 2019 . 2019. [116] Moritz Hardt, Ben Recht, and Yoram Singer. “Train faster, generalize better: Stability of stochastic gradient descent”. In: Proceedings of The 33rd International Conference on Machine Learning . Ed. by Maria Florina Balcan and Kilian Q. Weinberger. Vol. 48. Proceedings of Machine Learning Research. New York, New York, USA: PMLR, 20–22 Jun 2016, pp. 1225–1234. url: https: //proceedings.mlr.press/v48/hardt16.html. [117] Xiangnan He, Hanwang Zhang, Min-Yen Kan, and Tat-Seng Chua. “Fast matrix factorization for online recommendation with implicit feedback”. In: 39th International ACM SIGIR conference on Research and Development in Information Retrieval . 2016. [118] U.S. Department of Heatlh and Human Services. HIPAA for Professionals | HHS.gov .https: //www.hhs.gov/hipaa/for-professionals/index.html. Accessed on 21/02/2021. 2019. [119] Ehsan Hesamifard, Hassan Takabi, and Mehdi Ghasemi. “CryptoDL: Deep Neural Networks over Encrypted Data”. In: (Nov. 2017). arXiv: 1711.05189. [120] Muhammad El-Hindi, Tobias Ziegler, Matthias Heinrich, Adrian Lutsch, Zheguang Zhao, and Carsten Binnig. “Benchmarking the Second Generation of Intel SGX Hardware”. In: Proceedings of the 18th International Workshop on Data Management on New Hardware . DaMoN ’22. Philadelphia, PA, USA: Association for Computing Machinery, 2022. isbn: 9781450393782. doi: 10.1145/3 533737.3535098. url: https://doi.org/10.1145/3533737.3535098. 125 BIBLIOGRAPHY [121] Briland Hitaj, Giuseppe Ateniese, and Fernando Perez-Cruz. “Deep models under the GAN: information leakage from collaborative deep learning”. In: Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security . ACM. 2017, pp. 603–618. [122] Nils Homer, Szabolcs Szelinger, Margot Redman, David Duggan, Waibhav Tembe, Jill Muehling, John V Pearson, Dietrich A Stephan, Stanley F Nelson, and David W Craig. “Resolving individuals contributing trace amounts of DNA to highly complex mixtures using high-density SNP genotyping microarrays”. In: PLoS genetics 4.8 (2008), e1000167. [123] Aron N Horvath, Matteo Berchier, Farhad Nooralahzadeh, Ahmed Allam, and Michael Krauthammer. “Exploratory Analysis of Federated Learning Methods with Differential Privacy on MIMIC-III”. In: arXiv preprint arXiv:2302.04208 (2023). [124] Haosheng Huang, Yi Cheng, and Robert Weibel. “Transport mode detection based on mobile phone network data: A systematic review”. In: Transportation Research Part C: Emerging Technologies 101 (2019), pp. 297–312. [125] Ling Huang, Anthony D Joseph, Blaine Nelson, Benjamin IP Rubinstein, and JD Tygar. “Adversarial machine learning”. In: Proceedings of the 4th ACM workshop on Security and artificial intelligence . ACM. 2011, pp. 43–58. [126] Tyler Hunt, Congzheng Song, Reza Shokri, Vitaly Shmatikov, and Emmett Witchel. “Chiron: Privacypreserving machine learning as a service”. In: 2018. [127] Tyler Hunt, Zhiting Zhu, Yuanzhong Xu, Simon Peter, and Emmett Witchel. “Ryoan: A distributed sandbox for untrusted computation on secret data”. In: vol. 35. 4. ACM New York, NY, USA, 2018, pp. 1–32. [128] Seoyeon Hwang, Ercan Ozturk, and Gene Tsudik. “Balancing Security and Privacy in Genomic Range Queries”. In: ACM Transactions on Privacy and Security (2022). [129] Nick Hynes, Raymond Cheng, and Dawn Song. “Efficient deep learning on multi-source private data”. In: 2018. [130] Intel. HiBench is a big data benchmark suite. https://github.com/Intel-bigdata/ HiBench. (Accessed on 22/10/2022). [131] Salman Iqbal, Miss Laiha Mat Kiah, Babak Dhaghighi, Muzammil Hussain, Suleman Khan, Muhammad Khurram Khan, and Kim-Kwang Raymond Choo. “On cloud security attacks: A taxonomy and intrusion detection and prevention as a service”. In: Elsevier, 2016. doi: 10.1016/j.jnca.20 16.08.016. [132] Sara Jafarbeiki, Amin Sakzad, Shabnam Kasra Kermanshahi, Raj Gaire, Ron Steinfeld, Shangqi Lai, Gad Abraham, and Chandra Thapa. “PrivGenDB: Efficient and privacy-preserving query executions over encrypted snp-phenotype database”. In: Informatics in Medicine Unlocked 31 (2022), p. 100988. 126 BIBLIOGRAPHY [133] Szczurowski Jakub, Lubecki Adrian, Bałys Mieczysław, Brodawka Ewelina, and Zar�bska Katarzyna. “Life cycle assessment study on the public transport bus fleet electrification in the context of sustainable urban development strategy”. In: Science of The Total Environment 824 (2022), p. 153872. [134] Patrick Jauernig, Ahmad-Reza Sadeghi, and Emmanuel Stapf. “Trusted execution environments: properties, applications, and challenges”. In: IEEE Security & Privacy 18.2 (2020), pp. 56–60. doi: 10.1109/MSEC.2019.2947124. [135] Jianyu Jiang, Xusheng Chen, TszOn Li, Cheng Wang, Tianxiang Shen, Shixiong Zhao, Heming Cui, Cho-Li Wang, and Fengwei Zhang. “Uranus: Simple, Efficient SGX Programming and its Applications”. In: Proceedings of the 15th ACM Asia Conference on Computer and Communications Security . ASIA CCS ’20. Taipei, Taiwan: Association for Computing Machinery, 2020, pp. 826– 840. isbn: 9781450367509. doi: 10.1145/3320269.3384763. [136] Peter H Jin, Qiaochu Yuan, Forrest Iandola, and Kurt Keutzer. “How to scale distributed deep learning?” In: arXiv preprint arXiv:1611.04581 (2016). [137] Michael I Jordan and Tom M Mitchell. “Machine learning: Trends, perspectives, and prospects”. In: Science 349.6245 (2015), pp. 255–260. [138] Chiraag Juvekar, Vinod Vaikuntanathan, and Anantha Chandrakasan. “Gazelle: A Low Latency Framework for Secure Neural Network Inference”. In: Proceedings of the 27th USENIX Security Symposium (Jan. 2018). issn: 1520-5762. arXiv: 1801.05507. [139] Peter Kairouz, H. Brendan McMahan, Brendan Avent, Aurélien Bellet, Mehdi Bennis, Arjun Nitin Bhagoji, Kallista Bonawitz, Zachary Charles, Graham Cormode, Rachel Cummings, Rafael G. L. D’Oliveira, Hubert Eichner, Salim El Rouayheb, David Evans, Josh Gardner, Zachary Garrett, Adrià Gascón, Badih Ghazi, Phillip B. Gibbons, Marco Gruteser, Zaid Harchaoui, Chaoyang He, Lie He, Zhouyuan Huo, Ben Hutchinson, Justin Hsu, Martin Jaggi, Tara Javidi, Gauri Joshi, Mikhail Khodak, Jakub Konecný, Aleksandra Korolova, Farinaz Koushanfar, Sanmi Koyejo, Tancrède Lepoint, Yang Liu, Prateek Mittal, Mehryar Mohri, Richard Nock, Ayfer Özgür, Rasmus Pagh, Hang Qi, Daniel Ramage, Ramesh Raskar, Mariana Raykova, Dawn Song, Weikang Song, Sebastian U. Stich, Ziteng Sun, Ananda Theertha Suresh, Florian Tramèr, Praneeth Vepakomma, Jianyu Wang, Li Xiong, Zheng Xu, Qiang Yang, Felix X. Yu, Han Yu, and Sen Zhao. “Advances and Open Problems in Federated Learning”. In: Foundations and Trends® in Machine Learning 14.1–2 (2021), pp. 1–210. issn: 1935-8237. doi: 10.1561/2200000083. url: http://dx.doi.org/10.1 561/2200000083. [140] Jiawen Kang, Zehui Xiong, Dusit Niyato, Yuze Zou, Yang Zhang, and Mohsen Guizani. “Reliable federated learning for mobile networks”. In: IEEE Wireless Communications 27.2 (2020), pp. 72– 80. 127 BIBLIOGRAPHY [141] Seemeen Karimi, Xiaoqian Jiang, Robert H Dolin, Miran Kim, and Aziz Boxwala. “A secure system for genomics clinical decision support”. In: Journal of Biomedical Informatics 112 (2020), p. 103602. [142] Andrey Kim, Yongsoo Song, Miran Kim, Keewoo Lee, and Jung Hee Cheon. “Logistic regression model training based on the approximate homomorphic encryption”. In: BMC medical genomics 11.4 (2018), pp. 23–31. [143] Muah Kim, Onur Günlü, and Rafael F. Schaefer. “Federated Learning with Local Differential Privacy: Trade-Offs Between Privacy, Utility, and Communication”. In: ICASSP 2021 - 2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP) . 2021, pp. 2650– 2654. doi: 10.1109/ICASSP39728.2021.9413764. [144] Can Kockan, Kaiyuan Zhu, Natnatee Dokmai, Nikolai Karpov, M Oguzhan Kulekci, David P Woodruff, and S Cenk Sahinalp. “Sketching algorithms for genomic data analysis and querying in a secure enclave”. In: Nature methods 17.3 (2020), pp. 295–301. [145] Jakub Konečn�, H Brendan McMahan, Felix X Yu, Peter Richtárik, Ananda Theertha Suresh, and Dave Bacon. “Federated learning: Strategies for improving communication efficiency”. In: arXiv preprint arXiv:1610.05492 (2016). [146] William Kong, Andrés Muñoz Medina, Mónica Ribero, and Umar Syed. DP-Auditorium: a Large Scale Library for Auditing Differential Privacy . 2023. arXiv: 2307.05608 [cs.CR]. [147] Nishat Koti, Arpita Patra, Rahul Rachuri, and Ajith Suresh. “Tetrad: Actively Secure 4PC for Secure Training and Inference”. In: 29th Annual Network and Distributed System Security Symposium, NDSS 2022, San Diego, California, USA, April 24-28, 2022 . The Internet Society, 2022. url: https://www.ndss-symposium.org/ndss-paper/auto-draft-202/. [148] Maria Kugler, Sebastian Osswald, Christopher Frank, and Markus Lienkamp. “Mobility tracking system for CO2 footprint determination”. In: Proceedings of the 6th International Conference on Automotive User Interfaces and Interactive Vehicular Applications . 2014, pp. 1–8. [149] Sameer Kumar and Norm Jouppi. “Highly Available Data Parallel ML training on Mesh Networks”. In: arXiv preprint arXiv:2011.03605 (2020). [150] Roland Kunkel, Do Le Quoc, Franz Gregor, Sergei Arnautov, Pramod Bhatotia, and Christof Fetzer. “TensorSCONE: a secure TensorFlow framework using Intel SGX”. In: arXiv preprint arXiv:1902.04413 (2019). [151] Alexey Kurakin, Ian J. Goodfellow, and Samy Bengio. “Adversarial Machine Learning at Scale”. In: 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings . 2017. 128 BIBLIOGRAPHY [152] Christoph Lambert, Maria Fernandes, Jérémie Decouchant, and Paulo Esteves-Verissimo. “Maskal: Privacy preserving masked reads alignment using intel sgx”. In: 2018 IEEE 37th Symposium on Reliable Distributed Systems (SRDS) . IEEE. 2018, pp. 113–122. [153] Do Le Quoc, Franz Gregor, Jatinder Singh, and Christof Fetzer. “SGX-PySpark: Secure distributed data analytics”. In: The World Wide Web Conference . ACM. 2019, pp. 3564–3563. [154] Mathias Lecuyer, Vaggelis Atlidakis, Roxana Geambasu, Daniel Hsu, and Suman Jana. “Certified robustness to adversarial examples with differential privacy”. In: 2019 IEEE symposium on security and privacy (SP) . IEEE. 2019, pp. 656–672. [155] Taegyeong Lee, Zhiqi Lin, Saumay Pushp, Caihua Li, Yunxin Liu, Youngki Lee, Fengyuan Xu, Chenren Xu, Lintao Zhang, and Junehwa Song. “Occlumency: Privacy-preserving remote deeplearning inference using SGX”. In: The 25th Annual International Conference on Mobile Computing and Networking . 2019, pp. 1–17. [156] Heng Li and Richard Durbin. “Fast and accurate short read alignment with Burrows–Wheeler transform”. In: bioinformatics 25.14 (2009), pp. 1754–1760. [157] Mu Li, David G Andersen, Jun Woo Park, Alexander J Smola, Amr Ahmed, Vanja Josifovski, James Long, Eugene J Shekita, and Bor-Yiing Su. “Scaling distributed machine learning with the parameter server”. In: 11th USENIX Symposium on operating systems design and implementation (OSDI 14) . 2014, pp. 583–598. [158] Mu Li, David G Andersen, Alexander J Smola, and Kai Yu. “Communication Efficient Distributed Machine Learning with the Parameter Server”. In: Advances in Neural Information Processing Systems 27 . Ed. by Z. Ghahramani, M. Welling, C. Cortes, N. D. Lawrence, and K. Q. Weinberger. Curran Associates, Inc., 2014, pp. 19–27. [159] Ping Li, Jin Li, Zhengan Huang, Tong Li, Chong-Zhi Gao, Siu-Ming Yiu, and Kai Chen. “Multi-key privacy-preserving deep learning in cloud computing”. In: Future Generation Computer Systems 74 (2017), pp. 76–85. [160] Qinbin Li, Zeyi Wen, Zhaomin Wu, Sixu Hu, Naibo Wang, Yuan Li, Xu Liu, and Bingsheng He. “A survey on federated learning systems: Vision, hype and reality for data privacy and protection”. In: IEEE Transactions on Knowledge and Data Engineering (2021). [161] Tian Li, Anit Kumar Sahu, Ameet Talwalkar, and Virginia Smith. “Federated learning: Challenges, methods, and future directions”. In: IEEE signal processing magazine 37.3 (2020), pp. 50–60. [162] Tian Li, Anit Kumar Sahu, Manzil Zaheer, Maziar Sanjabi, Ameet Talwalkar, and Virginia Smith. “Federated optimization in heterogeneous networks”. In: Proceedings of Machine learning and systems 2 (2020), pp. 429–450. 129 BIBLIOGRAPHY [163] Wentao Li, Miran Kim, Kai Zhang, Han Chen, Xiaoqian Jiang, and Arif Harmanci. “COLLAGENE enables privacy-aware federated and collaborative genomic data analysis”. In: Genome Biology 24.1 (2023), p. 204. [164] Wenxiang Li, Yuanyuan Li, Ziyuan Pu, Long Cheng, Lei Wang, and Linchuan Yang. “Revealing the real-world CO2 emission reduction of ridesplitting and its determinants based on machine learning”. In: arXiv preprint arXiv:2204.00777 (2022). [165] Yuanzhi Li, Colin Wei, and Tengyu Ma. “Towards Explaining the Regularization Effect of Initial Large Learning Rate in Training Neural Networks”. In: Advances in Neural Information Processing Systems . Ed. by H. Wallach, H. Larochelle, A. Beygelzimer, F. d’Alché-Buc, E. Fox, and R. Garnett. Vol. 32. Curran Associates, Inc., 2019. url: https://proceedings.neurips.cc/paper_ files/paper/2019/file/bce9abf229ffd7e570818476ee5d7dde-Paper.pdf. [166] Xiaoyuan Liang, Yuchuan Zhang, Guiling Wang, and Songhua Xu. “A deep learning model for transportation mode detection based on smartphone sensing data”. In: IEEE Transactions on Intelligent Transportation Systems 21.12 (2019), pp. 5223–5235. [167] LibSodium. Introduction - Libsodium documentation .https://libsodium.gitbook.io/ doc/. (Accessed on 03/02/2021). [168] Joshua Lind, Christian Priebe, Divya Muthukumaran, Dan O’Keeffe, Pierre-Louis Aublin, Florian Kelbert, Tobias Reiher, David Goltzsche, David Eyers, Rüdiger Kapitza, Christof Fetzer, and Peter Pietzuch. “Glamdring: Automatic Application Partitioning for Intel SGX”. In: 2017 USENIX Annual Technical Conference (USENIX ATC 17) . Santa Clara, CA: USENIX Association, July 2017, pp. 285–298. isbn: 978-1-931971-38-6. url: https://www.usenix.org/conference/ atc17/technical-sessions/presentation/lind. [169] Christoph Lippert, Riccardo Sabatini, M. Cyrus Maher, Eun Yong Kang, Seunghak Lee, Okan Arikan, Alena Harley, Axel Bernal, Peter Garst, Victor Lavrenko, Ken Yocum, Theodore Wong, Mingfu Zhu, Wen-Yun Yang, Chris Chang, Tim Lu, Charlie W. H. Lee, Barry Hicks, Smriti Ramakrishnan, Haibao Tang, Chao Xie, Jason Piper, Suzanne Brewerton, Yaron Turpaz, Amalio Telenti, Rhonda K. Roby, Franz J. Och, and J. Craig Venter. “Identification of individuals by trait prediction using whole-genome sequencing data”. In: Proceedings of the National Academy of Sciences 114.38 (2017), pp. 10166–10171. doi: 10.1073/pnas.1711125114. url: https: //www.pnas.org/doi/abs/10.1073/pnas.1711125114. [170] Bo Liu, Ming Ding, Sina Shaham, Wenny Rahayu, Farhad Farokhi, and Zihuai Lin. “When machine learning meets privacy: A survey and outlook”. In: ACM Computing Surveys (CSUR) 54.2 (2021), pp. 1–36. [171] Jian Liu, Mika Juuti, Yao Lu, and Nadarajah Asokan. “Oblivious neural network predictions via minionn transformations”. In: Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security . ACM. 2017, pp. 619–631. 130 BIBLIOGRAPHY [172] Tianyi Liu, Xiang Xie, and Yupeng Zhang. “ZkCNN: Zero knowledge proofs for convolutional neural network predictions and accuracy”. In: Proceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security . 2021, pp. 2968–2985. [173] Yunhui Long, Vincent Bindschaedler, and Carl A Gunter. “Towards measuring membership privacy”. In: arXiv preprint arXiv:1712.09136 (2017). [174] Yunhui Long, Vincent Bindschaedler, Lei Wang, Diyue Bu, Xiaofeng Wang, Haixu Tang, Carl A Gunter, and Kai Chen. “Understanding membership inferences on well-generalized learning models”. In: arXiv preprint arXiv:1802.04889 (2018). [175] Oana Lorintiu and Andrea Vassilev. “Transportation mode recognition based on smartphone embedded sensors for carbon footprint estimation”. In: 2016 IEEE 19th International Conference on Intelligent Transportation Systems (ITSC) . IEEE. 2016, pp. 1976–1981. [176] Wen-Jie Lu, Yoshiji Yamada, and Jun Sakuma. “Privacy-preserving genome-wide association studies on cloud environment using fully homomorphic encryption”. In: BMC medical informatics and decision making . Vol. 15. Springer. 2015, pp. 1–8. [177] Massimiliano Luca, Gianni Barlacchi, Bruno Lepri, and Luca Pappalardo. “A survey on deep learning for human mobility”. In: ACM Computing Surveys (CSUR) 55.1 (2021), pp. 1–44. [178] Lingjuan Lyu, Han Yu, and Qiang Yang. “Threats to federated learning: A survey”. In: arXiv preprint arXiv:2003.02133 (2020). [179] Junming Ma, Yancheng Zheng, Jun Feng, Derun Zhao, Haoqi Wu, Wenjing Fang, Jin Tan, Chaofan Yu, Benyu Zhang, and Lei Wang. “SecretFlow-SPU: A Performant and User-Friendly Framework for Privacy-Preserving Machine Learning”. In: 2023 USENIX Annual Technical Conference (USENIX ATC 23) . Boston, MA: USENIX Association, July 2023, pp. 17–33. isbn: 978-1-939133-35-9. url: https://www.usenix.org/conference/atc23/presentation/ma. [180] Ricardo Macedo, Cláudia Correia, Marco Dantas, Cláudia Brito, Weijia Xu, Yusuke Tanimura, Jason Haga, and Joao Paulo. “The Case for Storage Optimization Decoupling in Deep Learning Frameworks”. In: 2021 IEEE International Conference on Cluster Computing (CLUSTER) . IEEE. 2021, pp. 649–656. [181] Bradley Malin. “Re-identification of familial database records”. In: AMIA annual symposium proceedings . Vol. 2006. American Medical Informatics Association. 2006, p. 524. [182] Priyanka Mary Mammen. “Federated learning: Opportunities and challenges”. In: arXiv preprint arXiv:2101.05428 (2021). [183] Yunlong Mao, Shanhe Yi, Qun Li, Jinghao Feng, Fengyuan Xu, and Sheng Zhong. “A privacypreserving deep learning approach for face recognition with edge computing”. In: USENIX Workshop on Hot Topics in Edge Computing (HotEdge 18), Boston, MA . 2018. 131 BIBLIOGRAPHY [184] Paulo Martins, Leonel Sousa, and Artur Mariano. “A survey on fully homomorphic encryption: An engineering perspective”. In: ACM Computing Surveys (CSUR) 50.6 (2017), pp. 1–33. [185] Dastan Maulud and Adnan M Abdulazeez. “A review on linear regression comprehensive in machine learning”. In: Journal of Applied Science and Technology Trends 1.4 (2020), pp. 140–147. [186] Ruben Mayer and Hans-Arno Jacobsen. “Scalable Deep Learning on Distributed Infrastructures: Challenges, Techniques and Tools”. In: CoRR abs/1903.11314 (2019). [187] Joelle Mbatchou, Leland Barnard, Joshua Backman, Anthony Marcketta, Jack A. Kosmicki, Andrey Ziyatdinov, Christian Benner, Colm O’Dushlaine, Mathew Barber, Boris Boutkov, Lukas Habegger, Manuel Ferreira, Aris Baras, Jeffrey Reid, Goncalo Abecasis, Evan Maxwell, and Jonathan Marchini. “Computationally efficient whole-genome regression for quantitative and binary traits”. In: Nature genetics 53.7 (2021), pp. 1097–1103. doi: 10.1038/s41588-021-00870-7. [188] Frank McKeen, Ilya Alexandrovich, Alex Berenzon, Carlos V Rozas, Hisham Shafi, Vedvyas Shanbhogue, and Uday R Savagaonkar. “Innovative instructions and software model for isolated execution.” In: vol. 10. 1. 2013. url: https://www.eit.lth.se/fileadmin/eit/courses/eitn5 0/Literature/hasp-2013-innovative-instructions-and-software-model- for-isolated-execution.pdf. [189] Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. “Communication-efficient learning of deep networks from decentralized data”. In: Artificial intelligence and statistics . PMLR. 2017, pp. 1273–1282. [190] H Brendan McMahan, Daniel Ramage, Kunal Talwar, and Li Zhang. “Learning differentially private recurrent language models”. In: arXiv preprint arXiv:1710.06963 (2017). [191] Bunjamin Memishi, Shadi Ibrahim, Marı�a S Pérez, and Gabriel Antoniu. “Fault tolerance in MapReduce: A survey”. In: Resource Management for Big Data Platforms: Algorithms, Modelling, and High-Performance Computing Techniques (2016), pp. 205–240. [192] Xiangrui Meng, Joseph Bradley, Burak Yavuz, Evan Sparks, Shivaram Venkataraman, Davies Liu, Jeremy Freeman, DB Tsai, Manish Amde, Sean Owen, Doris Xin, Reynold Xin, Michael J. Franklin, Reza Zadeh, Matei Zaharia, and Ameet Talwalkar. “MLlib: machine learning in Apache Spark”. In: vol. 17. 1. JMLR.org, Jan. 2016, pp. 1235–1241. [193] Hannah Verena Meyer and Ewan Birney. “PhenotypeSimulator: A comprehensive framework for simulating multi-trait, multi-locus genotype to phenotype relationships”. In: Bioinformatics 34.17 (2018), pp. 2951–2956. [194] Silvio Micali, Oded Goldreich, and Avi Wigderson. “How to play any mental game”. In: Proceedings of the Nineteenth ACM Symp. on Theory of Computing, STOC . ACM New York, NY, USA. 1987, pp. 218–229. 132 BIBLIOGRAPHY [195] Ilya Mironov. “Rényi differential privacy”. In: 2017 IEEE 30th computer security foundations symposium (CSF) . IEEE. 2017, pp. 263–275. [196] John C Mitchell and Joe Zimmerman. “Data-oblivious data structures”. In: 31st International Symposium on Theoretical Aspects of Computer Science (STACS 2014) . Schloss Dagstuhl-Leibniz- Zentrum fuer Informatik. 2014. [197] Payman Mohassel and Peter Rindal. “ABY3: A mixed protocol framework for machine learning”. In: Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security . ACM. 2018, pp. 35–52. [198] Payman Mohassel and Yupeng Zhang. “Secureml: A system for scalable privacy-preserving machine learning”. In: 2017 IEEE Symposium on Security and Privacy (SP) . IEEE. 2017, pp. 19– 38. [199] Viraaji Mothukuri, Reza M Parizi, Seyedamin Pouriyeh, Yan Huang, Ali Dehghantanha, and Gautam Srivastava. “A survey on security and privacy of federated learning”. In: Future Generation Computer Systems 115 (2021), pp. 619–640. [200] Nicolas Müller, Daniel Kowatsch, and Konstantin Böttinger. “Data poisoning attacks on regression learning and corresponding defenses”. In: 2020 IEEE 25th Pacific Rim International Symposium on Dependable Computing (PRDC) . IEEE. 2020, pp. 80–89. [201] Moni Naor and Benny Pinkas. “Efficient oblivious transfer protocols”. In: Proceedings of the twelfth annual ACM-SIAM symposium on Discrete algorithms . Society for Industrial and Applied Mathematics. 2001, pp. 448–457. [202] A Naranyanan and V Shmatikov. “Robust de-anonymization of large datasets”. In: Proceedings of the 2008 IEEE Symposium on Security and Privacy, May 2008 . 2008. [203] M. Nasr, R. Shokri, and A. Houmansadr. “Comprehensive Privacy Analysis of Deep Learning: Passive and Active White-box Inference Attacks against Centralized and Federated Learning”. In: 2019 2019 IEEE Symposium on Security and Privacy (SP) . Los Alamitos, CA, USA: IEEE Computer Society, May 2019, pp. 1021–1035. [204] Milad Nasr, Reza Shokri, and Amir Houmansadr. “Machine learning with membership privacy using adversarial regularization”. In: Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security . ACM. 2018, pp. 634–646. [205] Peter Ney, Luis Ceze, and Tadayoshi Kohno. “Genotype Extraction and False Relative Attacks: Security Risks to Third-Party Genetic Genealogy Services Beyond Identity Inference.” In: NDSS . 2020. 133