Update README.md
Browse files
README.md
CHANGED
|
@@ -1,133 +1,185 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
SCI
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: en
|
| 3 |
+
license: mit
|
| 4 |
+
tags:
|
| 5 |
+
- metacognition
|
| 6 |
+
- interpretability
|
| 7 |
+
- control-theory
|
| 8 |
+
- explainability
|
| 9 |
+
- research
|
| 10 |
+
- pytorch
|
| 11 |
+
- dynamic-inference
|
| 12 |
+
- safety
|
| 13 |
+
- signal-modeling
|
| 14 |
+
model_name: "SCI: Surgical Cognitive Interpreter"
|
| 15 |
+
library_name: pytorch
|
| 16 |
+
papers:
|
| 17 |
+
- https://arxiv.org/abs/2511.12240
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# SCI: Surgical Cognitive Interpreter
|
| 21 |
+
A Metacognitive Control Layer for Signal Dynamics
|
| 22 |
+
|
| 23 |
+
This repository contains the reference implementation of the **Surgical Cognitive Interpreter (SCI)**, a closed-loop metacognitive controller that wraps existing models and turns prediction into a regulated process rather than a one-shot function evaluation.
|
| 24 |
+
|
| 25 |
+
SCI is introduced in:
|
| 26 |
+
|
| 27 |
+
**Vishal Joshua Meesala**
|
| 28 |
+
*SCI: A Metacognitive Control for Signal Dynamics*
|
| 29 |
+
arXiv:2511.12240, 2025
|
| 30 |
+
https://arxiv.org/abs/2511.12240
|
| 31 |
+
|
| 32 |
+
The paper formalizes interpretability as a feedback-regulated state: SCI monitors a scalar interpretive signal \( SP(t) \), defined over reliability-weighted, multi-scale features, and adaptively adjusts an interpreter’s parameters to reduce interpretive error
|
| 33 |
+
\[
|
| 34 |
+
\Delta SP(t) = SP^\*(t) - SP(t),
|
| 35 |
+
\]
|
| 36 |
+
under Lyapunov-style stability constraints.
|
| 37 |
+
|
| 38 |
+
---
|
| 39 |
+
|
| 40 |
+
## 1. Motivation
|
| 41 |
+
|
| 42 |
+
Most neural networks are deployed as **open-loop function approximators**: they map inputs to outputs in a single forward pass, with no explicit mechanism to regulate computation, explanation quality, or clarification depth.
|
| 43 |
+
In safety–critical domains (medicine, industrial monitoring, environmental sensing), this is brittle:
|
| 44 |
+
|
| 45 |
+
- Easy and ambiguous inputs receive the same computational budget.
|
| 46 |
+
- Explanations are static and post hoc, with no adaptation under drift.
|
| 47 |
+
- There is no explicit notion of “interpretive error” that can be monitored or controlled.
|
| 48 |
+
|
| 49 |
+
SCI addresses this by introducing a **closed-loop metacognitive layer** that:
|
| 50 |
+
|
| 51 |
+
- Monitors a scalar interpretive state \( SP(t) \in [0,1] \).
|
| 52 |
+
- Computes interpretive error \( \Delta SP = SP^\* - SP \) relative to a target clarity level.
|
| 53 |
+
- Updates interpreter parameters \( \Theta \) according to a Lyapunov-inspired rule with safeguards.
|
| 54 |
+
- Allocates more inference steps and adaptation to ambiguous or unstable inputs.
|
| 55 |
+
- Exposes \( \Delta SP \) as a **safety signal** for abstention, escalation, or human-in-the-loop review.
|
| 56 |
+
|
| 57 |
+
Empirically, SCI:
|
| 58 |
+
|
| 59 |
+
- Allocates **3.6–3.8× more computation** to misclassified inputs than to correct ones.
|
| 60 |
+
- Produces an effective scalar safety signal \( \Delta SP \) with **AUROC ≈ 0.70–0.86** for error detection across vision, medical, and industrial benchmarks.
|
| 61 |
+
|
| 62 |
+
---
|
| 63 |
+
|
| 64 |
+
## 2. Conceptual Overview
|
| 65 |
+
|
| 66 |
+
SCI is a modular architecture with four main components.
|
| 67 |
+
|
| 68 |
+
### 2.1 Decomposition \( \Pi \)
|
| 69 |
+
|
| 70 |
+
A multi-scale, multimodal feature bank \( P(t, s) \) that organizes raw signals \( X(t) \) into interpretable components:
|
| 71 |
+
|
| 72 |
+
- Rhythmic components (frequency bands, oscillations)
|
| 73 |
+
- Trend components (baselines, drifts)
|
| 74 |
+
- Spatial / structural components (sensor topology, modes)
|
| 75 |
+
- Cross-modal interactions (coherence, correlation, causal couplings)
|
| 76 |
+
- Latent composites \( \Pi^\* \)
|
| 77 |
+
|
| 78 |
+
Each feature is weighted by a reliability score \( w_f(t) \) derived from:
|
| 79 |
+
|
| 80 |
+
- Signal-to-noise ratio (SNR)
|
| 81 |
+
- Temporal persistence
|
| 82 |
+
- Cross-sensor coherence
|
| 83 |
+
|
| 84 |
+
These weights ensure degraded or untrustworthy features are down-weighted.
|
| 85 |
+
|
| 86 |
+
---
|
| 87 |
+
|
| 88 |
+
### 2.2 Interpreter \( \psi_\Theta \)
|
| 89 |
+
|
| 90 |
+
A knowledge-guided interpreter that maps the reliability-weighted feature bank into:
|
| 91 |
+
|
| 92 |
+
- **Markers** \( m_k \): human-meaningful states or concepts
|
| 93 |
+
- **Confidences** \( p_k(t) \): calibrated probabilities
|
| 94 |
+
- **Rationales** \( r_k(t) \): sparse feature-level attributions and/or templated text
|
| 95 |
+
|
| 96 |
+
This component can be instantiated as a linear or shallow neural head on top of \( P(t, s) \), optionally constrained by domain rules or ontologies.
|
| 97 |
+
|
| 98 |
+
---
|
| 99 |
+
|
| 100 |
+
### 2.3 Surgical Precision (SP)
|
| 101 |
+
|
| 102 |
+
\( SP(t) \in [0,1] \) aggregates calibrated components such as:
|
| 103 |
+
|
| 104 |
+
- Clarity / selectivity
|
| 105 |
+
- Pattern strength
|
| 106 |
+
- Domain consistency
|
| 107 |
+
- Predictive alignment
|
| 108 |
+
|
| 109 |
+
In the minimal implementation, \( SP \) is normalized entropy of a marker or predictive distribution:
|
| 110 |
+
high SP corresponds to focused, confident internal usage of markers;
|
| 111 |
+
low SP corresponds to diffuse or ambiguous internal state.
|
| 112 |
+
|
| 113 |
+
---
|
| 114 |
+
|
| 115 |
+
### 2.4 Closed-Loop Controller
|
| 116 |
+
|
| 117 |
+
The controller monitors \( \Delta SP(t) \) and updates \( \Theta \) when interpretive clarity is insufficient.
|
| 118 |
+
|
| 119 |
+
\[
|
| 120 |
+
\Theta_{t+1} = \text{Proj}_{\mathcal{C}}\left[\Theta_t + \eta_t\left(\Delta SP(t)\nabla_\Theta SP(t) + \lambda_h u_h(t)\right)\right],
|
| 121 |
+
\]
|
| 122 |
+
|
| 123 |
+
where:
|
| 124 |
+
|
| 125 |
+
- \( \eta_t \): step-size schedule
|
| 126 |
+
- \( \lambda_h \): human-gain budget
|
| 127 |
+
- \( u_h(t) \): bounded human feedback signal (optional)
|
| 128 |
+
- \( \text{Proj}_{\mathcal{C}} \): projection enforcing constraints (trust region, sparsity, parameter bounds)
|
| 129 |
+
|
| 130 |
+
Lyapunov-style analysis shows that, under suitable conditions on \( \eta_t \) and \( \lambda_h \), the “interpretive energy”
|
| 131 |
+
|
| 132 |
+
\[
|
| 133 |
+
V(t) = \tfrac{1}{2}(\Delta SP(t))^2
|
| 134 |
+
\]
|
| 135 |
+
|
| 136 |
+
decreases monotonically up to bounded noise, so explanations become more stable and consistent over time.
|
| 137 |
+
|
| 138 |
+
This yields a **reactive interpretability layer** that not only explains but also stabilizes explanations under drift, feedback, and evolving conditions.
|
| 139 |
+
|
| 140 |
+
---
|
| 141 |
+
|
| 142 |
+
## 3. Repository Structure
|
| 143 |
+
|
| 144 |
+
The repository is organized as follows (file names may evolve slightly as the framework matures):
|
| 145 |
+
|
| 146 |
+
```text
|
| 147 |
+
sci/ # Core SCI library
|
| 148 |
+
__init__.py
|
| 149 |
+
config.py
|
| 150 |
+
controller.py # SCIController: closed-loop update over Θ using ΔSP
|
| 151 |
+
decomposition.py # Decomposition Π and reliability-weighted feature bank
|
| 152 |
+
interpreter.py # Interpreter / marker head and SP computation
|
| 153 |
+
reliability.py # Reliability scores (SNR, persistence, coherence)
|
| 154 |
+
sp.py # SP scalar and related metrics
|
| 155 |
+
utils.py # Shared utilities and helper functions
|
| 156 |
+
|
| 157 |
+
configs/ # Example configuration files
|
| 158 |
+
mnist.yaml
|
| 159 |
+
mitbih.yaml
|
| 160 |
+
bearings.yaml
|
| 161 |
+
|
| 162 |
+
examples/ # Jupyter notebooks (to be populated)
|
| 163 |
+
mnist_sci_demo.ipynb
|
| 164 |
+
ecg_sci_demo.ipynb
|
| 165 |
+
bearings_sci_demo.ipynb
|
| 166 |
+
|
| 167 |
+
experiments/ # Experiment scripts, logs, and analysis
|
| 168 |
+
|
| 169 |
+
scripts/ # Training utilities, Hub utilities, etc.
|
| 170 |
+
push_to_hub.py
|
| 171 |
+
|
| 172 |
+
run_sci_mitbih_fixed_k.py
|
| 173 |
+
run_sci_bearings.py
|
| 174 |
+
run_sci_signal_v2.py # Signal-domain SCI experiments
|
| 175 |
+
|
| 176 |
+
plot_metacognition_hero.py # Plotting script for metacognitive behavior
|
| 177 |
+
sc_arxiv.pdf # Paper PDF (for convenience)
|
| 178 |
+
sci_latex.tex # LaTeX source of the paper
|
| 179 |
+
|
| 180 |
+
pyproject.toml
|
| 181 |
+
setup.cfg
|
| 182 |
+
LICENSE
|
| 183 |
+
README.md
|
| 184 |
+
|
| 185 |
+
|