Federated learning is a distributed machine learning technique to train neural network models across edge devices with small amount of data; instead, training model in cloud or server with centralized, big data corpus. In this project, I implemented an application that clients can interact with a server to be part of federated learning. Server is responsible for receiving, sending, and aggregating neural network models. The clients are only assigned to training corresponding model with their local data. I used Centralized Federated Learning using WebSockets and TensorFlow. Lenet is preferred for computer vision model due to simplicity. CIFAR-10 and MNIST are used as dataset.
- Install the dependencies:
pip install -r requirements.txt
- Run a server
python server.py <number_of_requested_nodes> <number_of_communication_round> <name_of_dataset> <iid_or_non_iid> <balanced_or_unbalanced>
- Run a client
python client.py <client_id> <number_of_local_epoch>
- Server
- Client
-
WebSocket implementation adopted by europython-minimal-fl
-
Aggregation method (FedAvg) taken from Communication Efficient Learning of Deep Networks
from Decentralized Data
This project is licensed under the terms of the Baris Camli License.