Ensuring fairness in machine learning models is critical, particularly in high-stakes domains where biased decisions can lead to serious societal consequences. Existing preprocessing approaches generally lack transparent mechanisms for identifying which features or instances are responsible for unfairness. This obscures the rationale behind data modifications. We introduce FairSHAP, a novel pre-processing framework that leverages Shapley value attribution to improve both individual and group fairness. FairSHAP identifies fairness-critical instances in the training data using an interpretable measure of feature importance, and systematically modifies them through instance-level matching across sensitive groups. This process reduces discriminative risk - an individual fairness metric - while preserving data integrity and model accuracy. We demonstrate that FairSHAP significantly improves demographic parity and equality of opportunity across diverse tabular datasets, achieving fairness gains with minimal data perturbation and, in some cases, improved predictive performance. As a model-agnostic and transparent method, FairSHAP integrates seamlessly into existing machine learning pipelines and provides actionable insights into the sources of bias.Our code is on https://github.com/ZhuMuMu0216/FairSHAP.
翻译:确保机器学习模型的公平性至关重要,尤其在决策偏差可能导致严重社会后果的高风险领域。现有的预处理方法通常缺乏透明的机制来识别导致不公平的特征或实例,这模糊了数据修改背后的原理。我们提出了FairSHAP,一种新颖的预处理框架,它利用Shapley值归因来提升个体公平性和群体公平性。FairSHAP通过可解释的特征重要性度量识别训练数据中对公平性至关重要的实例,并通过跨敏感群体的实例级匹配对其进行系统性修改。这一过程在保持数据完整性和模型准确性的同时,降低了判别风险——一种个体公平性度量。我们证明,FairSHAP在多种表格数据集上显著改善了人口统计均等和机会均等,以最小的数据扰动实现了公平性提升,并在某些情况下提高了预测性能。作为一种模型无关且透明的方法,FairSHAP可无缝集成到现有的机器学习流程中,并为偏差来源提供可操作的见解。我们的代码位于https://github.com/ZhuMuMu0216/FairSHAP。