Greedy State Boundary Search (GSBS) identifies transitions between relatively stable neural activity patterns in continuous recordings. Repeated template reconstruction and time-pair correlation scans make analyses across brain regions, large cohorts, and parameter sweeps computationally prohibitive. We present HP-GSBS, an open-source implementation built on an exact mathematical reformulation that decomposes the matching objective into additive interval contributions from temporal prefix sums and computes Welch t-distance through constant-time rectangle queries over two-dimensional correlation prefix tables.
Combined with streaming candidate search, local-window refinement, and active-block caching, this formulation drives unified CPU, PyTorch CUDA, and Triton backends. Across controlled benchmarks spanning recording lengths, feature dimensions, and search depths, HP-GSBS achieves 154- to 1,730-fold speedups while identically reproducing reference boundary histories and selected state counts (maximum $|Deltamathrm{TD}|=1.88times10^{-11}$). Cross-backend numerical equivalence is further confirmed on four human electroencephalography recordings from the Brain, Body, and Behavior Dataset (120–173 states).
Applied to naturalistic movie-viewing functional magnetic resonance imaging from 16 participants (4,230 angular-gyrus voxels), HP-GSBS completes group and individual fits in 213.10 s on a single CPU and reveals intersubject boundary alignment above a circular-shift null (mean pairwise $F_1=0.414$ vs. 0.325, $p=0.001$). HP-GSBS reduces hour-scale benchmark fits to seconds or fractions of a second.
Recording-level parallelism and an optional low-memory execution path make cohort-level and multi-timescale analyses tractable on standard laboratory hardware.
Source: arXiv q-bio.NC (Neurons & Cognition) — Read the full article on the original site ↗
Get the best of this topic in your inbox
Join the newsletter. A short, useful digest, no spam.




