Skip to content

DadmehrRahbari/FDSH

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Adaptive and Efficient Federated Distillation with Selective Homomorphic Encryption (FDSH)

System Architecture Figure 1. Overall system architecture of the proposed FDSH framework.


📌 Overview

This repository provides the reference implementation of FDSH (Federated Distillation with Selective Homomorphic Encryption), an adaptive, privacy-preserving, and energy-aware federated learning framework designed for heterogeneous and resource-constrained edge devices.

FDSH addresses critical limitations of existing Federated Learning (FL) systems, namely membership inference attacks (MIA), non-IID data, energy constraints, and high cryptographic overhead, by combining:

  • Entropy-aware Selective Homomorphic Encryption (SHE)
  • Hierarchical Federated Knowledge Distillation (KD)
  • Energy-aware adaptive client participation
  • Cluster-based aggregation and resilience-aware training

The framework is evaluated primarily on Human Activity Recognition (HAR) tasks, but is designed to be extensible to other edge AI domains such as healthcare, speech, and IoT analytics.


📖 Associated Publication

If you use this code, please cite the following paper:

bibtex @article{RAHBARI2025131002,

title = {Adaptive and Efficient Federated Distillation with Selective Homomorphic Encryption for Edge AI},

journal = {Expert Systems with Applications},

pages = {131002},

year = {2025},

issn = {0957-4174},

doi = {https://doi.org/10.1016/j.eswa.2025.131002 },

url = {https://www.sciencedirect.com/science/article/pii/S0957417425046172 },

author = {Dadmehr Rahbari and Masoud Daneshtalab and Maksim Jenihhin} }

🎯 Key Contributions

Adaptive client participation based on real-time energy availability

Entropy-guided selective HE, encrypting only high-risk logits

Cluster-level knowledge distillation for scalability and personalization

Built-in MIA evaluation with near-random attack accuracy (~50%)

Unified Efficiency Index (UEI) for holistic system assessment

🧠 System Architecture

The FDSH framework operates in three layers:

Client Layer

Energy-aware training modes (full / partial / offload) Model size adaptation (TinyCNN, MobileNetV2, ResNet) Soft-logit generation with uncertainty estimation Selective encryption via HE

Cluster Aggregation Layer Homomorphic aggregation of encrypted logits Weighted KD within clusters Resilience-aware client handling

Global Server Layer Inter-cluster distillation Global model update and broadcast

⚙️ Installation

Requirements Python ≥ 3.9

PyTorch ≥ 2.0

NumPy, SciPy, scikit-learn

Pyfhel (for CKKS-based HE)

Matplotlib / Seaborn

File "HAR.rar" must be extracted in the same directory as "dataset". This is the dataset file from (https://archive.ics.uci.edu/dataset/240/human+activity+recognition+using+smartphones).

🚀 Running Experiments

Run Federated Training bash Copy code python scripts/run_federated.py --config configs/config.yaml Reproduce Paper Results bash Copy code python scripts/reproduce_results.py

📊 Experimental Results

Highlights +7% accuracy over baseline FL methods

~30% reduction in energy consumption

~25% lower communication overhead

Up to 34% higher Unified Efficiency Index (UEI)

MIA accuracy ≈ 50%, indicating strong privacy protection

🔐 Privacy & Security

Selective HE applied only to high-entropy logits

Homomorphic aggregation without decryption

Integrated MIA testing pipeline

Quantified privacy–utility–efficiency tradeoffs

📈 Unified Efficiency Index (UEI)

UEI combines:

Model accuracy Energy consumption Computation cost Communication overhead Privacy/security score

This enables holistic evaluation beyond accuracy-centric FL benchmarks.

🌍 Applicability & Extensions

While evaluated on HAR, FDSH is designed for:

Wearable & mobile sensing

Healthcare & medical imaging

Smart cities & IoT analytics

Edge AI under strict privacy constraints

🧪 Reproducibility & Best Practices

Deterministic seeds used in all experiments

Config-driven experiment management

Modular, extensible design

Clear separation of client, server, and security logic

🤝 Contributing

Contributions are welcome:

New datasets or modalities

Improved HE backends

Energy models for new devices

Large-scale deployment studies

📜 License

This project is released for academic and research use. For commercial usage, please contact the authors.

FDSH bridges the gap between privacy, efficiency, and accuracy in real-world federated edge intelligence.

About

Adaptive and Efficient Federated Distillation with Selective Homomorphic Encryption (FDSH)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages