LIME Analysis
NOT IMPLEMENTEDLIME (Local Interpretable Model-agnostic Explanations) is not in the PaTz codebase. Local explanations are provided by Integrated Gradients + MC Dropout uncertainty.
LIME requires perturbation-based sampling (10β50k perturbed sequences per protein) β computationally prohibitive for variable-length protein sequences on a 6 GB GPU. The per-protein IG attributions in results/xai_results.json already provide local (per-protein, per-residue) explanations with better axiomatic guarantees.
For a single protein, generate N=1,000β5,000 perturbed versions by randomly masking residue windows.
Run each perturbation through PaTz to get GO term prediction probability changes.
Fit a sparse linear model (Ridge) on the perturbation neighbourhood β coefficients are LIME weights.
Identify residue windows with highest positive/negative weight for a target GO term.
Per-residue importance map for each protein and each GO prediction. Fast (~2s/protein). Captum + Riemann fallback.
β OpenN=20 stochastic passes β predictive entropy H[p] per protein. Identifies unreliable predictions.
β OpenPairformer 4-layer 8-head attention weights (residueβresidue). Requires inference pass.
| Criterion | LIME | Integrated Gradients |
|---|---|---|
| Explanation type | Neighbourhood linear proxy | Path-integral attribution |
| Perturbation needed | β Yes (1kβ50k samples) | β No (50 interpolation steps) |
| Handles variable length | β Hard (masking ill-defined) | β Yes (per-residue dim-mean) |
| GO-term specificity | β Per-class linear fit | β Per-class gradient |
| Completeness axiom | β Approximate | β Exact (Captum) |
| Speed per protein | ~4 min (RTX 3050) | ~2 sec |
| Used in PaTz | β Not implemented | β src/xai/ig.py |