A personalized federated learning method based on prototype learning
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- XINJIANG UNIVERSITY
- Filing Date
- 2026-05-25
- Publication Date
- 2026-08-07
AI Technical Summary
静态高阈值在训练后期会引入过多的统计噪声干扰收敛;而静态低阈值在训练初期则会错误剔除携带关键全局特征的大梯度更新,限制了模型对解空间的探索能力
Smart Images

Figure CN122531699A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of distributed collaborative medical diagnostic technology, specifically to a personalized federated learning method based on prototype learning. Background Technology
[0002] In current cross-hospital medical collaboration scenarios, federated learning has become the mainstream technical paradigm for breaking down data silos in order to meet the requirements of patient privacy protection and data security compliance. Addressing the significant non-independent identically distributed (Non-IID) characteristics (i.e., data heterogeneity) of medical imaging data, existing technologies primarily mitigate the drift problem in local model updates through feature alignment and classifier collaboration mechanisms.
[0003] In this field, the closest prior art to the present invention is FedPAC (Personalized Federated Learning with Feature Alignment and Classifier Collaboration). This method constructs a global prototype by aggregating local prototypes from various clients (hospitals) on the server side, and uses a quadratic programming (QP) solver to collaboratively optimize the classifier weights of each participant. At the same time, it introduces feature alignment constraints into the local loss function to guide the local model toward global consensus.
[0004] Although existing technologies such as FedPAC have made some progress in handling data heterogeneity, the following deep-seated technical shortcomings still exist in the practical application of complex cross-hospital combined imaging diagnosis of rare / common diseases. These shortcomings directly limit the robustness and generalization accuracy of the diagnostic model:
[0005] 1. Incompatibility between static screening thresholds and non-convex optimization trajectories. Existing frameworks typically pre-define static client-side screening criteria. At different stages of model optimization, the system's requirements for data diversity and update quality differ fundamentally. A high static threshold introduces excessive statistical noise that interferes with convergence in the later stages of training; while a low static threshold incorrectly rejects large gradient updates carrying key global features in the early stages of training, limiting the model's ability to explore the solution space.
[0006] 2. Rigid Conflicts in Feature Alignment Constraints. In existing prototype-based personalized federated architectures, feature alignment regularization terms are typically introduced into the local loss function to force locally extracted features to gravitate towards the global prototype anchor point, with the alignment strength usually fixed at 1.0. However, this fixed and overly strong alignment constraint can easily lead to excessive suppression of local personalized features by global features, resulting in a significant decrease in the accuracy of the diagnostic model on local specific data.
[0007] 3. Sample size dominance and feature shift in prototype aggregation. Current technologies, when performing prototype aggregation on the server side, primarily rely on the sample size of each participating institution. Linear weighted aggregation is performed. In real-world clinical settings, large imaging centers, despite their large sample sizes, can lead to low-quality prototypes dominating the construction of the global feature space if there are inaccuracies in the image sequences or fluctuations in annotation quality. This single-dimensional weighting method ignores the differences in model training quality, resulting in nodes with large sample sizes but poor training quality excessively dominating the global prototype and thus polluting the global feature benchmark.
[0008] 4. Weight sparsity and long-tail knowledge forgetting in classifier collaboration. Existing technologies rely on QP solvers to find the optimal weight allocation at the mathematical level. Their optimization objectives naturally tend towards extreme points, leading to a high concentration of aggregated weights on a few central nodes with superior performance metrics. This phenomenon results in severe weight sparsity in the collaborative architecture, effectively excluding areas carrying peripheral domain knowledge (such as rare disease or rare pathological variation features) from the collaborative system. During continuous iteration, this will cause the global model to catastrophically forget long-tail pathological features. Summary of the Invention
[0009] To address the challenges of pathological feature alignment, rare disease knowledge preservation, and robustness optimization of global diagnostic models for cross-hospital medical images (such as CT, MRI, and X-rays) with heterogeneous data distribution, while protecting patient privacy, this invention proposes a personalized federated learning method based on prototype learning. Clients deployed in hospitals utilize local models to perform diagnoses based on input medical image data. These local models include feature extractors and classifiers. Each feature extractor extracts fixed-dimensional high-level semantics from the image, which is then input into a pre-trained classifier to identify the image's category. The training process for the classifier and feature extractor based on federated learning specifically includes the following steps:
[0010] The client trains its local feature extractor and classifier based on the global classifier parameters and global prototype library sent by the server.
[0011] After the client completes local training, it uses the average value of the high-level semantics of each category image as the prototype of that category using the feature extractor. The prototypes of all categories constitute the client's local prototype library.
[0012] Send the local classifier parameters, local sample count, local classifier loss, and local feature statistical vector to the server. The local feature statistical vector includes the variance of each class feature of the client and its global reference feature.
[0013] Based on the data uploaded by the client, the server obtains a distance matrix composed of the distances between the global reference features of each client, and assigns initial weights to each client by using the distance matrix and the feature variance of each client.
[0014] The server determines whether the initial weight of each client is greater than the decision threshold based on the current iteration number. If it is, the client participates in this aggregation.
[0015] Aggregate the local classifier parameters of the client based on the initial weights, and update the global classifier parameters;
[0016] The server calculates the weight of each client's prototype library based on the number of samples, classifier loss, and feature statistical vectors of each client. Based on this weight, the local prototype libraries of all clients are aggregated, the global prototype library is updated, and one training cycle is completed.
[0017] The Fed-SCA (Collaborative Aggregation Framework) proposed in this invention demonstrates significant technical advantages in non-independent identically distributed (Non-IID) medical image data environments by reconstructing distributed optimization paths. Compared with FedAvg, FedProx, and the closest existing technology FedPAC, this invention has the following expected beneficial effects:
[0018] 1. This invention significantly improves diagnostic accuracy and convergence stability in heterogeneous environments. Experiments demonstrate that this invention significantly outperforms existing benchmark methods on mainstream benchmark datasets such as CIFAR-10, Fashion-MNIST, EMNIST, and CINIC, validating its universal effectiveness under different medical image feature distributions.
[0019] 2. This invention possesses extremely high engineering deployment feasibility and algorithm robustness. Through a progress-aware dynamic filtering mechanism employing a three-stage step design, this invention can dynamically adjust the decision threshold of weights based on model maturity without introducing complex nonlinear operators. This not only significantly reduces invalid aggregation interference on the server side and overall system communication noise, but also perfectly aligns with the trajectory of non-convex optimization in deep learning, filtering strong noise in the early stages to accelerate convergence, and relaxing restrictions in the later stages to improve feature diversity.
[0020] 3. This invention achieves optimal dynamic matching between global consensus and local personalized features. It abandons traditional rigid alignment or complex dynamic coefficient scheduling, employing a degraded and constant feature alignment strength. This design follows the cognitive principle of "global guidance first, followed by local fine-tuning," utilizing the global correction capability when classification loss is high in the early stages of training, and reserving sufficient specific fine-tuning space for the local classifier when classification loss decreases in the mid-to-late stages. This avoids excessive suppression of locally sensitive pathological features and ensures that the framework maintains both global consistency and local specificity throughout the entire training cycle without increasing any additional scheduling computational overhead.
[0021] 4. This invention optimizes the purity of global feature representation and eliminates low-quality data contamination. It utilizes a quality-aware prototype aggregation strategy, employing square-root smoothing to process sample size weights, effectively suppressing the excessive dominance of large-sample clients in the aggregation process. Specifically, this invention introduces a power-law scaling scoring mechanism based on local training loss to accurately identify and amplify the contribution weights of high-reliability, high-confidence hospitals. This successfully purifies the global feature space, eliminates feature shifts caused by device differences or labeling errors, and enhances the robustness of the global model in complex heterogeneous environments.
[0022] 5. This invention enhances the protection against long-tail and rare disease pathological features, effectively curbing catastrophic amnesia. This invention introduces an entropy regularization weight balancing mechanism, which, by setting a threshold for truncating the underlying weights, physically prevents the collapse of collaborative paths. Furthermore, this invention utilizes normalized information entropy to monitor weight distribution; when the system is detected to be trapped in an excessive sparsity trap (…),… When the value is less than 0.3, maximum entropy priors are automatically injected. This intervention mechanism ensures that the feature contributions of medical nodes with extremely small sample sizes but unique pathological significance, such as rare disease research centers, are not directly cleared to zero, thus effectively preventing the permanent loss of medical knowledge in marginal fields. Attached Figure Description
[0023] Figure 1 This is a flowchart of a personalized federated learning method based on prototype learning according to the present invention.
[0024] Figure 2 This is a schematic diagram of the experimental data curves for this invention. Detailed Implementation
[0025] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0026] This invention proposes a personalized federated learning method based on prototype learning, deployed on a hospital client. This method utilizes a local model to perform diagnosis based on input medical image data. The local model includes a feature extractor and a classifier. Each feature extractor extracts fixed-dimensional high-level semantics from the image. This high-level semantics is then input into a pre-trained classifier to identify the image's category. The process of training the classifier and feature extractor based on federated learning is as follows: Figure 1 Specifically, it includes the following steps:
[0027] The client trains its local feature extractor and classifier based on the global classifier parameters and global prototype library sent by the server.
[0028] After the client completes local training, it uses the average value of the high-level semantics of each category image as the prototype of that category using the feature extractor. The prototypes of all categories constitute the client's local prototype library.
[0029] Send the local classifier parameters, local sample count, local classifier loss, and local feature statistical vector to the server. The local feature statistical vector includes the variance of each class feature of the client and its global reference feature.
[0030] Based on the data uploaded by the client, the server obtains a distance matrix composed of the distances between the global reference features of each client, and assigns initial weights to each client by using the distance matrix and the feature variance of each client.
[0031] The server determines whether the initial weight of each client is greater than the decision threshold based on the current iteration number. If it is, the client participates in this aggregation.
[0032] Aggregate the local classifier parameters of the client based on the initial weights, and update the global classifier parameters;
[0033] The server calculates the weight of each client's prototype library based on the number of samples, classifier loss, and feature statistical vectors of each client. Based on this weight, the local prototype libraries of all clients are aggregated, the global prototype library is updated, and one training cycle is completed.
[0034] This embodiment proposes a collaborative aggregation framework, Fed-SCA (Synergistic Collaborative Aggregation), which achieves deep optimization of the reliability of global knowledge aggregation and local personalization capabilities through collaborative interaction between the server and the hospital client. The specific technical means and implementation steps are as follows:
[0035] This embodiment simulates a federated diagnostics network containing up to 100 medical branch offices (clients), with the following hardware and software environment:
[0036] Hardware environment: The computing platform is configured with an NVIDIA GeForce GTX 1660 Ti GPU, an Intel Core i5-9300H CPU, and 16GB of DDR4 memory;
[0037] Software environment: The underlying development environment is based on PyTorch and CUDA 11.7.
[0038] This embodiment selects four benchmark datasets: CIFAR-10, Fashion-MNIST, EMNIST, and CINIC, to simulate the non-IID (non-independent and identically distributed) heterogeneous features in medical images.
[0039] This invention targets client-side components deployed in hospitals, including a feature extractor and a classifier. To avoid leaking local data features, the local feature extractor is trained only locally. The classifier is used to determine the type and severity of lesions in a user's medical image based on the extracted features. This invention only uploads the parameters of the local classifier to the server for aggregation. This invention is applied to cross-hospital central medical image diagnostic assistance. Its aim is to address the challenges of data heterogeneity, uneven sample sizes, and the inability to train on all datasets centrally, without compromising patient privacy or medical data, through federated learning to unify the diagnostic model. Furthermore, some hospitals with limited data may experience unsatisfactory image classification results due to insufficient data or concentrated samples. This invention improves the accuracy of medical image classification by training the feature extractor and classifier independently of shared data across hospitals. Specifically, the (t+1)th iteration of this invention includes the following steps:
[0040] 1. The client trains its local feature extractor and classifier based on the global classifier parameters for the t-th iteration and the global prototype library for the t-th iteration sent by the server, specifically including:
[0041] When the client performs local training, it first freezes the network parameters of the feature extractor, updates the classifier using the global classifier parameters, and then trains the classifier based on local samples. The loss function during training is the cross-entropy between the predicted class of a local sample and its true class.
[0042] Next, the trained classifier is frozen, and the local feature extractor is trained based on local samples using the classification loss and the difference between the global prototype library and the local prototype library. When the feature extractor is trained on the client side, the loss function is expressed as:
[0043]
[0044] in, This indicates that during classifier training, the classifier for the i-th client is based on local samples. The predicted category obtained from the extracted features is the same as that of the local samples. Real Category Cross-entropy between; This represents the loss function used when training the feature extractor on the client side. This indicates that the feature extractor extracts data from local samples. High-level semantics extracted from it; This indicates that the real category in the global prototype library is High-level semantics; This indicates the calculation of Euclidean distance.
[0045] 2. After the client completes local training, it uses the average value of the high-level semantics of each category image as the prototype of that category. The prototypes of all categories constitute the client's local prototype library. In particular, the feature extractor here is the feature extractor that was trained in the previous step.
[0046] 3. The average high-level semantics of each category's images is used by a feature extractor as the prototype for that category. The prototypes for all categories constitute the client-side local prototype library, specifically including:
[0047] Obtain the prototype value of the high-level semantics of the image under each category, and calculate the variance of the prototype values of all categories. Use this variance as the variance of each category feature of the client.
[0048] The global reference feature vector for client i is obtained by weighted summation according to the category distribution, and is expressed as:
[0049]
[0050] in, Let be the global reference feature vector of client i; C is the total number of categories classified by the client. The percentage of data for category c samples in client i; This represents the mean of the high-level semantics of category c samples in client i, i.e., the prototype value of category c samples in client i.
[0051] 4. Based on the data uploaded by the clients, the server obtains a distance matrix composed of the distances between the global reference features of each client. Initial weights are then assigned to each client using the distance matrix and the feature variance of each client. Specifically, this includes:
[0052] Construct a distance matrix on the server, represented as follows:
[0053]
[0054] in, This represents the distance between the global reference features of the i-th client and the j-th client. In this embodiment, the square of the Euclidean distance is used to measure the distance between the global reference features of the two clients. Represented as , Let i be the value of the k-th dimension element of the i-th client global reference feature. Let N be the value of the k-th dimension element of the global reference feature for the j-th client; N is the number of clients in the system.
[0055] Construct the QP optimization objective function and derive the initial weights for each client from it. The QP optimization objective function is expressed as:
[0056]
[0057] in, The set of initial weights for all clients, denoted as ; Let represent the characteristic variance of the i-th client.
[0058] 5. The server determines whether the initial weight of each client is greater than the decision threshold based on the current iteration number. If it is, the client participates in this aggregation.
[0059] As a preferred implementation, this embodiment does not use a fixed threshold, but rather an adaptive threshold that varies with the number of iterations, expressed as:
[0060]
[0061] in, Let t represent the decision threshold for the t-th training iteration, where T is the preset total number of training iterations.
[0062] As a preferred implementation, a minimum lower bound is assigned to the filtered weights. This is to ensure the physical continuity of the collaborative chain.
[0063] This invention ensures the complete extraction of all pathological features by the global model by forcibly retaining the weight share of minority hospitals carrying rare disease characteristics, thus significantly improving the generalization robustness of the system.
[0064] Furthermore, we use information entropy to measure whether the current weight distribution is healthy. To obtain a universal criterion, we divide the information entropy by the maximum possible entropy, which is the entropy under a perfectly uniform distribution, and express it as:
[0065]
[0066] Determine whether the entropy of the initial weight of the participating clients is less than the safety threshold K (in this embodiment, the safety threshold K is set to 0.3). The closer the value is to 0, the more concentrated the weight is on a few clients; The closer the value is to 1, the more evenly weighted the system. In this embodiment, 0.3 is set as the warning threshold. A value less than 0.3 indicates that the weights have become excessively concentrated in a very small number of nodes, and the collaborative system has entered a fragile sparse state, requiring the intervention logic to be activated.
[0067] When the system is detected to be trapped in an excessive sparsity trap, adaptive scaling is used. Injecting maximum entropy priors for weight correction is expressed as:
[0068]
[0069] Compare the original weights with the uniform distribution vector According to the calculated adaptive ratio Perform linear interpolation mixing, i.e.:
[0070]
[0071] in, Let be the initial weight of the i-th client after the update.
[0072] 6. Aggregate the local classifier parameters of the selected clients based on the initial weights, and update the global classifier parameters. This process can be represented as:
[0073]
[0074] in, These are the global classifier parameters obtained in the t-th iteration; For the t-th iteration, the local classifier parameters for the i-th client.
[0075] 7. The server calculates the weight of each client's prototype library based on the number of samples, classifier loss, and feature statistical vectors of each client. Based on this weight, the local prototype libraries of all clients are aggregated, the global prototype library is updated, and one training cycle is completed.
[0076] Specifically, the server calculates the weight of each client's prototype library based on the number of samples, classifier loss, and feature statistical vectors, as follows:
[0077]
[0078] in, This represents the weight of the i-th client prototype library; Let be the number of samples from the i-th client; Let be the quality weight of the client sample in the t-th iteration. The quality weight is defined as through ablation experiments. Since the initial classification loss value contains a lot of random noise and is unreliable, the quality weight is limited to 0.3. In the middle of training, the classification loss begins to truly reflect the alignment degree. Therefore, increasing the quality weight to 0.7 helps to accelerate the convergence to the optimal general representation. In the later stage of training, the quantitative interference is basically completely eliminated, which can eliminate the accuracy dilution caused by the over-smoothing effect and ensure that the model reaches the optimal generalization point. Let be the quality score of the i-th client, denoted as , Let be the classifier loss for the i-th client.
[0079] The server performs a weighted aggregation of the local prototypes of each client based on the weight of each client's prototype library to obtain the global prototype, which includes:
[0080]
[0081] in, Represents the global prototype of category c in the t-th iteration; This represents the local prototype of the i-th client category c during the t-th iteration.
[0082] Table 1 shows the ablation experiment results, recording the changes in classification accuracy after introducing four core innovative modules—Time-Aware Adaptive Filtering (TAFM), Quality-Aware Prototype Aggregation (QPAM), Entropy Regularized Weight Balancing (EWBM), and Degradation Constraint Feature Alignment Strategy (DFAS)—on top of the baseline model. Experimental data demonstrate that in Non-IID scenarios, introducing any single module individually improves performance, with the QAPA module making the most significant independent contribution to accuracy. When all innovative modules are applied together, the accuracy reaches a peak of 81.89%. This strongly demonstrates the necessity of multi-dimensional collaborative optimization, indicating that each module proposed in this invention makes an independent and significant positive contribution to handling data heterogeneity, purifying the feature space, and maintaining collaborative robustness. The organic integration of these modules successfully achieves the optimal balance of federated prototype learning performance.
[0083] Table 1 Ablation Experiment
[0084]
[0085] Table 2 presents a sensitivity analysis of the training progress factor in the entropy regularization weight balancing mechanism. The table records the specific impact of adjusting the training progress factor parameter on the final classification accuracy of the model in three different stages: the initial, middle, and later stages of training. Experimental data shows that model performance exhibits significant stage-specific sensitivity to the training progress factor value. In the initial stage, a value of 0.3 achieves the optimal accuracy of 81.89%, while in the later stage, even with the parameter increased to 1.0, the model maintains high diagnostic accuracy. This strongly demonstrates that by dynamically adjusting the training progress factor, the system can adaptively monitor the weight distribution and correct biases in real time, thereby maximizing feature integration efficiency in heterogeneous environments while ensuring the integrity of the collaborative architecture.
[0086] Table 2 Sensitivity analysis of training progress factors
[0087]
[0088] Table 3 shows the strength coefficients in the feature alignment strategy for degradation constraints. The sensitivity analysis table records the alignment loss percentage and final model accuracy performance for different intensity coefficient values. Experimental data shows that when the intensity coefficient... When the coefficient is set to 0.5 and the corresponding alignment loss accounts for approximately 23.10%, the model accuracy reaches a peak of 81.89%. Coefficients that are too high or too low both lead to varying degrees of performance degradation. This further demonstrates that by reducing the constraint alignment coefficient, this invention successfully achieves an optimal balance between local personalized feature mining and global pathological prototype consensus construction, avoiding feature suppression caused by excessive constraints in the early stages and preventing model shifts caused by insufficient constraints in the later stages.
[0089] Table 3 Sensitivity analysis of strength coefficient
[0090]
[0091] Table 4 compares the classification accuracy of this invention with various benchmark algorithms under different heterogeneous environments. The table records the performance data of this framework (ours) versus Baseline, FedAvg, and FedProx on four mainstream datasets: CIFAR-10, Fashion-MNIST, EMNIST, and CINIC. It also covers two typical Non-IID scenarios: full participation from 20 clients and random sampling from 100 clients. Experimental results show that the accuracy of this invention significantly outperforms existing benchmark methods in all test environments. In the 20-client scenario of CIFAR-10, this invention achieves an accuracy of 81.89%, a significant leap compared to FedAvg (67.53%) and FedProx (72.21%). This strongly demonstrates that this invention possesses strong general performance and robustness in processing heterogeneous medical image data, effectively handling classification tasks of varying scales and complexities.
[0092] Table 4 Comparative Experiments
[0093]
[0094] Figure 2 The experimental data curves illustrating the evolution of this invention across different datasets and communication rounds are presented. The graphs record the real-time performance fluctuations and final convergence accuracy of each algorithm within 200 communication cycles, under different client sizes (20 and 100) and in a non-IID heterogeneous scenario. The curve trends show that as training progresses, the performance curve of this invention not only achieves a higher final accuracy but also exhibits excellent stability in the later stages of training. Compared to the significant fluctuations of the comparison algorithms, the curve of this invention shows significantly smaller oscillations, indicating that this invention successfully achieves robust integration of global knowledge while ensuring local personalization capabilities, demonstrating excellent convergence characteristics and noise robustness.
[0095] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A personalized federated learning method based on prototype learning, characterized in that, The client deployed in the hospital uses a local model to make diagnoses based on the input medical image data. The local model includes a feature extractor and a classifier. Each feature extractor extracts high-level semantics of a fixed dimension from the image. The high-level semantics are then input into a pre-trained classifier to identify the category of the image. The process of training the classifier and feature extractor based on federated learning specifically includes the following steps: The client trains its local feature extractor and classifier based on the global classifier parameters and global prototype library sent by the server. After the client completes local training, it uses the average value of the high-level semantics of each category image as the prototype of that category using the feature extractor. The prototypes of all categories constitute the client's local prototype library. Send the local classifier parameters, local sample count, local classifier loss, and local feature statistical vector to the server. The local feature statistical vector includes the variance of each class feature of the client and its global reference feature. Based on the data uploaded by the client, the server obtains a distance matrix composed of the distances between the global reference features of each client, and assigns initial weights to each client by using the distance matrix and the feature variance of each client. The server determines whether the initial weight of each client is greater than the decision threshold based on the current iteration number. If it is, the client participates in this aggregation. Aggregate the local classifier parameters of the client based on the initial weights, and update the global classifier parameters; The server calculates the weight of each client's prototype library based on the number of samples, classifier loss, and feature statistical vectors of each client. Based on this weight, the local prototype libraries of all clients are aggregated, the global prototype library is updated, and one training cycle is completed.
2. The personalized federated learning method based on prototype learning according to claim 1, characterized in that, The process by which the client trains its local feature extractor and classifier based on the global classifier parameters and global prototype library sent by the server includes: On one client, the network parameters of the feature extractor are first frozen. After updating the classifier using the global classifier parameters, the classifier is trained based on local samples. After training is completed, the local classifier network parameters and the average cross-entropy loss of the local samples are saved. Freeze the trained classifier and train the local feature extractor based on local samples using the classification loss and the differences between the global prototype library and the local prototype library.
3. The personalized federated learning method based on prototype learning according to claim 2, characterized in that, When training the classifier on the client side, the loss function is: When training the feature extractor on the client side, the loss function is expressed as: in, This indicates that during classifier training, the classifier for the i-th client is based on local samples. The predicted category obtained from the extracted features is the same as that of the local samples. Real Category Cross-entropy between; This represents the loss function used when training the feature extractor on the client side. This indicates that the feature extractor extracts data from local samples. High-level semantics extracted from it; This indicates that the real category in the global prototype library is High-level semantics; This indicates the calculation of Euclidean distance.
4. The personalized federated learning method based on prototype learning according to claim 1, characterized in that, The acquisition of local feature statistical vectors includes: In one client, the mean of each category sample is calculated as a reference value, and then the variance of all category reference values is calculated. This variance is used as the variance of each category feature in the client. The weighted sum of the reference values for each category of the client is used as the global reference feature for that client.
5. The personalized federated learning method based on prototype learning according to claim 1, characterized in that, Initial weights are assigned to each client using the distance matrix and the feature variance of each client, including: in, The set of initial weights for all clients, denoted as N is the number of clients in the system. Let M represent the initial weight of the i-th client; M is the distance matrix, denoted as... , This represents the distance between the global reference features of the i-th client and the j-th client; Let represent the characteristic variance of the i-th client.
6. A personalized federated learning method based on prototype learning according to claim 1 or 5, characterized in that, Decision threshold representation: in, Let t represent the decision threshold for the t-th training iteration, where T is the preset total number of training iterations.
7. The personalized federated learning method based on prototype learning according to claim 5, characterized in that, If the initial weight of a client selected for aggregation is less than the set minimum value, then the initial weight of that client will be updated to the set minimum value.
8. A personalized federated learning method based on prototype learning according to claim 5 or 7, characterized in that, To determine if there is a risk of collapse in the initial weights of the participating clients, calculate whether the entropy of the initial weights of the participating clients is less than a safety threshold. If it is less, there is a risk, so update the initial weights of each client, reduce the initial weights of clients with larger weights and increase the initial weights of clients with smaller weights.
9. A personalized federated learning method based on prototype learning according to claim 8, characterized in that, When there is a risk of collapse, the update to the initial weights includes: in, Let this be the initial weight of the i-th client after the update; For adaptive mixing ratio, it is expressed as , This is a safety threshold; The entropy of the initial weights of the clients participating in the aggregation is denoted as... , where m is the number of clients participating in the aggregation.
10. A personalized federated learning method based on prototype learning according to claim 1, characterized in that, The server calculates the weights of each client's prototype library based on the number of samples, classifier loss, and feature statistical vectors, including: in, This represents the weight of the i-th client prototype library; Let be the number of samples from the i-th client; Let be the quality weight of the client sample in the t-th iteration; Let be the quality score of the i-th client, denoted as , Let be the classifier loss for the i-th client.