Skip to main content

Identify patient characteristics and data acquisition parameters associated with high error rates in predictive AI/ML models.

Project description

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

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).

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

afisp-0.2.0.tar.gz (17.5 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.0-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: afisp-0.2.0.tar.gz
  • Upload date:
  • Size: 17.5 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.0.tar.gz
Algorithm Hash digest
SHA256 0aae8d35f50d1ba4cb450d9e3a51af775dc96bb92739ffc26b53e624f40c6c53
MD5 160d33d2cb275a7641192595c247e72b
BLAKE2b-256 d900efd75b22670160ec43cf26e8ea4ab1a4d10ba3a34f83a9664df22d5f3ef6

See more details on using hashes here.

Provenance

The following attestation bundles were made for afisp-0.2.0.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.0-py3-none-any.whl.

File metadata

  • Download URL: afisp-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b114ccc3555eb757a0bcc23c1ce9a899e8b8acf38bcb465e85b86fc217a2bed
MD5 0186ae8c4de55bdda03f11beeda99fb2
BLAKE2b-256 2b09e05d14a3d3b04f10a759b268ccf3222ba9d14b41f0a23ac47b486d51c0fe

See more details on using hashes here.

Provenance

The following attestation bundles were made for afisp-0.2.0-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.

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