How swayam0611/federated-learning works
This repository is a research simulation of federated cardiovascular-disease training under a label-flipping attack, with local- and server-evaluation variants. The main workflow configures a run, loads client partitions and shared scaling values, trains three Flower clients, activates label flipping for the selected client, and uses server-side error-history detection to reject suspicious updates or roll back to a trusted model. It logs evaluation results and can optionally export a summary to Google Sheets. The scripts are monolithic; component boundaries below represent responsibilities within them. Unshown wiring is omitted or marked unverified.
Main entry points: src_server_eval/simulation_attack.py Server-eval clients · src_local_eval/simulation_attack.py Local-eval clients · output_final Client partitions · local_eval Local run log
Components 18
Run setup
- Local config
src_local_eval/config.yaml - Server config
src_server_eval/config.yaml - Local-eval runner
src_local_eval/simulation_attack.py - Server-eval runner
src_server_eval/simulation_attack.py
Federated training
- Client partitions
data/custom_splits/output_final - Shared scaler
shared - Local-eval clients
src_local_eval/simulation_attack.py - Server-eval clients
src_server_eval/simulation_attack.py - Label flipping
src_local_eval/simulation_attack.py - Label flipping
src_server_eval/simulation_attack.py
Detection and evaluation
- Local detection strategy
src_local_eval/simulation_attack.py - Server detection strategy
src_server_eval/simulation_attack.py - Local evaluation
src_local_eval/simulation_attack.py - Server evaluation
src_server_eval/simulation_attack.py
Results and export
- Local run log
metrics/local_eval - Server run log
metrics/server_eval
Other components
- Researcher
- Google Sheets
Connections 19
- Researcher → Local-eval runner: starts run
readme.md - Researcher → Server-eval runner: starts run
readme.md - Local config → Local-eval runner: configures
- Server config → Server-eval runner: configures
- Local-eval runner → Local-eval clients: starts simulation
src_local_eval/simulation_attack.py - Server-eval runner → Server-eval clients: starts simulation
src_server_eval/simulation_attack.py - Client partitions → Local-eval clients: provides data
readme.md - Client partitions → Server-eval clients: provides data
src_server_eval/simulation_attack.py - Shared scaler → Server-eval clients: normalizes data
src_server_eval/simulation_attack.py - Local-eval clients → Label flipping: activates attack
src_local_eval/simulation_attack.py - Server-eval clients → Label flipping: activates attack
src_server_eval/simulation_attack.py - Local-eval clients → Local detection strategy: sends updates
readme.md - Server-eval clients → Server detection strategy: sends updates
readme.md - Local detection strategy → Local evaluation: evaluates rounds
src_local_eval/simulation_attack.py - Server detection strategy → Server evaluation: evaluates rounds
src_server_eval/simulation_attack.py - Local detection strategy → Local run log: writes results
src_local_eval/simulation_attack.py - Server detection strategy → Server run log: writes results
src_server_eval/simulation_attack.py - Local run log → Google Sheets: exports summary
- Server run log → Google Sheets: exports summary