SafeLens: A Statistically Controlled Nonlinear Machine Learning Framework for Characterizing Hidden Dynamics in Event-Locked Neural Activity

Machine learning has advanced rapidly over the past decade, yet event-locked neural activity is still analyzed predominantly with traditional statistics and linear models. While traditional linear methods provide computationally tractable statistical control for pre-selected features or trial-averaged waveforms, they miss subtle nonlinear and trial-varying neural dynamics. Nonlinear models can capture these complex patterns, but their feature reliance is opaque and notoriously difficult to threshold statistically. We introduce SafeLens (Searchlight Analysis of Fluctuation Events, Leveraging Extensive Null Sampling) to combine the power of nonlinear machine learning with the rigorous false-positive control of traditional statistical inference. At each position of a sliding window, a random forest learns to discriminate event-locked activity from interleaved resting-state neural activity using multiscale temporal derivatives. Randomized feature ablation inverts slope polarity in held-out trials to map the random forest models' reliance on specific rising versus falling excursions across the time-frequency space. SafeLens then establishes an empirical null by running the same pipeline on separate resting-state recordings, training forests to discriminate rest from rest. This empirical null translates each channel's complex nonlinear resting dynamics into a model-matched noise floor on the map's linear reliance scale, allowing a single threshold to control the family-wise error rate against the channel's own background structure rather than a summary statistic of its baseline. When we injected simulated cortico-cortical evoked potentials (CCEPs) into resting intracranial EEG recordings, SafeLens recovered ~2.5 times as many polarity-resolved deflections as trial-average thresholding and the closest data-driven method, maintaining its advantage under trial-to-trial variability while yielding ~5-11 times fewer false components, ~2-5 times lower mean boundary error, and superior single-trial latency tracking as a timing prior. In eight patients, CCEPs remained detectable above chance until 1,040 ms after stimulation, compared with 570 and 455 ms for those benchmarks. Together, these findings establish SafeLens as a novel solution for enabling nonlinear models to uncover subtle, trial-varying neural dynamics under strict statistical control.

Authors

Institutions

Publication Details

Journal
bioRxiv (Cold Spring Harbor Laboratory)
Published
2026-11-04
DOI
https://doi.org/10.64898/2026.10.31.763367
Primary Topic
EEG and Brain-Computer Interfaces
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

SafeLens: A Statistically Controlled Nonlinear Machine Learning Framework for Characterizing Hidden Dynamics in Event-Locked Neural Activity

Corey J. Keller, Christopher B. Minasi, Christopher C. Cline, Umair Hassan
bioRxiv (Cold Spring Harbor Laboratory)
EEG and Brain-Computer Interfaces
preprint

SafeLens: A Statistically Controlled Nonlinear Machine Learning Framework for Characterizing Hidden Dynamics in Event-Locked Neural Activity

Corey J. Keller, Christopher B. Minasi, Christopher C. Cline, Umair Hassan
preprint en

Abstract

Machine learning has advanced rapidly over the past decade, yet event-locked neural activity is still analyzed predominantly with traditional statistics and linear models. While traditional linear methods provide computationally tractable statistical control for pre-selected features or trial-averaged waveforms, they miss subtle nonlinear and trial-varying neural dynamics. Nonlinear models can capture these complex patterns, but their feature reliance is opaque and notoriously difficult to threshold statistically. We introduce SafeLens (Searchlight Analysis of Fluctuation Events, Leveraging Extensive Null Sampling) to combine the power of nonlinear machine learning with the rigorous false-positive control of traditional statistical inference. At each position of a sliding window, a random forest learns to discriminate event-locked activity from interleaved resting-state neural activity using multiscale temporal derivatives. Randomized feature ablation inverts slope polarity in held-out trials to map the random forest models' reliance on specific rising versus falling excursions across the time-frequency space. SafeLens then establishes an empirical null by running the same pipeline on separate resting-state recordings, training forests to discriminate rest from rest. This empirical null translates each channel's complex nonlinear resting dynamics into a model-matched noise floor on the map's linear reliance scale, allowing a single threshold to control the family-wise error rate against the channel's own background structure rather than a summary statistic of its baseline. When we injected simulated cortico-cortical evoked potentials (CCEPs) into resting intracranial EEG recordings, SafeLens recovered ~2.5 times as many polarity-resolved deflections as trial-average thresholding and the closest data-driven method, maintaining its advantage under trial-to-trial variability while yielding ~5-11 times fewer false components, ~2-5 times lower mean boundary error, and superior single-trial latency tracking as a timing prior. In eight patients, CCEPs remained detectable above chance until 1,040 ms after stimulation, compared with 570 and 455 ms for those benchmarks. Together, these findings establish SafeLens as a novel solution for enabling nonlinear models to uncover subtle, trial-varying neural dynamics under strict statistical control.

bioRxiv (Cold Spring Harbor Laboratory)
Stanford University (US)
EEG and Brain-Computer Interfaces
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon