Skip to content

Aryankr31/ShadowFed

Repository files navigation

🛡️ ShadowFed

Synchronized & Encrypted learning


📖 Overview

ShadowFed is a privacy-preserving Federated Learning (FL) framework enhanced with Differential Privacy (DP).
It enables multiple clients (e.g., hospitals, banks, or smart devices) to collaboratively train machine learning models without sharing raw data, ensuring security, anonymity, and compliance with data protection standards.


Key Capabilities

  • 🤝 Federated Training – Clients train locally and share only model updates.
  • 🔒 Differential Privacy – Adds calibrated noise to updates to protect sensitive data.
  • 📡 Scalable Architecture – Supports multiple distributed clients.
  • 🧩 Modular Design – Easy to extend for healthcare, finance, or IoT domains.
  • 📊 Analytics & Monitoring – Logs performance and privacy metrics during training.

🏗️ Project Architecture

ShadowFed’s architecture balances collaboration with strong privacy guarantees.

  • Client Nodes – Hold private datasets, perform local training, and add DP noise.
  • Privacy Layer – Implements Differential Privacy before sending updates.
  • Server Aggregator – Combines client updates using Federated Averaging (FedAvg).
  • Global Model – A privacy-preserving, collaboratively trained model is shared back to clients.

Client Nodes      → Local training on private data
Privacy Layer     → DP noise addition to gradients/weights
Server Aggregator → Federated Averaging of model updates
Global Model      → Shared, privacy-preserving model for all clients


📂 Repository Structure


ShadowFed/
│── data/                  # Sample datasets for simulation
│── src/                   # Core source code
│   ├── client.py          # Client-side training logic
│   ├── server.py          # Aggregation logic (FedAvg)
│   ├── dp\_mechanism.py    # Differential Privacy algorithms
│   └── main.py            # Entry point for running simulations
│── requirements.txt       # Python dependencies
│── .gitignore             # Ignored files and directories
│── README.md              # Project documentation


🚀 Installation & Setup

1️⃣ Clone the Repository

git clone https://github.com/Aryankr31/ShadowFed.git
cd ShadowFed

2️⃣ Install Dependencies

pip install -r requirements.txt

3️⃣ Run the Simulation

python src/main.py

🛠️ Tech Stack

  • Python – Core language
  • PyTorch – Model training & inference
  • Flower (FLwr) – Federated learning framework
  • Opacus – Differential Privacy library for PyTorch
  • NumPy & Pandas – Data handling
  • Matplotlib – Training & privacy visualization

🌍 Real-World Applications

  • 🏥 Healthcare – Hospitals train models collaboratively without sharing patient data.
  • 💰 Finance – Banks detect fraud patterns without exposing customer records.
  • 🌆 Smart Cities – Federated video analysis with privacy guarantees.
  • 📱 IoT Devices – Edge devices contribute to training without leaking sensitive usage data.

📌 Future Scope

  • 🔐 Add Homomorphic Encryption for stronger privacy.
  • 🌐 Cross-silo Federated Learning between organizations.
  • ☁️ Cloud & Edge Deployment with Kubernetes/Docker.
  • 📡 Real-time FL for streaming data.

Acknowledgements

Thanks to the open-source community that made ShadowFed possible:

  • PyTorch
  • Flower (FLwr)
  • Opacus
  • NumPy / Pandas
  • Matplotlib

About

Model learns in the “shadows” without exposing raw data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors