https://github.com/aida-ugent/otf
Optimal Transport of Classifiers to Fairness (NeurIPS 2022).
https://github.com/aida-ugent/otf
fairness optimal-transport pytorch regularizer
Last synced: 6 days ago
JSON representation
Optimal Transport of Classifiers to Fairness (NeurIPS 2022).
- Host: GitHub
- URL: https://github.com/aida-ugent/otf
- Owner: aida-ugent
- License: mit
- Created: 2022-11-20T11:21:44.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-06-01T13:20:09.000Z (over 2 years ago)
- Last Synced: 2025-09-09T01:22:57.364Z (about 1 month ago)
- Topics: fairness, optimal-transport, pytorch, regularizer
- Language: Python
- Homepage:
- Size: 21.5 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Optimal Transport to Fairness (OTF)
This project contains an accessible implementation of the OTF cost function proposed in the paper *Optimal Transport of Classifiers to Fairness* published at NeurIPS 2022.
The OTF cost projects a probability distribution to the closest distribution in the set of all fair distributions, where closeness is defined in terms of Optimal Transport cost. As such, OTF quantifies the unfairness of a model while taking the input features of individuals into account.
### Use
An example use of the OTF method for the Adult dataset is given in `main.py` . The actual implementation of the cost is in `otf.otf_cost`, where a fairness notion as given in `otf.linear_fairness_notion` is expected. In `otf.predictor`, a generic probabilistic model is implemented that uses the OTF cost as an additional cost term to optimize during training. Finally, `otf.evaluation` computes some metrics as explained in the paper.
When using the OTF cost, please make sure to tune the `reg_strength` hyperparameter at the very least, e.g. in the range `[0.01, 0.001, 0.0001]`. Also, the computation of the OTF cost can be sped up by reducing the `nb_epochs` parameter and increasing the `margin_tol` and `constraint_tol`.
### Citation
If you found our code useful, please cite our paper:
@inproceedings{buyl2022otf,
title = {Optimal Transport of Classifiers to Fairness},
author = {Buyl, Maarten and De Bie, Tijl},
booktitle = {Advances in Neural Information Processing Systems},
volume = {35},
pages = {33728--33740},
year = {2022}
}