Skip to experiment
SYN·CO·RE LAB AI Experiment · PSY3230

SHERPA

SHAP-value-based ERP Analysis, in miniature. A classifier learns to tell "faces" from "objects" trials in simulated EEG — and then shows when and where the signal drove its decision. Named for the Sherpa guides: a way through the peaks and troughs of an ERP.
What is happening here?

Every trial is a short stretch of EEG after a picture appears: 10 electrodes, −200 to 800 ms. The data are synthetic, so the truth is known. Both conditions share the usual components (P1, N170, P3), but for faces the N170 — a negative deflection around 170 ms — is stronger at the posterior-lateral electrodes P7, P8, PO7 and PO8, and there is a smaller, later positivity around 400 ms at Cz and Pz. Everything else is noise, and a single trial is mostly noise.

A logistic regression is trained on 280 trials to predict the condition from all 510 values (electrode × time), then tested on 120 trials it has never seen. The heatmap is the attribution map: how much each electrode at each moment moved the model's decisions, averaged over the held-out trials. For a linear model the SHAP value of a feature is exactly weight × (value − average value), so nothing here is approximated. This page is a linear miniature of the idea, not the published pipeline.

Things to try: turn the effect size to zero — accuracy falls to chance and the map dissolves into speckle. Raise the noise and watch both degrade together. Tick "show planted difference" to check the map against the ground truth, which real data never give you. And a caveat that carries over to real data: the map shows what this model used, which is evidence about the brain only as far as the model is good.

electrode:

Grand-average ERP at

faces objects negative is plotted up

Attribution map — mean |SHAP|, electrode × time

lowhigh (relative to the map's maximum)
Hover or drag to move the time cursor; click a row to pick an electrode.

Scalp at ms

Seen from above, nose up. Colour = attribution at the cursor time.
Predicting the condition is the easy part. The map is the point: it lights up around 170 ms over the posterior-lateral electrodes because that is where the difference was planted — the classifier has become an instrument for reading the data, not just a score.