Giter Club home page Giter Club logo

fairvgnn's Introduction

FairVGNN

This repository is an official PyTorch(Geometric) implementation of FairVGNN in "Improving Fairness in Graph Neural Networks via Mitigating Sensitive Attribute Leakage".

If you use this software, please consider citing:

@inproceedings{fairview,
  author={Wang, Yu and Zhao, Yuying and Dong, Yushun and Chen, Huiyuan and Li, Jundong and Derr, Tyler},
  title={Improving Fairness in Graph Neural Networks via Mitigating Sensitive Attribute Leakage},
  booktitle={SIGKDD},
  year = {2022}
}

Motivation

Node representation learned by Graph Neural Networks (GNNs) may inherit historical prejudices and societal stereotypes from training data, leading to discriminatory bias in predictions. This paper demonstrates that feature propagation could vary feature correlations and cause the leakage of sensitive information to innocuous feature channels, which could further exacerbate discrimination in predictions.

Intuitively, features that are more correlated to sensitive features encode more discriminative information in learned node representations. Here we mask each feature channel based on their Pearson Correlation to the sensitive feature. We could clearly see that as we mask more sensitive-correlated feature channel, we end up with higher discrimination and bias in predicted results.

However the feature correlation would change after feature propagation in GNNs, as demonstrated by the following Figure on German dataset. We could clearly see that many innocuous feature channels become highly-correlated to sensitive one after propagation.

Framework

To prevent the sensitive leakage caused by feature propagation, we propose a novel framework FairVGNN to automatically learn fair views by identifying and masking sensitive-correlated channels and adaptively clamping weights to avoid leveraging sensitive-related features in learning fair node representations. The whole flowchart of FairVGNN is shown below:

Configuration

The default version of python we use is 3.8.10. Please install all necessary python packages via:

pip install -r requirements.txt

Please exclusively install torch 1.10.0+cu113 here and then install its compatiable torch-geometric following instructions here.

Result

Here we list the performance of our model (FairV). To reproduce the table, please run the following command:

bash run_german.sh (bash run_{dataset}.sh for other datasets.)

We want to kindly note that the table is obtained based on the scatter-based propagation, which is a non-deterministic operation (rusty1s/pytorch_scatter#226). Therefore, we would end up with different results after each running. Furthermore, we provide the sparse-matrix-based propagation, which is a deterministic operation. Both of these two versions of propagation are implemented in our repo for GCN baselines.

Reproduce preliminary results

The prelim folder includes all details to reproduce all preliminary results in this paper.

Analysis the effect of generative adversarial analysis

bash run_adv.sh

Analysis the effect of adaptive weight clipping

bash run_adwc.sh

Acknowledgement: The code is developed based on part of the code in the following papers:

[1] Chirag Agarwal, Himabindu Lakkaraju, and Marinka Zitnik. Towards a unified framework for fair and stable graph representation learning. arXiv preprint arXiv:2102.13186, 2021.

fairvgnn's People

Contributors

yuwvandy avatar maxisthespy avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.