Skip to content

MuhammadSaqib786/Smart-Home-Federated-Learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Home Federated Learning with Flower

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.

Project Structure

  • 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.

Datasets

You will need two datasets for this project. These are publicly available at the following URLs:

  1. Dataset 1: hh101.zip
  2. Dataset 2: hh102.zip

Download these datasets and extract them into your project folder.

How to Run the Project

Step 1: Install Dependencies

Step 2: Prepare the Datasets

Step 3: Start the Flower Server

python server.py

Step 4: Start Client 1

python client_1.py

Step 5: Start Client 2

python client_2.py

Step 6: Monitor Results

The server will aggregate the training results from the clients and display the loss and accuracy metrics for each federated learning round.

Troubleshooting

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.

Acknowledgements

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

Install dependencies

pip install -r requirements.txt

About

fedFedrated learning system to classify smart home activities using data from two separate datasets

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages