SHAP Analysis
NOT IMPLEMENTEDSHAP (SHapley Additive exPlanations) is not currently implemented in the PaTz codebase. Integrated Gradients (Captum) serves as the primary attribution method.
The src/xai/ module implements Integrated Gradients (Captum) with a manual Riemann fallback, not SHAP or LIME. SHAP Kernel requires 200–2,000× more forward passes than IG and is infeasible on a 6 GB GPU for per-residue attribution across 354 GO terms. The existing IG implementation is equivalent for feature-attribution purposes in deep learning.
Model-agnostic. Background distribution samples → marginal Shapley contributions per residue. O(2^L) exact; O(n_samples × L) approx.
Backpropagation-based. DeepLIFT + Shapley. Faster than Kernel. Requires full autograd graph — incompatible with frozen ESM-2 feature extraction pipeline.
SHAP summary plots: mean(|SHAP|) per residue position across all test proteins. Aggregates per-sample attributions.
| Criterion | Integrated Gradients (✓ used) | SHAP Kernel |
|---|---|---|
| Computational cost | ~50 forward/backward passes | ~500–5,000 forward passes |
| GPU memory | Low (gradient tape) | High (coalitions × batch) |
| Axiomatic guarantees | Completeness, Sensitivity, Linearity | Efficiency, Symmetry, Dummy, Linearity |
| Handles residue length | Yes (per-residue dim-mean) | Difficult (variable L) |
| Feasible on RTX 3050 | ✓ Yes | ✗ Too slow / OOM |
| Literature precedent | Standard for protein LMs | More common in tabular/NLP |