Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
AIF360 — 一套全面的数据集和机器学习模型公平性度量指标、这些指标的说明,以及用于缓解数据集和模型中偏差的算法。 | Kitploit
工具/GitHubGitHub/trusted-ai/aif360
机器学习论文与研究学习与教育
GitHubtrusted-ai/aif360

AIF360

一套全面的数据集和机器学习模型公平性度量指标、这些指标的说明,以及用于缓解数据集和模型中偏差的算法。

查看仓库网站
2.9k9072个月前Kitploit 审核通过

最受欢迎

查看全部 →

发现我们社区最常用的工具。

探索所有工具

浏览我们的工具集合

查看所有工具 →
分享

AI Fairness 360 (AIF360)

Continuous Integration Documentation PyPI version CRAN_Status_Badge

AI Fairness 360 工具包是一个可扩展的开源库,包含由研究社区开发的技术,用于在 AI 应用生命周期的各个阶段帮助检测和缓解机器学习模型中的偏见。AI Fairness 360 包同时提供 Python 和 R 版本。

AI Fairness 360 包包括:

  1. 一套全面的指标,用于测试数据集和模型中的偏见,
  2. 这些指标的说明,以及
  3. 用于缓解数据集和模型中偏见的算法。

它旨在将算法研究从实验室转化为金融、人力资本管理、医疗保健和教育等广泛领域的实际实践。我们邀请您使用并改进它。

AI Fairness 360 交互式体验 提供了对概念和功能的入门介绍。教程和其他 notebook 提供了更深入的、面向数据科学家的介绍。完整的 API 也可用。

由于功能集非常全面,要弄清楚哪些指标和算法最适合给定的用例可能会令人困惑。为了提供帮助,我们创建了一些可供查阅的指导材料。

我们在开发该包时考虑了可扩展性。这个库仍在开发中。我们鼓励您贡献自己的指标、解释器和去偏算法。

在 Slack 上与我们联系(邀请在此)!

支持的偏见缓解算法

  • Optimized Preprocessing (Calmon et al., 2017)
  • Disparate Impact Remover (Feldman et al., 2015)
  • Equalized Odds Postprocessing (Hardt et al., 2016)
  • Reweighing (Kamiran and Calders, 2012)
  • Reject Option Classification (Kamiran et al., 2012)
  • Prejudice Remover Regularizer (Kamishima et al., 2012)
  • Calibrated Equalized Odds Postprocessing (Pleiss et al., 2017)
  • Learning Fair Representations (Zemel et al., 2013)
  • Adversarial Debiasing (Zhang et al., 2018)
  • Meta-Algorithm for Fair Classification (Celis et al., 2018)
  • Rich Subgroup Fairness (Kearns, Neel, Roth, Wu, 2018)
  • Exponentiated Gradient Reduction (Agarwal et al., 2018)
  • Grid Search Reduction (Agarwal et al., 2018, Agarwal et al., 2019)
  • Fair Data Adaptation (Plečko and Meinshausen, 2020, Plečko et al., 2021)
  • Sensitive Set Invariance/Sensitive Subspace Robustness (Yurochkin and Sun, 2020, Yurochkin et al., 2019)

支持的公平性指标

  • 全面的组公平性指标集,源自选择率和错误率,包括丰富子组公平性
  • 全面的样本失真指标集
  • Generalized Entropy Index (Speicher et al., 2018)
  • Differential Fairness and Bias Amplification (Foulds et al., 2018)
  • Bias Scan with Multi-Dimensional Subset Scan (Zhang, Neill, 2017)

安装

R

root@kitploit:~
install.packages("aif360")

有关 R 安装设置的更多详情,请参阅此处的说明。

Python

支持的 Python 配置:

操作系统Python 版本
macOS3.10 – 3.13
Ubuntu3.10 – 3.13
Windows3.10 – 3.13

(可选)创建虚拟环境

AIF360 需要许多 Python 包的特定版本,这些版本可能会与您系统上的其他项目冲突。强烈建议使用虚拟环境管理器,以确保依赖项可以安全安装。如果您在安装 AIF360 时遇到问题,请先尝试此方法。

Conda

建议在所有配置中使用 Conda,尽管 Virtualenv 在我们的使用场景中通常可以互换。如果您尚未安装 conda,Miniconda 就足够了(如果您好奇,可以查看 Anaconda 和 Miniconda 之间的区别)。

然后,要创建一个新的 Python 3.11 环境,请运行:

root@kitploit:~
conda create --name aif360 python=3.11
conda activate aif360

此时 shell 应显示为 (aif360) $。要停用该环境,请运行:

root@kitploit:~
(aif360)$ conda deactivate

提示符将恢复为 $ 。

使用 pip 安装

要从 PyPI 安装最新的稳定版本,请运行:

root@kitploit:~
pip install aif360

注意:某些算法需要额外的依赖项(不过所有指标都可以开箱即用)。要安装包含特定算法依赖项的版本,请运行,例如:

root@kitploit:~
pip install 'aif360[LFR,OptimPreproc]'

或者,要获得完整的功能,请运行:

root@kitploit:~
pip install 'aif360[all]'

可用的附加选项包括:OptimPreproc, LFR, AdversarialDebiasing, DisparateImpactRemover, LIME, ART, Reductions, FairAdapt, inFairness, LawSchoolGPA, notebooks, tests, docs, all

如果您遇到任何错误,请尝试故障排除步骤。

手动安装

克隆此仓库的最新版本:

root@kitploit:~
git clone https://github.com/Trusted-AI/AIF360

如果您想运行示例,请立即下载数据集,并按照 aif360/data/README.md 中的说明将它们放在各自的文件夹中。

然后,导航到项目的根目录并运行:

root@kitploit:~
pip install --editable '.[all]'

运行示例

要运行示例 notebook,请完成上述手动安装步骤。然后,如果您没有使用 [all] 选项,请按如下方式安装额外的依赖项:

root@kitploit:~
pip install -e '.[notebooks]'

最后,如果您尚未下载数据集,请按照 aif360/data/README.md 中的说明进行下载。

故障排除

如果您在安装过程中遇到任何错误,请在此处查找您的问题并尝试解决方案。

TensorFlow

有关详细说明,请参阅使用 pip 安装 TensorFlow 页面。

注意:我们要求 'tensorflow >= 1.13.1'。

安装 tensorflow 后,请尝试重新运行:

root@kitploit:~
pip install 'aif360[AdversarialDebiasing]'

仅在使用 aif360.algorithms.inprocessing.AdversarialDebiasing 类时才需要 TensorFlow。

CVXPY

在 MacOS 上,如果您之前从未安装过 Xcode 命令行工具,则可能需要先安装:

root@kitploit:~
xcode-select --install

在 Windows 上,您可能需要下载 Microsoft C++ Build Tools for Visual Studio 2019。有关最新的安装说明,请参阅 CVXPY 安装 页面。

然后,尝试通过以下方式重新安装:

root@kitploit:~
pip install 'aif360[OptimPreproc]'

仅在使用 aif360.algorithms.preprocessing.OptimPreproc 类时才需要 CVXPY。

使用 AIF360

examples 目录包含各种以不同方式使用 AI Fairness 360 的 jupyter notebook 集合。教程和演示都展示了使用 AIF360 的可运行代码。教程提供了额外的讨论,引导用户完成 notebook 的各个步骤。请参阅此处了解有关教程和演示的详细信息。

引用 AIF360

AI Fairness 360 的技术描述可参阅此论文。以下是该论文的 bibtex 条目。

root@kitploit:~
@misc{aif360-oct-2018,
    title = "{AI Fairness} 360:  An Extensible Toolkit for Detecting, Understanding, and Mitigating Unwanted Algorithmic Bias",
    author = {Rachel K. E. Bellamy and Kuntal Dey and Michael Hind and
	Samuel C. Hoffman and Stephanie Houde and Kalapriya Kannan and
	Pranay Lohia and Jacquelyn Martino and Sameep Mehta and
	Aleksandra Mojsilovic and Seema Nagar and Karthikeyan Natesan Ramamurthy and
	John Richards and Diptikalyan Saha and Prasanna Sattigeri and
	Moninder Singh and Kush R. Varshney and Yunfeng Zhang},
    month = oct,
    year = {2018},
    url = {https://arxiv.org/abs/1810.01943}
}

AIF360 视频

  • Kush Varshney 于 2018 年 9 月 20 日发布的 AI Fairness 360 入门视频(32 分钟)

贡献

Rich Subgroup Fairness(inprocessing/gerryfair_classifier.py)的开发分支在此处。欢迎贡献,作者列出的潜在贡献清单可查看此处。

下载工具