0% found this document useful (0 votes)
26 views6 pages

DFML Project Overview and Results

a repo of my project

Uploaded by

animesh22074
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views6 pages

DFML Project Overview and Results

a repo of my project

Uploaded by

animesh22074
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DFML Project Report

Animesh Gupta(2022074), Baljyot Singh Modi(2022133)


December 10, 2024

1 Introduction
In this project, we Explored Federated Machine Learning (FL) by implementing various algorithms and
techniques. Specifically, we applied FedAvg and FedProx for both partial and full client participation,
integrated top-K sparsification and quantization to reduce communication overhead, and utilized the
Adam optimizer for efficient [Link] used weighted clients participation Our aim was to evaluate
the performance and scalability of these approaches in federated learning environments.

2 Dataset and Hyperparameter


We used MNIST dataset to conduct our experiments.

2.1 Data Partitioning


To replicate non-iid implementation of data between clients, first we gave each clients the labels we
are going to give them some may get more and some may get less number of labels. Then we assign
them data belonging to those labels. The outcome is a set of client-specific datasets that each contain
diverse and unbalanced data, reflecting real-world scenarios in federated learning environments where
client data may differ significantly.

2.2 HyperParameters
We created 5 clients using above data partitioning methodology and with batch size of 64 for each
[Link] rate of 0.001 is used for client side model with ADAM optimizer. All the optimization
methods are run on top of Fed-Avg full participation with 15 global epochs and 5 epoch per client.

3 Methodologies
3.1 FedAvg
We utilized Vanilla FedAvg, which averages the weights from all participating clients to create a global
model. Additionally, we experimented with both full and partial client participation.

3.2 FedProx
FedProx, extension of FedAvg introduces a proximal term in the local objective function of each client.
In our implementation, we set the weight of this proximal term to 0.0001 , however this value can be
experimented.

3.3 Top-K Sparsification


Top-K sparsification is a technique used to reduce communication overhead in federated learning by
transmitting only the most significant model updates. In our approach, sparsification was applied only
when sending weights from clients to the server, not during the server-to-client broadcast. This decision
was based on the observation that clients are typically resource-constrained, whereas the server often
has sufficient resources for communication.

1
3.4 Quantization
Quantization is a technique used in federated learning to compress model updates, by converting the
floating-point model weights to lower precision formats, such as integers, quantization significantly
decreases the size of the data transmitted.

3.5 Adam Optimizer


The Adam (Adaptive Moment Estimation) optimizer is a popular optimization algorithm used in
training machine learning models. It combines the best properties of the AdaGrad and RMSProp
algorithms to provide an optimization method that can handle sparse gradients on noisy problems.
We have applied ADAM on the server side , by modelling the differnce in the new and old weight as
gradient.

3.6 Weighted Client Participation


Weighted client participation in federated learning adjusts the contribution of each client to the global
model based on specific metrics, rather than treating all clients equally. This approach addresses
the fact that clients often differ in dataset sizes and [Link] our experiment, we weighted
client contributions based on dataset [Link] work could explore additional metrics, such as the
magnitude of weight updates

4 Results
Table 1 shows results of all the methods and optimization methods.

Method Participation Accuracy F1-Score


Fed-avg Full(client=3) 82.66 0.784
Fed-avg partial 75.59 0.682
Fed-Prox Full 85.41 0.813
Fed-Prox partial(client=3) 77.8 0.704
Top k Sparsification full(k=119988) 84.25 0.802
Quantization full(levels=16) 76.25 0.7001
Adam Optimizer full 94.12 0.93
Weighted Client Participation full 87.6 0.835

Table 1: Experiments and results table.

5 References
[Link]
[Link]

2
Figure 1: Fed Avg partial participation

Figure 2: Fed Avg Loss Curve

3
Figure 3: Fed prox Full participation

Figure 4: Fed Prox Loss Curve

4
Figure 5: Adam optimizer.

Figure 6: Adam Loss Curve

5
Figure 7: Quamtization optimizer

Common questions

Powered by AI

Top-K sparsification and quantization both aim to reduce communication overhead by diminishing the size of data transmitted during model updates, with sparsification focusing on sending only the most significant updates and quantization compressing data size more broadly. In the project, top-K sparsification resulted in a higher accuracy (84.25%) and F1-score (0.802) compared to quantization (76.25% accuracy, 0.7001 F1-score), suggesting it was more effective at maintaining model performance while reducing overhead .

FedProx differs from FedAvg by introducing a proximal term in the local objective function for each client, which helps stabilize convergence and allows for better handling of heterogeneity across client datasets. In the project, FedProx achieved higher accuracy and F1-score compared to FedAvg under full client participation, with 85.41% accuracy and 0.813 F1-score versus FedAvg's 82.66% accuracy and 0.784 F1-score .

Weighted client participation can be particularly beneficial in scenarios where clients have varying dataset sizes and distributions. In the project, client contributions to the global model were weighted based on dataset size, acknowledging that not all data may be equally informative or abundant. This approach yielded better model performance compared to treating all clients equally, achieving an accuracy of 87.6% and F1-score of 0.835 .

The project employed a non-iid data partitioning method by assigning unbalanced labels and data to clients, resulting in client-specific datasets that mimic real-world federated learning environments. This approach highlights the diversity and imbalance in client data, reflecting scenarios where data distribution across clients may vary significantly, thus testing the robustness and scalability of federated learning algorithms .

The Adam optimizer was applied on the server-side to handle sparse gradients effectively and efficiently train the global model despite noisy problems. It combines AdaGrad and RMSProp properties, optimizing the model's convergence. In the project, this optimizer achieved the highest performance metrics, with an accuracy of 94.12% and an F1-score of 0.93, significantly outperforming other optimization methods .

The primary findings indicated that FedProx with full client participation achieved superior results compared to FedAvg, with 85.41% accuracy and 0.813 F1-score versus FedAvg's 82.66% accuracy and 0.784 F1-score. The Adam optimizer provided the best overall performance (94.12% accuracy, 0.93 F1-score). Weighted client participation improved outcomes by considering dataset size, resulting in 87.6% accuracy and 0.835 F1-score. These findings suggest that combining advanced optimization and participation methods enhances federated learning outcomes .

Non-iid data partitioning impacts results interpretability by introducing a more realistic scenario where client data variability can confound outcomes of algorithm performance. It complicates attributing model performance purely to the algorithm as variations may arise from data distribution effects. Such partitioning in the project led to diverse, unbalanced client datasets, mirroring real-world data variance and challenging the model’s ability to generalize, thereby providing a stringent test of algorithm robustness .

Client participation variations affect federated learning performance significantly. The project demonstrated that full client participation using FedAvg resulted in higher accuracy (82.66%) and F1-score (0.784) compared to partial participation (75.59% accuracy, 0.682 F1-score). With FedProx, full participation similarly showed higher metrics (85.41% accuracy, 0.813 F1-score) versus partial participation. Thus, involving more clients generally boosts model reliability and performance by incorporating more data variability into the global model .

The project applied top-K sparsification and quantization techniques to address communication overhead in federated learning. Top-K sparsification reduces communication overhead by transmitting only the most significant model updates, specifically applying sparsification when sending weights from clients to the server, given that clients are typically resource-constrained. Quantization further compresses the model updates by converting the floating-point model weights to lower precision formats like integers, significantly reducing data size transmitted during updates .

Quantization contributed to communication efficiency by compressing model updates through conversion to lower precision formats, thereby reducing the transmission data size. Despite enhancing efficiency, it had lower performance metrics than some other methods with an accuracy of 76.25% and an F1-score of 0.7001. This indicates a trade-off between communication efficiency and model accuracy in federated learning .

You might also like