This repository accompanies the paper: "Fair Play for Individuals, Foul Play for Groups? Auditing Anonymization’s Impact on ML Fairness". The key contributions of this paper is a systematical investigation of the interplay between anonymization techniques and fairness in machine learning (ML). Through various case studies, we address several critical research questions about the effects of anonymization, record suppression, dataset characteristics, and classifier choices on fairness metrics.
To set up the environment and install dependencies: pip install -r requirements.txt
Each script answers a specific research question (RQ). Run any experiment with: python <experiment_file>.py
How do different anonymization techniques (𝑘-anonymity, ℓ-diversity, and 𝑡-closeness) and their parameters affect the fairness of ML models?
How does varying the record-level suppression threshold during anonymization impact fairness, particularly for sub-populations?
What is the impact of altering the target distribution on fairness metrics, specifically by varying the threshold for binarizing the income variable?
How does dataset size mediate the trade-offs between privacy, fairness, and utility?
Do fairness results observed using XGBoost generalize across other ML classifiers, such as Random Forests and Neural Networks?
Consolidated findings from the above experiments are presented in:
├── data/ # Datasets used in the experiments
│ ├── adult_reconstruction.csv # Reconstructed ACSIncome dataset
│ └── compas-scores-two-years.csv # COMPAS dataset
├── hierarchies/ # CSV hierarchies for QI generalization
│ ├── ACSIncome
│ ├── adult
│ └── compas
├── results/ # Output CSVs from all experiments
├── 1_K_Anonymity_Impact_Fairness.py # RQ1: 𝑘-anonymity experiment
├── 1_L_Diversity_Impact_Fairness.py # RQ1: ℓ-diversity experiment
├── 1_T_Closeness_Impact_Fairness.py # RQ1: 𝑡-closeness experiment
├── 1_Exp_Suppression.py # RQ2: Suppression threshold impact
├── 1_Exp_Target_Distribution.py # RQ3: Effect of target binarization
├── 1_Exp_Data_Size_Fraction.py # RQ4: Dataset size variation
├── 1_Exp_Classifiers.py # RQ5: Model generalization study
├── 2_Results_Anon_Imp_Fairness.ipynb # Notebook with aggregated results
├── config_experiments.py # Configuration file for all experiments
├── utils.py # Utility functions
├── hierarchy_gen_ACSIncome.py # Generates hierarchies for ACSIncome
├── requirements.txt # Required Python libraries
├── LICENSE # License for the repository
└── README.md # Project overview and usage guide
For any questions, please contact Héber H. Arcolezi: heber.hwang-arcolezi [at] inria.fr
If you find this code useful, please consider citing our paper:
@article{arcolezi2025fair,
title={Fair Play for Individuals, Foul Play for Groups? Auditing Anonymization's Impact on ML Fairness},
author={Arcolezi, H{\'e}ber H and Alishahi, Mina and Bendoukha, Adda-Akram and Kaaniche, Nesrine},
journal={arXiv preprint arXiv:2505.07985},
year={2025}
}
Both the ACSIncome and Adult datasets were obtained via the Folktables Python library.
The COMPAS dataset was obtained from ProPublica’s investigation into algorithmic bias in criminal justice risk assessments, available at https://github.com/propublica/compas-analysis.
Anonymization methods were implemented via the Anjana Python library.
This repository is licensed under the MIT License. See LICENSE for details.