This project implements a federated learning system to classify smart home activities using data from two separate datasets. The project uses Flower for federated learning, TensorFlow for model training, and a simple LSTM network for classification.
- server.py: This is the server-side code for federated learning, which coordinates the training and evaluation.
- client_1.py: This file handles the training for Client 1, using the
hh101
dataset. - client_2.py: This file handles the training for Client 2, using the
hh102
dataset. - task.py: This contains the data loading, preprocessing functions, and the model definition (LSTM).
- test.py: This script checks for the number of classes in each dataset partition.
- requirements.txt: Contains all the dependencies required to run the project.
You will need two datasets for this project. These are publicly available at the following URLs:
Download these datasets and extract them into your project folder.
python server.py
python client_1.py
python client_2.py
The server will aggregate the training results from the clients and display the loss and accuracy metrics for each federated learning round.
If you encounter any issues or bugs while running the project, ensure that:
All dependencies are installed correctly using the requirements.txt file.
Both datasets are available in the directory.
The server.py, client_1.py, and client_2.py scripts are run in the correct order.
This project uses the CASAS datasets, which are publicly available. The Flower framework is used for federated learning.
source myenv/bin/activate # On Windows use myenv\Scripts\activate
pip install -r requirements.txt