Skip to main content

Fair Empirical Risk Minimization via Exponential Renyi Mutual Information (ERMI)

Project description

Fair Empirical Risk Minimization Via Exponential Rényi Mutual Information

This repository is dedicated to implementation of Fair Empirical Risk Minimization (FERMI) algorithms proposed in . FERMI provides the first stochastic algorithm with theroretical convergence guarantees for promoting fairness in classification tasks. To balance the accuracy and fairness, fair risk minimization through exponential Rényi mutual information framework minimizes the following objective function:

where the first term represents the population risk (accuracy) and the second term is a regularizer promoting exponential Rényi mutual information (ERMI) between the sensitive attribute(s) and predictions. Note that ERMI is a stronger notion of fairness compared to existing notions of fairness such as mutual information [Kamishima et al., 2011, Rezaei et al., 2020, Steinberget al., 2020, Zhang et al., 2018, Cho et al., 2020a], Pearson correlation [Zafar et al., 2017], false positive/negative rates[Bechavod and Ligett, 2017], Hilbert Schmidt independence criterion (HSIC) [Pérez-Suay et al., 2017], and Rényicorrelation [Baharlouei et al., 2020, Grari et al., 2020, 2019], in the sense that it upper bounds all aforementioned notions. Thus, minimizing ERMI guarantees the fairness of model under those notions. In the following table we compare FERMI with several state-of-the-art approaches in the literature. Note that the abbrevations NB, Cont., Stoch., DP, EOD, MI and RC stand for Non-binary, Continuous, Stochastic, Dempographic Parity, Equalized Odds, Mutual Information, and Rényi Correlation respectively.

Reference NB Target NB Attribute NB both exp. Violation Notion Unbiased Stoch. Alg Convergence Guarantee
Sotchastic FERMI :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: DP, EOD, MI, RC, ERMI :heavy_check_mark: O(ε-4) (Stoch)
Batch FERMI :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: DP, EOD, MI, RC, ERMI :x: O(ε-4) (Batch)
Cho et al. [2020a] :heavy_check_mark: :heavy_check_mark: :x: DP, EOD, MI :heavy_check_mark: :x:
Cho et al. [2020b] :heavy_check_mark: :heavy_check_mark: :heavy_check_mark: DP, EOD biased :x:
Baharlouei et al. [2020] :heavy_check_mark: :heavy_check_mark: :x: DP, EOD, RC :x: O(ε-4) (Batch)
Rezaei et al. [2020] :x: :x: :x: DP, EOD :x: :x:
Jiang et al. [2020] :x: :heavy_check_mark: :x: DP :x: :x:
Donini et al. [2018] :x: :heavy_check_mark: :x: EOD :x: :x:
Zhang et al. [2018] :heavy_check_mark: :heavy_check_mark: :x: DP, EOD biased :x:

Dependencies

The following packages must be installed via Anaconda or pip before running the codes. Download and install Python 3.x version from Python 3.x Version: Then install the following packages via Conda or pip:

Binary Classification with Binary Sensitive Attribute

To run the code for a binary classification problem with a binary sensitive attribute use the following command:

python BinaryClassification/Binary_FERMI.py

The above code updates the parameters of a logistic regression model via gradient descent algorithm. When the training dataset is large-scale, the implemented algorithm can be slow. Thus, we suggest to run the following code which updates the parameters using stochastic gradient descent. Note that, from a theoretical point of view the number of required iterations for FERMI (stochastic version) is not better than the deterministic algorithm, but the per-iteration cost is much smaller especially when smaller batches are chosen.

python BinaryClassification/Stochastic_FERMI.py

Stochastic FERMI for Large-scale Neural Networks on Datasets with Multiple Sensitive Attributes (Non-binary Labels and Sensitive Attributes)

The implementation of Algorithm 1 in paper, specialized to a 4-layer neural network on color mnist dataset can be found in NeuralNetworkMnist folder. You can run it on color mnist dataset via:

python NeuralNetworkMnist/code_cm.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

FERMI_ODDS-0.0.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

FERMI_ODDS-0.0.1-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file FERMI_ODDS-0.0.1.tar.gz.

File metadata

  • Download URL: FERMI_ODDS-0.0.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.5

File hashes

Hashes for FERMI_ODDS-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d06f12d98bcf352adb234fea3a8d247ba1a49392c4f6c3fdfcf27899a4485178
MD5 2c8fe0c8286b90c49aba29fa863106d8
BLAKE2b-256 61bbe60af48187ea81080fc197bc4df8080773ee989368da7ffc1f1b716abe00

See more details on using hashes here.

File details

Details for the file FERMI_ODDS-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: FERMI_ODDS-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.5

File hashes

Hashes for FERMI_ODDS-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cbabbdb795bd74573ff39ea795e6ab48fe8c45785cfda42145c39743e276ada1
MD5 18727735a354e4845c03f0052910893b
BLAKE2b-256 bbc6295f2d429a42987749a301f64e8f7e7e0565d3a3ff00753c7f6e4ac226f5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page