Releases: sev7enITA/ProjectFrameworkAI
Responsible AI Assessment Framework with KPIs rev1
import React, { useState, useEffect, useMemo } from 'react';
import { BarChart, Bar, XAxis, YAxis, CartesianGrid, Tooltip, Legend, ResponsiveContainer, PieChart, Pie, Cell } from 'recharts';
// --- Icon SVGs ---
const ChevronDownIcon = () => (
);
const CheckCircleIcon = () => (
);
// --- Enhanced Initial Survey Data ---
const initialSurveyData = [
{
id: "cat0_overview", // New ID prefix for clarity
categoryName: "Project Overview & Context",
guidingQuestions: "Provide a general description of the AI project or system being assessed. What is its primary purpose and scope?",
qualitativeAnswer: "",
isOpen: true, // First category is open by default
kpis: [
// This section might be primarily for qualitative input, but example KPIs could be added if relevant to context setting
{ id: "kpi0_1", text: "Clarity of project goals and objectives.", score: 0, maxScore: 5 },
{ id: "kpi0_2", text: "Definition of target users and use cases.", score: 0, maxScore: 5 },
]
},
{
id: "cat_problem",
categoryName: "Problem Statement",
guidingQuestions: "What specific issue does the AI solve?",
qualitativeAnswer: "",
isOpen: false,
kpis: [
{ id: "kpiprob_1", text: "Problem alignment rating (internal/external validation).", score: 0, maxScore: 5 },
{ id: "kpiprob_2", text: "Quantifiable impact of solving the problem.", score: 0, maxScore: 5 }
]
},
{
id: "cat_whyai",
categoryName: "Why AI?",
guidingQuestions: "Why is AI chosen for this solution, and what type of AI is optimal (e.g., machine learning, rule-based, hybrid)?",
qualitativeAnswer: "",
isOpen: false,
kpis: [
{ id: "kpiwhy_1", text: "Fit assessment score for AI vs. alternative solutions.", score: 0, maxScore: 5 },
{ id: "kpiwhy_2", text: "Performance-to-objective alignment percentage for chosen AI type.", score: 0, maxScore: 5 }
]
},
{
id: "cat1_accountability", // Original cat1, updated
categoryName: "Accountability",
guidingQuestions: "Who is responsible for the AI system's decisions, data processes, development, deployment, and outcomes? Are roles and responsibilities clearly defined, documented, and communicated? Is there a mechanism for redress if things go wrong?",
qualitativeAnswer: "",
isOpen: false,
kpis: [
{ id: "kpi1_1", text: "Existence of a clear governance structure for AI, with defined roles and responsibilities.", score: 0, maxScore: 5 },
{ id: "kpi1_2", text: "Documented processes for AI system approval, monitoring, and decommissioning.", score: 0, maxScore: 5 },
{ id: "kpi1_3", text: "Availability of clear channels for stakeholders to raise concerns or seek redress regarding AI system behavior.", score: 0, maxScore: 5 },
{ id: "kpi1_4", text: "Regular training for relevant personnel on AI ethics, risks, and accountability.", score: 0, maxScore: 5 },
{ id: "kpiacc_1", text: "# of accountable roles mapped to specific AI lifecycle stages.", score: 0, maxScore: 5 },
{ id: "kpiacc_2", text: "Average response time to incidents or identified issues (hours/days).", score: 0, maxScore: 5 } // Note: for # KPIs, consider how to score. Here, lower is better, so scoring might be inverted or based on targets. For simplicity, we'll keep 1-5 scale representing adherence to target response times.
]
},
{
id: "cat_stakeholders",
categoryName: "Stakeholders",
guidingQuestions: "Who are the internal and external stakeholders and impact groups (including vulnerable groups)? How are they identified and engaged?",
qualitativeAnswer: "",
isOpen: false,
kpis: [
{ id: "kpistake_1", text: "Stakeholder satisfaction index (e.g., from surveys).", score: 0, maxScore: 5 },
{ id: "kpistake_2", text: "# of stakeholder engagement sessions conducted per development phase.", score: 0, maxScore: 5 },
{ id: "kpistake_3", text: "Representation of diverse stakeholder groups in consultations.", score: 0, maxScore: 5 }
]
},
{
id: "cat2_fairness_diversity", // Original cat2, updated
categoryName: "Fairness, Non-Discrimination & Diversity",
guidingQuestions: "How does the AI system avoid unfair bias and discrimination? What measures are in place to identify, mitigate, and monitor biases in data, algorithms, and outcomes? How are accessibility and diverse perspectives integrated?",
qualitativeAnswer: "",
isOpen: false,
kpis: [
{ id: "kpi2_1", text: "Bias detection and mitigation techniques are implemented throughout the AI lifecycle.", score: 0, maxScore: 5 },
{ id: "kpi2_2", text: "Regular testing for fairness across different demographic groups and sensitive attributes.", score: 0, maxScore: 5 },
{ id: "kpi2_3", text: "Data sources are assessed for representativeness and potential biases.", score: 0, maxScore: 5 },
{ id: "kpifair_1", text: "% bias detected/mitigated in pre-deployment testing.", score: 0, maxScore: 5 },
{ id: "kpifair_2", text: "Inclusivity score in UX audits (e.g., based on heuristics).", score: 0, maxScore: 5 },
{ id: "kpifair_3", text: "Accessibility conformance level (e.g., WCAG AA).", score: 0, maxScore: 5 },
{ id: "kpifair_4", text: "# of diversity inputs incorporated into design/development.", score: 0, maxScore: 5 },
{ id: "kpifair_5", text: "Stakeholder diversity index for feedback collection.", score: 0, maxScore: 5 }
]
},
{
id: "cat3_transparency_explainability", // Original cat3, updated
categoryName: "Transparency & Explainability",
guidingQuestions: "How transparent is the AI system's decision-making process? Can its operations, logic, and outcomes be understood and explained to relevant stakeholders? How is it documented?",
qualitativeAnswer: "",
isOpen: false,
kpis: [
{ id: "kpi3_1", text: "Comprehensive documentation on AI model design, data, and limitations is maintained and accessible.", score: 0, maxScore: 5 },
{ id: "kpi3_2", text: "Methods for explaining AI decisions (e.g., XAI tools, LIME, SHAP) are used and validated.", score: 0, maxScore: 5 },
{ id: "kpi3_3", text: "Users and affected individuals are clearly informed when interacting with or being assessed by an AI system.", score: 0, maxScore: 5 },
{ id: "kpitrans_1", text: "Explainability rating from user surveys.", score: 0, maxScore: 5 },
{ id: "kpitrans_2", text: "# of explanations delivered/accessed for significant decisions.", score: 0, maxScore: 5 }
]
},
{
id: "cat_communication",
categoryName: "Communication",
guidingQuestions: "How are the AI system's functions, capabilities, limitations, potential risks, and user rights communicated to stakeholders?",
qualitativeAnswer: "",
isOpen: false,
kpis: [
{ id: "kpicomm_1", text: "Average # of user queries on system function resolved per week/month.", score: 0, maxScore: 5 },
{ id: "kpicomm_2", text: "Clarity score of communication materials from user surveys.", score: 0, maxScore: 5 },
{ id: "kpicomm_3", text: "Accessibility of information about system risks and rights.", score: 0, maxScore: 5 }
]
},
{
id: "cat4_robustness_safety", // Original cat4, updated
categoryName: "Technical Robustness, Security & Safety",
guidingQuestions: "How is the AI system protected from security threats and designed to operate safely and reliably? What testing, fallback, and cybersecurity plans exist?",
qualitativeAnswer: "",
isOpen: false,
kpis: [
{ id: "kpi4_1", text: "Robust security measures (e.g., encryption, access control) are in place for AI models, data, and infrastructure.", score: 0, maxScore: 5 },
{ id: "kpi4_2", text: "Regular vulnerability assessments and penetration testing are conducted.", score: 0, maxScore: 5 },
{ id: "kpi4_3", text: "Fail-safe mechanisms, redundancy, and human oversight are implemented to prevent critical failures.", score: 0, maxScore: 5 },
{ id: "kpi4_4", text: "AI systems are tested for robustness against adversarial attacks and unexpected inputs.", score: 0, maxScore: 5 },
{ id: "kpirobust_1", text: "% system uptime / availability.", score: 0, maxScore: 5 },
{ id: "kpirobust_2", text: "% drop in performance during stress/edge case testing.", score: 0, maxScore: 5 }, // Lower is better, score reflects adherence to tolerance
{ id: "kpirobust_3", text: "# of successful fallbacks triggered in test/production environments.", score: 0, maxScore: 5 }
]
},
{
id: "cat5_privacy_governance", // Original cat5, updated
categoryName: "Privacy & Data Governance",
guidingQuestions: "How does the AI system respect and protect individual privacy? How is data governed, collected, used, shared, accessed, and managed for interoperability, in compliance with regulations and ethical standards?",
qualitativeAnswer: "",
isOpen: false,
kpis: [
{ id: "kpi5_1", text: "Data minimization principles are applied; only necessary data is collected and processed.", score: 0, maxScore: 5 },
{ id: "kpi5_2", text: "Privacy-enhancing technologies (e.g., anonymization, differential privacy, federated learning) are ...