DetoxAI: a Python Toolkit for Debiasing Deep Learning Models in Computer Vision
Ignacy Stępka, Lukasz Sztukiewicz, Michał Wiliński, Jerzy Stefanowski
TL;DR
DetoxAI addresses fairness in vision-based deep learning where existing tools focus on tabular data and do not address biases in internal representations. It introduces a post-hoc, representation-level debiasing toolkit that integrates with PyTorch to desensitize protected attributes without full retraining. The framework includes multiple debiasing methods (Savani/Zhang, LEACE, ClArC variants, and Threshold Optimization), quantitative fairness metrics (Equalized Odds, Demographic Parity, Accuracy Parity), and visualization tools to track attribution shifts, all accessible via a unified detoxai.debias(...) API. The paper demonstrates DetoxAI's utility through practical engineering and research use cases, and emphasizes its production-readiness, modularity, and extensibility for broad adoption in industry and research. This work promises to streamline fairness interventions in vision models and enable robust benchmarking and deployment of debiased classifiers.
Abstract
While machine learning fairness has made significant progress in recent years, most existing solutions focus on tabular data and are poorly suited for vision-based classification tasks, which rely heavily on deep learning. To bridge this gap, we introduce DetoxAI, an open-source Python library for improving fairness in deep learning vision classifiers through post-hoc debiasing. DetoxAI implements state-of-the-art debiasing algorithms, fairness metrics, and visualization tools. It supports debiasing via interventions in internal representations and includes attribution-based visualization tools and quantitative algorithmic fairness metrics to show how bias is mitigated. This paper presents the motivation, design, and use cases of DetoxAI, demonstrating its tangible value to engineers and researchers.
