OA0
OA0 是一个探索 AI 的社区
现在注册
已注册用户请  登录
OA0  ›  代码  ›  cleanlab — 自动发现数据标注问题并提升模型训练质量

cleanlab — 自动发现数据标注问题并提升模型训练质量

 
  crunch ·  2026-08-26 11:00:24 · 1 次点击  · 0 条评论  
pypi_versions py_versions coverage Github Stars Twitter

文档 | 示例 | 博客 | 研究

Cleanlab 的开源库通过自动检测机器学习数据集中的问题,帮助您清洗数据与标注标签。为了促进使用杂乱真实世界数据的机器学习,这个以数据为中心的 AI 包利用您现有的模型来估计数据集问题,解决这些问题即可训练出更优秀的模型。

通过以下代码,cleanlab **自动检测**猫/狗数据集中的各种问题示例:

        lab = cleanlab.Datalab(data=dataset, label="column_name_for_labels")
        # 拟合任意 ML 模型,获取数据的 feature_embeddings 和 pred_probs
        lab.find_issues(features=feature_embeddings, pred_probs=pred_probs)
        lab.report()

运行 cleanlab 开源版

此 cleanlab 包可在 Python 3.10+ 上运行,并支持 Linux、macOS 以及 Windows。

  • 此处开始!通过 uvpipconda 安装。
  • 从源码安装最新开发版的开发者,请参阅 master 分支文档

实践以数据为中心的 AI 可以按如下步骤进行:
1. 在原始数据集上训练初始 ML 模型。
2. 利用该模型诊断数据问题(通过 cleanlab 方法)并改进数据集。
3. 在改进后的数据集上训练相同的模型。
4. 尝试各种建模技术以进一步提升性能。

大多数人直接从步骤 1 跳到 4,但通过使用 cleanlab,您无需任何建模代码更改即可获得巨大提升!
通过迭代步骤 2 → 4 持续提升性能(并尝试使用清洗后的数据进行评估)。

将 cleanlab 与任何模型以及在大多数 ML 任务中结合使用

cleanlab 的所有功能适用于任何数据集任何模型。是的,任何模型:PyTorch、Tensorflow、Keras、JAX、HuggingFace、OpenAI、XGBoost、scikit-learn 等。

cleanlab 在广泛的机器学习任务中非常有用。此以数据为中心的 AI 包提供专门功能的特定任务包括:
1. 二分类和多分类
2. 多标签分类(例如图像/文档标记)
3. 标记分类(例如文本中的实体识别)
4. 回归(预测数据集中的数值列)
5. 图像分割(具有逐像素标注的图像)
6. 目标检测(具有边界框标注的图像)
7. 多标注者标注的数据分类
8. 多标注者的主动学习(建议标注或重新标注哪些数据以最大化模型改进)
9. 异常值检测(识别不符合分布的异常数据)

对于其他 ML 任务,如果适当应用,cleanlab 仍能帮助您改进数据集。
请参阅我们的示例笔记本博客

如此新鲜,如此 cleanlab

除了自动捕获数据中潜伏的各种问题之外,这个以数据为中心的 AI 包还帮助您处理噪声标签并训练更健壮的 ML 模型
这里有一个例子:


# cleanlab 适用于**任何分类器**。是的,您可以使用 PyTorch/TensorFlow/OpenAI/XGBoost 等。
cl = cleanlab.classification.CleanLearning(sklearn.YourFavoriteClassifier())

# 用一行代码找到**任何数据集**中的数据和标签问题!
label_issues = cl.find_label_issues(data, labels)

# 训练一个更健壮的模型版本,使其在噪声数据上更可靠。
cl.fit(data, labels)

# 估计如果您在没有*任何*标签问题的情况下训练会得到的预测结果。
cl.predict(test_data)

# 一个通用的以数据为中心的 AI 工具,cleanlab 量化任何数据集的类别级问题和整体数据质量。
cleanlab.dataset.health_summary(labels, confident_joint=cl.confident_joint)

cleanlab 通过最先进的置信学习算法清洗您的数据标签,该算法发表在此论文博客中。在 labelerrors.com 查看一些使用 cleanlab 清洗的数据集。

cleanlab 具有以下特点:

  1. 有理论支持 -- 具有可证明的标签噪声估计保证,即使使用非完美模型也适用。
  2. 快速 -- 代码并行化且可扩展。
  3. 易于使用 -- 一行代码即可发现错误标签、不良标注者、异常值,或训练对噪声鲁棒的模型。
  4. 通用 -- 适用于任何数据集(文本、图像、表格、音频等)+ 任何模型(PyTorch、OpenAI、XGBoost 等)。

使用 cleanlab 在各种图像数据集中发现并纠正的错误给定标签示例。 虽然这些示例来自图像数据集,但此方法同样适用于文本、音频、表格数据。

引用和相关出版物

cleanlab 基于同行评审的研究。如果您使用此包,以下相关论文可供引用:

置信学习 (JAIR '21) (点击显示 bibtex) @article{northcutt2021confidentlearning, title={Confident Learning: Estimating Uncertainty in Dataset Labels}, author={Curtis G. Northcutt and Lu Jiang and Isaac L. Chuang}, journal={Journal of Artificial Intelligence Research (JAIR)}, volume={70}, pages={1373--1411}, year={2021} }
排名剪枝 (UAI '17) (点击显示 bibtex) @inproceedings{northcutt2017rankpruning, author={Northcutt, Curtis G. and Wu, Tailin and Chuang, Isaac L.}, title={Learning with Confident Examples: Rank Pruning for Robust Classification with Noisy Labels}, booktitle = {Proceedings of the Thirty-Third Conference on Uncertainty in Artificial Intelligence}, series = {UAI'17}, year = {2017}, location = {Sydney, Australia}, numpages = {10}, url = {http://auai.org/uai2017/proceedings/papers/35.pdf}, publisher = {AUAI Press}, }
标签质量评分 (ICML '22) (点击显示 bibtex) @inproceedings{kuan2022labelquality, title={Model-agnostic label quality scoring to detect real-world label errors}, author={Kuan, Johnson and Mueller, Jonas}, booktitle={ICML DataPerf Workshop}, year={2022} }
标记分类/实体识别中的标签错误 (NeurIPS '22) (点击显示 bibtex) @inproceedings{wang2022tokenerrors, title={Detecting label errors in token classification data}, author={Wang, Wei-Chen and Mueller, Jonas}, booktitle={NeurIPS Workshop on Interactive Learning for Natural Language Processing (InterNLP)}, year={2022} }
多标签分类中的标签错误 (ICLR '23) (点击显示 bibtex) @inproceedings{thyagarajan2023multilabel, title={Identifying Incorrect Annotations in Multi-Label Classification Data}, author={Thyagarajan, Aditya and Snorrason, Elías and Northcutt, Curtis and Mueller, Jonas}, booktitle={ICLR Workshop on Trustworthy ML}, year={2023} }
目标检测中的标签错误 (ICML '23) (点击显示 bibtex) @inproceedings{tkachenko2023objectlab, title={ObjectLab: Automated Diagnosis of Mislabeled Images in Object Detection Data}, author={Tkachenko, Ulyana and Thyagarajan, Aditya and Mueller, Jonas}, booktitle={ICML Workshop on Data-centric Machine Learning Research}, year={2023} }
图像分割中的标签错误 (ICML '23) (点击显示 bibtex) @inproceedings{lad2023segmentation, title={Estimating label quality and errors in semantic segmentation data via any model}, author={Lad, Vedang and Mueller, Jonas}, booktitle={ICML Workshop on Data-centric Machine Learning Research}, year={2023} }
检测数值数据中的错误 (DMLR '24) (点击显示 bibtex) @inproceedings{zhou2023errors, title={Detecting Errors in a Numerical Response via any Regression Model}, author={Zhou, Hang and Mueller, Jonas and Kumar, Mayank and Wang, Jane-Ling and Lei, Jing}, booktitle={Journal of Data-centric Machine Learning Research}, year={2024} }
分布外检测 (ICML '22) (点击显示 bibtex) @inproceedings{kuan2022ood, title={Back to the Basics: Revisiting Out-of-Distribution Detection Baselines}, author={Kuan, Johnson and Mueller, Jonas}, booktitle={ICML Workshop on Principles of Distribution Shift}, year={2022} }
用于多标注者数据的 CROWDLAB (NeurIPS '22) (点击显示 bibtex) @inproceedings{goh2022crowdlab, title={CROWDLAB: Supervised learning to infer consensus labels and quality scores for data with multiple annotators}, author={Goh, Hui Wen and Tkachenko, Ulyana and Mueller, Jonas}, booktitle={NeurIPS Human in the Loop Learning Workshop}, year={2022} }
ActiveLab: 主动学习与数据重标注 (ICLR '23) (点击显示 bibtex) @inproceedings{goh2023activelab, title={ActiveLab: Active Learning with Re-Labeling by Multiple Annotators}, author={Goh, Hui Wen and Mueller, Jonas}, booktitle={ICLR Workshop on Trustworthy ML}, year={2023} }
检测数据集漂移和非独立同分布采样 (ICML '23) (点击显示 bibtex) @inproceedings{cummings2023drift, title={Detecting Dataset Drift and Non-IID Sampling via k-Nearest Neighbors}, author={Cummings, Jesse and Snorrason, Elías and Mueller, Jonas}, booktitle={ICML Workshop on Data-centric Machine Learning Research}, year={2023} }

要了解/引用上述未描述的 cleanlab 功能,请查看我们的博客

其他资源

有兴趣贡献吗? 请参阅贡献指南开发指南以及有价值的贡献想法

有问题吗? 请查看我们的常见问题解答Github Issues

1 次点击  ∙  0 人收藏  
登录后收藏  
0 条回复
关于 ·  帮助 ·  PING ·  隐私 ·  条款   
OA0 - Omni AI 0 一个探索 AI 的社区
沪ICP备2024103595号-2
耗时 31 ms
Developed with Cursor