DetoxAI Logo DetoxAI

A Python package for debiasing neural networks

PUT Logo Poznan University of Technology
*Indicates Equal Contribution
Submitted to ECML-PKDD Demo Track 2025

How DetoxAI Works

DetoxAI Features
DetoxAI transforms biased neural networks into fair and balanced models with minimal code integration.

Key Features

Multiple Debiasing Methods

DetoxAI includes several state-of-the-art debiasing techniques:

  • ClArC family
  • Zhang et al.
  • Savani et al.
  • Belrose et al.

Dataset Integration

Works with popular datasets out of the box:

  • CelebA
  • FairFace
  • CIFAR-10/100
  • Caltech101

Visualization Tools

Powerful tools to understand and visualize bias:

  • Saliency maps with Layer-wise Relevance Propagation
  • Side-by-side comparisons of original vs. debiased models
  • Aggregate visualizations to track focus shift

Simple API

DetoxAI is designed to be easy to use:

  • Works with existing PyTorch models
  • Integrates with standard dataloaders
  • Single function call to apply multiple methods

Quick Start

Code Example
# DetoxAI is available on PyPI, and can be installed by running the following command:
pip install detoxai

# DetoxAI Quickstart Example
import detoxai

# Load your pretrained model
model = ...

# Prepare a dataloader yielding (input, label, protected attribute)
dataloader = ...

# Debias the model using DetoxAI
corrected = detoxai.debias(model, dataloader)

# Access metrics from the SAVANIAFT debiasing method
metrics = corrected["SAVANIAFT"].get_all_metrics()

# Retrieve the debiased model
model = corrected["SAVANIAFT"].get_model()
            

DetoxAI provides a simple API for debiasing neural networks in image classification tasks.

Side by side comparison

Saliency maps obtained with Layer-wise Relevance Propagation (LRP) showing where the model focuses when classifying images.

Aggregate results

Aggregate visualizations (average photos) that we used in our work to show the effect of debiasing.

BibTeX


          @misc{detoxai,
            authors={Ignacy Stepka and Lukasz Sztukiewicz and Michal Wilinski and Jerzy Stefanowski},
            title={DetoxAI: a Python Toolkit for Debiasing Deep Learning Models in Computer Vision},
            year={2025},
          }