Random noise-driven post-processing federal long-tail classifier calibration method and device
By constructing a virtual balanced dataset and optimizing classifier parameters in federated learning, the problems of model bias and confidence inaccuracy caused by long-tail distribution are solved, achieving efficient calibration under data privacy protection and improving the fairness and generalization performance of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-20
- Publication Date
- 2026-04-14
AI Technical Summary
In federated learning, model bias and inaccurate prediction confidence caused by long-tail distribution and client heterogeneity pose potential risks, especially in high-reliability scenarios such as medical image analysis and autonomous driving. Existing methods struggle to effectively calibrate models while adhering to data privacy protection principles.
By constructing a virtual balanced dataset on a central server, classifier parameters are optimized using random noise sampling and calibration loss functions, and the feature extractor is frozen, achieving adaptive post-processing calibration and avoiding access to client data or gradient information.
It significantly improves the model's ability to identify tail categories and its overall calibration, reduces the risk of privacy breaches, is applicable to any federated learning process, and has high practicality and scalability.
Smart Images

Figure CN121861379A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of image classification technology using federated learning, and more particularly to a method and apparatus for calibrating a post-processing federated long-tail classifier driven by random noise. Background Technology
[0002] In recent years, federated learning, as a distributed machine learning paradigm, has made significant progress in collaboratively training global models while protecting data privacy. However, it faces severe challenges in practical deployment, particularly under the dual constraints of long-tail data distribution and client heterogeneity. The trained global model exhibits systematic biases and inaccurate confidence levels: on the one hand, due to insufficient participation of tail-class data in global training, the model's prediction accuracy for these tail-class data is significantly lower than that for head-class data, leading to an imbalance in overall performance; on the other hand, even for the model itself, its output prediction confidence often fails to accurately reflect the true classification difficulty of the samples, showing overconfidence in head-class samples and insufficient confidence in tail-class samples, which greatly reduces the model's credibility and reliability. Such biases and inaccuracies pose potential risks in federated applications with extremely high reliability requirements, such as medical image analysis and autonomous driving. Insufficient understanding and incorrect confidence in a minority of classes (tail-classes) by the model can directly lead to serious decision-making errors.
[0003] Addressing model bias in federated long-tail learning and improving the fairness and calibration of the global model has become a crucial research direction in this field. Existing methods can be broadly categorized into client-side local optimization and central server-side processing. Client-side local optimization methods mitigate the impact of local data imbalance by introducing strategies such as reweighting and improving loss functions during client training; server-side post-processing methods adjust or calibrate the global classifier after model aggregation. However, existing methods have significant shortcomings. On one hand, many methods heavily rely on the server's access to balanced auxiliary datasets or sensitive information such as gradients and feature statistics from the client, violating the core principle of data privacy protection in federated learning and introducing additional communication and privacy leakage risks. On the other hand, a few completely data-independent post-processing methods are typically based on static, heuristic global adjustments, lacking adaptive optimization capabilities for specific model states and data distributions, resulting in limited calibration effectiveness.
[0004] Therefore, there is an urgent need for a calibration method suitable for federated long-tail learning scenarios that can strictly adhere to the principle of server-side data independence, requires no auxiliary data or client privacy information, and can adaptively and dynamically optimize the classifier to significantly improve its generalization ability and prediction calibration accuracy for long-tail distributions while ensuring the overall performance of the model. Summary of the Invention
[0005] To overcome the shortcomings of the prior art, this disclosure provides a method and apparatus for calibrating a post-processing federated long-tail classifier driven by random noise.
[0006] According to a first aspect of this disclosure, a post-processing federated long-tail classifier calibration method driven by random noise is provided, comprising the following steps:
[0007] S1. By performing multiple rounds of federated learning training between the central server and multiple clients, a pre-trained global model containing feature extractors and classifiers is obtained.
[0008] S2. On the central server, the feature extractor is frozen, and a virtual balanced dataset is constructed based on random noise sampling and uniform label sampling. ,in The total number of samples, with a range of values of 100. to Each feature vector From isotropic Gaussian distribution Independent sampling was obtained, among which for 3D identity matrix For feature dimensions; each label From discrete uniform distribution Independent sampling in, among which Total number of categories;
[0009] S3. On the central server, using the virtual balanced dataset and calibration loss function The calibrated classifier parameters are obtained. Specifically:
[0010] ;
[0011] In the formula, , For the classifier parameters, for The real space of dimension 1 For feature dimension, Total number of categories; and For the first The category and the Weight vectors for each category; For feature vectors Transpose of;
[0012] S4. For the test samples to be classified, use the feature extractor and calibrated classifier of the central server to make predictions.
[0013] According to a second aspect of this disclosure, a post-processing federated long-tail classifier calibration apparatus driven by random noise is provided, comprising:
[0014] The standard federated training module is used to aggregate a pre-trained global model containing feature extractors and classifiers by performing multiple rounds of federated learning training between a central server and multiple clients.
[0015] A virtual data construction module is used on the central server to freeze the feature extractor and construct a virtual balanced dataset based on random noise sampling and uniform label sampling. ,in The total number of samples, with a range of values of 100. to Each feature vector From isotropic Gaussian distribution Independent sampling was obtained, among which for 3D identity matrix For feature dimensions; each label From discrete uniform distribution Independent sampling in, among which Total number of categories;
[0016] The post-processing calibration module is used on the central server to utilize the virtual balanced dataset. and calibration loss function The calibrated classifier parameters are obtained. Specifically:
[0017] ;
[0018] In the formula, , For the classifier parameters, for The real space of dimension 1 For feature dimension, Total number of categories; and For the first The category and the Weight vectors for each category; For feature vectors Transpose of;
[0019] The prediction output module is used to predict the test samples to be classified using the feature extractor and calibrated classifier of the central server.
[0020] The principle of this disclosed technical solution is as follows:
[0021] During the federated training phase, a pre-trained global model with high-quality feature extraction capabilities but a long-tail bias in the classifier is obtained through collaborative iteration between the server and multiple clients. Subsequently, in the noise-driven post-processing calibration phase, a perfectly balanced virtual dataset is constructed using isotropic Gaussian noise to serve as an ideal proxy for the real data distribution. The server freezes the feature extractor and optimizes a specialized calibration loss function on the virtual dataset to calibrate the biased classifier. Ultimately, the optimized classifier generates a more accurate and well-calibrated predicted probability distribution.
[0022] The technical effects of this disclosure are as follows:
[0023] This disclosure provides a post-processing federated long-tail classifier calibration method and apparatus based on random noise-driven calibration. It proposes a completely data-independent noise-driven post-processing calibration mechanism, offering an efficient and privacy-secure solution for federated long-tail learning. The main technical effects of this disclosure are: First, the method strictly adheres to the data privacy principles of federated learning. The server side requires no real client data, auxiliary datasets, or additional gradients and statistical information; calibration can be completed using only program-generated isotropic Gaussian noise, fundamentally eliminating the risk of privacy leakage. Second, by constructing a virtual balanced dataset and designing a corresponding loss function, the optimization process exhibits an adaptive norm balancing effect, effectively correcting classifier weight bias caused by the long-tail distribution of data, significantly improving the model's recognition ability in tail categories and overall calibration accuracy. Third, as a lightweight, plug-and-play module, this method can be seamlessly integrated into any existing federated learning training process without altering the original training process, and has extremely low computational and communication overhead, demonstrating high practicality and scalability. Using the method disclosed herein, the fairness, calibration accuracy, and generalization performance of the global model in federated long-tail learning scenarios can be significantly improved while strictly protecting data privacy. Attached Figure Description
[0024] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. The drawings are provided for a better understanding of the present invention and are not intended to limit the scope of this disclosure. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:
[0025] Figure 1 A flowchart illustrating the steps of the random noise-driven post-processing federated long-tail classifier calibration method provided in this disclosure.
[0026] Figure 2 A flowchart illustrating the random noise-driven post-processing federated long-tail classifier calibration method provided in this disclosure.
[0027] Figure 3This is a schematic diagram of the structure of the random noise-driven post-processing federated long-tail classifier calibration device provided in this disclosure. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.
[0029] like Figure 1 and Figure 2 As shown in the embodiments of this disclosure, a post-processing federated long-tail classifier calibration method driven by random noise is provided, including the following steps:
[0030] S1. By performing multiple rounds of federated learning training between the central server and multiple clients, a pre-trained global model containing feature extractors and classifiers is obtained.
[0031] It has One client, each client Holding private datasets ,in For the first One input sample, Label it as a category. For the first The total number of samples from each client; each client dataset contains There are categories, and their sample sizes satisfy [the following conditions are met] The long-tail distribution The sample size is given, and the data exhibits a non-independent and identically distributed distribution across different clients; each client model contains a feature extractor. and classifier Among them, feature extractor Input Mapped to feature vectors , for The real space of dimension 1 For feature dimension, For the first Feature extractor parameters for each client, classifier eigenvectors Mapped to prediction vector , for The real space of dimension 1 The total number of categories, , For the first Classifier parameters for each client, The total number of categories, For the first The first client Weight vectors for each category;
[0032] Through multiple rounds of communication The global model is trained in the next iteration. Values Each round of communication Includes the following steps, The range of values is - :
[0033] (1) Central server Set the current global model parameters The central server sends the data to each client. Includes feature extractor and classifier , Central server No. Feature extractor parameters for the next communication , Central server No. Classifier parameters for this communication for The real space of dimension 1 For feature dimension, Total number of categories;
[0034] (2) Each client has a local dataset Execution In each training round, local parameters are updated by minimizing the cross-entropy loss:
[0035] ;
[0036] in For the first The first client The weight vectors of each category, For feature vectors Transpose of;
[0037] (3) Each client will update the local model parameters Uploaded to the central server , For the first The first client Feature extractor parameters for the next communication For the first The first client Classifier parameters for the next communication;
[0038] (4) The central server aggregates all received local parameters and updates the global model parameters:
[0039] ;
[0040] in For the first The aggregate weight of each client is taken in the federated average algorithm. ;
[0041] through After round-robin communication, a pre-trained global model is obtained. , Central server No. Feature extractor parameters for the next communication.
[0042] S2. On the central server, the feature extractor is frozen, and a virtual balanced dataset is constructed based on random noise sampling and uniform label sampling. ,in The total number of samples, with a range of values of 100. to Each feature vector From isotropic Gaussian distribution Independent sampling was obtained, among which for 3D identity matrix For feature dimensions; each label From discrete uniform distribution Independent sampling in, among which This represents the total number of categories.
[0043] S3. On the central server, using the virtual balanced dataset and calibration loss function The calibrated classifier parameters are obtained. Specifically:
[0044] ;
[0045] In the formula, , For the classifier parameters, for The real space of dimension 1 For feature dimension, Total number of categories; and For the first The category and the Weight vectors for each category; For feature vectors The transpose of .
[0046] By optimizing the loss function renew The calibrated classifier is obtained. .
[0047] S4. For the test samples to be classified Using the central server Feature extractor parameters and the calibrated classifier parameters The global model is processed in the following steps:
[0048] (1) Through the feature extractor parameters Extract test samples eigenvectors ;
[0049] (2) The feature vector Input to the calibrated classifier Calculate its for all The predicted probability distribution of each class:
[0050] ;
[0051] in, and Central server No. Categories No. Categories ;
[0052] (3) The category with the highest output probability value is taken as the test sample. The final predicted category.
[0053] In some embodiments of this disclosure, experiments were conducted on three datasets: CIFAR-10-LT, CIFAR-100-LT, and ImageNet-LT. The results obtained using the methods of this disclosure were compared with those obtained using existing training methods for model calibration. To objectively evaluate the comparison results, the performance of different training methods on the CIFAR-10-LT and CIFAR-100-LT datasets was calculated at multiple imbalance ratios IF=100, IF=50, and IF=10. The comparison results are shown in Tables 1 and 2. In Tables 1 and 2, the following baseline methods were selected for comparison: (1) Federated learning methods: FedAvg (Federated Averaging), FedProx (Federated Proximal Optimization), FedAvgM (Federated Averaging with Momentum), FedDF (Federated Distillation), FedBE (Federated Bayesian Ensemble), FedNova (Federated Normalized Averaging), FedDisco (Federated Distribution-Aware Coordination), CCVR (Class Center Vector Regularization), FedLWS (Federated Hierarchical Weight Sharing); (2) Federated long-tail learning methods: Fed-Focal Loss (Federated Focusing Loss), Ratio Loss (Ratio Loss), FEDIC (Federated Invariance Calibration), CReFF (Client Resampling and Feature Fusion), Fed-GraB (Federated Gradient Balancing), Fed-LoGe (Federated Log Regularization), and FedLF (Federated Long-Tail Fairness); (3) Centralized long-tail learning methods: ERM (Empirical Risk Minimization, Training Based on Cross-Entropy Loss) and cRT (Classifier Retraining).
[0054] In Tables 1 and 2, a higher ACC value indicates a higher classification accuracy. As can be seen from Tables 1 and 2, the method disclosed herein can be adapted to different federated learning methods, consistently achieving a significant improvement in calibration performance, and its classification accuracy is also higher than that of federated long-tail methods without calibration.
[0055] Table 1
[0056]
[0057] Table 2
[0058]
[0059] This disclosure also provides performance comparisons on the ImageNet-LT dataset. Results obtained using the methods of this disclosure are compared with results from federated long-tail methods in the prior art. To objectively evaluate the comparison results, the results of each training time model method are presented using accuracy metrics under different categories: high-frequency classes containing more than 100 training samples; mid-frequency classes containing 20 to 100 training samples; low-frequency classes containing no more than 20 training samples; and the complete set containing all training samples. The results are shown in Table 3.
[0060] In Table 3, a higher ACC value indicates better accuracy. Table 3 shows that in some embodiments, the accuracy of the method disclosed herein is significantly improved across different federated methods, particularly in a few categories where its performance far surpasses other methods.
[0061] Table 3
[0062]
[0063] In some embodiments, such as Figure 3 As shown, a post-processing federated long-tail classifier calibration device 100 based on random noise is provided, comprising:
[0064] Standard federated training module 10 is used to aggregate a pre-trained global model containing a feature extractor and a classifier by performing multiple rounds of federated learning training between a central server and multiple clients.
[0065] The virtual data construction module 20 is used on the central server to freeze the feature extractor and construct a virtual balanced dataset based on random noise sampling and uniform label sampling. ,in The total number of samples, with a range of values of 100. to Each feature vector From isotropic Gaussian distribution Independent sampling was obtained, among which for 3D identity matrix For feature dimensions; each label From discrete uniform distribution Independent sampling in, among which Total number of categories;
[0066] Post-processing calibration module 30 is used on the central server to utilize the virtual balanced dataset. and calibration loss function The calibrated classifier parameters are obtained. Specifically:
[0067] ;
[0068] In the formula, , For the classifier parameters, for The real space of dimension 1 For feature dimension, Total number of categories; and For the first The category and the Weight vectors for each category; For feature vectors Transpose of;
[0069] The prediction output module 40 is used to predict the test sample to be classified using the feature extractor and calibrated classifier of the central server.
[0070] The embodiments described above are merely preferred embodiments of this disclosure and are not intended to limit the scope of this disclosure. Without departing from the spirit of this disclosure, any modifications and improvements made by those skilled in the art to the technical solutions of this disclosure shall fall within the protection scope defined by the claims of this disclosure.
Claims
1. A post-processing federated long-tail classifier calibration method driven by random noise, characterized in that, Includes the following steps: S1. By performing multiple rounds of federated learning training between the central server and multiple clients, a pre-trained global model containing feature extractors and classifiers is obtained. S2. On the central server, the feature extractor is frozen, and a virtual balanced dataset is constructed based on random noise sampling and uniform label sampling. ,in The total number of samples, with a range of values of 100. to Each feature vector From isotropic Gaussian distribution Independent sampling was obtained, among which for 3D identity matrix For feature dimensions; each label From discrete uniform distribution Independent sampling in, among which Total number of categories; S3. On the central server, using the virtual balanced dataset and calibration loss function The calibrated classifier parameters are obtained. Specifically: ; In the formula, , For the classifier parameters, for The real space of dimension 1 For feature dimension, Total number of categories; and For the first The category and the Weight vectors for each category; For feature vectors Transpose of; S4. For the test samples to be classified, use the feature extractor and calibrated classifier of the central server to make predictions.
2. The random noise-driven post-processing federated long-tail classifier calibration method according to claim 1, characterized in that, The learning and training process described in S1 follows the federated learning paradigm, specifically including: It has One client, each client Holding private datasets ,in For the first One input sample, Label it as a category. For the first The total number of samples from each client; each client dataset contains There are categories, and their sample sizes satisfy [the following conditions are met] The long-tail distribution The sample size is given, and the data exhibits a non-independent and identically distributed distribution across different clients; each client model contains a feature extractor. and classifier Among them, feature extractor Input Mapped to feature vectors , for The real space of dimension 1 For feature dimension, For the first Feature extractor parameters for each client, classifier eigenvectors Mapped to prediction vector , for The real space of dimension 1 The total number of categories, , For the first Classifier parameters for each client, The total number of categories, For the first The client number Weight vectors for each category; Through multiple rounds of communication The global model is trained in the next iteration. Values Each round of communication Includes the following steps, The range of values is - : (1) Central server Set the current global model parameters The central server sends the data to each client. Includes feature extractor and classifier , Central server No. Feature extractor parameters for the next communication , Central server No. Classifier parameters for this communication for The real space of dimension 1 For feature dimension, Total number of categories; (2) Each client has a local dataset Execution In each training round, local parameters are updated by minimizing the cross-entropy loss: ; in For the first The client number The weight vectors of each category, For feature vectors Transpose of; (3) Each client will update the local model parameters Uploaded to the central server , For the first The client number Feature extractor parameters for the next communication For the first The client number Classifier parameters for this communication; (4) The central server aggregates all received local parameters and updates the global model parameters: ; in For the first The aggregate weight of each client is taken in the federated average algorithm. ; through After round-robin communication, a pre-trained global model is obtained. , Central server No. Feature extractor parameters for the next communication.
3. The random noise-driven post-processing federated long-tail classifier calibration method according to claim 2, characterized in that, S4 for the test samples to be classified Using the central server Feature extractor parameters and the calibrated classifier parameters The global model is processed in the following steps: (1) Through the feature extractor parameters Extract test samples eigenvectors ; (2) The feature vector Input to the calibrated classifier Calculate its for all The predicted probability distribution of each class: ; in, and Central server No. Categories No. Categories ; (3) The category with the highest output probability value is taken as the test sample. The final predicted category.
4. A post-processing federated long-tail classifier calibration device driven by random noise, characterized in that, include: The standard federated training module is used to aggregate a pre-trained global model containing feature extractors and classifiers by performing multiple rounds of federated learning training between a central server and multiple clients. A virtual data construction module is used on the central server to freeze the feature extractor and construct a virtual balanced dataset based on random noise sampling and uniform label sampling. ,in The total number of samples, with a range of values of 100. to Each feature vector From isotropic Gaussian distribution Independent sampling was obtained, among which for 3D identity matrix For feature dimensions; each label From discrete uniform distribution Independent sampling in, among which Total number of categories; The post-processing calibration module is used on the central server to utilize the virtual balanced dataset. and calibration loss function The calibrated classifier parameters are obtained. Specifically: ; In the formula, , For the classifier parameters, for The real space of dimension 1 For feature dimension, Total number of categories; and For the first The category and the Weight vectors for each category; For feature vectors Transpose of; The prediction output module is used to predict the test samples to be classified using the feature extractor and calibrated classifier of the central server.