A Distributed Medical Data Privacy Protection Method Based on Homomorphic Encryption
By optimizing model updates through a distributed key generation mechanism and a gradient-parameter dual-momentum evolution mechanism, and combining this with a quality-quantity adaptive aggregation strategy, the problems of private key security and data quality in federated learning are solved, thereby improving the privacy protection and performance of medical data models.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-28
- Publication Date
- 2026-04-03
AI Technical Summary
Existing federated learning schemes based on homomorphic encryption face security risks in medical applications, such as centralized storage of private keys, insufficient quality of medical data affecting model performance, and neglect of data quality during aggregation, resulting in insufficient privacy protection and model performance.
A distributed key generation mechanism is adopted to ensure private key security. A gradient-parameter dual momentum evolution mechanism is combined to optimize the model update direction. A quality-quantity adaptive aggregation strategy is designed to improve data quality assessment, enhance privacy protection and model performance.
This effectively avoids the security risks of centralized storage of private keys, improves the stability and accuracy of the model under non-independent and identically distributed data, enhances the robustness and generalization ability of the model, and ensures the privacy protection of medical data and system efficiency.
Smart Images

Figure CN121585340B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of information processing, specifically relating to a distributed medical data privacy protection method based on homomorphic encryption. Background Technology
[0002] In recent years, with the in-depth application of artificial intelligence and big data technologies in the healthcare field, training high-performance models using multi-source medical data has become an important means to improve disease diagnosis, treatment plan recommendations, and public health early warning capabilities. However, medical data is highly sensitive, involving patients' identity information, medical history, genetic data, and other private information, and its collection, storage, and use are strictly regulated by laws and regulations. At the same time, due to compliance requirements, commercial competition, or data sovereignty considerations, medical institutions are often unwilling to directly share raw data, resulting in a serious "data silo" phenomenon, which restricts the construction and development of cross-institutional intelligent medical models.
[0003] To address these challenges, federated learning, as an emerging distributed machine learning paradigm, has been widely adopted in the medical field. Federated learning allows multiple participants to collaboratively train a globally shared model without exchanging their local raw data, exchanging only model parameters (such as gradient or weight updates), thus achieving the privacy goal of "the model moves but the data doesn't" to some extent. However, research shows that even without transmitting raw data, model update information can still leak sensitive information through attacks such as gradient inversion and membership inference. Especially in medical scenarios, attackers can use limited auxiliary knowledge to reconstruct patient medical records or infer whether someone participated in the training, making the privacy risks significant.
[0004] To enhance privacy in federated learning, traditional methods typically combine differential privacy, secure multi-party computation, or homomorphic encryption for data anonymization, access control, and encrypted storage. Among these, homomorphic encryption has attracted significant attention due to its ability to perform addition and / or multiplication directly on ciphertext, particularly in horizontal federated learning. Participants can encrypt their local model updates and upload them to the aggregation server. The server then performs secure aggregation (such as weighted averaging in FedAvg) in ciphertext, obtaining the encrypted global model update without decryption, fundamentally preventing the leakage of intermediate results. Homomorphic encryption even supports computations of arbitrary complexity, providing a theoretical possibility for privacy-preserving training of high-precision medical models.
[0005] However, existing federated learning schemes based on homomorphic encryption still face many bottlenecks in medical applications: First, the private key for homomorphic encryption is usually generated by a trusted third party. If the third party is compromised, the security of the encryption will be compromised. Second, due to the special characteristics of medical data, such as missing values and noise interference, simple data model training often fails to fully explore the potential value of the data, thus affecting the final performance of the model. Third, existing federated learning methods often rely too much on the quantity of data during the aggregation process, while neglecting the importance of data quality.
[0006] Therefore, there is an urgent need to propose a new privacy protection architecture for the medical field that integrates federated learning and homomorphic encryption. This architecture should not only inherit the advantage of "data localization" of federated learning, but also achieve strong privacy protection in the model aggregation process through an efficient and secure homomorphic encryption mechanism. At the same time, it should take into account system efficiency, model utility and regulatory compliance, and provide reliable technical support for distributed medical intelligence. Summary of the Invention
[0007] To address the challenges of protecting medical data privacy, this invention proposes a distributed medical data privacy protection method based on homomorphic encryption. It ensures private key security by employing a distributed key generation mechanism and enhances the performance of the medical data model by combining data quality assessment and a gradient-parameter dual-momentum evolution mechanism. Specifically, in the key generation stage, this invention proposes a distributed key generation mechanism based on homomorphic encryption to ensure private key security, avoiding the security risks of centralized private key storage in traditional methods, and achieving distributed management of private keys, thereby enhancing the system's privacy protection and anti-attack capabilities. In the local model training stage, this invention proposes a gradient-parameter dual-momentum evolution mechanism based on homomorphic encryption. This mechanism optimizes the model update direction by introducing the momentum of gradients and model parameters during local training, significantly improving the model's robustness and stability, especially when facing non-independent and identically distributed data. In the global model aggregation stage, this invention proposes a quality-quantity adaptive aggregation strategy under homomorphic encryption conditions. This strategy considers not only the quantity of data but also the weighted evaluation of data quality, effectively suppressing the negative impact of low-quality data on the global model, thereby improving the accuracy and generalization ability of the global model. Finally, to verify the effectiveness of the present invention, experiments were conducted on a classification task based on medical data. The results show that the model using the method of the present invention achieves significant improvements in both privacy protection and performance, promoting the application of federated learning in the medical field.
[0008] The technical solution of the present invention is as follows:
[0009] A distributed medical data privacy protection method based on homomorphic encryption includes the following steps:
[0010] Step 1: Build a federated learning distributed framework consisting of multiple clients, an aggregation server, and a key management center, and initialize the CKKS homomorphic encryption environment;
[0011] Step 2: Obtain the original medical image dataset and select a control dataset, then perform preprocessing and localized segmentation;
[0012] Step 3: A distributed key generation mechanism based on homomorphic encryption is used to generate keys. The key management center generates the parameters required for the private key and distributes them to each client. Each client then randomly generates its own partial private key and uploads the generated private key to the key management center, which then generates the public key.
[0013] Step 4: The client uses the data locally to perform several rounds of model training. During the training process, the momentum coefficients of the gradient-parameter dual momentum evolution mechanism of the local model are calculated. Then, the client uses the CKKS homomorphic encryption public key to homomorphically encrypt the model parameters and uploads the encrypted model, data quantity, and gradient information to the aggregation server.
[0014] Step 5: After receiving the data quantity and gradient information from each client, the aggregation server performs aggregation calculations based on the quality-quantity adaptive aggregation strategy to complete the ciphertext aggregation and realize the ciphertext update of the global model.
[0015] Step 6: Distribute the updated global encryption model to each client and perform decryption and local update optimization;
[0016] Step 7: Repeat steps 4-6 until the preset number of training rounds or model performance convergence is reached.
[0017] Furthermore, in step 1, the Home medical institutions as One client, defined For the first One client, Each client holds its own local dataset, defining... For the first Local datasets held by each client, For the first The number of data points in the local dataset held by each client; a central cloud node is selected as the aggregation server, responsible for coordinating global rounds, collecting ciphertext, and completing CKKS homomorphic operations; the key management center is designated as an independent trusted third party, responsible for coordinating with each client to generate distributed public and private keys and establish a CKKS encryption parameter environment;
[0018] The process of initializing the CKKS homomorphic encryption environment is as follows: allocate a total number of local training rounds to each client. At the same time, set the global total number of rounds. Set the degree of the cyclic polynomial. Total bits of the ciphertext modulus chain Complete the initialization of the homomorphic encryption environment; set a security parameter for the homomorphic encryption environment based on the security level of the data. .
[0019] Furthermore, the specific process of step 2 is as follows:
[0020] Step 2.1: Divide the original medical image dataset into training and test sets proportionally and perform uniform preprocessing: First, randomly crop and randomly flip the images in the training set; then convert the images into tensors and standardize them according to ImageNet statistics. ImageNet is a public benchmark dataset whose statistics include mean and standard deviation; for the images in the test set, only center cropping, tensorization, and standardization are performed.
[0021] Step 2.2: Divide the control dataset into training and test sets in the same proportion and perform uniform preprocessing: convert the single-channel images in the control dataset directly into tensors and perform Z-score standardization based on the mean and standard deviation; randomly flip the training set horizontally, and perform only tensor quantization and standardization on the test set.
[0022] Step 2.3: Combine the original medical image dataset and the control dataset according to the number of clients. Divided into non-overlapping groups Each subset corresponds only to the local storage of the current medical institution, and no original image or tag leaves the local node.
[0023] Furthermore, the specific process of step 3 is as follows:
[0024] Step 3.1: The key management center selects a modulus. :
[0025] ;
[0026] in, Indicates the first One prime factor; The number of prime factors;
[0027] Step 3.2: The key management center constructs a polynomial ring. :
[0028] ;
[0029] in, It is a polynomial ring over integers; As a variable; for Polynomial of degree 1;
[0030] Step 3.3: Obtain the global private key and global public key based on the polynomial ring;
[0031] The process of generating the global private key is as follows:
[0032] Each client randomly generates a unique identifier locally. The polynomial on the given surface is used as a partial private key. The partial private keys of each client are summed to obtain the global private key. :
[0033] ;
[0034] ;
[0035] in, For the first Client Part of the private key; For the first A client randomly generates a local attribute belonging to polynomials over;
[0036] The process of generating a global public key is as follows:
[0037] Each client generates the first part of the public key polynomial and the error polynomial according to the public key generation algorithm:
[0038] ;
[0039] ;
[0040] in, , The first The first part of the public key polynomial and error polynomial generated by each client;
[0041] The client computes its own second part of the public key polynomial:
[0042] ;
[0043] in, , The first The second part of the public key polynomial and the global private key generated by the client;
[0044] Each client will generate two partial public key polynomials. Uploaded to the key management center for aggregation, two global sub-public keys are calculated:
[0045] ;
[0046] ;
[0047] in, , These are the first and second global sub-public keys, respectively.
[0048] Final global public key for:
[0049] .
[0050] Furthermore, the specific process of step 4 is as follows:
[0051] Step 4.1: Initialize the global model and distribute it to each client as the local model during global training. Define the loss function for local training and calculate the gradient of the local model.
[0052] Step 4.2: Define the momentum coefficient and update the compensation factor in the loss function in combination with the gradient of the local model to achieve the adjustment and optimization of the local model;
[0053] Step 4.3: The client uses the global public key issued by the key management center to encrypt the global model parameters and generate ciphertext;
[0054] Step 4.4: After completing local training and encryption, each client uploads its encrypted model parameters to the aggregation server; at the same time, the client synchronously uploads its corresponding local data quantity and gradient information calculated during training.
[0055] Furthermore, the specific process of step 4.1 is as follows:
[0056] Step 4.1.1: Set up the global model and define the global training... The global model of the wheel is and order , This represents the epoch number of the global training; next, the global model is distributed to each client as the local model during global training, defining the epoch number. Client Global training The local model of the wheel is Once the client receives the global model, it performs local training using its own private data. During local training, the client uses a loss function to optimize the model parameters. The specific calculation formula is as follows:
[0057] ;
[0058] in, It is a hyperparameter; and This is a variable representing the index of the model parameter; It is a constant representing the number of model parameters; , They represent the first Client Local training Wheel, First The local model of the wheel; It is a compensation factor used to dynamically correct the differences between the client and the global model and to correct the direction of parameter updates; Represents the L2 norm;
[0059] Step 4.1.2: After training is complete, calculate the gradient of the local model:
[0060] ;
[0061] in, Indicates the first Client In the global training The gradient of the local model; , They represent the first Client In the Round, in the The model obtained by local iterative training during a round of global training; Represents natural parameters.
[0062] Furthermore, the specific process of step 4.2 is as follows:
[0063] Step 4.2.1: Measure the difference between the two rounds of modeling based on the cosine similarity of the gradients of the two models:
[0064] ;
[0065] in, The cosine similarity between gradient vectors in two adjacent training rounds; , The first Client In the global training Wheel, First The gradient of the local model; Represents the dot product of vectors;
[0066] Step 4.2.2: Use cosine similarity to determine the momentum coefficients of the gradient-parameter dual momentum evolution momentum mechanism. :
[0067] ;
[0068] in, and These are the scaling and translation coefficients, respectively;
[0069] Step 4.2.3, for Apply constraints:
[0070] ;
[0071] in, and These are the lower and upper bounds of the momentum coefficient, respectively.
[0072] Step 4.2.4, based on Update the compensation factor:
[0073] ;
[0074] in, , They represent the first Client In the Wheel, First Compensation factors during the global training process; The function is used to restrict each element in a tensor to a specified range; parameters Used for control The update range; For the first Client Local training The gradient of the local model; , The first Client Global training Wheel, First The local model of the wheel;
[0075] In step 4.3, the generation of ciphertext is defined. The calculation process is as follows:
[0076] ;
[0077] in, , These are the first and second parts of the ciphertext, respectively. , These are the first part and the second part of the public key polynomial, respectively. It is a random polynomial; It is a noise term used for encryption; It is a disturbance term; It is a plaintext message to be encrypted.
[0078] Furthermore, the specific process of step 5 is as follows:
[0079] Step 5.1: In this round of training, the gradient of the global model needs to be calculated first.
[0080] ;
[0081] in, Indicates the global training of the first The gradient of the global model; For the first Client The local dataset held; Indicates the first Client In the global training The gradient of the local model;
[0082] Step 5.2: Calculate the quality score of each client and filter the clients based on the threshold filtering mechanism; after obtaining the gradient of the global model, evaluate the quality of each client from two dimensions: cosine similarity and normalized value.
[0083] Step 5.3: After obtaining the quality scores of each client, further combine the amount of data in the local dataset held by each client to collaboratively determine the final weight of each client in the global aggregation:
[0084] ;
[0085] in, For the first Client The weight it occupies; This indicates the ratio between the quality score and the number of data points. Indicates the first Client Mass fraction after filtration;
[0086] Normalize the weights:
[0087] ;
[0088] in, Indicates to The result obtained after normalization; For the first Client The weight it occupies; This represents the number of clients that participated in the aggregation after filtering.
[0089] Step 5.4: Perform weighted aggregation of the encrypted parameters uploaded by each client:
[0090] ;
[0091] in, For global training A global model of wheels; For the first Client Global training The local model of the wheel; For global training Wheels The result obtained after normalization.
[0092] Furthermore, the specific process of step 5.2 is as follows:
[0093] Step 5.2.1: Calculate the cosine similarity between the gradient of the client's local model and the gradient of the global model:
[0094] ;
[0095] in, For the first Client Cosine similarity between the gradients of the local model and the gradients of the global model; For the first Client In the global training The gradient of the local model;
[0096] Step 5.2.2: Normalize the gradient of the client's local model:
[0097] ;
[0098] in, For the first Client The gradient normalized value of the local model; For global training The maximum norm among the gradients of all client-side local models;
[0099] Step 5.2.3: Calculate the client's quality score:
[0100] ;
[0101] in, Indicates the global training of the first Wheel of Life Client mass fraction; parameters These are the weighting coefficients;
[0102] Step 5.2.4: Design a threshold-based client filtering mechanism: If the quality score of the current client is lower than a preset threshold, the client will be removed from the current aggregation process; the mathematical description is as follows:
[0103] ;
[0104] in, Indicates the first Client Mass fraction after filtration; The preset threshold; For the Sigmoid function; These are positive real number control parameters.
[0105] Furthermore, the specific process of step 6 is as follows: First, the key management center securely distributes the global private key to all clients; the clients use the private key to participate in decryption and recovery of the global model, and combine it with the local gradient-parameter dual momentum mechanism to further correct the direction of model parameter updates, thereby achieving local update optimization; the local gradient-parameter dual momentum mechanism utilizes a compensation factor. Dynamically correct the differences between the client and the global model, and adjust the direction of parameter updates.
[0106] The beneficial technical effects brought about by this invention are as follows.
[0107] 1. By constructing a distributed key generation mechanism based on homomorphic encryption, this invention effectively avoids the security risks of centralized private key storage in traditional methods. This mechanism ensures distributed management of private keys, enhances the system's resistance to attacks, and improves the security of data privacy protection, thereby effectively reducing the potential risk of data privacy leakage.
[0108] 2. By designing a gradient-parameter dual-momentum evolution mechanism based on homomorphic encryption, this invention optimizes the model's update direction during local training, enhancing the model's stability and convergence speed under non-independent and identically distributed (Non-IID) data. This mechanism effectively suppresses the risk of overfitting, improves the model's robustness, and ensures long-term stable performance of the model in medical data scenarios.
[0109] 3. By employing a quality-quantity adaptive aggregation strategy under homomorphic encryption, this invention fully considers the impact of data quality and quantity during federated learning, ensuring that the negative impact of low-quality data on the global model is minimized. This strategy significantly improves the model's accuracy and generalization ability, especially when processing medical data, effectively addressing the problem of large differences in data quality and enhancing the overall performance and robustness of the model. Attached Figure Description
[0110] Figure 1 This is a flowchart of the distributed medical data privacy protection method based on homomorphic encryption according to the present invention.
[0111] Figure 2 This is a comparison chart showing the changes in loss between the method of this invention and the baseline method on the original chest X-ray image dataset.
[0112] Figure 3 This is a comparison chart showing the accuracy changes of the method of this invention and the baseline method on the raw image dataset of chest X-rays.
[0113] Figure 4 This is a comparison chart showing the change in accuracy between the method of this invention and the baseline method on the raw image dataset of chest X-rays.
[0114] Figure 5 This is a comparison chart showing the changes in recall rates between the method of this invention and the baseline method on the raw image dataset of chest X-rays.
[0115] Figure 6 This is a comparison chart showing the changes in F1 scores between the method of this invention and the baseline method on the raw image dataset of chest X-rays.
[0116] Figure 7 This is a comparison chart showing the changes in loss between the method of this invention and the baseline method on the MNIST dataset.
[0117] Figure 8 This is a comparison chart showing the changes in accuracy between the method of this invention and the baseline method on the MNIST dataset.
[0118] Figure 9 This is a comparison chart showing the changes in accuracy between the method of this invention and the baseline method on the MNIST dataset.
[0119] Figure 10 This is a comparison chart showing the changes in recall rates between the method of this invention and the baseline method on the MNIST dataset.
[0120] Figure 11 This is a comparison chart showing the changes in F1 scores between the method of this invention and the baseline method on the MNIST dataset. Detailed Implementation
[0121] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0122] CKKS is an approximately homomorphic and probabilistic asymmetric encryption scheme whose security is built upon the Ring-LWE lattice-hard problem. This scheme supports simultaneous addition and scalar multiplication of real-valued vectors in the ciphertext domain. With its unique advantage of "computable ciphertext, undisclosed floating-point plaintext," CKKS has become the preferred encryption method for achieving "data immobility, model mobility" in federated learning and distributed medical collaboration. This invention ensures the confidentiality of sensitive medical data throughout the entire process by encrypting high-dimensional model parameters, while simultaneously enabling efficient aggregation and iteration to generate a high-precision global model.
[0123] like Figure 1 As shown, a distributed medical data privacy protection method based on homomorphic encryption specifically includes the following steps:
[0124] Step 1: Build a federated learning distributed framework and initialize the CKKS homomorphic encryption environment.
[0125] The federated learning distributed framework built in this invention is a federated system consisting of multiple clients, an aggregation server, and a key management center (KMC);
[0126] Will Home medical institutions as One client, defined For the first One client, Each client holds its own local dataset, defining... For the first Local datasets held by each client, For the first The data size is determined by the number of local datasets held by each client; a central cloud node is selected as the aggregation server to coordinate global rounds, collect ciphertext, and perform CKKS homomorphic operations; the key management center acts as an independent, trusted third party, responsible for collaborating with clients to generate distributed public and private keys and establishing a CKKS encryption parameter environment, providing a secure foundation for subsequent model encryption and ciphertext computation. During this process, the key management center does not directly hold the complete private key, but instead guides each client to generate its own partial private and public keys. Subsequently, when the federated system needs to perform decryption, the key management center securely aggregates the partial private keys from each client to restore global decryption capabilities.
[0127] The process of initializing the homomorphic encryption environment is as follows: allocate a total number of local training rounds to each client. At the same time, set the global total number of rounds. Set the degree of the cyclic polynomial. Total bits of the ciphertext modulus chain Complete the initialization of the homomorphic encryption environment. Set a security parameter for the homomorphic encryption environment based on the data security requirements. .
[0128] In this embodiment, to maximize model performance while ensuring privacy, the CKKS homomorphic encryption parameters are set as follows: The required security parameters of the encryption system are selected based on the data security requirements. Safety parameters Used to ensure the strength of encryption algorithms. Generally speaking, The larger the value, the higher the security of the encryption system, but the computational complexity also increases. This value is closely related to the selected security level, with common choices being 128-bit or 256-bit. A 128-bit security level is generally sufficient to resist attacks using existing technologies. However, for medically sensitive data, this invention chooses to use the higher 256-bit security level. The set ring polynomial degree... Total bits of the ciphertext modulo chain It reserves two levels of multiplication depth to cover all homomorphic operations required by the quality-quantity adaptive aggregation strategy.
[0129] Step 2: First, obtain the original medical image dataset and select a control dataset to verify the generalization ability of the medical data model. Next, preprocess and localize the data to prepare for subsequent model training. Preprocessing steps include standardization, cropping, and data augmentation; during localization, data is allocated according to the client to ensure that the original medical data is always stored locally to avoid data leakage. The specific process is as follows:
[0130] Step 2.1: In this embodiment, the raw chest X-ray image dataset is obtained as the raw medical image dataset. This raw medical image dataset serves as the core data source for both training and testing, simulating the distribution of private data from multiple medical institutions in a federated learning scenario. It is then divided into training and testing sets in an 8:2 ratio. The raw medical image dataset undergoes unified preprocessing.
[0131] The images in the training set are first randomly cropped (256×256 pixels, padded with 32 pixels at the edges) and randomly horizontally flipped (probability 0.5) to enhance the model's robustness to differences in shooting angles. Then, the images are converted into tensors and standardized according to ImageNet statistics (mean 0.485, 0.456, 0.406, standard deviation 0.229, 0.224, 0.225). ImageNet is a publicly available benchmark dataset, and its statistics include mean and standard deviation. ImageNet is a color image dataset, with each image having RGB three channels. Therefore, when calculating the statistics for the entire dataset, three means and three standard deviations are selected to calculate the R, G, and B channels respectively.
[0132] The images in the test set are only cropped at the center, tensorized, and standardized to ensure that the metrics on the test set are stable and free from random fluctuations, thus truly reflecting the model performance.
[0133] Step 2.2: In addition to using the original chest X-ray image dataset, the MNIST dataset (the MNIST dataset is a classic handwritten digit recognition dataset released publicly by the National Institute of Standards and Technology, containing various handwritten digit images) is introduced as a control dataset to verify the generalization ability of the proposed federated learning distributed architecture in cross-domain and cross-modal scenarios. Similarly, the MNIST dataset is divided into training and test sets in an 8:2 ratio.
[0134] The MNIST dataset was preprocessed as follows: 28×28 single-channel images were directly converted to tensors and Z-score normalized according to official statistics (mean 0.1307, standard deviation 0.3081). The training set was randomly horizontally flipped (probability 0.5) for slight augmentation, while the test set only underwent tensor quantization and normalization to ensure consistency with the processing logic of the original chest X-ray image dataset. The Z-score normalization formula is as follows:
[0135] ;
[0136] in, These are the original feature values after standardization. It is the original feature value of each image pixel in the dataset; It is the mean of all pixel values in the dataset; It is the standard deviation of all pixel values in the dataset.
[0137] Step 2.3: Combine the original medical image dataset and the control dataset according to the number of clients. Divided into non-overlapping groups Each subset corresponds only to the local storage of the current medical institution, and no original image or tag leaves the local node, thereby ensuring the security of medical data.
[0138] Step 3: In the key generation stage, this invention employs a distributed key generation mechanism based on homomorphic encryption. The key management center generates the parameters required for the private key and distributes them to each client. Each client then randomly generates its own partial private key and uploads it to the key management center, which then generates the public key. The specific process is as follows:
[0139] Step 3.1: The key management center selects a modulus. The modulus is a large prime number used for modulo operations in all encryption operations. (Selected) Greater than the degree of the cyclic polynomial And it needs to be chosen to be large enough to ensure encryption security. To improve key security and increase computational complexity, It is decomposed into a series of prime factors. This factorization structure enhances the security of the encryption process. Specifically, The generation process is as follows:
[0140] ;
[0141] in, Indicates the first Prime factors, ; The number of prime factors. It represents multiplication.
[0142] Step 3.2: The key management center constructs a polynomial ring. This polynomial ring is a core component for generating public and private keys, and its mathematical structure plays a crucial role in the encryption process. The formula is as follows:
[0143] ;
[0144] in, It is a polynomial ring over integers; As a variable; for Polynomial of degree 1;
[0145] Step 3.3: Use the polynomial ring generated above to generate a key and distribute it to each client to generate partial private and public keys for each client, thereby obtaining the global private and public keys. The specific process is as follows:
[0146] Step 3.3.1: The private key plays a crucial role in the ciphertext decryption process and is the core of the decryption operation. The global private key generation process is as follows:
[0147] Step 3.3.1.1: To ensure the security of the private key, this invention uses a distributed key generation mechanism, where each client randomly generates a private key locally. A polynomial on the polynomial is used as a partial private key:
[0148] ;
[0149] in, For the first Client Part of the private key; For the first A client randomly generates a local attribute belonging to A polynomial on the polynomial ring, wherein each coefficient of the polynomial is derived from the polynomial ring. Random sampling in the middle, and in the modulus In this context, the coefficients in the polynomial take the values of random integers. All clients' partial private keys are not uploaded or centrally stored within the framework to ensure the decentralized and unrecoverable nature of private key information.
[0150] Step 3.3.1.2: The global private key is represented as the sum of the partial private keys of each client:
[0151] ;
[0152] in, This is the global private key;
[0153] Step 3.3.2: Generating the global public key requires two partial public key polynomials and one error polynomial. The error term is used to ensure security during the encryption process. The global public key generation process is as follows:
[0154] Step 3.3.2.1: Each client generates the first part of the public key polynomial and the error polynomial according to the public key generation algorithm:
[0155] ;
[0156] ;
[0157] in, For the first The first part of the public key polynomial generated by the client. The coefficients in the polynomial ring are all derived from the polynomial ring. Random sampling in the middle; For the first The error polynomial generated by each client follows a low-noise distribution, used to enhance the system's randomness and security. The coefficients in the polynomial ring are all derived from the polynomial ring. Random sampling.
[0158] Step 3.3.2.2: After generating the first part of the public key polynomial and the error polynomial, the client calculates its own second part of the public key polynomial:
[0159] ;
[0160] in, For the first The second part of the public key polynomial generated by the client; For the first A global private key generated by a client;
[0161] Step 3.3.2.3: Each client generates two partial public key polynomials. Uploaded to the key management center for aggregation, the key management center calculates two global sub-public keys without knowing any private key information:
[0162] ;
[0163] ;
[0164] in, This is the first global sub-public key; This is the second global sub-public key;
[0165] Step 3.3.2.4: The final global public key It consists of two global sub-public keys:
[0166] ;
[0167] This completes the process of generating the distributed public-private key pair. This method ensures the correctness of CKKS encryption while avoiding the security risks associated with centralized private key storage, preventing any single node from independently recovering the global private key, thus significantly improving the system's privacy protection and attack resistance. The generated global public key is then distributed to clients to encrypt their own model data.
[0168] Step 4: This invention proposes a gradient-parameter dual-momentum evolution mechanism based on homomorphic encryption. The client performs several rounds of model training locally using data. During training, the momentum coefficients of the local model's gradient-parameter dual-momentum evolution mechanism are calculated. Next, the client uses the CKKS homomorphic encryption public key to homomorphically encrypt the model parameters and uploads the encrypted model, data quantity, and gradient information to the aggregation server. The specific model selected in this embodiment is the deep residual network ResNet-18; the specific process is as follows:
[0169] Step 4.1: Initialize the global model and distribute it to each client as a local model for global training. Define the loss function for local training and calculate the gradient of the local model. The specific process is as follows:
[0170] Step 4.1.1: Set up the global model and define the global training... The global model of the wheel is and order , This represents the epoch number of the global training. Then, the global model is distributed to each client as a local model during global training, defining the epoch number... Client Global training The local model of the wheel is Once the client receives the global model, it performs local training using its own private data. During local training, the client employs a specific loss function to optimize the model parameters. This function combines the L2 regularization loss for model parameter updates with the negative of the dot product of the parameters and specific coefficients to enhance the stability of the model parameters. Loss Function The specific calculation formula is as follows:
[0171] ;
[0172] in, It is a hyperparameter used to control the effect of the regularization term; and This is a variable representing the index of the model parameter; It is a constant representing the number of model parameters; , They represent the first Client Local training Wheel, First The local model of the wheel; let , indicating the local training round number; It is a compensation factor used to dynamically correct the difference between the client and the global model; in this case, it can be understood as correcting the direction of parameter updates. This represents the L2 norm, used to measure the magnitude of parameter variation. In this way, the loss function not only penalizes drastic changes in parameters but also further adjusts the model's learning process through the dot product of parameters and coefficients, thereby improving the model's generalization ability and stability.
[0173] Step 4.1.2: After training is complete, calculate the gradient of the local model. The calculation process is as follows:
[0174] ;
[0175] in, Indicates the first Client In the global training The gradient of the local model; , They represent the first Client In the Round, in the The model obtained by local iterative training during a round of global training; Represents natural parameters.
[0176] Step 4.2: Define the momentum coefficient and update the compensation factor in the loss function based on the gradient of the local model to achieve adjustment and optimization of the local model. After local training is completed, this invention uses cosine similarity as an indicator to... Updates are performed to more effectively constrain local model parameters during optimization, thereby reducing their deviation from the global model and further improving the robustness of the federated model. The specific process is as follows:
[0177] Step 4.2.1: To more accurately measure the difference between the two models, this invention introduces cosine similarity based on the gradients of the two models as a discriminant. The calculation process is as follows:
[0178] ;
[0179] in, The cosine similarity between gradient vectors in two adjacent training rounds; , The first Client In the global training Wheel, First The gradient of the local model; This represents the dot product of vectors.
[0180] Step 4.2.2: After calculating the cosine similarity index, use this index to determine the momentum coefficients of the gradient-parameter dual momentum evolution momentum mechanism. Its definition is as follows:
[0181] ;
[0182] in, and These are the scaling and translation coefficients, used to control the range of change of the momentum coefficient.
[0183] Step 4.2.3: To ensure the stability of the momentum coefficient value, this invention further refines the momentum coefficient... Apply constraints:
[0184] ;
[0185] in, and These are the lower and upper bounds of the momentum coefficient, respectively, used to prevent the momentum coefficient from being too small, which would lead to slow convergence, or too large, which would cause training instability.
[0186] With this design, if the gradient directions of the local models are highly consistent (i.e., the cosine similarity is close to 1), then A relatively large value accelerates model convergence; conversely, a small value leads to significant differences in the gradient directions of the local models. It will be suppressed to enhance the robustness of the model.
[0187] Step 4.2.4: Update the compensation factor based on the momentum coefficient to complete the adjustment and optimization of the local model in this round. The update process is as follows:
[0188] ;
[0189] in, , They represent the first Client In the Wheel, First Compensation factors during the global training process. The function is used to restrict each element in a tensor to a specified range; parameters Used for control The update range; For the first Client Local training The gradient of the local model; , The first Client Global training Wheel, First The local model of the wheel.
[0190] Step 4.3: The client uses the global public key issued by the key management center. Encrypt the global model parameters to generate ciphertext. To ensure the privacy and security of medical data, the encryption process is as follows:
[0191] ;
[0192] in, This is the first part of the ciphertext; This is the second part of the ciphertext; It is a random polynomial; It is a noise term used for encryption; It is a disturbance term; It is a plaintext message to be encrypted.
[0193] Step 4.4: After completing local training and encryption, each client uploads its encrypted model parameters to the aggregation server. Simultaneously, the client also uploads the corresponding amount of local data and the gradient information calculated during training.
[0194] Step 5: The aggregation server receives the data quantity and gradient information from each client. During the aggregation phase, this invention uses a quality-quantity adaptive aggregation strategy under homomorphic encryption to perform aggregation calculations and complete ciphertext aggregation, thereby updating the ciphertext of the global model. This process not only ensures the statistical fairness of the aggregation results but also improves the convergence and robustness of the global model. The aggregation server calculates quality scores based on the data quantity, gradient direction consistency, and gradient magnitude of each client, filtering out low-quality clients; it then performs weighted aggregation on the encrypted model based on the additivity of homomorphic encryption, completing the ciphertext update of the global model. Specifically, it first analyzes and evaluates the weights of each client's data quantity and quality in the global model aggregation. This process significantly improves the effectiveness and final performance of the model aggregation. Subsequently, based on the calculated weights and combined with the additivity of homomorphic encryption, it performs weighted aggregation on the encryption parameters from different clients, thereby generating the updated global model. The specific implementation steps are as follows:
[0195] Step 5.1: In this round of training, the gradient of the global model is calculated first. Calculating the gradient of the global model depends on the global model parameters in the current round. However, since aggregation is not yet complete and the global model has not been generated, this invention proposes a global gradient approximation reconstruction scheme to approximately obtain the gradient of the global model in the absence of global model parameters. The specific calculation process is as follows:
[0196] ;
[0197] in, Indicates the global training of the first The gradient of the global model; For the first Client The local dataset held; For the first Client The amount of data in the local dataset held; Indicates the first Client In the global training The gradient of the local model;
[0198] Step 5.2: Calculate the quality score for each client. This invention designs a threshold-based filtering mechanism to filter clients. After obtaining the gradient of the global model, this invention evaluates the quality of each client from two dimensions: cosine similarity and normalized value. The specific process is as follows:
[0199] Step 5.2.1: Calculate the cosine similarity between the gradient of the client's local model and the gradient of the global model to measure the consistency between their gradient directions and the global optimization direction. The formula is as follows:
[0200] ;
[0201] in, For the first Client Cosine similarity between the gradients of the local model and the gradients of the global model; For the first Client In the global training The gradient of the local model.
[0202] Step 5.2.2: Normalize the gradients of the client's local model and quantify the gradient contribution based on their magnitude. The gradient normalization formula is as follows:
[0203] ;
[0204] in, For the first Client The gradient normalized value of the local model; For global training The maximum norm among the gradients of all client-side local models; The overall value represents the magnitude.
[0205] Step 5.2.3: Calculate the client's quality score using the following formula:
[0206] ;
[0207] in, Indicates the global training of the first Wheel of Life Client mass fraction; parameters , which is a weighting coefficient used to balance cosine similarity and gradient normalization magnitude, thereby ensuring the rationality and robustness of the scoring results.
[0208] Step 5.2.4: To increase the contribution of high-quality clients during the aggregation process and reduce the adverse impact of low-quality clients on the global model, this invention designs a threshold-based client filtering mechanism. Specifically, if the quality score of a current client is lower than a preset threshold, the client will be removed from the current aggregation process. Its mathematical description is as follows:
[0209] ;
[0210] in, Indicates the first Client Mass fraction after filtration; The preset threshold; For the Sigmoid function; This is a positive real number control parameter used to control the client's quality score relative to a preset threshold. The filtration intensity at that time is such that when the mass fraction is below a preset threshold, its polymerization contribution is continuously suppressed.
[0211] Step 5.3: After obtaining the quality scores of each client, the final weight of each client in the global aggregation is determined collaboratively by considering the amount of data in the local dataset held by each client. This weight reflects both the data scale and the data quality, thus ensuring the fairness and effectiveness of the aggregation. The calculation process is as follows:
[0212] ;
[0213] in, For the first Client The weight it occupies; This indicates the ratio between the quality score and the number of data points.
[0214] The weights are normalized using the following formula:
[0215] ;
[0216] in, Indicates to The result obtained after normalization; For the first Client The weight it occupies; This represents the number of clients that participate in the aggregation after filtering.
[0217] Step 5.4: Utilize the additivity characteristic of homomorphic encryption to perform weighted aggregation of the encrypted parameters uploaded by each client. This invention can complete the global model update without decryption, thus protecting data privacy while ensuring the security and scalability of the aggregation process. The aggregation process is as follows:
[0218] ;
[0219] in, For global training A global model of wheels; This is a variable representing the index of the model parameter; For the first Client Global training The local model of the wheel; For global training Wheels The result obtained after normalization.
[0220] Step 6: Distribute the updated encrypted global model to each client and perform decryption and local update optimization. First, the key management center securely distributes the global private key to all clients. Clients use the private key to decrypt and recover the global model, and further correct the direction of model parameter updates using a local gradient-parameter dual-momentum evolution mechanism, achieving personalized direction-enhanced local update optimization. The local gradient-parameter dual-momentum evolution mechanism utilizes a compensation factor... Dynamically correct the differences between the client and the global model, and adjust the direction of parameter updates.
[0221] Step 7: Repeat the iterative process of model distribution, encrypted training, and encrypted aggregation from Steps 4 to 6. The aggregation server continuously distributes the global model, and each client repeatedly performs local training, homomorphic encrypted upload, and aggregation on the aggregation server until the preset training rounds are reached or the model performance converges.
[0222] After the aggregation server distributes the new global model to each client, the client updates and trains the model according to step 4 based on its local data, generating a new local model, and feeds the new local model back to the aggregation server. The aggregation server then aggregates the models again according to step 5. This process iterates several times until a preset convergence condition is met, at which point training terminates. The convergence condition is: reaching the maximum number of training rounds. Or the model converges. After the final round of training, the key management center securely distributes the global private key to all honest clients. Each client uses the global private key to decrypt the received encrypted global model parameters, thereby obtaining the plaintext model parameters. They then independently evaluate the model's performance on their local test set, calculating various evaluation metrics to verify the model's accuracy and generalization ability. This process ensures that, while protecting data privacy, the model can be effectively evaluated on local data, while also guaranteeing the security and reliability of the entire federated learning process.
[0223] To demonstrate the theoretical feasibility and rationality of this invention, the following proof and analysis are provided.
[0224] (1) The present invention effectively guarantees the privacy and security of data.
[0225] Analysis: In this invention, homomorphic encryption (CKKS) technology is used to protect medical data. Specifically, after each medical institution completes model training locally, it encrypts its model parameters using the public key distributed by the key management center, ensuring that sensitive information remains in ciphertext throughout the entire transmission and processing process. Subsequently, the aggregation server calculates the data quality score of each institution based on the ciphertext without decryption, and combines it with sample size weights to aggregate and update the model parameters in the ciphertext domain. Thanks to the characteristics of homomorphic encryption, model parameters can directly perform addition and scalar multiplication operations in the encrypted state without decryption. This mechanism ensures that the original data and model parameters remain in ciphertext form throughout the entire federated learning process, effectively avoiding the risk of data leakage during transmission and processing. In terms of security, the CKKS homomorphic encryption scheme is based on the lattice-hard assumption of the Ring-LWE (Learning with Error) problem, providing theoretical protection for data privacy. Regarding irreversibility, even if an attacker intercepts the ciphertext, it is difficult to decrypt it and recover the original data within an acceptable timeframe using current computing power.
[0226] (2) The present invention improves the robustness and stability of the model.
[0227] Analysis: This invention proposes a gradient-parameter dual-momentum evolution mechanism based on homomorphic encryption and a quality-quantity adaptive aggregation strategy under homomorphic encryption conditions. It comprehensively optimizes the federated learning process from three dimensions: client gradient credibility, global consistency, and parameter evolution momentum. During the training phase, the invention further optimizes the aggregated model by introducing a gradient-parameter dual-momentum evolution mechanism. As can be seen from the loss function formula, this mechanism not only adaptively updates the current gradient but also considers the momentum information of historical parameters, thus forming a smooth update trajectory in the global optimization direction. This dual-momentum design effectively alleviates the model drift and convergence oscillation problems commonly found in traditional federated learning frameworks, improving the convergence speed and stability of the model in non-independent and identically distributed (Non-IID) data scenarios. In the aggregation phase, this invention fully considers the impact of client data quality and quantity on the global model, employing a weighted aggregation strategy to enhance the model's generalization ability. Specifically, during the aggregation process, based on the quantity and quality of client data, the contribution of each client parameter in the aggregation is collaboratively determined, thereby generating an updated global model. This process not only ensures the statistical fairness of the aggregation results but also significantly improves the convergence and robustness of the global model. By calculating the cosine similarity between the gradients of the client's local model and the global model, and combining this with gradient normalization, the quality of data from each client is comprehensively evaluated. This mechanism ensures that high-quality data has a higher weight in model training, thereby improving the model's generalization ability. After aggregation, a gradient-parameter dual-momentum evolution mechanism is introduced to dynamically adjust the direction of model parameter updates, effectively suppressing the risk of overfitting while accelerating the model's convergence speed and improving its stability. With the help of the weighted aggregation strategy and the gradient-parameter dual-momentum evolution mechanism, the medical data model exhibits stronger robustness in heterogeneous data scenarios, ensuring the model's stability and reliability under different data distributions.
[0228] To demonstrate the practical feasibility and superiority of this invention, the following comparative experiments are presented.
[0229] In this invention, experiments are conducted using raw chest X-ray image datasets and the MNIST dataset as examples. Both datasets are test sets after the preprocessing described in step 2. Multiple evaluation metrics are set to measure model performance, including accuracy, precision, recall, and F1 score, with the following formulas:
[0230] ;
[0231] ;
[0232] ;
[0233] ;
[0234] in, Indicates accuracy rate; Indicates accuracy rate; Recall rate is a key metric. express Score indicators; , , , These represent the number of true positives, true negatives, false positives, and false negatives during model training, respectively.
[0235] The baseline method used is the FedAvg aggregation method. FedAvg aggregation is the earliest open-source framework to incorporate federated learning concepts and has become one of the most classic baseline methods in the field of federated learning. The functional comparison results between the method of this invention and the baseline method are shown in Table 1.
[0236] Table 1. Functional Comparison of the Invention Method and the Baseline Method
[0237] .
[0238] In this experiment, the Adam optimizer was used with a learning rate of 0.001 and 100 iterations. All hyperparameters remained consistent throughout the training process. Experimental results show the changes in loss, accuracy, precision, recall, and F1 score for the two methods on the original chest X-ray image dataset, as illustrated in the following graphs. Figure 2 , Figure 3 , Figure 4 , Figure 5 and Figure 6 As shown in the figure. Furthermore, on the MNIST dataset, the comparison charts of the changes in loss, accuracy, precision, recall, and F1 score for the two methods are shown in the figure. Figure 7 , Figure 8 , Figure 9 , Figure 10 and Figure 11 As shown.
[0239] From Table 1 and Figures 2-11 Experimental results show that the proposed solution protects privacy while maintaining the same level of performance as the baseline method. This experiment demonstrates the practical feasibility and superiority of the proposed solution.
[0240] Of course, the above description is not intended to limit the present invention, and the present invention is not limited to the examples given above. Any changes, modifications, additions or substitutions made by those skilled in the art within the scope of the present invention should also fall within the protection scope of the present invention.
Claims
1. A distributed medical data privacy protection method based on homomorphic encryption, characterized in that, Includes the following steps: Step 1: Build a federated learning distributed framework consisting of multiple clients, an aggregation server, and a key management center, and initialize the CKKS homomorphic encryption environment; Step 2: Obtain the original medical image dataset and select a control dataset, then perform preprocessing and localized segmentation; Step 3: A distributed key generation mechanism based on homomorphic encryption is used to generate keys. The key management center generates the parameters required for the private key and distributes them to each client. Each client then randomly generates its own partial private key and uploads the generated private key to the key management center, which then generates the public key. Step 4: The client performs several rounds of model training locally using the data. During training, the momentum coefficients of the gradient-parameter dual momentum evolution mechanism of the local model are calculated. Then, the client uses the CKKS homomorphic encryption public key to homomorphically encrypt the model parameters and uploads the encrypted model, data quantity, and gradient information to the aggregation server. The specific process is as follows: Step 4.1: Initialize the global model and distribute it to each client as a local model for global training. Define the loss function for local training and calculate the gradient of the local model. The specific process is as follows: Step 4.1.1: Set up the global model and define the global training... The global model of the wheel is and order , This represents the epoch number of the global training; next, the global model is distributed to each client as the local model during global training, defining the epoch number. Client Global training The local model of the wheel is Once the client receives the global model, it performs local training using its own private data. During local training, the client uses a loss function to optimize the model parameters. The specific calculation formula is as follows: ; in, It is a hyperparameter; and This is a variable representing the index of the model parameter; It is a constant representing the number of model parameters; , They represent the first Client Local training Wheel, First The local model of the wheel; It is a compensation factor used to dynamically correct the differences between the client and the global model and to correct the direction of parameter updates; Represents the L2 norm; Step 4.1.2: After training is complete, calculate the gradient of the local model: ; in, Indicates the first Client In the global training The gradient of the local model; , They represent the first Client In the Round, in the The model obtained by local iterative training during a round of global training; Represents natural parameters; Step 4.2: Define the momentum coefficient and update the compensation factor in the loss function based on the gradient of the local model to achieve adjustment and optimization of the local model; the specific process is as follows: Step 4.2.1: Measure the difference between the two rounds of modeling based on the cosine similarity of the gradients of the two models: ; in, The cosine similarity between gradient vectors in two adjacent training rounds; , The first Client In the global training Wheel, First The gradient of the local model; Represents the dot product of vectors; Step 4.2.2: Use cosine similarity to determine the momentum coefficients of the gradient-parameter dual momentum evolution momentum mechanism. : ; in, and These are the scaling and translation coefficients, respectively. Step 4.2.3, for Apply constraints: ; in, and These are the lower and upper bounds of the momentum coefficient, respectively. Step 4.2.4, based on Update the compensation factor: ; in, , They represent the first Client In the Wheel, First Compensation factors during the global training process; The function is used to restrict each element in a tensor to a specified range; parameters Used for control The update range; For the first Client Local training The gradient of the local model; , The first Client Global training Wheel, First The local model of the wheel; Step 4.3: The client uses the global public key issued by the key management center to encrypt the global model parameters and generate ciphertext; In step 4.3, the generation of ciphertext is defined. The calculation process is as follows: ; in, , These are the first and second parts of the ciphertext, respectively. , These are the first part and the second part of the public key polynomial, respectively. It is a random polynomial; It is a noise term used for encryption; It is a disturbance term; It is a plaintext message to be encrypted; Step 4.4: After completing local training and encryption, each client uploads its encrypted model parameters to the aggregation server; at the same time, the client synchronously uploads its corresponding local data quantity and gradient information calculated during training. Step 5: After receiving the data quantity and gradient information from each client, the aggregation server performs aggregation calculations based on the quality-quantity adaptive aggregation strategy to complete the ciphertext aggregation and realize the ciphertext update of the global model. Step 6: Distribute the updated global encryption model to each client and perform decryption and local update optimization; Step 7: Repeat steps 4-6 until the preset number of training rounds is reached or the model performance converges.
2. The distributed medical data privacy protection method based on homomorphic encryption according to claim 1, characterized in that, In step 1, Home medical institutions as One client, defined For the first One client, Each client holds its own local dataset, defining... For the first Local datasets held by each client, For the first The number of data points in the local dataset held by each client; a central cloud node is selected as the aggregation server, responsible for coordinating global rounds, collecting ciphertext, and completing CKKS homomorphic operations; the key management center is designated as an independent trusted third party, responsible for coordinating with each client to generate distributed public and private keys and establish a CKKS encryption parameter environment; The process of initializing the CKKS homomorphic encryption environment is as follows: allocate a total number of local training rounds to each client. At the same time, set the global total number of rounds. ; Determine the degree of the cyclic polynomial Total bits of the ciphertext modulus chain Complete the initialization of the homomorphic encryption environment; set a security parameter for the homomorphic encryption environment based on the security level of the data. .
3. The distributed medical data privacy protection method based on homomorphic encryption according to claim 1, characterized in that, The specific process of step 2 is as follows: Step 2.1: Divide the original medical image dataset into training and test sets proportionally and perform uniform preprocessing: First, randomly crop and randomly flip the images in the training set; then convert the images into tensors and standardize them according to ImageNet statistics. ImageNet is a public benchmark dataset whose statistics include mean and standard deviation; for the images in the test set, only center cropping, tensorization, and standardization are performed. Step 2.2: Divide the control dataset into training and test sets in the same proportion and perform uniform preprocessing: convert the single-channel images in the control dataset directly into tensors and perform Z-score standardization based on the mean and standard deviation; randomly flip the training set horizontally, and perform only tensor quantization and standardization on the test set. Step 2.3: Combine the original medical image dataset and the control dataset according to the number of clients. Divided into non-overlapping groups Each subset corresponds only to the local storage of the current medical institution, and no original image or tag leaves the local node.
4. The distributed medical data privacy protection method based on homomorphic encryption according to claim 1, characterized in that, The specific process of step 3 is as follows: Step 3.1: The key management center selects a modulus. : ; in, Indicates the first One prime factor; The number of prime factors; Step 3.2: The key management center constructs a polynomial ring. : ; in, It is a polynomial ring over integers; As a variable; for Polynomial of degree; Step 3.3: Obtain the global private key and global public key based on the polynomial ring; The process of generating the global private key is as follows: Each client randomly generates a unique identifier locally. The polynomial on the given surface is used as a partial private key. The partial private keys of each client are summed to obtain the global private key. : ; ; in, For the first Client Part of the private key; For the first A client randomly generates a local attribute belonging to polynomials over; The process of generating a global public key is as follows: Each client generates the first part of the public key polynomial and the error polynomial according to the public key generation algorithm: ; ; in, , The first The first part of the public key polynomial and error polynomial generated by each client; The client computes its own second part of the public key polynomial: ; in, , The first The second part of the public key polynomial and the global private key generated by the client; Each client will generate two partial public key polynomials. Uploaded to the key management center for aggregation, two global sub-public keys are calculated: ; ; in, , These are the first and second global sub-public keys, respectively. Final global public key for: 。 5. The distributed medical data privacy protection method based on homomorphic encryption according to claim 4, characterized in that, The specific process of step 5 is as follows: Step 5.1: In this round of training, the gradient of the global model needs to be calculated first. ; in, Indicates the global training of the first The gradient of the global model; For the first Client The local dataset held; Indicates the first Client In the global training The gradient of the local model; Step 5.2: Calculate the quality score of each client and filter the clients based on the threshold filtering mechanism; after obtaining the gradient of the global model, evaluate the quality of each client from two dimensions: cosine similarity and normalized value. Step 5.3: After obtaining the quality scores of each client, further combine the amount of data in the local dataset held by each client to collaboratively determine the final weight of each client in the global aggregation: ; in, For the first Client The weight it occupies; This indicates the ratio between the quality score and the number of data points. Indicates the first Client Mass fraction after filtration; Normalize the weights: ; in, Indicates to The result obtained after normalization; For the first Client The weight it occupies; This represents the number of clients that participated in the aggregation after filtering. Step 5.4: Perform weighted aggregation of the encrypted parameters uploaded by each client: ; in, For global training A global model of wheels; For the first Client Global training The local model of the wheel; For global training Wheels The result obtained after normalization.
6. The distributed medical data privacy protection method based on homomorphic encryption according to claim 5, characterized in that, The specific process of step 5.2 is as follows: Step 5.2.1: Calculate the cosine similarity between the gradient of the client's local model and the gradient of the global model: ; in, For the first Client Cosine similarity between the gradients of the local model and the gradients of the global model; For the first Client In the global training The gradient of the local model; Step 5.2.2: Normalize the gradient of the client's local model: ; in, For the first Client The gradient normalized value of the local model; For global training The maximum norm among the gradients of all client-side local models; Step 5.2.3: Calculate the client's quality score: ; in, Indicates the global training of the first Wheel of Life Client mass fraction; parameters These are the weighting coefficients; Step 5.2.4: Design a threshold-based client filtering mechanism: If the quality score of the current client is lower than a preset threshold, the client will be removed from the current aggregation process; the mathematical description is as follows: ; in, Indicates the first Client Mass fraction after filtration; The preset threshold; For the Sigmoid function; These are positive real number control parameters.
7. The distributed medical data privacy protection method based on homomorphic encryption according to claim 1, characterized in that, The specific process of step 6 is as follows: First, the key management center securely distributes the global private key to all clients; the clients use the private key to participate in decryption and recovery of the global model, and further correct the direction of model parameter updates by combining the local gradient-parameter dual momentum mechanism to achieve local update optimization; the local gradient-parameter dual momentum mechanism utilizes a compensation factor. Dynamically correct the differences between the client and the global model, and adjust the direction of parameter updates.
Citation Information
Patent Citations
Privacy protection federated learning method and device, electronic equipment and storage medium
CN117150550A
Federal learning hybrid attack data security defense system and method
CN119961922A