Skip to main content

MiniACSIncome: A benchmark for fairness verification of neural networks.

Project description

MiniACSIncome

A benchmark for fairness verification of neural networks. The benchmark is based on the ACSIncome dataset from the folktables package. MiniACSIncome is based on USA census data from 2018.

Examples

Load a MiniACSIncome dataset.

from miniacsincome import MiniACSIncome

dataset = MiniACSIncome(num_variables=5)
dataset[0]
# (tensor([ 0.,  1.,  1.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
#           0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,  0.,
#           0.,  1.,  0.,  0.,  0.,  0., 60.,  0.,  0.,  1.,  0.,  0.]),
#  tensor(0)

The MiniACSIncome class is a torch.utils.data.Dataset. It can be used with the usual PyTorch dataloaders.

Load a trained MiniACSIncome dataset from the benchmark.

from miniacsincome import get_network

get_network(num_variables=5)
# Sequential(
#   (0): Linear(in_features=40, out_features=10, bias=True)
#   (1): ReLU()
#   (2): Linear(in_features=10, out_features=2, bias=True)
# )

The last part of MiniACSIncome are the input distributions (population models) for each MiniACSIncome dataset.

from miniacsincome import get_population_model, get_network
import torch

pop_model, input_space, input_transform = get_population_model(5)
input_space.input_shape
# torch.Size([40])
input_space.input_bounds
# (tensor([0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
#          0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0.,
#          0., 0., 0., 0.]),
#  tensor([ 1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
#           1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,  1.,
#           1.,  1.,  1.,  1.,  1.,  1., 99.,  1.,  1.,  1.,  1.,  1.]))

data = pop_model.sample(100, seed=0).to(torch.float32)
data.shape
# torch.Size([100, 40])

net = get_network(num_variables=5)
net(input_transform(data)).argmax(dim=-1).float().mean()
# tensor(0.2900)

Population Model

The population models are trained in population_model.ipynb. Each population model is derived from the population model for MiniACSIncome-8. The marginal distributions of this population model are:

marginal distributions

The covariance of the population model matches the covariance of the original dataset reasonably well.

covariance matrix comparison

Citation

If you use this dataset in your research, please cite:

@inproceedings{probspec,
  author       = {David Boetius and Stefan Leue and Tobias Sutter},
  title        = {Solving Probabilistic Verification Problems of Neural Networks using Branch and Bound},
  booktitle    = {{ICML}},
  series       = {Proceedings of Machine Learning Research},
  volume       = {267},
  publisher    = {{PMLR}},
  year         = {2025},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

miniacsincome-0.0.1.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

miniacsincome-0.0.1-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file miniacsincome-0.0.1.tar.gz.

File metadata

  • Download URL: miniacsincome-0.0.1.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.7

File hashes

Hashes for miniacsincome-0.0.1.tar.gz
Algorithm Hash digest
SHA256 f3a097eca3bbf3db17b56960e8275155dc131e89ae6a208f34d5351a8d7f9364
MD5 20099f2cfd9f1678ab2a5c9653005a0d
BLAKE2b-256 bc64c37d660ba8549a969b9eb40d7e3cc1e38c91a70cd6c925156d5520698ec9

See more details on using hashes here.

File details

Details for the file miniacsincome-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for miniacsincome-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4036ede3a6515cdaebcb26dc7f70d729aa51e5d428cdc1f94a9640d417995911
MD5 b48ce2c859e227df7c3ca9074954bb0a
BLAKE2b-256 9ba9137ae9c580521dd15d2b011614a188aa9430614590179948763e5b94ff12

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page