Research Article
Enhancing Fairness in Federated Learning: A Contribution-Based Differentiated Model Approach
Algorithm 1
Clustering algorithm based on contribution.
| | Input: contribution scores set , number of clusters | | | Output: clustering results | | (1) | Randomly select a sample from as the first cluster center. | | (2) | fordo | | (3) | Calculate the shortest distance between each sample and the existing cluster centers . | | (4) | Select the next cluster center with probability . | | (5) | end for | | (6) | Use the selected cluster centers as initial cluster centers, i.e., . | | (7) | while The cluster centers no longer change do | | (8) | For each sample , calculate its distance to each cluster center , where . | | (9) | Assign each sample to the cluster of nearest cluster center . | | (10) | fordo | | (11) | Calculate the mean of all samples in cluster . | | (12) | update the cluster center | | (13) | end for | | (14) | end while | | (15) | Output clustering results |
|