Explainability Framework for ISO Auditors: SHAP + Counterfactual Dashboards
A tool that helps ISO auditors understand *why* a forecasting model made a specific power dispatch decision β like showing which weather sensors or grid measurements most influenced the 'reduce solar output' alert.
⚠️ Why It Matters
π Definition
The Explainability Framework for ISO Auditors is an engineering system integrating SHAP (Shapley Additive Explanations) for local feature attribution and counterfactual analysis for actionable 'what-if' scenario generation, embedded within production-grade forecasting pipelines to satisfy ISO 50001 Annex A.4.2 (transparency of energy performance indicators) and NERC CIP-014-2 (cybersecurity risk modeling traceability). It enforces deterministic, versioned, and reproducible explainability outputs aligned with regulatory audit trails.
π¨ Concept Diagram
AI-generated illustration for visual understanding
π‘ Engineering Insight
SHAP alone is insufficient for ISO audits β it answers 'what contributed?' but not 'what could we change to avoid this outcome?'. Counterfactuals must be grounded in grid physics (e.g., Ohmβs Law, PV I-V curve constraints) and bounded by SCADA actuator limits; otherwise, they become speculative fiction, not audit evidence. Always validate counterfactual feasibility against actual substation RTU setpoint ranges before deployment.
π Detailed Explanation
Unlike generic ML explainers, every explanation artifact carries cryptographic signatures, versioned metadata (model commit hash, sensor firmware versions, NWP model ID), and trace links to raw telemetry (e.g., AWS S3 object ARNs with immutability locks). This satisfies ISO 50001βs requirement for 'documented information' (Clause 7.5) and enables auditors to reconstruct the full causal chain from cloud cover pixel to dispatch action.
Advanced deployment requires co-design with grid control engineers: counterfactuals are not generated for arbitrary features, but only for *actuatable inputs* β e.g., inverter reactive power setpoint, battery charge rate, or curtailment signal β and are filtered through real-time stability margins (PSS/E transient stability thresholds). The framework also embeds uncertainty-aware SHAP (U-SHAP) to quantify how forecast variance propagates into attribution uncertainty β critical when justifying probabilistic dispatch decisions under CAISOβs ASO rules.
π Engineering Workflow
π Decision Guide
| Rock/Field Condition | Recommended Design Action |
|---|---|
| Forecast error > 12% AND SHAP Stability Score < 0.08 | Trigger sensor fusion recalibration; freeze model version; escalate to ISO audit liaison. |
| Counterfactual Feasibility Index (CFI) < 0.72 AND NWP bias > 2.1Β°C | Disable NWP-driven counterfactuals; activate sky-camera-only perturbation mode; log to FERC Form 730. |
| Audit Trace Latency > 250 ms for β₯3 consecutive dispatch cycles | Failover to pre-certified offline explainer; initiate pipeline latency root-cause analysis per ISO 50001 Clause 9.1.2. |
📊 Key Properties & Parameters
SHAP Stability Score
0.02β0.15 (unitless, normalized to prediction scale)Mean absolute deviation of SHAP values across 100 bootstrapped inference samples on identical input β quantifies explanation robustness.
Scores >0.12 trigger automatic retraining or sensor recalibration alerts in pipeline monitoring.
Counterfactual Feasibility Index (CFI)
0.68β0.94 (unitless)Ratio of physically admissible counterfactual perturbations (e.g., irradiance Β±15%, wind speed Β±3 m/s) to total generated perturbations.
CFI < 0.75 disables counterfactual dashboard export and flags SCADA interface misalignment.
Audit Trace Latency
85β210 msTime from forecast generation to availability of signed, immutable SHAP + counterfactual artifacts in audit-ready object storage (e.g., S3 with WORM policy).
Latency > 300 ms violates NERC CIP-014-2 Section R2.3.1 real-time explainability requirement.
Feature Attribution Consistency
0.97β0.998Pearson correlation between SHAP values computed via KernelExplainer and TreeExplainer on identical inputs (for tree-based ensemble models).
Consistency < 0.95 mandates fallback to surrogate linear model with certified sensitivity bounds.
π Key Formulas
SHAP Stability Score (SSS)
SSS = mean(|Ο_i^{(b)} β ΟΜ_i|) over b=1..100Quantifies variance of SHAP value Ο_i for feature i across bootstrap samples.
| Symbol | Name | Unit | Description |
|---|---|---|---|
| SSS | SHAP Stability Score | Quantifies variance of SHAP value Ο_i for feature i across bootstrap samples | |
| Ο_i^{(b)} | SHAP value for feature i in bootstrap sample b | SHAP contribution of feature i in the b-th bootstrap sample | |
| ΟΜ_i | Mean SHAP value for feature i | Average SHAP value of feature i across all bootstrap samples | |
| b | Bootstrap sample index | Index ranging from 1 to 100 for bootstrap samples |
Counterfactual Feasibility Index (CFI)
CFI = |{Ξ΄x β Ξx : g(x+Ξ΄x) β Ξ©_grid}| / |Ξx|Fraction of perturbations Ξ΄x that satisfy grid physics constraints Ξ©_grid.
| Symbol | Name | Unit | Description |
|---|---|---|---|
| CFI | Counterfactual Feasibility Index | dimensionless | Fraction of perturbations Ξ΄x that satisfy grid physics constraints Ξ©_grid |
| Ξ΄x | Perturbation vector | same as x | Admissible input perturbation |
| Ξx | Set of all admissible perturbations | same as x | Domain of allowable perturbations |
| g | Physics simulator or constraint mapping function | same as Ξ©_grid | Function mapping perturbed input to physical output space |
| x | Original input | same as Ξ΄x | Baseline input to the system |
| Ξ©_grid | Grid physics constraint set | same as g(x+Ξ΄x) | Set of physically feasible outputs satisfying grid-based physics constraints |
🏭 Engineering Example
CAISO Zone SP15 - El Dorado Solar Farm
N/A (grid-scale energy system)ποΈ Applications
- FERC Order 888/2222 compliance reporting
- CAISO ASO probabilistic dispatch justification
- PJM Interconnection explainability audits
- ISO New England renewable forecasting credit validation
π§ Try It: Interactive Calculator
π Real Project Case
CAISO Zone 12 Solar Ramp Event Mitigation
2.1 GW solar portfolio across Central Valley, CA