This project implements a federated learning system with differential privacy using the Flower library. The system is designed to train a neural network model on distributed healthcare data while preserving privacy through differential privacy mechanisms.
The project implements a client-server architecture where:
- A central server coordinates the federated learning process
- Multiple clients (10 in this implementation) train the model on their local data
- Differential privacy is applied to protect sensitive information during the training process
The project uses a healthcare dataset containing the following features:
- ABP Diastolic
- ABP Systolic
- Glucose
- Heart Rate
- Respiratory Rate
- Temperature (°F)
- hospital_expire_flag (target variable)
The dataset contains 71,026 rows of patient data.
.
├── data/
│ └── merged_data.csv
├── server.py
├── client.py
├── start_clients.sh
├── requirements.txt
└── README.md
- Python 3.7+
- Flower (flwr)
- TensorFlow
- Pandas
- NumPy
- Clone the repository:
git clone https://github.com/Gmehta604/Differential-Privacy-Federated-Learning.git- Install the required packages:
pip install -r requirements.txt- Start the server:
python server.py- Start the clients (in a new terminal):
./start_clients.sh- Coordinates the federated learning process
- Aggregates model updates from clients
- Implements differential privacy mechanisms
- Each client receives a portion of the dataset
- Trains the model locally
- Applies differential privacy to model updates
- Sends encrypted updates to the server
The implementation includes differential privacy mechanisms to protect sensitive data during the federated learning process.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Flower library for federated learning implementation
- TensorFlow for neural network implementation
- Contributors and maintainers of the project