diff --git a/site/gatsby-site/src/components/taxa/CsetTaxonomyPage.js b/site/gatsby-site/src/components/taxa/CsetTaxonomyPage.js index 15052f5b1e..a3c5e62960 100644 --- a/site/gatsby-site/src/components/taxa/CsetTaxonomyPage.js +++ b/site/gatsby-site/src/components/taxa/CsetTaxonomyPage.js @@ -1,12 +1,11 @@ import React from 'react'; +import { Trans, useTranslation } from 'react-i18next'; + import { getClassificationValue } from 'utils/classifications'; import AiidHelmet from 'components/AiidHelmet'; import { isAiHarm } from 'utils/cset'; - -import BillboardJS from '@billboard.js/react'; -import bb, { bar } from 'billboard.js'; -import { Trans, useTranslation } from 'react-i18next'; +import GroupBarChart from 'components/taxa/GroupBarChart'; export default function CsetTaxonomyPage(props) { const { allMongodbAiidprodClassifications } = props.data; @@ -42,34 +41,36 @@ export default function CsetTaxonomyPage(props) {

{metaTitle}

-
- - The CSET AI Harm Taxonomy for AIID is the second edition of the CSET incident taxonomy. It - characterizes the harms, entities, and technologies involved in AI incidents and the - circumstances of their occurrence. The charts below show select fields from the CSET AI - Harm Taxonomy for AIID. Details about each field can be found{' '} - - here - - . However, brief descriptions of the field are provided above each chart. - -
+
+

+ + The CSET AI Harm Taxonomy for AIID is the second edition of the CSET incident taxonomy. + It characterizes the harms, entities, and technologies involved in AI incidents and the + circumstances of their occurrence. The charts below show select fields from the CSET AI + Harm Taxonomy for AIID. Details about each field can be found + + here + + . However, brief descriptions of the field are provided above each chart. + +

-
- The taxonomy provides the CSET definition for AI harm. -
+

+ The taxonomy provides the CSET definition for AI harm. +

-
- - AI harm has four elements which, once appropriately defined, enable the identification of - AI harm. These key components serve to distinguish harm from non-harm and AI harm from - non-AI harm. To be an AI harm, there must be: - -
- -
- - Not every incident in AIID meets this definition of AI harm. The below bar charts show the - annotated results for both all AIID incidents and incidents that meet the CSET definition - of AI harm. - -
- -
- - CSET has developed specific definitions for the underlined phrases that may differ from - other organizations' definitions. As a result, other organizations may make different - assessments on whether any particular AI incident is (or is not) AI harm. Details about - CSET's definitions for AI harm can be found - - here - - . - -
+

+ All four elements need to be present in order for there to be AI harm. +

-
- - Every incident is independently classified by two CSET annotators. Annotations are - peer-reviewed and finally randomly selected for quality control ahead of publication. - Despite this rigorous process, mistakes do happen, and readers are invited to{' '} - - report - {' '} - any errors they might discover while browsing. - -
- - - - Differential treatment based upon a protected characteristic: This special interest - intangible harm covers bias and fairness issues concerning AI. However, the bias must be - associated with a group having a protected characteristic. + Not every incident in AIID meets this definition of AI harm. The below bar charts show + the annotated results for both all AIID incidents and incidents that meet the CSET + definition of AI harm. - } - attributeShortName={'Harm Distribution Basis'} - groups={{ - 'All AIID Incidents': { - filter: (c) => getClassificationValue(c, 'Protected Characteristic') == 'yes', - valuesCount: {}, - }, - 'CSET AI Harm Definition': { - filter: (c) => - getClassificationValue(c, 'Protected Characteristic') == 'yes' && isAiHarm(c), - valuesCount: {}, - }, - }} - classifications={classifications} - namespace={namespace} - className="mt-8" - /> - - -
- - Autonomy is an AI's capability to operate independently. Levels of autonomy - differ based on whether or not the AI makes independent decisions and the degree of - human oversight. The level of autonomy does not depend on the type of input the AI - receives, whether it is human- or machine-generated. - -
- Currently, CSET is annotating three levels of autonomy. -
-
    -
  • - - Level 1: the system operates independently with no simultaneous human oversight. - -
  • -
  • - - Level 2: the system operates independently but with human oversight, where the - system makes a decision or takes an action, but a human actively observes the - behavior and can override the system in real-time. - -
  • -
  • - - Level 3: the system provides inputs and suggested decisions or actions to a - human that actively chooses to proceed with the AI's direction. - -
  • -
-
- - } - className="mt-10" - /> -
    -
  • - Autonomy1 (fully autonomous): Does the system operate independently, without - simultaneous human oversight, interaction or intervention? -
  • - -
  • - Autonomy2 (human-on-loop): Does the system operate independently but with human - oversight, where the system makes decisions or takes actions but a human actively observes - the behavior and can override the system in real time? -
  • +

    + +

    + + CSET has developed specific definitions for the underlined phrases that may differ from + other organizations' definitions. As a result, other organizations may make + different assessments on whether any particular AI incident is (or is not) AI harm. + Details about CSET's definitions for AI harm can be found + + here + + . + +

    + +

    + + Every incident is independently classified by two CSET annotators. Annotations are + peer-reviewed and finally randomly selected for quality control ahead of publication. + Despite this rigorous process, mistakes do happen, and readers are invited to{' '} + + report + {' '} + any errors they might discover while browsing. + +

    -
  • - Autonomy3 (human-in-the-loop): Does the system provide inputs and suggested - decisions to a human that -
  • -
- {[ - { - attributeShortName: 'Physical Objects', - titleDescription: 'Did the incident occur in a domain with physical objects?', - subtitle: ( - <> - - Incidents that involve physical objects are more likely to have damage or injury. - However, AI systems that do not operate in a physical domain can still lead to harm. - - - ), - }, - { - attributeShortName: 'Entertainment Industry', - titleDescription: 'Did the incident occur in the entertainment industry?', - subtitle: ( - - AI systems used for entertainment are less likely to involve physical objects and - hence unlikely to be associated with damage, injury, or loss. Additionally, there is a - lower expectation for truthful information from entertainment, making detrimental - content less likely (but still possible). - - ), - }, - { - attributeShortName: 'Report, Test, or Study of data', - titleDescription: - 'Was the incident about a report, test, or study of training data instead of the AI itself?', - subtitle: ( - - The quality of AI training and deployment data can potentially create harm or risks in - AI systems. However, an issue in the data does not necessarily mean the AI will cause - harm or increase the risk for harm. It is possible that developers or users apply - techniques and processes to mitigate issues with data. - - ), - }, - { - attributeShortName: 'Deployed', - titleDescription: - 'Was the reported system (even if AI involvement is unknown) deployed or sold to users?', - subtitle: <>, - }, - { - attributeShortName: 'Producer Test in Controlled Conditions', - titleDescription: - 'Was this a test or demonstration of an AI system done by developers, producers, or researchers (versus users) in controlled conditions?', - subtitle: ( - - AI tests or demonstrations by developers, producers, or researchers in controlled - environments are less likely to expose people, organizations, property, institutions, - or the natural environment to harm. Controlled environments may include situations - such as an isolated compute system, a regulatory sandbox, or an autonomous vehicle - testing range. - - ), - }, - { - attributeShortName: 'Producer Test in Operational Conditions', - titleDescription: - 'Was this a test or demonstration of an AI system done by developers, producers, or researchers (versus users) in operational conditions?', - subtitle: ( - - Some AI systems undergo testing or demonstration in an operational environment. - Testing in operational environments still occurs before the system is deployed by - end-users. However, relative to controlled environments, operational environments try - to closely represent real-world conditions that affect use of the AI system.{' '} - - ), - }, - { - attributeShortName: 'User Test in Controlled Conditions', - titleDescription: - 'Was this a test or demonstration of an AI system done by users in controlled conditions?', - subtitle: ( - - Sometimes, prior to deployment, the users will perform a test or demonstration of the - AI system. The involvement of a user (versus a developer, producer, or researcher) - increases the likelihood that harm can occur even if the AI system is being tested in - controlled environments because a user may not be as familiar with the functionality - or operation of the AI system. - - ), - }, - { - attributeShortName: 'User Test in Operational Conditions', - titleDescription: - 'Was this a test or demonstration of an AI system done by users in operational conditions?', - subtitle: ( + + - The involvement of a user (versus a developer, producer, or researcher) increases the - likelihood that harm can occur even if the AI system is being tested. Relative to - controlled environments, operational environments try to closely represent real-world - conditions and end-users that affect use of the AI system. Therefore, testing in an - operational environment typically poses a heightened risk of harm to people, - organizations, property, institutions, or the environment. + Differential treatment based upon a protected characteristic: This special interest + intangible harm covers bias and fairness issues concerning AI. However, the bias must + be associated with a group having a protected characteristic. - ), - }, - ].map(({ attributeShortName, titleDescription, subtitle }) => ( + } + attributeShortName={'Harm Distribution Basis'} + groups={{ + 'All AIID Incidents': { + filter: (c) => getClassificationValue(c, 'Protected Characteristic') == 'yes', + valuesCount: {}, + }, + 'CSET AI Harm Definition': { + filter: (c) => + getClassificationValue(c, 'Protected Characteristic') == 'yes' && isAiHarm(c), + valuesCount: {}, + }, + }} + classifications={classifications} + namespace={namespace} + className="mt-8" + /> - ))} - - ); -} - -function GroupBarChart({ - groups, - attributeShortName, - classifications, - namespace, - title, - titleDescription = '', - subtitle = null, - className = '', -}) { - title ||= attributeShortName; - - for (const groupName in groups) { - groups[groupName].valuesCount = {}; - } - - let allValues = new Set(); - - for (const classification of classifications) { - if (classification.namespace != namespace) continue; - - const baseValue = getClassificationValue(classification, attributeShortName); - - const values = Array.isArray(baseValue) ? baseValue : [baseValue]; - - for (const value of values) { - if (value) allValues.add(value); - - for (const groupName in groups) { - const group = groups[groupName]; - - if (group.filter(classification)) { - group.valuesCount[value] ||= 0; - group.valuesCount[value] += 1; - } - } - } - } - - allValues = Array.from(allValues); - - const groupNames = Object.keys(groups); - - const autonomySort = (a, b) => Number(a.id[8] || 0) - Number(b.id[8] || 0); - - const options = { - data: { - order: attributeShortName == 'Autonomy Level' ? autonomySort : undefined, - x: 'x', - columns: [ - ['x', ...groupNames], - ...allValues - .sort() - .map((value) => [ - value, - ...groupNames.map((groupName) => groups[groupName].valuesCount[value] || 0), - ]), - ], - groups: [allValues], - type: bar(), - color: function (color, d) { - if (d.id === 'yes') return '#2ca02c'; - if (d.id === 'no') return '#d62728'; - if (d.id === 'maybe') return '#1f77b4'; - return color; - }, - }, - axis: { - x: { - type: 'category', - height: 40, - tick: { - tooltip: true, - }, - }, - }, - tooltip: { - show: false, - }, - }; + +
+ + Autonomy is an AI's capability to operate independently. Levels of autonomy + differ based on whether or not the AI makes independent decisions and the degree + of human oversight. The level of autonomy does not depend on the type of input the + AI receives, whether it is human- or machine-generated. + +
+ Currently, CSET is annotating three levels of autonomy. +
+
    +
  • + + Level 1: the system operates independently with no simultaneous human + oversight. + +
  • +
  • + + Level 2: the system operates independently but with human oversight, where the + system makes a decision or takes an action, but a human actively observes the + behavior and can override the system in real-time. + +
  • +
  • + + Level 3: the system provides inputs and suggested decisions or actions to a + human that actively chooses to proceed with the AI's direction. + +
  • +
+
+ + } + className="mt-10" + /> +
    +
  • + Autonomy1 (fully autonomous): Does the system operate independently, without + simultaneous human oversight, interaction or intervention? +
  • - return ( -
    -

    {titleDescription}

    - {subtitle && <>{subtitle}} -
    -

    {title}

    - (by Incident Count) -
    - -
    - {allValues.length > 5 && - groupNames.map((groupName) => { - const byGroupOccurences = (a, b) => - (groups[groupName].valuesCount[b] || 0) - (groups[groupName].valuesCount[a] || 0); +
  • + Autonomy2 (human-on-loop): Does the system operate independently but with human + oversight, where the system makes decisions or takes actions but a human actively + observes the behavior and can override the system in real time? +
  • - return ( -
    -

    {groupName}

    - - - - - - - {allValues.sort(byGroupOccurences).map((value) => ( - - - - - ))} - -
    CategoryCount
    {value}{groups[groupName].valuesCount[value]}
    -
    - ); - })} +
  • + Autonomy3 (human-in-the-loop): Does the system provide inputs and suggested + decisions to a human that +
  • +
+ {[ + { + attributeShortName: 'Physical Objects', + titleDescription: 'Did the incident occur in a domain with physical objects?', + subtitle: ( + <> + + Incidents that involve physical objects are more likely to have damage or injury. + However, AI systems that do not operate in a physical domain can still lead to + harm. + + + ), + }, + { + attributeShortName: 'Entertainment Industry', + titleDescription: 'Did the incident occur in the entertainment industry?', + subtitle: ( + + AI systems used for entertainment are less likely to involve physical objects and + hence unlikely to be associated with damage, injury, or loss. Additionally, there is + a lower expectation for truthful information from entertainment, making detrimental + content less likely (but still possible). + + ), + }, + { + attributeShortName: 'Report, Test, or Study of data', + titleDescription: + 'Was the incident about a report, test, or study of training data instead of the AI itself?', + subtitle: ( + + The quality of AI training and deployment data can potentially create harm or risks + in AI systems. However, an issue in the data does not necessarily mean the AI will + cause harm or increase the risk for harm. It is possible that developers or users + apply techniques and processes to mitigate issues with data. + + ), + }, + { + attributeShortName: 'Deployed', + titleDescription: + 'Was the reported system (even if AI involvement is unknown) deployed or sold to users?', + subtitle: <>, + }, + { + attributeShortName: 'Producer Test in Controlled Conditions', + titleDescription: + 'Was this a test or demonstration of an AI system done by developers, producers, or researchers (versus users) in controlled conditions?', + subtitle: ( + + AI tests or demonstrations by developers, producers, or researchers in controlled + environments are less likely to expose people, organizations, property, + institutions, or the natural environment to harm. Controlled environments may + include situations such as an isolated compute system, a regulatory sandbox, or an + autonomous vehicle testing range. + + ), + }, + { + attributeShortName: 'Producer Test in Operational Conditions', + titleDescription: + 'Was this a test or demonstration of an AI system done by developers, producers, or researchers (versus users) in operational conditions?', + subtitle: ( + + Some AI systems undergo testing or demonstration in an operational environment. + Testing in operational environments still occurs before the system is deployed by + end-users. However, relative to controlled environments, operational environments + try to closely represent real-world conditions that affect use of the AI system.{' '} + + ), + }, + { + attributeShortName: 'User Test in Controlled Conditions', + titleDescription: + 'Was this a test or demonstration of an AI system done by users in controlled conditions?', + subtitle: ( + + Sometimes, prior to deployment, the users will perform a test or demonstration of + the AI system. The involvement of a user (versus a developer, producer, or + researcher) increases the likelihood that harm can occur even if the AI system is + being tested in controlled environments because a user may not be as familiar with + the functionality or operation of the AI system. + + ), + }, + { + attributeShortName: 'User Test in Operational Conditions', + titleDescription: + 'Was this a test or demonstration of an AI system done by users in operational conditions?', + subtitle: ( + + The involvement of a user (versus a developer, producer, or researcher) increases + the likelihood that harm can occur even if the AI system is being tested. Relative + to controlled environments, operational environments try to closely represent + real-world conditions and end-users that affect use of the AI system. Therefore, + testing in an operational environment typically poses a heightened risk of harm to + people, organizations, property, institutions, or the environment. + + ), + }, + ].map(({ attributeShortName, titleDescription, subtitle }) => ( + + ))}
- + ); } diff --git a/site/gatsby-site/src/components/taxa/GroupBarChart.js b/site/gatsby-site/src/components/taxa/GroupBarChart.js new file mode 100644 index 0000000000..dbae781504 --- /dev/null +++ b/site/gatsby-site/src/components/taxa/GroupBarChart.js @@ -0,0 +1,161 @@ +import React from 'react'; +import { getClassificationValue } from 'utils/classifications'; +import BillboardJS from '@billboard.js/react'; +import bb, { bar } from 'billboard.js'; + +export default function GroupBarChart({ + groups, + attributeShortName, + classifications, + namespace, + title, + titleDescription = '', + subtitle = null, + className = '', +}) { + title ||= attributeShortName; + + for (const groupName in groups) { + groups[groupName].valuesCount = {}; + } + + let allValues = new Set(); + + for (const classification of classifications) { + if (classification.namespace != namespace) continue; + + const baseValue = getClassificationValue(classification, attributeShortName); + + const values = Array.isArray(baseValue) ? baseValue : [baseValue]; + + for (const value of values) { + if (value) allValues.add(value); + + for (const groupName in groups) { + const group = groups[groupName]; + + if (group.filter(classification)) { + group.valuesCount[value] ||= 0; + group.valuesCount[value] += 1; + } + } + } + } + + allValues = Array.from(allValues); + + const groupNames = Object.keys(groups); + + const max = (list) => list.reduce((m, e) => Math.max(m, e), 0); + + const sum = (list) => list.reduce((s, e) => s + e, 0); + + const groupSizes = groupNames.map((groupName) => + sum(Object.values(groups[groupName].valuesCount)) + ); + + const largestGroupSize = max(groupSizes); + + const autonomySort = (a, b) => Number(a.id[8] || 0) - Number(b.id[8] || 0); + + const stepMultiple = 5; // Stepsize should be a multiple of this + + const stepCount = 10; + + const stepSize = Math.round(largestGroupSize / stepCount / stepMultiple) * stepMultiple; + + const options = { + size: { height: 320 + 20 * allValues.length }, + data: { + order: attributeShortName == 'Autonomy Level' ? autonomySort : undefined, + x: 'x', + columns: [ + ['x', ...groupNames], + ...allValues + .sort() + .map((value) => [ + value, + ...groupNames.map((groupName) => groups[groupName].valuesCount[value] || 0), + ]), + ], + groups: [allValues], + type: bar(), + color: function (color, d) { + if (d.id === 'yes') return '#2ca02c'; + if (d.id === 'no') return '#d62728'; + if (d.id === 'maybe') return '#1f77b4'; + return color; + }, + }, + axis: { + y: { tick: { stepSize } }, + y2: { + show: false, + }, + x: { + type: 'category', + height: 40, + tick: { + tooltip: true, + stepSize: 10, + }, + }, + }, + tooltip: { + show: false, + }, + grid: { + y: { + lines: Array(stepCount / 2 + 1) + .fill() + .map((_, i) => ({ + value: (i + 1) * 2 * stepSize, + position: 'start', + })), + }, + }, + }; + + return ( +
line]:stroke-gray-300 [&_.bb-ygrid-line>line]:stroke-1`} + > +

{titleDescription}

+ {subtitle && <>{subtitle}} +
+

{title}

+ (by Incident Count) +
+ +
+ {allValues.length > 5 && + groupNames.map((groupName) => { + const byGroupOccurences = (a, b) => + (groups[groupName].valuesCount[b] || 0) - (groups[groupName].valuesCount[a] || 0); + + return ( +
+

{groupName}

+ + + + + + + {allValues.sort(byGroupOccurences).map((value) => ( + + + + + ))} + +
CategoryCount
{value}{groups[groupName].valuesCount[value]}
+
+ ); + })} +
+
+ ); +} diff --git a/site/gatsby-site/src/pages/summaries/cset-charts.js b/site/gatsby-site/src/pages/summaries/cset-charts.js index 02a3d0a60b..35c9d2bff7 100644 --- a/site/gatsby-site/src/pages/summaries/cset-charts.js +++ b/site/gatsby-site/src/pages/summaries/cset-charts.js @@ -1,12 +1,10 @@ import React from 'react'; import { graphql } from 'gatsby'; -import BillboardJS from '@billboard.js/react'; -import bb, { bar } from 'billboard.js'; - import AiidHelmet from 'components/AiidHelmet'; import { getClassificationValue } from 'utils/classifications'; import { isAiHarm } from 'utils/cset'; +import GroupBarChart from 'components/taxa/GroupBarChart'; export default function CsetChartsPage({ data, ...props }) { const metaTitle = 'CSET Charts'; @@ -33,184 +31,79 @@ export default function CsetChartsPage({ data, ...props }) {

{metaTitle}

- - getClassificationValue(c, 'Protected Characteristic') == 'yes', - valuesCount: {}, - }, - 'CSET AI Harm Definition': { - filter: (c) => - getClassificationValue(c, 'Protected Characteristic') == 'yes' && isAiHarm(c), - valuesCount: {}, - }, - }} - classifications={classifications} - namespace="CSETv1" - /> - - -
    -
  • - Autonomy1 (fully autonomous): Does the system operate independently, without - simultaneous human oversight, interaction or intervention? -
  • - -
  • - Autonomy2 (human-on-loop): Does the system operate independently but with human - oversight, where the system makes decisions or takes actions but a human actively observes - the behavior and can override the system in real time? -
  • -
  • - Autonomy3 (human-in-the-loop): Does the system provide inputs and suggested - decisions to a human that -
  • -
- {[ - 'Physical Objects', - 'Entertainment Industry', - 'Report, Test, or Study of data', - 'Deployed', - 'Producer Test in Controlled Conditions', - 'Producer Test in Operational Conditions', - 'User Test in Controlled Conditions', - 'User Test in Operational Conditions', - ].map((attributeShortName) => ( +
- ))} - - ); -} - -function GroupBarChart({ groups, attributeShortName, classifications, namespace, title }) { - title ||= attributeShortName; - - for (const groupName in groups) { - groups[groupName].valuesCount = {}; - } - - let allValues = new Set(); - - for (const classification of classifications) { - if (classification.namespace != namespace) continue; - - const baseValue = getClassificationValue(classification, attributeShortName); - - const values = Array.isArray(baseValue) ? baseValue : [baseValue]; - - for (const value of values) { - if (value) allValues.add(value); - - for (const groupName in groups) { - const group = groups[groupName]; - - if (group.filter(classification)) { - group.valuesCount[value] ||= 0; - group.valuesCount[value] += 1; - } - } - } - } - - allValues = Array.from(allValues); - - const groupNames = Object.keys(groups); - - const autonomySort = (a, b) => Number(a.id[8] || 0) - Number(b.id[8] || 0); - - const options = { - data: { - order: attributeShortName == 'Autonomy Level' ? autonomySort : undefined, - x: 'x', - columns: [ - ['x', ...groupNames], - ...allValues - .sort() - .map((value) => [ - value, - ...groupNames.map((groupName) => groups[groupName].valuesCount[value] || 0), - ]), - ], - groups: [allValues], - type: bar(), - color: function (color, d) { - if (d.id === 'yes') return '#2ca02c'; - if (d.id === 'no') return '#d62728'; - if (d.id === 'maybe') return '#1f77b4'; - return color; - }, - }, - axis: { - x: { - type: 'category', - height: 40, - tick: { - tooltip: true, - }, - }, - }, - tooltip: { - show: false, - }, - }; - - return ( - <> -
-

{title}

- (by Incident Count) -
- -
- {allValues.length > 5 && - groupNames.map((groupName) => { - const byGroupOccurences = (a, b) => - (groups[groupName].valuesCount[b] || 0) - (groups[groupName].valuesCount[a] || 0); - - return ( -
-

{groupName}

- - - - - - {allValues.sort(byGroupOccurences).map((value) => ( - - - - - ))} -
CategoryCount
{value}{groups[groupName].valuesCount[value]}
-
- ); - })} + getClassificationValue(c, 'Protected Characteristic') == 'yes', + valuesCount: {}, + }, + 'CSET AI Harm Definition': { + filter: (c) => + getClassificationValue(c, 'Protected Characteristic') == 'yes' && isAiHarm(c), + valuesCount: {}, + }, + }} + classifications={classifications} + namespace="CSETv1" + /> + + +
    +
  • + Autonomy1 (fully autonomous): Does the system operate independently, without + simultaneous human oversight, interaction or intervention? +
  • + +
  • + Autonomy2 (human-on-loop): Does the system operate independently but with human + oversight, where the system makes decisions or takes actions but a human actively + observes the behavior and can override the system in real time? +
  • + +
  • + Autonomy3 (human-in-the-loop): Does the system provide inputs and suggested + decisions to a human that +
  • +
+ {[ + 'Physical Objects', + 'Entertainment Industry', + 'Report, Test, or Study of data', + 'Deployed', + 'Producer Test in Controlled Conditions', + 'Producer Test in Operational Conditions', + 'User Test in Controlled Conditions', + 'User Test in Operational Conditions', + ].map((attributeShortName) => ( + + ))}
);