Skip to main content

SpuCo (Spurious Correlations Datasets and Benchmarks)

Documentation Status

SpuCo is a Python package developed to further research to address spurious correlations. Spurious correlations arise when machine learning models learn to exploit easy features that are not predictive of class membership but are correlated with a given class in the training data. This leads to catastrophically poor performance on the groups of data without such spurious features at test time.

Diagram illustrating the spurious correlations problem

Link to Paper: https://arxiv.org/abs/2306.11957

The SpuCo package is designed to help researchers and practitioners evaluate the robustness of their machine learning algorithms against spurious correlations that may exist in real-world data. SpuCo provides:

  • Modular implementations of current state-of-the-art (SOTA) methods to address spurious correlations
  • SpuCoMNIST: a controllable synthetic dataset that explores real-world data properties such as spurious feature difficulty, label noise, and feature noise
  • SpuCoAnimals: a large-scale vision dataset curated from ImageNet to explore real-world spurious correlations
  • SpuCoSun: a large-scale vision dataset with created using backgrounds from SUN397 (class feature) and foregrounds (spurious feature) created using a text-to-image diffusion model corresponding to OpenImagesV7. Two versions of this dataset are provided: SpuCoSun Easy and SpuCoSun Hard with easy and hard spurious features, respectively.

Note: This project is under active development.

Quickstart

Refer to quickstart for scripts and notebooks to get started with SpuCo

You can explore the data with the notebook: Explore Data

You can find scripts / notebooks for training with SOTA methods in the folders under quickstart. These are organized by dataset name.

Installation

pip install spuco

Requires >= Python 3.10

Using with GuildAI

Creating gpu-affinitized queues

for i in {0..7}; do guild run queue -b --gpus="$i" -y; done

About Us

This package is maintained by Siddharth Joshi from the BigML group at UCLA, headed by Professor Baharan Mirzasoleiman.

Metadata

Release files for spuco 2.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spuco 2.0.3
File Size Uploaded
spuco-2.0.3.tar.gz 95.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for spuco 2.0.3
File Interpreter ABI Platform
spuco-2.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 223.0 kB

Release files / spuco-2.0.3.tar.gz

Download URL spuco-2.0.3.tar.gz
Size 95.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d8f6431a573953d16da2cc5815ad3c98fcf1964624e4549d709edba6976a0b8f
BLAKE2b-256 checksum
How to use checksums
47673f362357bdad7f052239a3061d396651b1a06ce2498d6d5c624ced07e9b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.0

Release files / spuco-2.0.3-py3-none-any.whl

Download URL spuco-2.0.3-py3-none-any.whl
Size 127.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79e3ac8b6dd6b08616ac6a20ae41eb635ca553ea2b75e1a6f04a28dd6fb2ce86
BLAKE2b-256 checksum
How to use checksums
c779e9b08f4900a6aa475e4852d1f64401b337eabd987048292f9a76323a1f25
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.0

Release history Release notifications | RSS feed

This release

2.0.3 This release

2 release files

2.0.2

2 release files

2.0.1

1 release file

2.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page