A trusted federated learning system and method based on a trusted execution environment
By introducing a filtering aggregation algorithm with trusted execution environment and adaptive thresholds into the federated learning system, the privacy and security attack problems faced by the federated learning system are solved, and higher model accuracy and security are achieved.
Patent Information
- Application Number
- CN202411807879.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-12-10
AI Technical Summary
The privacy and security attacks faced by federated learning systems, including data reconstruction attacks, attribute inference attacks, member inference attacks, data poisoning and model poisoning attacks, have not yet fully resolved these problems.
A trusted federated learning system based on a trusted execution environment is adopted to configure the domain virtual machine, encryption module and decryption module on the server and client to establish a secure interconnection, and use an adaptive threshold filtering aggregation algorithm to perform model aggregation to ensure that data is transmitted and processed in an encrypted state.
Effectively resist model poisoning attacks and privacy attacks, protect the integrity of federated learning protocols and the confidentiality of parameters, improve the accuracy and security of the training model, and comprehensively solve the privacy and security attacks faced by the current federated learning system.
Smart Images

Figure CN119272291B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of privacy and security technology of federated learning systems, and in particular to a trusted federated learning system and method based on a trusted execution environment. Background Art
[0002] Federated learning is an emerging distributed training architecture that focuses on privacy protection. It aims to facilitate the collaborative training of a machine learning / deep learning model between multiple clients, and this collaboration does not require sharing the original data of any client. The core idea of federated learning is that during the training process, each client uploads the model update (usually model gradient or model weight) to a central server, and the server aggregates the local model updates from different clients to finally form a global model, avoiding each client from uploading local original data. Because federated learning can protect user data privacy, it has been applied in various scenarios, such as business, healthcare, and industry. A trusted execution environment is an independent execution area on the device's main processor, isolated from the system's main operating system. It ensures that data is processed in a secure computing environment, providing isolated, encrypted electronic structures and end-to-end security guarantees for applications running in it, including authenticated code execution, confidentiality, authenticity, and system integrity.
[0003] However, many recent research works have proposed privacy and security attacks against federated learning systems, undermining the credibility of federated learning systems. Currently, the privacy attacks faced by federated learning systems mainly include data reconstruction attacks, attribute reasoning attacks, member inference attacks, etc., and the security attacks faced mainly include data poisoning and model poisoning attacks. Among them, the main principle of privacy attacks is that the attacker can infer the privacy of the client based on the observed plaintext local model updates / global model parameters; the main principle of security attacks is that the attacker manipulates local training data or local training processes to affect the trained global model. At present, there are solutions to solve some privacy or security attacks. However, it has not yet been possible to fully solve these privacy and security issues currently facing federated learning systems. Summary of the invention
[0004] The purpose of the present invention is to provide a trusted federated learning system and method based on a trusted execution environment to solve the technical problems raised in the background technology.
[0005] To achieve the above-mentioned purpose, the present invention provides a trusted federated learning system based on a trusted execution environment, comprising a server and several clients; the server and the several clients are both configured with a domain virtual machine, an encryption module and a decryption module, the domain virtual machine is used as a trusted execution environment, and a remote security connection module is configured therein; the remote security connection module is used to establish a secure interconnection between the trusted execution environments on the server and the client, and transmit model information; the client is used to decrypt the received global model through the decryption module in the trusted execution environment, and train it based on local training data to obtain a local model, calculate the model parameter update data of the local model to obtain a local update model, and the encryption module encrypts it and uploads it to the server through the remote security connection module of the client; the server is used to generate an initial global model according to a preset model structure in the trusted execution environment, the encryption module encrypts it and sends it to the client through the remote security connection module of the server, and is also used to receive the local update model, the decryption module decrypts the local update model, and aggregates it using a filtering aggregation algorithm with an adaptive threshold to obtain a global model, and the encryption module encrypts the global model and sends it to the client.
[0006] Furthermore, the filtering aggregation algorithm with an adaptive threshold is a central security aggregation algorithm with data poisoning resistance capability, and the server aggregates and obtains a global model by executing the filtering aggregation algorithm with an adaptive threshold.
[0007] Furthermore, the establishment of the secure interconnection is specifically as follows: the remote security connection modules in the client and the server respectively generate public key-private key pairs locally in the trusted execution environment; the remote security connection modules of the client and the server respectively send remote authentication requests to each other, and after receiving the requests from each other, the remote security connection modules on the client and the server generate a hardware-signed remote attestation report in the trusted execution environment and return it to the other party, wherein the remote attestation report contains the respective code integrity check values and the public key information of the remote security connection module; the client and the server receive the remote attestation report of the other party, and use their respective signature verification algorithms to verify the authenticity and integrity of the remote attestation report sent by the other party to authenticate the legitimacy of the identity and the code integrity of the other party, and save the public key information in the remote attestation report sent by the other party; the domain virtual machines on the client and the server run the key negotiation protocol based on their respective private key information and the public key information of the other party to derive a shared symmetric encryption key for use by the encryption module and the decryption module, so as to build an encrypted communication channel and realize secure interconnection.
[0008] Furthermore, the encryption module and the decryption module use symmetric encryption for encryption and decryption. The encryption module encrypts the local update model or the global model that leaves the trusted execution environment, and the decryption module decrypts the local update model or the global model within the trusted execution environment.
[0009] Beneficial effects: The present invention establishes a secure connection between the trusted execution environments on the client and the server, performs identity legitimacy authentication and code integrity authentication on each other between the trusted execution environments, and establishes an encrypted secure communication channel on both sides to ensure the integrity of the federated learning protocol on both sides, so as to solve the model poisoning attack faced by federated learning.
[0010] The present invention also provides a trusted federated learning method based on a trusted execution environment, the method comprising the following steps:
[0011] S1. Several clients and servers start domain virtual machines on their local devices as trusted execution environments, and establish secure interconnection through remote secure connection modules in their respective domain virtual machines.
[0012] S2. The server generates an initial global model according to the preset model structure in the trusted execution environment, encrypts it through the encryption module, and sends it to several clients;
[0013] S3. Several clients receive the encrypted global model, pass it into the trusted execution environment, decrypt it through the decryption module, perform local training based on the local training data preset by the client to obtain a local model, calculate the parameter update data of the local model to obtain a local update model, encrypt the local update model through the encryption module, and upload it to the server;
[0014] S4. The server receives several encrypted local update models, transmits them to the trusted execution environment, decrypts them through the decryption module, and aggregates them using the adaptive threshold filtering aggregation algorithm to obtain the aggregated global model;
[0015] S5, judging whether the global model after aggregation has converged;
[0016] If yes, complete the training of trusted federated learning;
[0017] If not, proceed to step S6;
[0018] S6. The server encrypts the aggregated global model through its encryption module to obtain an encrypted global model, and sends it to several clients, repeating steps S3 to S5 until a converged global model is obtained.
[0019] Furthermore, the specific steps of using the adaptive threshold filtering aggregation algorithm to aggregate and obtain the global model in step S4 are:
[0020] S41, the local update models uploaded by several clients in the first two rounds of training are directly regarded as legal updates and participate in the aggregation process;
[0021] S42: Determine the model update threshold B of the client for the third round and thereafter according to the local update models uploaded by the clients in the second round and thereafter. The calculation formula of the model update threshold B is:
[0022] ,
[0023] In the above formula, It represents the mean of the parameter update norms of all legal local update models in the last round of training. It represents the variance of the parameter update norm of all legal local update models in the last round of training. The value of B follows the Gaussian distribution of the parameter update norm of the local update model uploaded by several clients. ;
[0024] S43: The local update models whose parameter update bi-norm of the local update models uploaded by the client in the third round and thereafter exceeds the model update threshold B are regarded as malicious updates and are directly discarded, and do not participate in the aggregation process;
[0025] S44, collecting root data through a server or several clients to generate a root data set, the server performs root model training on it by presetting the root model structure, and calculates the parameter update data of the root model in each round of root model training, which is recorded as , for each local model parameter update data uploaded by several clients, denoted as , calculate its credibility score And the server's aggregation V of the legal local update model, the calculation formulas are:
[0026] ,
[0027] In the above formula, represents the cosine similarity, represents the activation function, Indicates The confidence score of the locally updated model uploaded by the client, Indicates The local model parameter update data uploaded by the client, Indicates The confidence score of the locally updated model uploaded by the client, Indicates The local model parameter update data uploaded by the client, Indicates The parameter update data of the root model in the round root model training; N represents the number of all clients with local updated models that are not filtered out by the threshold. The adaptive threshold filtering aggregation algorithm deployed in the trusted execution environment of the present invention is a central security aggregation algorithm with data poisoning resistance capability, which replaces the conventional central aggregation algorithm in the previous federated learning, can ensure that the data poisoning resistance algorithm is not bypassed or tampered with, effectively solve the data poisoning attack faced by federated learning, and improve the accuracy and security of the trained model.
[0028] Furthermore, the root data set in step S44 is a number of local training data collected by the server from each client, or the server collects a number of data that are close to independent and identically distributed with the local training data of each client as root data to form a root data set.
[0029] Beneficial effects:
[0030] The present invention protects the local training and central aggregation process of the entire federated learning based on a trusted execution environment. The global model, the local model and their updated data exist only in plain text in the trusted execution environment. The data is encrypted when leaving the trusted execution environment to protect the integrity of the federated learning protocol and the confidentiality of the parameters. At the same time, the central aggregation of the model is a central security aggregation with data poisoning resistance capability, which effectively resists poisoning attacks and privacy attacks while only introducing very little computing overhead, effectively protecting user data privacy while improving the accuracy and security of the trained model, comprehensively solving the privacy and security attacks faced by the current federated learning system, solving the privacy and security concerns in the actual scenarios of federated learning, and having a wider range of application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions implemented in the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0032] Figure 1 The following is a workflow diagram of a trusted federated learning system based on a trusted execution environment of the present invention;
[0033] Figure 2 This is a workflow diagram of a typical federated learning system;
[0034] Figure 3 The figure is a flow chart of a trusted federated learning method based on a trusted execution environment of the present invention. DETAILED DESCRIPTION
[0035] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0036] For ease of understanding, Figure 2 The figure shows the workflow of a typical federated learning system. The server first sends an initial global model to each client, and then each client performs model training locally based on its own local data and uploads the trained model update to the server. The server then aggregates the local model updates of each client to obtain the next round of global model and repeats the process. Figure 2 Repeat steps ①-④ until a converged global model is obtained.
[0037] This embodiment takes the domain virtual machine provided by the ARM confidential computing architecture (Confidential Compute Architecture, CCA) hardware characteristics as an example as a trusted execution environment, and specifically describes the following:
[0038] ARM CCA introduces a new security extension called Realm Management Extension (RME). ARM CCA introduces two new worlds, called Realm World and Root World. The Root World is used to run the monitoring code with the highest privileges, namely ARM trusted firmware. The Realm World is a new execution environment specifically used to run the developer's virtual machine, called the Realm VM. In the Realm World, multiple Realm VMs are isolated by the underlying trusted Realm Management Monitor (RMM), ensuring that a Realm VM cannot attack other Realm VMs. CCA guarantees the confidentiality and integrity of data while supporting remote attestation of Realm VMs. A Realm VM instance running in a Realm World can request a remote attestation report from the RMM to provide its identity and integrity to the remote verifier. The report contains a pair of bound platform and realm attestations. It not only shows the authenticity and secure boot process of the CCA platform, but also records the initial state of the attested Realm VM. Therefore, the remote verifier can ensure that its Realm VM runs on a trusted CCA platform and that its VM image has not been tampered with.
[0039] like Figure 1-Figure 3As shown, the present invention provides a trusted federated learning system based on a trusted execution environment. The code in the trusted federated learning system is based on the existing federated learning framework (Flower) to develop the corresponding client local training code and server aggregation code, and use the domain virtual machine to run the Flower framework and upper-level code on a platform with ARM CCA characteristics. The system includes a server and several clients; the server and several clients are configured with a domain virtual machine, an encryption module and a decryption module. The domain virtual machine is used as a trusted execution environment, and a remote security connection module is configured therein; the virtual machine image in the domain virtual machine used in this embodiment includes a Linux Kernel as the underlying operating system and a root file system (rootfs) required for its operation. Since the Flower framework is developed based on the Python language, the root file system needs to include the Python operating environment. The codes for local training and central aggregation are different, and a set of rootfs needs to be made for the client and the server respectively. Use the memory root file system (initramfs) as the root file system of the domain virtual machine to ensure that when the domain virtual machine is started, the domain management monitor can calculate the integrity of its domain virtual machine image file (including the image of Kernel and initramfs). After the image is made, start the domain virtual machine locally to obtain the client's code verification value And the code verification value on the server .
[0040] The remote secure connection module is used to establish a secure connection between the trusted execution environment on the server and the client to transmit model information; the establishment of the secure connection is specifically as follows:
[0041] The remote security connection modules in the client and server respectively generate a public key-private key pair locally in the trusted execution environment. In this embodiment, the client and server use the prepared virtual machine image file to start the domain virtual machine to run the remote security connection module therein, and generate an RSA2048 public key and private key pair; the remote security connection modules of the client and server respectively send remote authentication requests to each other. After receiving the request from the other party, the remote security connection modules on the client and server generate a hardware-signed remote attestation report in the trusted execution environment and return it to the other party, wherein the remote attestation report contains the respective code integrity check values and the public key information of the remote security connection module. ; The client and server receive each other's remote attestation report, and use their own signature verification algorithms to verify the authenticity and integrity of the remote attestation report sent by the other party to authenticate the legitimacy of the other party's identity and code integrity, and save the public key information in the remote attestation report sent by the other party; The domain virtual machines on the client and server run the key negotiation protocol based on their own private key information and the other party's public key information to derive a shared symmetric encryption key for use by the encryption module and decryption module to build an encrypted communication channel and achieve secure interconnection. The shared encryption key is used by the encryption module or decryption module to encrypt and decrypt the model parameter information exchanged between the two parties to protect the confidentiality of the model parameters.
[0042] The signature verification algorithm verifies integrity and authenticity in the following ways:
[0043] The client and server start the domain virtual machine locally to obtain the client's code verification value Verify the code value with the server , the code integrity check value is signed by secure hardware and cannot be tampered with; obtain the code integrity check value in the remote attestation report sent by the server and the code integrity checksum in the remote attestation report sent by the client After receiving the remote proof report sent by the server, the client confirms that the aggregated code executed by the server is running in a trusted execution environment to authenticate the legitimacy of the other party's identity and verify and After receiving the remote proof report sent by the client, the server confirms that the client's local training code is indeed running in a trusted execution environment to authenticate the legitimacy of the other party's identity and verify and to ensure consistency of the client's local training code has not been tampered with.
[0044] In this embodiment, the remote security connection modules on the client and server provide their respective public key information to the RMM, and the RMM is responsible for obtaining the platform evidence generated and signed by the CCA hardware trust root, generating a certificate containing public key information and signing, and returning the assembled remote proof report to the remote security connection module of the other party. After the other party receives the remote proof report, it can verify that the signature of the report comes from the security hardware of ARM to confirm that the server-side center aggregation is running in a trusted execution environment, and at the same time, it can confirm that the code integrity in the trusted execution environment has not been destroyed by comparing the code integrity check value in the remote proof report and the code integrity check value obtained by the startup domain virtual machine. The cryptographic operations used by the remote security connection module and the encryption / decryption module can call existing cryptographic libraries, such as openssl. The key negotiation protocol in this embodiment adopts the elliptic curve key exchange (Elliptic Curve Diffie-Hellman, ECDH) algorithm. Based on its own private key and the other party's public key, the elliptic curve key exchange algorithm is executed in each local trusted execution environment to derive a shared AES256 symmetric encryption key for use by the encryption / decryption module.
[0045] The client is used to decrypt the received global model through the decryption module in the trusted execution environment, and train the global model based on the local training data to obtain the local model, calculate the model parameter update data of the local model to obtain the local update model, and the encryption module encrypts it and uploads it to the server through the remote security connection module of the client; the server is used to generate an initial global model according to the preset model structure in the trusted execution environment, the encryption module encrypts it and sends it to the client through the remote security connection module of the server, and is also used to receive the local update model. The decryption module decrypts the local update model and aggregates it using the adaptive threshold filtering aggregation algorithm to obtain the global model. The encryption module encrypts the global model and sends it to the client. The adaptive threshold filtering aggregation algorithm in this embodiment is a central security aggregation algorithm with data poisoning resistance capability. The server aggregates the global model by executing the adaptive threshold filtering aggregation algorithm.
[0046] The establishment of a connection between the client and the server to exchange model parameter data means that the model parameter data will leave the trusted execution environment. Therefore, a secure communication channel needs to be established to ensure the confidentiality of the data during transmission. Identity legitimacy authentication and code integrity authentication are performed between the trusted execution environments on the client and the server, and an encrypted secure communication channel is established on both sides to achieve secure interconnection and ensure the integrity of the federated learning protocol on both sides. This can solve the model poisoning attacks faced by federated learning and comprehensively address the privacy and security attacks faced by the current federated learning system.
[0047] In addition, the encryption module and the decryption module use symmetric encryption for encryption and decryption. The encryption module encrypts the local update model or the global model that leaves the trusted execution environment, and the decryption module decrypts the local update model or the global model within the trusted execution environment. The encryption module and the decryption module use the AES256-CBC algorithm for encryption and decryption. In addition, the SHA-256 hash operation message authentication code (Hash-based Message Authentication Code, HMAC) is used to ensure the integrity of the encrypted and decrypted model parameters.
[0048] This system builds a trusted execution environment on the client and server devices to protect the local training and central aggregation process of the entire federated learning in the trusted execution environment. The global model and local model and their updated data only exist in plain text in the trusted execution environment, and the data is encrypted when leaving the trusted execution environment, thereby protecting the confidentiality of the data in the federated learning process and addressing the privacy attacks faced by federated learning.
[0049] The present invention also provides a trusted federated learning method based on a trusted execution environment, the method comprising the following steps:
[0050] S1. Several clients and servers start domain virtual machines on their local devices as trusted execution environments, and establish secure connections through remote secure connection modules in their respective domain virtual machines, such as Figure 1 As shown, in this embodiment, several clients are numbered and the first Client ,in =1,2,3...n;
[0051] S2. The server generates an initial global model according to the preset model structure in the trusted execution environment, encrypts it through the encryption module, and sends it to several clients;
[0052] S3. Several clients receive the encrypted global model, pass it into the trusted execution environment, decrypt it through the decryption module, perform local training based on the local training data preset by the client to obtain a local model, calculate the parameter update data of the local model to obtain a local update model, encrypt the local update model through the encryption module, and upload it to the server; the local training data in this step is loaded into the trusted execution environment, so that the entire training process is carried out in the trusted execution environment;
[0053] S4. The server receives several encrypted local update models, transmits them to the trusted execution environment, decrypts them through the decryption module, and aggregates them using the adaptive threshold filtering aggregation algorithm to obtain the aggregated global model;
[0054] S5, judging whether the global model after aggregation has converged;
[0055] If yes, complete the training of trusted federated learning;
[0056] If not, proceed to step S6;
[0057] S6. The server encrypts the aggregated global model through its encryption module to obtain an encrypted global model, and sends it to several clients, repeating steps S3 to S5 until a converged global model is obtained.
[0058] In this embodiment, the specific steps of using the adaptive threshold filtering aggregation algorithm to aggregate and obtain the global model in step S4 are:
[0059] S41, the local update models uploaded by several clients in the first two rounds of training are directly regarded as legal updates and participate in the aggregation process;
[0060] S42: Determine the model update threshold B of the client for the third round and thereafter according to the local update models uploaded by the clients in the second round and thereafter. The calculation formula of the model update threshold B is:
[0061] ,
[0062] In the above formula, It represents the mean of the parameter update norms of all legal local update models in the last round of training. It represents the variance of the parameter update norm of all legal local update models in the last round of training. The value of B follows the Gaussian distribution of the parameter update norm of the local update model uploaded by several clients. ;
[0063] S43: The local update models whose parameter update bi-norm of the local update models uploaded by the client in the third round and thereafter exceeds the model update threshold B are regarded as malicious updates and are directly discarded, and do not participate in the aggregation process;
[0064] S44, collecting root data through a server or several clients to generate a root data set, the server performs root model training on it by presetting the root model structure, and calculates the parameter update data of the root model in each round of root model training, which is recorded as , for each local model parameter update data uploaded by several clients, denoted as , calculate its credibility score and the server's aggregation of legitimate local update models , the calculation formulas are:
[0065] ,
[0066] In the above formula, represents the cosine similarity, represents the activation function, Indicates The confidence score of the locally updated model uploaded by the client, Indicates The local model parameter update data uploaded by the client, Indicates The confidence score of the locally updated model uploaded by the client, Indicates The local model parameter update data uploaded by the client, Indicates The parameter update data of the root model in the round root model training; N represents the number of clients with local updated models that are not filtered out by the threshold.
[0067] The root data set in step S44 is a number of local training data (eg, 1%) collected by the server from each client, or a number of data that is close to independent and identically distributed with the local training data of each client collected by the server as root data to form a root data set.
[0068] The above formula shows that the local model parameter update data that is closer to the root model's parameter update data has a greater impact on the aggregated global model because their trust scores are higher. Therefore, using an adaptive threshold filtering aggregation algorithm for aggregation can effectively reduce the impact of malicious model updates on the global model.
[0069] The trusted execution environment can ensure the confidentiality of model parameters in federated learning and the integrity of the federated learning protocol, and resist privacy attacks and model poisoning attacks. However, it cannot prevent data poisoning attacks implemented by attackers from the data level, because it is impossible to calculate a legal check value in advance for the training data of each local client to verify the integrity of the training data. Therefore, the adaptive threshold filtering aggregation algorithm provided by the present invention is a central security aggregation algorithm with data poisoning resistance, which replaces the conventional central aggregation algorithm in previous federated learning. It identifies the received local update model to distinguish whether it is a malicious local update model after data poisoning, so as to have the ability to resist data poisoning. The algorithm not only has the ability to resist common data poisoning attacks in different ways, such as Byzantine attacks and backdoor attacks; and the algorithm runs in a trusted execution environment, which can ensure that its integrity will not be destroyed, thereby ensuring that attackers cannot bypass the resistance to data poisoning, and further improve the defense capability.
[0070] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
[0071] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A trusted federated learning system based on a trusted execution environment, characterized in that: It includes a server and several clients; the server and the several clients are both configured with a domain virtual machine, an encryption module and a decryption module, and the domain virtual machine is used as a trusted execution environment, in which a remote secure connection module is configured; The remote secure connection module is used to establish a secure connection between the trusted execution environment on the server and the client to transmit model information; The client is used to decrypt the received global model through the decryption module in the trusted execution environment, train the global model based on the local training data to obtain a local model, calculate the model parameter update data of the local model to obtain the local update model, encrypt the model through the encryption module and upload it to the server through the remote security connection module of the client; The server is used to generate an initial global model according to a preset model structure in a trusted execution environment, the encryption module encrypts the model and sends it to the client through the remote secure connection module of the server, and is also used to receive a local update model, the decryption module decrypts the local update model, and aggregates it using a filtering aggregation algorithm with an adaptive threshold to obtain a global model, and the encryption module encrypts the global model and sends it to the client; The establishment of the secure interconnection is specifically as follows: The remote secure connection modules in the client and the server generate public key-private key pairs in their respective local locations in the trusted execution environment; The remote security connection modules of the client and the server respectively send remote authentication requests to each other. After receiving the requests from each other, the remote security connection modules on the client and the server generate a hardware-signed remote attestation report in the trusted execution environment and return it to the other party, wherein the remote attestation report contains the respective code integrity check values and the public key information of the remote security connection module; the client and the server receive the remote attestation report of the other party, use their respective signature verification algorithms to verify the authenticity and integrity of the remote attestation report sent by the other party, so as to authenticate the legitimacy of the identity and code integrity of the other party, and save the public key information in the remote attestation report sent by the other party; The domain virtual machines on the client and server run the key negotiation protocol based on their respective private key information and the other party's public key information to derive a shared symmetric encryption key for use by the encryption module and decryption module to build an encrypted communication channel and achieve secure interconnection.
2. The trusted federated learning system according to claim 1, characterized in that: The filtering aggregation algorithm with an adaptive threshold is a central security aggregation algorithm with data poisoning resistance capability. The server aggregates and obtains a global model by executing the filtering aggregation algorithm with an adaptive threshold.
3. The trusted federated learning system according to claim 1, characterized in that: The encryption module and the decryption module use symmetric encryption for encryption and decryption. The encryption module encrypts the local update model or the global model that leaves the trusted execution environment, and the decryption module decrypts the local update model or the global model in the trusted execution environment.
4. A trusted federated learning method based on a trusted execution environment, characterized in that: The trusted federated learning system according to any one of claims 1 to 3, wherein the method comprises the following steps: S1. Several clients and servers start domain virtual machines on their local devices as trusted execution environments, and establish secure interconnection through remote secure connection modules in their respective domain virtual machines. S2. The server generates an initial global model according to the preset model structure in the trusted execution environment, encrypts it through the encryption module, and sends it to several clients; S3. Several clients receive the encrypted global model, pass it into the trusted execution environment, decrypt it through the decryption module, perform local training based on the local training data preset by the client to obtain a local model, calculate the parameter update data of the local model to obtain a local update model, encrypt the local update model through the encryption module, and upload it to the server; S4. The server receives several encrypted local update models, transmits them to the trusted execution environment, decrypts them through the decryption module, and aggregates them using the adaptive threshold filtering aggregation algorithm to obtain the aggregated global model; S5, judging whether the global model after aggregation has converged; If yes, complete the training of trusted federated learning; If not, proceed to step S6; S6. The server encrypts the aggregated global model through its encryption module to obtain an encrypted global model, and sends it to several clients, repeating steps S3 to S5 until a converged global model is obtained.
5. The trusted federated learning method according to claim 4, characterized in that: The specific steps of using the adaptive threshold filtering aggregation algorithm to aggregate and obtain the global model in step S4 are: S41, the local update models uploaded by several clients in the first two rounds of training are directly regarded as legal updates and participate in the aggregation process; S42: Determine the model update threshold B of the client for the third round and thereafter according to the local update models uploaded by the clients in the second round and thereafter. The calculation formula of the model update threshold B is: , In the above formula, It represents the mean of the parameter update norms of all legal local update models in the last round of training. It represents the variance of the parameter update norm of all legal local update models in the last round of training. The value of B follows the Gaussian distribution of the parameter update norm of the local update model uploaded by several clients. ; S43: The local update models whose parameter update bi-norm of the local update models uploaded by the client in the third round and thereafter exceeds the model update threshold B are regarded as malicious updates and are directly discarded, and do not participate in the aggregation process; S44, collecting root data through a server or several clients to generate a root data set, the server performs root model training on the root model by presetting the root model structure, and calculates the parameter update data of the root model in each round of root model training, which is recorded as , for each local model parameter update data uploaded by several clients, denoted as , calculate its credibility score and the server's aggregation of legitimate local update models , the calculation formulas are: , In the above formula, represents the cosine similarity, represents the activation function, represents the trust score of the local update model uploaded by the i-th client, Indicates the local model parameter update data uploaded by the i-th client. represents the trust score of the local update model uploaded by the jth client, Indicates the local model parameter update data uploaded by the jth client. represents the parameter update data of the root model in the rth round of root model training; N represents the number of clients that have local updated models that are not filtered out by the threshold.
6. The trusted federated learning method according to claim 5, characterized in that: The root data set in step S44 is a number of local training data collected by the server from each client, or a number of data that is close to independent and identically distributed with the local training data of each client collected by the server as root data to form a root data set.
Citation Information
Patent Citations
Federal learning method and system based on trusted execution environment
CN116502732A
Federal learning method, system and device and storage medium
CN117172311A