Privacy-preserving and communication-efficient image recognition method based on ranked federated learning
By using a double mask mechanism and edge pop-up algorithm based on ranked federated learning, combined with a secret sharing protocol and voting mechanism, the problems of high communication cost and data leakage in federated learning are solved, and privacy protection and efficient image recognition model training are achieved.
Patent Information
- Application Number
- CN202411891562.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2044-12-20
AI Technical Summary
Existing federated learning methods have shortcomings in terms of communication costs and privacy protection. The huge model parameters lead to high communication costs, and the client going offline midway may result in inaccurate aggregation, posing a risk of data leakage.
A double-mask mechanism based on ranked federated learning is adopted. Through the secret sharing protocol and Diffie-Hellman key agreement, the client adds a double mask before uploading parameters. The mask can be offset or reconstructed during the aggregation stage. The edge pop-up algorithm and voting mechanism are combined for model training and updating, and a mechanism that supports client offline midway is supported.
Effectively protect client data privacy, reduce communication costs, ensure the accuracy and continuity of model training, support dynamic client participation, and reduce communication overhead.
Smart Images

Figure CN119834964B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of privacy-preserving federated learning, and in particular relates to a privacy-preserving and communication-efficient image recognition method based on ranked federated learning. Background Art
[0002] In the era of big data, the conflict between data fusion needs and data privacy protection is becoming increasingly prominent. Federated learning, a distributed machine learning framework, allows for collaborative global model training by sharing model parameters without directly exchanging raw data. Specifically, each client independently trains a model based on local data and then uploads the resulting model parameters to the server. The server aggregates these parameters to update the global model and distributes the updated global model to each client. Federated learning avoids centralized data collection, shifting from the "model remains static, data moves" model to a "data remains static, model moves" model. This better protects the privacy of training data and facilitates the use of distributed data resources.
[0003] However, federated learning still carries the risk that model parameters (i.e., gradients and weights, etc.) could be used to infer the client's original data. Existing technologies primarily protect these parameters through homomorphic encryption, secure multi-party computation, and differential privacy. Furthermore, the large number of parameters in federated learning models leads to high communication costs. Existing privacy-preserving federated learning efforts reduce communication costs by improving local training efficiency, reducing the number of communication rounds, optimizing client selection strategies, and implementing model compression. However, because communication between the client and server still relies on traditional model parameters, the degree of reduction in communication costs is limited. Furthermore, limited network bandwidth and the geographical dispersion of client data can exacerbate communication overhead in federated learning, and even cause clients to disconnect midway.
[0004] That is, while federated learning can mitigate the risk of data leakage to a certain extent, intermediate model parameters shared by clients can still expose local data information. Furthermore, federated learning faces challenges such as high communication overhead for model updates and the possibility that clients with limited network bandwidth may go offline midway, resulting in inaccurate aggregation. Summary of the Invention
[0005] To solve the above problems, the present invention provides a privacy-preserving and communication-efficient image recognition method based on ranked federated learning. The double mask mechanism of ranked federated learning can reduce the communication overhead by more than 8 times while ensuring the performance and privacy protection of the image recognition model.
[0006] A privacy-preserving and communication-efficient image recognition method based on ranked federated learning is disclosed. The method employs an image recognition model obtained by federated learning between a cloud server and multiple clients for image recognition. The image recognition model is obtained by:
[0007] S1: A trusted third party generates two public and private key pairs for each client, one for mask generation and one for authentication encryption. Each client sends its two public keys as a message to the cloud server. When the cloud server receives at least t messages, it broadcasts the received public key list to all clients that are still online in the current round.
[0008] S2: Each client randomly selects a first mask seed and distributes the seed and the private key used for mask generation to other clients according to the secret sharing protocol;
[0009] S3: Each client uses the public key used for authentication and encryption to authenticate and encrypt its own identity information and the identity information of the client shared with itself, and sends the resulting ciphertext to the cloud server.
[0010] S4: The cloud server determines whether it has received at least t ciphertexts in the current round. If so, it broadcasts the currently received ciphertexts and the global ranking of the edge importance between each network node in the image recognition model of the current round to the clients that are still online in the current round. In the first round, the cloud server ranks the edge importance between each network node in the image recognition model based on the initialized edge scores.
[0011] S5: Each client reorders the local edge scores according to the received global ranking, then uses the edge pop-up algorithm to update the reordered local edge scores, and finally obtains the local ranking of the current round based on the updated local edge scores;
[0012] S6: Each client converts its local ranking in the current round into a vote count, and uses the first mask seed selected in step S2 and the private key shared with other clients for mask generation to superimpose a double mask perturbation on the vote count. The resulting masked vote count is then uploaded to the cloud server.
[0013] S7: Each client decrypts the ciphertext received in step S4. If the decryption is successful, it sends the first mask seed slices of other clients that are still online in the current round, which it shared in step S2, to the cloud server. At the same time, it sends the private key slices of other clients that are offline in the current round, which it shared in step S2, to the cloud server.
[0014] S8: The cloud server determines whether it has received at least t messages in the current round, where the messages are the first mask seed slice and the private key slice. If so, the cloud server uses the secret reconstruction algorithm to reconstruct the first mask seed and the private key used for mask generation, and calculates the corresponding shared key based on the reconstructed structure;
[0015] S9: The cloud server aggregates the masked votes corresponding to all clients received in step S6 based on the shared key, and uses the Argsort function to generate a new global ranking for the aggregated new votes. It then returns to step S1 to start the next round of iteration until the set number of iterations is reached. The global ranking obtained when the set number of iterations is used as the edge importance ranking between each node in the image recognition model, and the edges between each node are weighted according to the edge importance ranking to obtain the final image recognition model.
[0016] Furthermore, in step S1, the method for generating one of the public key and private key pairs of any client m is as follows:
[0017]
[0018] Among them, KA.Gen represents the algorithm for generating public-private key pairs, public parameters pp = (G, q, g, H), q represents the order, G represents a group of order q, g represents the generator, and H represents the hash function. and They represent the private key and public key of client m for authentication encryption, and They represent the private key and public key of client m used for mask generation.
[0019] Furthermore, in step S2, the method for any client m to share the seed and private key is:
[0020] From the finite field Z of positive integers q Randomly select a positive integer as the first mask seed b m ;
[0021] Client m uses the secret sharing protocol to send the first mask seed b m and the private key used for mask generation Share with another client u:
[0022]
[0023] Among them, SS.Share represents the secret sharing algorithm, t is the secret sharing threshold, and U1 represents the set of surviving clients that are still online in the current step. represents the private key of client m for mask generation, b u,mRepresents the first mask seed b of client m m The first masked seed slice shared with client u, Represents the private key of client m The private key slice shared with client u, (u,b u,m ) represents the seed data packet shared by client m to client u, Indicates the private key data packet shared by client m to client u.
[0024] Furthermore, in step S3, any client m and any client u that shares secrets with client m corresponds to a ciphertext x u,m :
[0025]
[0026] Among them, AE.Enc represents the encryption algorithm, KA.Agree represents the negotiated shared key algorithm, The private key of client u for authentication encryption. b represents the public key of client m for authentication encryption. u,m Represents the first mask seed b of client m m The first masked seed slice shared with client u, Represents the private key of client m The private key slice shared with client u. || represents string concatenation.
[0027] Furthermore, in step S5, the method for any client m to obtain the local ranking of the current round is:
[0028] Use the Sort function to sort the local edge scores from small to large to obtain the rearranged local edge scores;
[0029] According to the global ranking, the re-arranged local edge scores are assigned to the edges between each network node in the image recognition model, wherein smaller local edge scores are assigned to lower-ranked edges, and larger local edge scores are assigned to higher-ranked edges, thereby obtaining the re-assigned edges between each network node in the image recognition model;
[0030] Use the edge pop-up algorithm to update the local edge score in the re-assigned image recognition model to obtain the updated local score
[0031]
[0032] Where EP represents the edge pop-up algorithm, E represents the number of local rounds, and Ω m represents the local data of client m, K represents the set constant, η represents the learning rate, θ ωDenote the weights of the edges between nodes in the local image recognition model of client m, θ s Denote the scores of the edges between nodes in the local image recognition model of client m;
[0033] Use the Argsort function to rank the edges between the network nodes in the updated local scores in the image recognition model to obtain the local ranking of client m in the current round.
[0034] Furthermore, in step S6, any client m uses the Argsort function to convert the local ranking in the current round into a vote count.
[0035] Furthermore, in step S6, the masked vote count y m of any client m is obtained as follows:
[0036]
[0037] where v m is the vote count converted from the local ranking of client m in the current round, U2 is the set of surviving clients still online in the current step, q m,u is the shared secret key negotiated between client m and client u, and KA.Agree represents the algorithm for negotiating the shared secret key, represents the private key of client m for mask generation, represents the public key of client u for mask generation, PRG represents the pseudo-random number generator, b m is the first-layer mask seed selected by client m, u ∈ U2: m < u represents the clients in the set of surviving clients U2 with numbers less than m, and u ∈ U2: m > u represents the clients in the set of surviving clients U2 with numbers greater than m.
[0038] Furthermore, in step S7, the method for any client m to decrypt the ciphertext received in step S4 is:
[0039] Decrypt the ciphertext according to the following formula:
[0040]
[0041] where AE.Enc represents the encryption algorithm, KA.Agree represents the algorithm for negotiating the shared secret key, represents the private key of client u for authenticated encryption, represents the public key of client m for authenticated encryption, b u,m represents the first-layer mask seed b of client m m the slice of the first-layer mask seed shared by client m to client u, Represents the private key of client m The private key slice shared with client u, || represents the concatenation of strings, χ u,m represents the ciphertext corresponding to client m and client u that shares secrets with client m, and u′ represents the ciphertext χ u,m The decryption number corresponding to the client u is obtained after decryption, and m′ represents the decryption of the ciphertext χ u,m The decryption number corresponding to the client u obtained after decryption;
[0042] Determine whether the equation u=u′∧m=m′ is equal. If they are equal, the decryption is successful.
[0043] Furthermore, in step S8, the method for obtaining the shared key corresponding to any client m is:
[0044]
[0045] in, represents the private key of client m for mask generation, SS.Recon represents the secret reconstruction algorithm, Represents the private key of client m The private key slice shared with client u, U4 is the set of surviving clients still online in the current step, t is the secret sharing threshold, b u,m Represents the first mask seed b of client m m The first masked seed slice shared with client u;
[0046] Calculate the corresponding shared key:
[0047]
[0048] Among them, q m,u The shared key negotiated between client m and client u. KA.Agree represents the negotiated shared key algorithm. Indicates the public key of client u used for mask generation.
[0049] Furthermore, in step S9, the cloud server performs voting aggregation in the following manner:
[0050]
[0051] Among them, v total is the new number of votes after aggregation, U3 is the set of surviving clients still online after step S6, U2 is the set of surviving clients still online after step S3, and y m is the number of mask votes corresponding to client m, q m,u is the shared key negotiated by client m and client u, PRG represents the pseudo-random number generator, bm The first-layer masking seed selected for client m, where m ∈ U3, u ∈ U2\U3: m < u represents the clients with numbers less than m in the surviving client set U2 but not in the surviving client set U3, and m ∈ U3, u ∈ U2\U3: m > u represents the clients with numbers greater than m in the surviving client set U2 but not in the surviving client set U3.
[0052] Beneficial effects:
[0053] 1. The present invention provides a privacy-preserving and communication-efficient image recognition method based on ranked federated learning. By combining the secret sharing protocol and the Diffie-Hellman key protocol, a dual masking mechanism for protecting the privacy of ranked parameters uploaded by clients locally is designed. Specifically, a dual mask is added before the local client uploads parameters, and during the aggregation phase, the masks can be canceled or reconstructed and eliminated from each other. Neither the malicious cloud server nor the client can use the information they possess to infer the privacy information of other clients, thus ensuring that the data of each client will not be leaked during the entire federated learning process, and solving the problem that the intermediate model parameters shared by clients in federated learning may still expose local data information. That is to say, the present invention proposes a method for a privacy-preserving and efficient federated learning image recognition model based on ranked communication rather than traditional gradients, which can reduce the communication cost while ensuring accuracy and privacy protection, so as to protect the client data and the ranked model parameters uploaded by the client from being exposed during the entire federated learning process.
[0054] 2. The present invention provides a privacy-preserving and communication-efficient image recognition method based on ranked federated learning. By combining the edge popping algorithm, the global model is collaboratively trained based on the ranking of the random network edge, and a voting mechanism is adopted to aggregate and update the global model, reducing the communication overhead and ensuring the efficiency of the federated learning communication process.
[0055] 3. The present invention provides a privacy-preserving and communication-efficient image recognition method based on ranked federated learning. By combining the secret sharing protocol, a mechanism supporting clients to go offline midway is designed. Specifically, the masking seeds are secretly shared before mask generation. After that, even if some clients go offline midway, only a certain number of online clients are needed to reconstruct and eliminate the masking seeds, thus ensuring the accuracy of aggregation. That is to say, the present invention designs a mask recovery mechanism supporting clients to go offline midway, allowing the masks of the clients going offline midway to be reconstructed by interacting with some online clients, thus ensuring the accuracy during voting aggregation and solving the problem that inaccurate aggregation occurs due to clients going offline midway. Brief description of the drawings
[0056] Figure 1Flowchart of the training method for the privacy-preserving and communication-efficient image recognition model based on ranked federated learning provided by the present invention. DETAILED DESCRIPTION
[0057] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0058] This paper proposes a privacy-preserving and communication-efficient image recognition method based on ranked federated learning. It primarily designs a double-masking mechanism to protect the privacy of ranking-based parameters uploaded locally by clients, ensuring the security of raw data and intermediate parameters during the federated learning process. In this method, even if some clients go offline during the federated learning process, mask reconstruction can be performed through interaction with some online clients, thereby maintaining the accuracy of the aggregated results. Furthermore, by uploading ranking-based parameter information rather than traditional gradients, the present invention improves communication efficiency. This practical method achieves privacy protection and secure aggregation while maintaining good model performance and reducing communication overhead.
[0059] The present invention mainly involves two entities: cloud servers and clients. The cloud server is mainly responsible for broadcasting and updating the global ranking of each round. The client is an independent entity with different data sets, such as image data. Each client calculates the ranking of the network edge in the random network based on its local image data and votes. After being perturbed by the double mask mechanism, the masked vote count is uploaded to the cloud server, thereby collaboratively training the global image recognition model under the federated learning framework. The ultimate goal is to obtain a subnetwork that minimizes the average loss of the client. The present invention assumes that the cloud server and all clients are honest and curious. Specifically, although the cloud server and clients strictly follow the standard procedures required to complete the federated learning task, they are also curious about the image privacy information of other clients and may try to use previously acquired knowledge to infer or obtain the image privacy information of other clients.
[0060] Specifically, such as Figure 1 As shown, a privacy-preserving and communication-efficient image recognition method based on ranked federated learning is used to perform image recognition using an image recognition model obtained by federated learning between a cloud server and multiple clients. The image recognition model is obtained by:
[0061] S0: System initialization.
[0062] System initialization involves deploying a set of clients and a cloud server. The client's local training set contains a certain number of image samples. The system initializes the network weights and scores based on a random seed selected by the cloud server. This random seed is shared with the clients, allowing them to re-establish the initial weights and scores locally.
[0063] Specifically, given the randomly initialized initial network θ, a set of N clients U = {C1, C2, ..., C N}, a cloud server S and security parameter k, and using a secret sharing protocol with threshold (t, N), perform the following steps:
[0064] Generate public parameters:
[0065] (G,q,g,H)←KA.Param(k);
[0066] Return pp = (G, q, g, H);
[0067] Initialize network parameters:
[0068] Choose a random seed SEED←Z q ;
[0069] θ ω ←SKC(θ,SEED);
[0070] θ s ←KU(θ,SEED);
[0071] Among them, t represents the threshold of the secret sharing protocol, q represents the order, G represents a group of order q, g represents the generator, H represents the hash function, KA.Param represents the algorithm for generating public parameters, pp represents the public parameters, Z q represents a finite field, θ ω represents the weight of the network θ, SKC represents the signature Kamin constant algorithm, θ s represents the score of the network θ, and KU represents the Kaiming uniform algorithm.
[0072] S1: A trusted third party generates two public and private key pairs for each client, one for mask generation and one for authentication encryption. Each client sends its two public keys as a message to the cloud server. When the cloud server receives at least t messages, it broadcasts the received public key list to all clients that are still online in the current round.
[0073] Given a public parameter pp, for a client m∈U, the method for generating one of the public key and private key pairs of any client m is as follows:
[0074]
[0075] Among them, KA.Gen represents the algorithm for generating public-private key pairs, public parameters pp = (G, q, g, H), q represents the order, G represents a group of order q, g represents the generator, and H represents the hash function. and They represent the private key and public key of client m for authentication encryption, and They represent the private key and public key of client m used for mask generation.
[0076] Client m sends To the cloud server, when the cloud server receives at least t messages, the broadcast list Given all clients in the surviving client set U1, U1 represents the surviving client set of this step.
[0077] S2: Each client randomly selects a first mask seed and distributes the seed and the private key used for mask generation to other clients according to the secret sharing protocol;
[0078] Among them, for client m∈U1, the method for any client m to share the seed and private key is:
[0079] From the finite field Z of positive integers q Randomly select a positive integer as the first mask seed b m ;
[0080] Client m uses the secret sharing protocol to send the first mask seed b m and the private key used for mask generation Share with another client u:
[0081]
[0082] Where SS.Share represents the secret sharing algorithm, t is the secret sharing threshold, and U1 represents the set of surviving clients that are still online in step S2. represents the private key of client m for mask generation, b u,m Represents the first mask seed b of client m m The first masked seed slice shared with client u, Represents the private key of client m The private key slice shared with client u, (u,b u,m ) represents the seed data packet shared by client m to client u, Indicates the private key data packet shared by client m to client u.
[0083] It should be noted that the key to a secret sharing protocol with a threshold (t, N) is to partition the secret into N independent shares. If t shares are known, the original secret can be recovered, but if only t-1 shares are known, the original secret cannot be reconstructed. SS.Share is used in the secret sharing phase, and SS.Recon is used in the secret reconstruction phase.
[0084] S3: Each client uses the public key used for authentication encryption to authenticate and encrypt its own identity information and the client identity information shared with it, and sends the resulting ciphertext to the cloud server. Authentication encryption means that AE.Enc is used to encrypt plaintext and AE.Dec is used to decrypt ciphertext.
[0085] Among them, any client m and any client u that shares secrets with client m corresponds to a ciphertext χ u,m :
[0086]
[0087] Among them, AE.Enc represents the encryption algorithm, KA.Agree represents the negotiated shared key algorithm, The private key of client u for authentication encryption. b represents the public key of client m for authentication encryption. u,m Represents the first mask seed b of client m m The first masked seed slice shared with client u, Represents the private key of client m The private key slice shared with client u. || represents string concatenation.
[0088] S4: The cloud server determines whether it has received at least t ciphertexts in the current round. If so, it broadcasts the currently received ciphertexts and the global ranking of the edge importance between each network node in the image recognition model of the current round to the clients that are still online in the current round. In the first round, the cloud server ranks the edge importance between each network node in the image recognition model based on the initialized edge scores.
[0089] It should be noted that steps S1 to S4 are primarily divided into two phases: key generation and key sharing. During the key generation phase, a trusted third party generates two public and private key pairs for each client, one for mask generation and one for authentication and encryption. The trusted third party is a fully trusted key management center, and the communication channel between the trusted third party and any entity is secure. During the key sharing phase, a first mask seed is randomly selected for each client. This seed, along with the private key used for mask generation, is distributed to all clients according to a secret sharing protocol. Authentication and encryption are also required to ensure confidentiality and integrity during the sharing process.
[0090] Then, the client m ciphertext χ u,m To the cloud server, when the cloud server receives at least t messages, it broadcasts the ciphertext list and the global ranking of the current round Given all clients in U2, U2 represents the set of surviving clients of step S4.
[0091] S5: Each client reorders the local edge scores according to the received global ranking, then uses the edge pop-up algorithm to update the reordered local edge scores, and finally obtains the local ranking of the current round based on the updated local edge scores;
[0092] Among them, for the first round of global ranking, given the initialization score θ s , perform the following steps:
[0093]
[0094] in, = represents the global ranking for round 1. It should be noted that in the first round, the global image recognition ranking is calculated based on the initialized network score and broadcast to all clients in the surviving client set. For subsequent rounds, the cloud server broadcasts the updated global image recognition ranking.
[0095] Furthermore, for client m∈U2, given the score θ s and global ranking Where U2 represents the set of surviving clients in step S4, It represents the global ranking of the dth round. The method for any client m to obtain the local ranking of the current round is:
[0096] S51: Use the Sort function to sort the local edge scores from small to large to obtain the rearranged local edge scores
[0097] S52: assigning the re-arranged local edge scores to the edges between each network node in the image recognition model according to the global ranking, wherein smaller local edge scores are assigned to lower-ranked edges, and larger local edge scores are assigned to higher-ranked edges, thereby obtaining the re-assigned edges between each network node in the image recognition model;
[0098] For example, suppose θ s =[0.3,0.8,0.5,0.4,0.9,1.3], Among them, θ s In the example, the score of edge 1 is 0.3, the score of edge 2 is 0.8, and so on. In the figure, edge 2 has the lowest ranking and edge 5 has the highest ranking, so:
[0099] Sort(θ s )=[0.3,0.4,0.5,0.8,0.9,1.3]
[0100] Then it means θ s [2] = 0.3, θ s [4] = 0.4, θ s [0] = 0.5, θ s [1] = 0.8, θ s [3] = 0.9, θ s [5]=1.3, then the rearranged θ is s =[0.5,0.8,0.3,0.9,0.4,1.3].
[0101] S53: Use the edge pop-up algorithm to update the local edge score in the re-assigned image recognition model to obtain the updated local score
[0102]
[0103] Where EP represents the edge pop-up algorithm, E represents the number of local rounds, and Ω m represents the local data of client m, K represents the set constant, η represents the learning rate, θ ω represents the weight of the edges between nodes in the local image recognition model of client m, θ s represents the fraction of edges between nodes in the local image recognition model of client m;
[0104] It should be noted that the edge popping algorithm is an algorithm for finding a "super mask" high-performance sub-network. "Super mask" refers to a sub-network of a randomly initialized network that can achieve high accuracy without training.
[0105] S54: Use Argsort function to sort the updated local scores rank the edges between each network node in the image recognition model under to obtain the local ranking of the current round of client m
[0106] As can be seen, in step S5, the client reorders the local scores of the network according to the received global ranking of image recognition in the current round. Through the edge popping algorithm, the client searches locally for a highly efficient subnetwork whose performance is close to fully trained and updates the scores, so as to calculate the local ranking of each edge of the image recognition network according to the finally updated scores.
[0107] S6: Each client converts the local ranking of the current round into a vote count, and uses the first masking seed selected by itself in step S2 and the private key for mask generation shared with other clients to superimpose double masking perturbations on the vote count, and then uploads the obtained masked vote count to the cloud server;
[0108] Among them, any client m uses the Argsort function to convert the local ranking of the current round into a vote count
[0109]
[0110] The masked vote count y of any client m m is obtained as follows:
[0111]
[0112] Among them, v m is the vote count converted by client m from the local ranking of the current round, U2 is the set of surviving clients still online in step S4, q m,u is the shared key negotiated between client m and client u, and KA.Agree represents the negotiated shared key algorithm, represents the private key of client m for mask generation, represents the public key of client u for mask generation, PRG represents the pseudo-random number generator, b m is the first masking seed selected by client m, u ∈ U2: m < u represents the clients in the surviving client set U2 with numbers less than m, and u ∈ U2: m > u represents the clients in the surviving client set U2 with numbers greater than m.
[0113] The clients send the list to the cloud server. When the cloud server receives at least t messages, it broadcasts the U3 list, and U3 represents the set of surviving clients still online in step S6.
[0114] It's important to note that a pseudorandom number generator (PRG) is a type of generator that produces a sequence of numbers that appear nearly random but are actually generated through a deterministic computational process. Given the generator's output, it's impossible to accurately predict the next random number. Given a random number sequence, it's impossible to reverse engineer the generator's internal state or seed.
[0115] It can be seen that in step S6, the client votes for the edges in the network according to its local ranking of image recognition to obtain the local vote count, and then performs double mask perturbation on it and uploads it to the cloud server. m The client also needs to use the Diffie-Hellman key agreement to calculate the shared key q m,u As the second mask seed. When the cloud server receives enough messages from the client, it will broadcast the list of surviving clients.
[0116] It should be noted that the Diffie-Hellman key agreement refers to: KA.Param is used for parameter generation, KA.Gen is used to generate key pairs, and KA.Agree is used to negotiate shared keys between clients.
[0117] S7: Each client decrypts the ciphertext received in step S4. If the decryption is successful, it sends the first mask seed slices of other clients that are still online in the current round, which it shared in step S2, to the cloud server. At the same time, it sends the private key slices of other clients that are offline in the current round, which it shared in step S2, to the cloud server.
[0118] The method for any client m to decrypt the ciphertext received in step S4 is:
[0119] Decrypt the ciphertext according to the following formula:
[0120]
[0121] Among them, AE.Enc represents the encryption algorithm, KA.Agree represents the negotiated shared key algorithm, The private key of client u for authentication encryption. b represents the public key of client m for authentication encryption. u,m Represents the first mask seed b of client m m The first masked seed slice shared with client u, Represents the private key of client m The private key slice shared with client u, || represents the concatenation of strings, χ u,mrepresents the ciphertext corresponding to client m and client u that shares secrets with client m, and u′ represents the ciphertext χ u,m The decryption number corresponding to the client u is obtained after decryption, and m′ represents the decryption of the ciphertext χ u,m The decryption number corresponding to the client u obtained after decryption;
[0122] Determine whether the equation u=u′∧m=m′ is equal. If they are equal, the decryption is successful.
[0123] For example, client m decrypts successfully and sends shared data to offline client u∈U2\U3 And send shared b for online client u∈U3 u,m to the cloud server.
[0124] S8: The cloud server determines whether it has received at least t messages in the current round, where the messages are the first mask seed slice and the private key slice. If so, the cloud server uses the secret reconstruction algorithm to reconstruct the first mask seed and the private key used for mask generation, and calculates the corresponding shared key based on the reconstructed structure;
[0125] The method for obtaining the shared key corresponding to any client m is:
[0126]
[0127]
[0128] in, represents the private key of client m for mask generation, SS.Recon represents the secret reconstruction algorithm, Represents the private key of client m The private key slice shared with client u, U4 is the set of surviving clients still online in the current step, t is the secret sharing threshold, b u,m Represents the first mask seed b of client m m The first masked seed slice shared with client u;
[0129] Calculate the corresponding shared key:
[0130]
[0131] Among them, q m,u The shared key negotiated between client m and client u. KA.Agree represents the negotiated shared key algorithm. Indicates the public key of client u used for mask generation.
[0132] S9: The cloud server performs vote aggregation on the masked vote counts corresponding to all clients received in step S6 based on the shared key, and uses the Argsort function to generate a new global ranking from the aggregated new vote counts which represents the global ranking of the next round, and then returns to step S1 to start the iteration of the next round until the set number of iterations is reached. The global ranking obtained when setting the number of iterations is used as the ranking of the importance of the edges between the nodes in the image recognition model, and weights are assigned to the edges between the nodes according to the edge importance ranking to obtain the final image recognition model that minimizes the average loss of all clients when completing the image recognition task;
[0133] Among them, the method for the cloud server to perform vote aggregation is:
[0134]
[0135] where v total is the aggregated new vote count, U3 is the set of surviving clients still online after step S6, U2 is the set of surviving clients still online after step S4, y m is the masked vote count corresponding to client m, q m,u is the shared key negotiated between client m and client u, PRG represents a pseudo-random number generator, b m is the first-layer masking seed selected by client m, m ∈ U3, u ∈ U2\U3: m < u represents the clients with numbers less than m in the set of surviving clients U2 but not in the set of surviving clients U3, m ∈ U3, u ∈ U2\U3: m > u represents the clients with numbers greater than m in the set of surviving clients U2 but not in the set of surviving clients U3.
[0136] It should be noted that in steps S7 - S9, first, the ciphertext is decrypted for the surviving clients. If the conditions are met after decryption, the private key-related share is sent to the clients that went offline midway, and the first-layer masking seed-related share is sent to the online clients to the cloud server. When the cloud server receives a sufficient number of messages from the clients, it will reconstruct the private key and the first-layer masking seed of the clients accordingly according to the secret sharing protocol. The corresponding shared key can be recalculated through the reconstructed private key, so as to obtain the second-layer masking seed of the offline clients. Finally, the aggregation operation of the client votes is performed. During this process, the masks will be cancelled or eliminated after reconstruction.
[0137] In summary, the present invention can solve the following three technical problems:
[0138] 1. Privacy protection. This invention ensures that each client's data is not leaked during the federated learning process. Specifically, the server cannot infer the client's private information from the acquired data, and the client cannot infer the private information of other clients based on its own information. Furthermore, even if some clients go offline during the process, the privacy of each client can still be guaranteed.
[0139] 2. Robustness. Clients may go offline at any time due to network problems, hardware failures, or other reasons. The present invention needs to ensure that the system is not affected by client offline, support dynamic client participation in the federated learning process, and maintain the continuity and accuracy of model training and data privacy protection.
[0140] 3. Efficiency. Large model parameters in federated learning lead to high communication overhead. This invention aims to reduce the amount of data required to communicate model parameters in traditional federated learning by adopting a lightweight communication mechanism and algorithm optimization, thereby improving the communication efficiency of federated learning.
[0141] Of course, the present invention may have many other embodiments. Without departing from the spirit and essence of the present invention, those skilled in the art may of course make various corresponding changes and modifications based on the present invention, but these corresponding changes and modifications should all fall within the scope of protection of the claims attached to the present invention.
Claims
1. A privacy-preserving and communication-efficient image recognition method based on ranked federated learning, characterized in that: Image recognition is performed using an image recognition model obtained by federated learning between a cloud server and multiple clients, wherein the image recognition model is obtained by: S1: A trusted third party generates two public and private key pairs for each client, one for mask generation and one for authentication encryption. Each client sends its two public keys as a message to the cloud server. When the cloud server receives at least t messages, it broadcasts the received public key list to all clients that are still online in the current round. S2: Each client randomly selects a first mask seed and distributes the seed and the private key used for mask generation to other clients according to the secret sharing protocol; S3: Each client uses the public key used for authentication and encryption to authenticate and encrypt its own identity information and the identity information of the client shared with itself, and sends the resulting ciphertext to the cloud server. S4: The cloud server determines whether it has received at least t ciphertexts in the current round. If so, it broadcasts the currently received ciphertexts and the global ranking of the edge importance between each network node in the image recognition model of the current round to the clients that are still online in the current round. In the first round, the cloud server ranks the edge importance between each network node in the image recognition model based on the initialized edge scores. S5: Each client reorders the local edge scores according to the received global ranking, then uses the edge pop-up algorithm to update the reordered local edge scores, and finally obtains the local ranking of the current round based on the updated local edge scores; S6: Each client converts its local ranking in the current round into a vote count, and uses the first mask seed selected in step S2 and the private key shared with other clients for mask generation to superimpose a double mask perturbation on the vote count. The resulting masked vote count is then uploaded to the cloud server. S7: Each client decrypts the ciphertext received in step S4. If the decryption is successful, it sends the first mask seed slices of other clients that are still online in the current round, which it shared in step S2, to the cloud server. At the same time, it sends the private key slices of other clients that are offline in the current round, which it shared in step S2, to the cloud server. S8: The cloud server determines whether it has received at least t messages in the current round, where the messages are the first mask seed slice and the private key slice. If so, the cloud server uses the secret reconstruction algorithm to reconstruct the first mask seed and the private key used for mask generation, and calculates the corresponding shared key based on the reconstructed structure; S9: The cloud server aggregates the masked votes corresponding to all clients received in step S6 based on the shared key, and uses the Argsort function to generate a new global ranking for the aggregated new votes. It then returns to step S1 to start the next round of iteration until the set number of iterations is reached. The global ranking obtained when the set number of iterations is used as the edge importance ranking between each node in the image recognition model, and the edges between each node are weighted according to the edge importance ranking to obtain the final image recognition model.
2. The privacy-preserving and communication-efficient image recognition method based on ranked federated learning according to claim 1, characterized in that: In step S1, the method for generating one of the public and private key pairs of any client m is as follows: Among them, KA.Gen represents the algorithm for generating public-private key pairs, public parameters pp = (G, q, g, H), q represents the order, G represents a group of order q, g represents the generator, and H represents the hash function. and They represent the private key and public key of client m for authentication encryption, and They represent the private key and public key of client m used for mask generation.
3. The privacy-preserving and communication-efficient image recognition method based on ranked federated learning according to claim 1, characterized in that: In step S2, the method for any client m to share the seed and private key is: From the finite field Z of positive integers q Randomly select a positive integer as the first mask seed b m ; Client m uses the secret sharing protocol to send the first mask seed b m and the private key used for mask generation Share with another client u: Among them, SS.Share represents the secret sharing algorithm, t is the secret sharing threshold, and U1 represents the set of surviving clients that are still online in the current step. represents the private key of client m for mask generation, b u,m Represents the first mask seed b of client m m The first masked seed slice shared with client u, Represents the private key of client m The private key slice shared with client u, (u,b u,m ) represents the seed data packet shared by client m to client u, Indicates the private key data packet shared by client m to client u.
4. The privacy-preserving and communication-efficient image recognition method based on ranked federated learning according to claim 1, characterized in that: In step S3, any client m and any client u that shares secrets with client m corresponds to a ciphertext x u,m : Among them, AE.Enc represents the encryption algorithm, KA.Agree represents the negotiated shared key algorithm, The private key of client u for authentication encryption. b represents the public key of client m for authentication encryption. u,m Represents the first mask seed b of client m m The first masked seed slice shared with client u, Represents the private key of client m The private key slice shared with client u. || represents string concatenation.
5. The privacy-preserving and communication-efficient image recognition method based on ranked federated learning according to claim 1, characterized in that: In step S5, the method for any client m to obtain the local ranking of the current round is: Use the Sort function to sort the local edge scores from small to large to obtain the rearranged local edge scores; According to the global ranking, the re-arranged local edge scores are assigned to the edges between each network node in the image recognition model, wherein smaller local edge scores are assigned to lower-ranked edges, and larger local edge scores are assigned to higher-ranked edges, thereby obtaining the re-assigned edges between each network node in the image recognition model; Use the edge pop-up algorithm to update the local edge score in the re-assigned image recognition model to obtain the updated local score Where EP represents the edge pop-up algorithm, E represents the number of local rounds, and Ω m represents the local data of client m, K represents the set constant, η represents the learning rate, θ ω represents the weight of the edges between nodes in the local image recognition model of client m, θ s represents the fraction of edges between nodes in the local image recognition model of client m; Use the Argsort function to sort the updated local scores Rank the edges between network nodes in the image recognition model below to obtain the local ranking of client m in the current round.
6. The privacy-preserving and communication-efficient image recognition method based on ranked federated learning according to claim 1, characterized in that: In step S6, any client m uses the Argsort function to convert the local ranking of the current round into the number of votes.
7. The privacy-preserving and communication-efficient image recognition method based on ranked federated learning according to claim 1, characterized in that: In step S6, the number of masked votes y of any client m m The method to obtain is: where, v m is the number of votes converted from the local ranking of the current round by client m, U2 is the set of surviving clients still online in the current step, q m,u is the shared key negotiated between client m and client u, and KA.Agree represents the algorithm for negotiating the shared key, represents the private key of client m for mask generation, represents the public key of client u for mask generation, PRG represents the pseudo-random number generator, b m is the first-layer mask seed selected by client m, u ∈ U2: m < u represents the clients in the set of surviving clients U2 with numbers less than m, and u ∈ U2: m > u represents the clients in the set of surviving clients U2 with numbers greater than m.
8. The privacy-preserving and communication-efficient image recognition method based on ranked federated learning according to claim 1, wherein: In step S7, any client m decrypts the ciphertext received in step S4 in the following manner: Decrypt the ciphertext according to the following formula: Among them, AE.Enc represents the encryption algorithm, KA.Agree represents the negotiated shared key algorithm, The private key of client u for authentication encryption. b represents the public key of client m for authentication encryption. u,m Represents the first mask seed b of client m m The first masked seed slice shared with client u, Represents the private key of client m The private key slice shared with client u, || represents the concatenation of strings, χ u,m represents the ciphertext corresponding to client m and client u that shares secrets with client m, and u′ represents the ciphertext χ u,m The decryption number corresponding to the client u is obtained after decryption, and m′ represents the decryption of the ciphertext χ u,m The decryption number corresponding to the client u obtained after decryption; Determine whether the equation u=u′∧m=m′ is equal. If they are equal, the decryption is successful.
9. The privacy-preserving and communication-efficient image recognition method based on ranked federated learning according to claim 1, wherein: In step S8, the method for obtaining the shared key corresponding to any client m is: in, represents the private key of client m for mask generation, SS.Recon represents the secret reconstruction algorithm, Represents the private key of client m The private key slice shared with client u, U4 is the set of surviving clients still online in the current step, t is the secret sharing threshold, b u,m Represents the first mask seed b of client m m The first masked seed slice shared with client u; Calculate the corresponding shared key: Among them, q m,u The shared key negotiated between client m and client u. KA.Agree represents the negotiated shared key algorithm. Indicates the public key of client u used for mask generation.
10. The privacy-preserving and communication-efficient image recognition method based on ranked federated learning according to claim 1, wherein: In step S9, the cloud server performs voting aggregation in the following manner: where, v total is the new aggregated vote count, U3 is the set of surviving clients still online after step S6, U2 is the set of surviving clients still online after step S3, y m is the masked vote count corresponding to client m, q m,u is the shared key negotiated between client m and client u, PRG represents a pseudorandom number generator, b m is the first masked seed selected by client m, m ∈ U3, u ∈ U2\U3: m < u represents the clients with numbers less than m in the set of surviving clients U2 but not in the set of surviving clients U3, m ∈ U3, u ∈ U2\U3: m > u represents the clients with numbers greater than m in the set of surviving clients U2 but not in the set of surviving clients U3.
Citation Information
Patent Citations
Federal learning privacy protection method and system, medium, equipment and terminal
CN115883076A
Personalized privacy protection medical data aggregation method and system
CN118395472A