Skip to main content

AFISP: Software to identify patient characteristics and data acquisition parameters associated with high error rates in predictive AI/ML models

PyPI version Tests Python versions

This repository contains code for the Regulatory Science Tool titled AFISP. The tool allows users to probe a trained machine learning (ML) or AI model for subgroups on which it underperforms.

Full documentation can be viewed at https://afisp.readthedocs.io/.

Installation

AFISP is a pure-Python package (Python 3.10+). Its rule-extraction step uses the pure-Python sirus package, so no R installation is required. Install it with pip:

pip install afisp

To install the latest version from source (e.g. for development):

git clone https://github.com/asubbaswamy/AFISP.git
cd AFISP
pip install -e ".[test]"

The optional torch extra (pip install "afisp[torch]") is only needed for the torch_roc_auc_surrogate loss in afisp.utils.

Run the test suite with pytest.

Repo Organization

The /afisp directory contains the source code for the tool.

A demo jupyter notebook showcasing the core functionality of the tool can be found in 'demo.ipynb'.

Tool Description

AFISP is a tool used to evaluate predictive AI models for patient subgroups with high error rates. The tool is applied after AI models have been trained and is applicable across many types of diagnostic and prognostic AI applications and modalities. Specifically, for a given AI model, AFISP requires three inputs: First, it requires per-sample loss function values (i.e., per-sample error values) for an independent test dataset (i.e., a dataset consisting of data samples that were not used to train or tune the AI model). Second, it requires meta-data such as measured patient characteristics (e.g., demographic information, comorbidities, etc.) or data acquisition parameters (e.g., X-ray radiation dose, scanner type) for each sample in the evaluation dataset. Third, it uses a performance threshold, which can be selected using prior knowledge or using a reference model. Given these inputs, AFISP identifies the worst-performing data subset: the largest subset of the evaluation dataset that produces performance below the threshold. The worst-performing data subset contains samples with the highest expected error rates (based on the meta-data features) and will have a different distribution of the meta-data features than the full evaluation dataset.

After selecting the worst-performing data subset, AFISP identifies interpretable subgroups (combinations of meta-data values such as “male patients with dementia”) present within the subset. This allows the user to understand specific characteristics of the data subset that are associated with the model’s lower performance. AFISP outputs a table of subgroups with low AI model performance, along with their sizes and performance values.

Purpose

AFISP is a software tool intended for exploratory analysis of patient subgroups to help identify which subgroups the predictive AI model is inaccurate. After a predictive AI model has been trained, model developers can use AFISP to test their models for the existence of subgroups on whom their model performs poorly. This is important for understanding the range of populations and data acquisition parameters for which the model may be unreliable. When AFISP identifies a subgroup, this can prompt model developers to perform further analysis to better understand the subgroup and to update or improve their model (for example, by collecting additional data from the underperforming subgroup and fine-tuning).

Download files

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

Source Distribution

afisp-0.2.1.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

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

afisp-0.2.1-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file afisp-0.2.1.tar.gz.

File metadata

  • Download URL: afisp-0.2.1.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for afisp-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9aabf771b77013aff49b626011f83dd72342f46c47bf8d20080189ab17228d71
MD5 e9c5af6cd82fc34be60e997210f4c1ee
BLAKE2b-256 1ae8a301d520a005c899c8987b8f39599a742cdcf036ce7613f508a2fcd93df2

See more details on using hashes here.

Provenance

The following attestation bundles were made for afisp-0.2.1.tar.gz:

Publisher: publishing.yml on asubbaswamy/AFISP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file afisp-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: afisp-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for afisp-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ec4e8db7a056b93d60f84de9b680ea60f2c1e212854a88e02958f8eb35717c1f
MD5 4dd754aa0f74cf48e1c1f573106f09ff
BLAKE2b-256 40c635fbfe1db9d93efb3ce2ee87dc8c24f68d1ddbd130c849fd577e24c4c779

See more details on using hashes here.

Provenance

The following attestation bundles were made for afisp-0.2.1-py3-none-any.whl:

Publisher: publishing.yml on asubbaswamy/AFISP

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 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