Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ahmeddoghri/fedcal

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fedcal

FedAvg's marketing photo has every client looking identical and happy. fedcal takes that photo, gives one client a bad day, and measures what happens.

CI python deps license

FedAvg is easy to explain because every client politely disappears into one neat average. Real clients do not disappear, they have different feature shifts and different class skews, and somebody's device always ends up with the worst slice of the data. fedcal makes that mess explicit: six clients with different distributions, updates clipped so no single client can hijack the global model, and a conservative local calibration step that only nudges a client's bias when it actually improves validation accuracy, since letting personalization run wild on a small local slice is how you overfit your way into a worse model.

Run it

git clone https://github.com/ahmeddoghri/fedcal
cd fedcal
pip install -e ".[dev]"
python -m fedcal.benchmark

Verified benchmark

Generated locally with python -m fedcal.benchmark:

model          macro_acc  worst_client_acc
fedavg            0.829             0.667
fedprox           0.833             0.667
fedprox_cal       0.815             0.694
worst_gain         0.028

Plain FedAvg and FedProx both strand the worst client at 66.7% accuracy while looking fine on the macro average, which is exactly how a federated model quietly fails one real user while the dashboard says everything is green. Adding conservative local calibration trades 1.4 points of macro accuracy for a 2.8 point gain on the worst client, on purpose, because the worst client is the one who actually complains.

Research trail

Tests

pytest -q
ruff check .

MIT © Ahmed Doghri

About

Federated learning where the clients are allowed to be different, because they are. Non-IID benchmark comparing FedAvg, FedProx, and calibration on worst-client accuracy.

Topics

Resources

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.