Skip to main content

AIM-CU: A CUSUM-based tool for AI Monitoring

Project description

Monitoring a clinically deployed AI device to detect performance drift is an essential step to ensure the safety and effectiveness of AI.

AIM-CU is a statistical tool for AI monitoring based on a cumulative sum (AIM-CU) approach.

AIM-CU computes:

  • The parameter choices for change-point detection based on an acceptable false alarm rate

  • Detection delay estimates for a given displacement of the performance metric from the target for those parameter choices.

System setup

Make sure R is installed in the system. There is no specific version that this relies on. Here we have used the version 4.1.2 (2021-11-01). Instructions for Linux (the below setup is only performed in Linux):

wget -qO- https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc |  tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc
add-apt-repository "deb https://cloud.r-project.org/bin/linux/ubuntu $(lsb_release -cs)-cran40/"
apt-get install -y --no-install-recommends r-base r-base-dev

# setup R configs
echo "r <- getOption('repos'); r['CRAN'] <- 'http://cran.us.r-project.org'; options(repos = r);" > ~/.Rprofile
Rscript -e "install.packages('ggplot2')"
Rscript -e "install.packages('hexbin')"
Rscript -e "install.packages('lazyeval')"
Rscript -e "install.packages('cusumcharter')"
Rscript -e "install.packages('RcppCNPy')"
Rscript -e "install.packages('spc')"

Code execution

Clone AIM-CU repository.

git clone https://github.com/DIDSR/AIM-CU.git

Run the following commands to install required dependencies (Python = 3.10 is used).

apt-get -y install python3
apt-get -y install pip
cd AIM-CU
pip install -r requirements.txt

Run AIM-CU.

cd src/package
python3 app.py

Open the URL http://0.0.0.0:7860 that is running the AIM-CU locally.

Example code execution

Example code can be run through Jupyter Notebook. Do this by entering the jupyter notebook command from the /src/package/ directory. The tool is designed to be used through a GUI, not from the console.

Demo

AIM-CU can also be run through the demo available at https://huggingface.co/spaces/didsr/AIM-CU. If Space is paused, click on Restart button. Note: this Space uses a custom Docker container; build may break due to latest package updates pulled by HuggingFace.

Usability

  • Example AI output CSV file is available as config/spec-60-60.csv to be uploaded in monitoring phase.

  • Workflow instruction to run the tool is available at bottom-left of UI.

  • Sample UI output is available at assets/ui.png.

  • Setting control:save_figure to true from config.toml will save tables and plots in figure/.

  • Running AIM-CU usually only takes a few seconds, and it does not require a GPU to run.

Disclaimer

About the Catalog of Regulatory Science Tools

The enclosed tool is in preparation for the Catalog of Regulatory Science Tools. Note that this software is not (yet) a standalone RST but rather is to be included as a reference tool to support other Regulatory Science Tools (such as synthetic datasets) for reproducibility.

This catalog collates a variety of regulatory science tools that the FDA’s Center for Devices and Radiological Health’s (CDRH) Office of Science and Engineering Labs (OSEL) developed. These tools use the most innovative science to support medical device development and patient access to safe and effective medical devices. If you are considering using a tool from this catalog in your marketing submissions, note that these tools have not been qualified as Medical Device Development Tools and the FDA has not evaluated the suitability of these tools within any specific context of use. You may request feedback or meetings for medical device submissions as part of the Q-Submission Program.

For more information about the Catalog of Regulatory Science Tools, email RST_CDRH@fda.hhs.gov.

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

aim_cu-0.2.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

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

aim_cu-0.2.0-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aim_cu-0.2.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for aim_cu-0.2.0.tar.gz
Algorithm Hash digest
SHA256 971f9b16a8d6f871bc29b8f7d576fcbddd86cd3ea7377835dd5b031897f81938
MD5 1c4bef75a45abcc825bb8efbc31ebdca
BLAKE2b-256 1166f82fe6188c6ae1c0bc5da488765d3a32d1005c8aa92fa58fd29e68f266ef

See more details on using hashes here.

File details

Details for the file aim_cu-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: aim_cu-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for aim_cu-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3d255eca763b398374b55f3ced2c9dc35721c34d5a04be61de3d0d503e909426
MD5 585eee9c7ce495f905fedac2914f04a7
BLAKE2b-256 841da0b7368fe4fa025a6b8315b08eabf2627d37fbc0a5afc6466ba7444ef165

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