Skip to main content

SAFE AI package to measure risks of AI models

Project description

SAFE AI

The increasing widespread of Artificial Intelligence (AI) applications implies the formalisa- tion of an AI risk management model which needs methodological guidelines for an effec- tive implementation. To fill the gap, Giudici and Raffinetti (2023) introduced a S.A.F.E. risk management model which derives from the proposed international regulations four main compliance principles: Security, Accuracy, Fairness and Explainability, that can be measured for any AI application. The primary motivation for developing safeaipackage is providing a unified framework that can evaluate these AI risks. The important aspect of the S.A.F.E. model is that it proposes metrics that are interrelated, are standardised, and have a common mathematical root: the Lorenz Zonoid tool (see, e.g. Koshevoy and Mosler 1996; Lorenz 1905). Despite the advantages deriving from the S.A.F.E approach, it suffers from being computationally intensive as it requires the construction of all the models’ configurations. Moreover, the recent regulatory debate has further expanded the notion of Security, distinguishing the internal resilience of an AI system: its robustness; from the external resilience of the ecosystem which surrounds it: environmental, social and governance sustainability see, e.g. International Standard Organisation 2023. In line with this evolution and the need of providing a unified and computationally efficient method, in this contribution we suggest to combine different statistical metrics able to measure the Security (robustness), Accuracy, Fairness and Explainability of highly complex machine learning models. We remark that the definition of robustness that we adopt in this paper derives from that being employed by AI regulators and standard setters, for which an AI system should achieve an appropriate level of robustness, to be resilient to internal anomalies and external attacks. For consistency, the proposed measures will be based on the Lorenz and concordance curves (see, e.g. Giudici and Raffinetti 2011). This will allow to integrate all measures into an agnostic score that can be employed to assess the trustworthiness of any AI application.

The revisited S.A.F.E. approach will be called RGB where RGB stands for “Rank Graduation Box”. The use of the term “box” is motivated by the need of emphasizing that our proposal is always in progress so that, like a box, it can be constantly filled by innovative tools addressed to the measurement of the new future requirements necessary for the safety condition of AI-systems.

Install

Simply use:

pip install safeaipackage

Example

In the folder "examples", we provide two notebooks related to a classification and a regression problem applied to the employee dataset. This dataset can also be downloaded from this folder.

Citations

The proposed measures in this package came primarily out of research by Paolo Giudici, Emanuela Raffinetti, and Golnoosh Babaei in the Statistical laboratory at the University of Pavia. If you use safe_ai package in your research we would appreciate a citation to the appropriate paper(s):

  • For the RGA measure introduced in "check_accuracy" module, you can read/cite this paper

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

safeaipackage-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

safeaipackage-0.1.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file safeaipackage-0.1.0.tar.gz.

File metadata

  • Download URL: safeaipackage-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for safeaipackage-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a34a113980b04433222fe6f6da2efc1200915fcc7f108fe2ec478fcd3e95b429
MD5 410bbee656b52dc0abe42b1707695cdf
BLAKE2b-256 9957790c47b868bd7df012c6c78f0bab19cdc4eec3a000c86d2ab80ef9a70b9b

See more details on using hashes here.

File details

Details for the file safeaipackage-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: safeaipackage-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for safeaipackage-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f36b052723c1fb349eab9c374812215ce338375aaf792d8ed21246021604a00a
MD5 c0c2813b9b736192ee6808693f613ff4
BLAKE2b-256 d9fbb200928f71b53d0bae9731f393bc390d5f756b3f9a36799e0f3b57f34e89

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