This repository contains Jupyter notebooks that provide examples of both centralized and federated learning using the Human Activity Recognition Using Smartphones Dataset.
The aim is to demonstrate the differences and implementation details between centralized learning, where data is combined and processed on a single server, and federated learning, where data remains on decentralized devices and only model updates are shared.
The dataset used in these examples is the Human Activity Recognition Using Smartphones Dataset from the UCI Machine Learning Repository. This dataset contains sensor signals collected from smartphones of 30 subjects performing six different activities (walking, walking upstairs, walking downstairs, sitting, standing, and laying).
- Activities: 6
- Subjects: 30
- Features: 561
- Data: Time and frequency domain variables
The repository contains the following Jupyter notebooks:
- Notebook Directory:
CL-sklearn
- Description: This notebook demonstrates the implementation of a centralized learning model using
scikit-learn
. All data is aggregated on a central server for training. - Dependencies:
scikit-learn
- Notebook Directory:
FL-sklearn
- Description: This notebook demonstrates the implementation of a federated learning model using the Flower framework. The training is distributed across multiple devices, and only model updates are shared with a central server.
- Dependencies:
flwr
(flwr | link)
- Notebook Directory:
CL-tensorflow
- Description: This notebook demonstrates the implementation of a centralized learning model using
tensorflow
. All data is aggregated on a central server for training. - Dependencies:
tensorflow
- Notebook Directory:
FL-tensorflow
- Description: This notebook demonstrates the implementation of a federated learning model using the Flower framework. The training is distributed across multiple devices, and only model updates are shared with a central server.
- Dependencies:
flwr
(flwr | link)
Ensure you have the following installed:
- Python 3.12.2
- Jupyter Notebook or JupyterLab