CaMBrain - Real-time, Continuous EEG Inference with Causal State Space Models Abhilash Durgam, Nyle Siddiqui, Jeffrey A. Chan-Santiago, Qiushi Fu, Elakkat D. Gireesh, Mubarak Shah Abstract Electroencephalography (EEG) signals are a critical, non-invasive method to monitor electrical brain activity. They play a major role in neuromuscular and biomechanical settings, as they are used in clinical settings to monitor sleep, seizure activity, muscular response, etc. However, the length of EEGs is limitless - they can span anywhere from a couple seconds to multiple hours. This serves as a major hurdle for existing deep learning methods due to two major factors: (1) existing EEG models are predominantly built upon the attention mechanism, incurring quadratic scaling as the sequence length increases, and (2) raw EEG signals must be processed in a sliding-window fashion due to current models’ requirements of fixed-length input, preventing global understanding across the entire signal as a whole. To this extent, we propose CaMBRAIN - the first Ca usal, M amba-based EEG model capable of performing real-time inference of brain EEG signals. We argue that bidirectional approaches to processing EEG signals are counterintuitive and needlessly expensive due to the causal, unidirectional nature of EEG. Thus, we propose a unidirectional, causal, state space model (SSM) for EEG understanding. However, training such a model is not straightforward, as crucial EEG events can be extremely brief - occurring within fractions of a second - yet may be separated by long intervals spanning minutes. While current EEG methods use self-supervised objectives to optimize for signal reconstruction, these objectives are not well suited for streaming state space models; they fail to explicitly train the hidden state to retain the salient long-range context needed for streaming inference. Therefore, we introduce a multi-stage self-supervised training pipeline specifically tailored to encourage long-range memory retention and strong performance on EEG signals, while preserving the linear-time complexity of state space models. CaMBRAIN achieves state-of-the-art (SOTA) results across 3 different EEG datasets with > > 10 × \times higher throughput than existing models, enabling the first model capable of performing long-range, continuous inference of variable-length EEG signals. Figure 1 : Existing methods (top) operate on overlapping sliding windows, repeatedly recomputing features over shared regions and limiting context to short segments. In contrast, CaMBRAIN (bottom) enables continuous EEG inference by maintaining a persistent hidden state that incrementally compresses all past context, eliminating redundant computation and enabling efficient, global temporal EEG understanding in real time (right). Window sizes not-to-scale. 1 Introduction Electroencephalography (EEG) is a widely used, non-invasive technique for measuring electrical activity in the brain 5 , playing a central role in clinical applications such as seizure detection 34 , 35 and cognitive behavioral analysis 18 , 3 . Unlike many modalities in computer vision or natural language processing, EEG is inherently a continuous, high-frequency, multichannel temporal signal, often spanning minutes to hours of recording. This unique structure presents both an opportunity and a challenge: while EEG contains rich temporal dynamics across multiple frequency channels, effectively modeling these intricate, long-range dependencies efficiently remains difficult. Recent advances in deep learning have significantly improved EEG analysis, with transformer-based architectures emerging as the dominant paradigm due to their strong performance in capturing temporal dependencies 39 . However, this success comes with two critical limitations that hinder their applicability to real-world EEG settings. First, transformers incur quadratic computational complexity with respect to sequence length, making them fundamentally inefficient for long-duration EEG signals. Second, due to this unfavorable scaling, existing approaches typically rely on a sliding-window inference strategy where overlapping segments of a long signal are processed independently and their predictions are aggregated (Fig. 1 ). While effective on a small scale, this approach introduces substantial redundancy and computational overhead by repeatedly recomputing overlapping regions. More importantly, it prevents the model from maintaining a persistent representation of long-range context, since each window is processed in isolation rather than as part of a continuous signal history. These limitations are particularly problematic in real-time or continuous EEG monitoring, where both efficiency and long-range temporal reasoning are essential. In such settings, EEG should not be treated as a collection of independent segments, but as a continuous signal where each new observation builds on prior context. A model deployed in this regime must process incoming EEG without looking ahead at future signal, and must do so at a cost that does not grow with how long the recording has been running equivalently, the entire relevant past must be retained in a compact memory that updates as the signal continues. This matches how clinicians monitor EEG at the bedside, and the need for continuous, efficient EEG processing has been acknowledged in prior work 12 , 33 . In this work, we introduce CaMBRAIN, a causal state space model for EEG that enables real-time, continuous streaming inference. Built on a Mamba-3 architecture, our model processes EEG signals in consecutive 62.5 ms patches, even across windows, to update a persistent hidden state that compactly summarizes all past information. Unlike sliding-window approaches, CaMBRAIN does not revisit previous inputs; instead, it leverages the inherent property of state space models to encode long-range temporal context from previous patches directly within the hidden state, allowing efficient and scalable inference over arbitrarily long signals. This design aligns naturally with the causal and unidirectional nature of EEG, avoiding the need for bidirectional processing and redundant computation. However, architectural choices alone do not fully address the demands of continuous EEG inference. The pretraining objective also shapes what the hidden state retains, and prior EEG foundation models 13 , 4 , 24 have largely relied on self-supervised objectives. While such reconstruction-based objectives can capture local signal structure, they inherently prioritize learning short-range, signal fidelity at the masked regions rather than learning to compress and retain globally relevant context. This is misaligned with the demands of continuous inference, where the objective is also to selectively retain and propagate the most salient information forward in time. In the context of state space models, this distinction is critical: the hidden state must function as a compact, information-rich summary of the entire history, rather than a mechanism for reconstructing local signal details. To address this, we propose a representation-level self-supervised learning framework inspired by JEPA-style training, adapted to the challenges of continuous, causal EEG modeling. By combining multi-step autoregressive prediction with masked latent prediction under a strict unidirectional constraint, our approach explicitly encourages the model to encode predictive, informative, and long-range temporal features within its hidden state. We summarize our contributions as the following: • We propose a unidirectional EEG inference formulation for real-time inference, departing from sliding-window and bidirectional transformer-based approaches that treat signals as independent segments. • We propose CaMBRAIN, a causal Mamba-3 encoder for efficient streaming EEG processing, where a persistent hidden state replaces sliding-window recomputation by maintaining a unified representation of the entire signal history. • As an alternative to reconstruction-based frameworks, we introduce a representation-level self-supervised training method for continuous EEG inference, designed to promote the retention of predictive, long-range temporal information within the model’s hidden state. 2 Related Works 2.1 Self-Supervised Learning in EEG Deep learning has become increasingly effective for EEG analysis 7 , with recent work shifting from task-specific supervised models toward large-scale self-supervised and foundation models. Early approaches such as BENDR 19 adapted contrastive sequence pretraining to EEG, while BIOT 40 introduced a transformer-based framework for cross-dataset biosignal learning. Other works focus on scaling EEG pretraining objectives: LaBraM 16 uses vector-quantized neural spectrum prediction, while REVE 12 studies large-scale pretraining across heterogeneous EEG setups. In parallel, recent models have improved architectural flexibility for EEG, with CBraMod 37 modeling spatial and temporal dependencies through cross-attention and LUNA 11 introducing topology-agnostic channel representations for variable EEG montages. These methods have substantially improved transfer across EEG datasets and downstream tasks, including abnormal EEG detection 26 , event detection 26 , sleep staging 1 , and cognitive-state prediction 42 , 25 , 28 . However, despite their strong representation learning capabilities, most existing EEG models still operate on fixed-length segments and are typically applied to long recordings through sliding-window inference. This formulation treats a continuous EEG as a collection of independent or overlapping windows, requiring redundant computation over shared regions and limiting the model’s ability to maintain a persistent representation of the entire signal history. In contrast, our work focuses on continuous EEG inference, where each new EEG patch updates a persistent hidden state without revisiting previous inputs. This setting is especially important for real-time clinical and wearable applications, where models must produce frequent predictions while preserving long-range context over arbitrarily long recordings. 2.2 State Space Models State space models (SSMs) have recently emerged as efficient alternatives to attention for long-sequence modeling. Structured SSMs such as S4 15 and S5 29 showed that continuous-time dynamical systems can be parameterized for stable and efficient sequence learning, while Mamba 14 introduced selective state spaces that improve content-dependent modeling while retaining linear-time scaling. These properties make SSMs a natural fit for EEG, since EEG is a long, causal, temporally ordered signal with relevant events that may be sparse and separated by long intervals. Recent EEG models have begun to explore this direction: EEGMamba 38 applies a bidirectional Mamba architecture for efficient EEG foundation modeling. However, these methods are still designed for window-level processing and often use bidirectional scans and reconstruction-based pretraining, which limits their suitability for EEG streaming inference. CaMBRAIN instead uses a unidirectional causal Mamba-3 encoder whose hidden state is explicitly preserved across incoming EEG patches, enabling efficient real-time updates while avoiding both quadratic attention and bidirectional dependence on future context. 3 Methodology We present CaMBRAIN (left, Fig. 2 ), a causal EEG foundation model for continuous streaming inference. Unlike prior approaches that rely on bidirectional processing and reconstruction-based objectives, our method operates in a unidirectional, forward-only manner and prioritizes learning representations rather than reconstructing signals for optimal streaming performance. Our method is built on two key principles: (1) causal, linear-time sequence modeling to enable continuous EEG streaming, and (2) representation-level self-supervised learning to encourage the SSM hidden state to capture and retain salient EEG context over long temporal horizons. We first provide some background on state space models and EEG signals, followed by our three stages of training: (i) causal predictive pretraining (Sec. 3.2.1 ), (ii) latent prediction learning for long-horizon memory (Sec. 3.2.2 ), and (iii) downstream fine-tuning (Sec. 3.2.3 ). 3.1 Preliminaries EEG Patching. We represent an EEG segment as a multichannel time series X\in\mathbb{R}^{C\times T} , where C denotes the number of EEG channels and T denotes the number of temporal samples. Rather than operating directly on raw samples, EEGs are partitioned into non-overlapping patches spanning all channels and P time steps, producing G_{T}=\lfloor T/P\rfloor patches. Each patch is then embedded using a transformer 11 , yielding EEG tokens \mathbf{X}=\{x_{1},\ldots,x_{G_{T}}\} , where each x_{t}\in\mathbb{R}^{d} summarizes the EEG content at temporal index t across all channels. We refer to these embeddings as EEG tokens . State Space Models. Structured state space models have emerged as an efficient alternative for sequence modeling, offering near-linear complexity with respect to sequence length while capturing long-range dependencies. At a high level, SSMs model a time-dependent input signal as the evolution of a latent dynamical system. Given an input sequence x(t)\in\mathbb{R}^{L} , an SSM maintains a latent state h(t)\in\mathbb{R}^{N} that evolves over time and produces an output y(t)\in\mathbb{R}^{L} . To operate on discrete sequences, the continuous dynamics are discretized using a learnable step size \Delta , yielding: \displaystyle h_{t}=\mathbf{\bar{A}}h_{t-1}+\mathbf{\bar{B}}x_{t},\qquad y_{t}=\mathbf{\bar{C}}h_{t}. where \bar{\mathbf{A}}\in\mathbb{R}^{N\times N} governs state transitions, and \mathbf{\bar{B}} and \bar{\mathbf{C}} denote input and output projections, respectively. After discretization, the same SSM can be evaluated either recurrently or as a global convolution. The recurrent form updates a hidden state one step at a time (left), while unrolling the recurrence yields a convolutional form (right): \displaystyle h_{t} \displaystyle=\bar{\textbf{A}}h_{t-1}+\bar{\textbf{B}}x_{t}, \displaystyle y_{t} \displaystyle=\bar{\textbf{C}}h_{t}, \displaystyle\bar{\textbf{K}} \displaystyle=(\bar{\textbf{C}}\bar{\textbf{B}},\bar{\textbf{C}}\bar{\textbf{A}}\bar{\textbf{B}},\cdots,\bar{\textbf{C}}\bar{\textbf{A}}^{t}\bar{\textbf{B}}), \displaystyle y \displaystyle=x*\bar{\textbf{K}}. Thus, during training the sequence can be processed efficiently in parallel using the convolutional form, while at inference the recurrent form updates the hidden state online. This formulation naturally defines a causal model, parameterized by \theta=\left\{\mathbf{\bar{A}},\mathbf{\bar{B}},\mathbf{\bar{C}},\Delta\right\} where the hidden state at time step t depends only on past and current inputs \{x_{1},\dots,x_{t}\} . As a result, SSMs are well-suited for streaming settings, enabling autoregressive inference with constant memory and per-step compute. Due to the rich spectral structure across multiple frequency bands in EEG signals, we leverage a Mamba-3 architecture 20 for our causal encoder, which employs complex-valued state transitions to better capture oscillatory dynamics and phase relationships. In addition to this, we leverage SSM’s ability to compress previous context into an accessible hidden state to achieve near real-time, continuous streaming inference of EEG signals with accurate long-range capabilities. Because each of these properties has direct implications for EEG modeling, we summarize the underlying recurrences and their EEG intuition in Appendix A.5 . 3.2 CaMBRAIN A key advantage of CaMBRAIN is its inherited ability from state space modeling to maintain and update a persistent hidden state, allowing new EEG samples to be processed continuously while retaining relevant historical information (see Tab. 3(a) ). During inference, CaMBRAIN processes incoming EEG in 62.5 ms patches, using its hidden state to make real-time predictions with context beyond the current patch. In contrast, prior EEG models 19 , 40 , 31 operate on fixed-length windows, where each segment is processed independently. While such models can capture temporal structure within a window, they do not maintain an explicit state across windows and therefore require repeated reprocessing of overlapping windows to gain longer-context understanding of an EEG. Additionally, their reliance on bidirectional attention limits their applicability in strictly causal settings, as future context is required during inference. However, architecture alone does not guarantee effective streaming: the hidden state must also be trained to retain previous context and produce future predictions. We therefore design CaMBRAIN around both a causal streaming architecture and a training objective that encourages long-range memory retention. An overview of CaMBRAIN is provided in Fig. 2 , followed by its training formulation below. Figure 2 : Overview of CaMBRAIN . CaMBRAIN is a causal state space model that processes EEG in 62.5 ms patches using a unidirectional state space model with a persistent hidden state. We train it with a three-stage pipeline: (1) causal predictive pretraining with autoregressive and masked reconstruction objectives to learn local temporal structure, (2) decoder-free latent JEPA training using a student–teacher framework to enforce long-range consistency and memory retention in the hidden state, and (3) downstream fine-tuning for task-specific prediction. This design enables real-time, continuous inference over arbitrarily long EEG recordings. 3.2.1 Stage 1: Causal Predictive Pretraining The goal of Stage 1 is to instill general temporal structure in the encoder under a strict causal constraint, before any representation-level training. While one of our aims is to perform large-scale self-supervised learning without reconstruction, it is important that the model is first instilled with some general temporal understanding of EEGs for better performance (see Sec. 4.3 ). We pretrain the encoder using two complementary objectives applied in a strictly causal, forward-only manner: autoregressive modeling (ARM) and masked reconstruction (top-right, Fig. 2 ). Autoregressive Modeling (ARM). Given a sequence of EEG token embeddings \{x_{t}\}_{t=1}^{G_{T}} , the model produces hidden states \{h_{t}\}_{t=1}^{G_{T}} , where each h_{t} depends only on past inputs x_{\leq t} . The autoregressive objective predicts the embedding of the next patch from the current hidden state, \hat{x}_{t+1}=g(h_{t}) , where g(\cdot) is a learnable prediction head. The ARM loss is defined as: \mathcal{L}_{\text{ARM}}=\sum_{t=1}^{G_{T}-1}\ell(\hat{x}_{t+1},x_{t+1}), where the target embeddings \{x_{t+1}\} are obtained from the unmasked signal. While this next-patch prediction objective encourages the model to capture the temporal dynamics and evolution of EEG signals, it primarily enforces consistency across time and does not explicitly encourage the learning of robust local representations. To complement this, we combine ARM with a masked modeling objective. Masked Reconstruction. To aid the model in capturing local structure, we additionally apply a masked reconstruction objective which focuses on reconstructing missing information from the causal context provided by the encoder hidden states. Masking is performed at the token level after EEG embedding. Specifically, a subset of EEG tokens are selected, and all values within each selected token are masked with zeros. The masked tokens are passed through the encoder, and a decoder d(\cdot) reconstructs the original EEG signal from the masked tokens: \hat{X}=d(h_{1:G_{T}}). Given the set of masked positions \mathcal{M} , the reconstruction loss is applied only on masked regions: \mathcal{L}_{\text{mask}}=\ell(\hat{X},X;\mathcal{M}). The overall Stage 1 objective combines both losses: \mathcal{L}_{\text{Stage1}}=\lambda_{\text{ARM}}\mathcal{L}_{\text{ARM}}+\lambda_{\text{mask}}\mathcal{L}_{\text{mask}}, (1) where \lambda_{\text{ARM}} and \lambda_{\text{mask}} control the relative weighting of the two objectives. While Stage 1 instills strong local temporal structure in the encoder, it trains a single property of the model: predicting and reconstructing patches from their immediate causal context. As previously mentioned, these objectives do not explicitly encourage the model to compress and retain the most salient information over long temporal horizons - an especially important attribute for continuous streaming inference. Moreover, prior approaches require a decoder even at downstream time, increasing inference overhead. To address this, we propose a latent prediction framework for EEG streaming in Stage 2 that directly optimizes representation quality without decoder-based reconstruction. 3.2.2 Stage 2: Reconstruction-free Causal Latent Representation Refinement Our second stage of training tasks the model to predict target representations produced by a separate network (middle-right, Fig. 2 ), directly encouraging the hidden state to encode informative features of the EEG signal. Stage 1 provides a useful initialization by training the encoder to recover raw EEG content, encouraging sensitivity to local waveform structure. However, raw-signal reconstruction is a limited objective for streaming inference: it mainly rewards fidelity to short-range signal details and is poorly suited for supervising what the hidden state should preserve over long horizons. To achieve this, we adopt a JEPA-style 2 training framework, where a student model is trained to predict latent representations produced by a teacher network. Rather than enforcing global feature alignment between student and teacher, the teacher observes the unmasked input signal, while the student operates on a partially masked view and learns to predict the corresponding teacher representations. We use two separate prediction heads: a masked predictor g_{\mathrm{mask}} for masked latent modeling and a future predictor g_{\mathrm{future}} for multi-step future latent prediction. This formulation frames representation learning as a conditional prediction problem, encouraging the student model to encode sufficient contextual information in its hidden state to infer missing or future EEG content under a strict causal constraint. The teacher is implemented as an exponential moving average (EMA) of the student and is not updated through backpropagation, providing a stable and slowly evolving target. Building on this idea, we adapt our framework to the challenges of continuous EEG streaming inference in two key ways. First, we enforce strict causality, ensuring that predictions are made only from past observations without access to future inputs. Second, we incorporate a multi-step autoregressive objective, requiring the model to predict both masked and future latent representations from the teacher over time. Together, these modifications crucially encourage CaMBRAIN to prioritize encoding temporally relevant information into its hidden state, improving its ability to retain and utilize long-range EEG context in a streaming setting. Our process is implemented as follows: Student–Teacher Framework. We maintain two networks with identical architectures: a student network with parameters \theta and a teacher network with parameters \phi . The teacher is initialized as a copy of the student and is updated as an exponential moving average (EMA) of the student parameters: \phi\leftarrow\tau\phi+(1-\tau)\theta, where \tau\in[0,1) is a momentum parameter that is gradually increased during training. The teacher network is not updated via backpropagation and serves as a stable target for representation learning. The student processes a randomly masked version of the input EEG signal, while the teacher receives the unmasked signal. Both networks produce sequences of latent representations \{h_{t}^{(s)}\}_{t=1}^{G_{T}} and \{h_{t}^{(t)}\}_{t=1}^{G_{T}} . At masked positions \mathcal{M} , the student is trained to predict the corresponding teacher representations using the masked predictor g_{\mathrm{mask}} : \hat{h}^{(t)}_{t}=g_{\mathrm{mask}}(h^{(s)}_{t}),\quad t\in\mathcal{M}, and is optimized with a Smooth L1 loss: L_{\mathrm{pred}}=\sum_{t\in\mathcal{M}}\mathrm{SmoothL1}\left(\hat{h}^{(t)}_{t},h^{(t)}_{t}\right). This asymmetry forces the student to infer missing local EEG content from its available causal context, encouraging the hidden state to encode informative representations from partial observations. However, this objective alone does not enforce that the hidden state encodes information predictive of future EEG dynamics. Multi-Step Autoregressive Prediction. While masked latent prediction encourages the model to infer missing EEG content, it does not explicitly enforce that the hidden state captures the temporal dynamics of the signal. In particular, accurately reconstructing masked regions does not guarantee that the model can predict future EEG activity from its current hidden state, especially over extended time horizons. To address this, we extend the autoregressive objective to multiple future steps. Given a hidden state h_{t}^{(s)} , the model predicts the next K latent representations from a single hidden state using a separate future predictor g_{\mathrm{future}} : \hat{h}^{(t)}_{t+1:t+K}=g_{\mathrm{future}}(h^{(s)}_{t}), where g_{\mathrm{future}} is a lightweight prediction head shared across time steps. The targets are the corresponding future teacher representations, which provide a stable reference without exposing future information to the student encoder: L_{\mathrm{future}}=\sum_{t=1}^{G_{T}-K}\sum_{k=1}^{K}\ell\left(\hat{h}^{(t)}_{t+k},h^{(t)}_{t+k}\right). By requiring the model to predict multiple future representations from a single hidden state, this objective encourages the hidden state to encode information that is predictive of the long-range temporal dynamics of the EEG signal, rather than relying solely on local context. The final Stage 2 loss combines both objectives: L_{\mathrm{Stage2}}=L_{\mathrm{pred}}+L_{\mathrm{future}}. 3.2.3 Stage 3: Downstream Fine-Tuning After pretraining, we adapt the model to downstream EEG tasks using supervised fine-tuning (bottom-right, Fig. 2 ). Given an input EEG sequence, the pretrained encoder produces a sequence of latent representations. Unlike prior window-based or attention-based EEG models, which typically require pooling or aggregating token representations across a fixed input segment, CaMBRAIN can use just the final hidden state for classification. In particular, successive 62.5 ms EEG patches can be processed online by updating the hidden state without revisiting past inputs, and predictions can be produced directly from the current hidden state without storing or pooling over previous tokens. We therefore pass the final hidden state to a lightweight linear classification head for task-specific prediction. Following previous works 11 , 12 , we fine-tune the entire model end-to-end using standard supervision. Full implementation details are given in Sec. A.1 4 Experiments 4.1 Datasets and Evaluation Protocol We evaluate CaMBRAIN on a diverse set of EEG benchmarks spanning artifact detection, abnormality classification, mental stress detection, and seizure detection, including TUAR 26 , TUAB 26 , MAT 42 , and CHB-MIT 28 . These datasets cover a range of clinical and real-world EEG settings, varying in subject populations, recording conditions, and label distributions. This diversity allows us to assess both in-distribution performance and generalization to out-of-distribution (OOD) scenarios. Following prior work, we treat each dataset as a downstream task and fine-tune our pretrained model accordingly. Importantly, our training pipeline is designed to learn general-purpose EEG representations, and downstream fine-tuning serves to evaluate how well these representations transfer across tasks and domains. We report standard evaluation metrics for EEG classification, including area under the ROC curve (AUROC) and area under the precision-recall curve (AUPR), which are common in EEG tasks such as seizure detection and artifact classification. 4.2 Results Despite avoiding overlapping windows and redundant recomputation, CaMBRAIN achieves competitive or superior performance across all benchmarks. On TUAR artifact detection and CHB-MIT seizure detection (Table 1 ), CaMBRAIN obtains the best AUROC among compared methods, reaching 0.936 on TUAR and 0.921 on CHB-MIT. These gains are especially notable for CHB-MIT, where seizure events are highly imbalanced and long-range temporal context is important. We further evaluate CaMBRAIN on TUAB abnormal EEG detection and MAT mental stress detection (Table 2 ). CaMBRAIN remains competitive with substantially larger EEG foundation models and achieves the best MAT balanced accuracy and AUROC. Overall, these results suggest that persistent-state streaming and representation-level training provide strong cross-task EEG representations while avoiding the redundant computation of sliding-window inference. Compute efficiency at deployment. Table 1(b) reports sustained compute at the 16 Hz streaming update rate ( 62.5 ms patches), the load a real-time monitor must support. CaMBRAIN’s 1.23 GFLOPs/s is between 6.1\times (CBraMod) and 158\times (REVE) below every foundation-model baseline while matching or exceeding their AUROC. The gap is structural, not size-driven: CBraMod is 9\times smaller than CaMBRAIN yet needs 6\times more sustained compute, because attention costs \mathcal{O}(T) per query where the SSM step is \mathcal{O}(1) , and persistent state avoids recomputing overlapping windows. Overall, the results demonstrate that CaMBRAIN benefits from both its streaming architecture and representation-level training strategy. CaMBRAIN avoids the need for overlapping window-based processing and the associated redundant computation. Furthermore, the combination of masked latent prediction and multi-step autoregressive objectives encourages the hidden state to capture predictive, long-range temporal structure, rather than local signal fidelity. Table 1 : Performance comparison on TUAR artifact detection and CHB-MIT seizure detection. (a) TUAR artifact detection (MMC Objective). Model Size AUROC \uparrow AUC-PR \uparrow Supervised Models EEGNet 21 — 0.752 0.433 EEG-GNN 9 — 0.837 0.488 GraphS4mer 32 — 0.833 0.461 Self-supervised Models BrainBERT 36 43M 0.753 0.350 EEGFormer-B 6 2.3M 0.847 0.483 EEGFormer-L 6 3.2M 0.852 0.483 LUNA-B 11 7M 0.902 0.495 LUNA-H 11 311M 0.921 0.528 CaMBRAIN 37M 0.936 0.565 (b) CHB-MIT seizure detection. GFLOPs/s reports sustained compute at the 16 Hz streaming update rate, Lower is better. Model Size AUROC \uparrow AUC-PR \uparrow GFLOPs/s \downarrow Supervised Models EEGNet 21 — 0.805 0.191 — ST-Transformer 30 3.2M 0.824 0.142 — Self-supervised Models BENDR 19 0.39M 0.863 0.307 — BIOT 40 3.2M 0.876 0.328 15.80 LaBraM 16 5.9M 0.868 0.329 16.99 CBraMod 37 4.0M 0.889 0.369 7.51 LUNA-L 11 43M 0.896 0.316 35.85 REVE 12 72M 0.908 0.380 194.79 CaMBRAIN 37M 0.921 0.389 1.23 Table 2 : Comparison on TUAB abnormal EEG detection and MAT mental stress detection. (a) TUAB abnormal EEG detection. Model Size AUROC \uparrow AUC-PR \uparrow Supervised Models SPaRCNet 17 0.8M 0.867 0.841 ContraWR 41 1.6M 0.845 0.842 CNN-Transformer 27 3.2M 0.846 0.843 ST-Transformer 30 3.2M 0.870 0.852 Self-supervised Models BrainBERT 36 43.2M 0.853 0.846 EEGFormer 6 2.3M 0.867 0.867 BIOT 40 3.2M 0.881 0.869 FEMBA 33 47.7M 0.882 0.889 CEReBrO 10 85.2M 0.891 0.904 LaBraM 16 5.9M 0.902 0.896 CBraMod 37 69.3M 0.915 0.922 LUNA 11 7M 0.886 0.895 CaMBRAIN 37M 0.867 0.876 (b) MAT mental stress detection. Method AUROC \uparrow Bal. Acc. \uparrow EEGNet 21 0.732 0.677 EEGConformer 31 0.742 0.680 SPaRCNet 17 0.741 0.687 ContraWR 41 0.733 0.663 CNN-Transformer 27 0.725 0.677 FFCL 22 0.733 0.679 ST-Transformer 30 0.713 0.663 BIOT 40 0.753 0.687 LaBraM-B 16 0.772 0.690 CBraMod 37 0.790 0.725 REVE-B 12 0.845 0.766 CaMBRAIN 0.876 0.778 4.3 Ablations 4.3.1 Ablation on Hidden State To exhibit the value of persistent memory, we compare persistent state inference, where CaMBRAIN carries its hidden state across the full EEG recording, against windowed inference, where the state is reset every 5 s to mimic conventional windowed evaluation. As shown in Table 3(a) , persistent state inference consistently improves both onset localization and patch-level classification, a +0.015 increase in AUROC. These gains confirm that CaMBRAIN benefits not only from efficient inference, but from allowing the hidden state to compress and retain long-range EEG history. This supports our central claim: treating EEG as a continuous stream provides useful temporal context that is lost when models process each window independently. 4.3.2 Ablation on Pretraining Stages We further ablate the impact of our self-supervised pretraining strategy in Table 3(b) . The first row corresponds to standard downstream fine-tuning on TUAR from random initialization, which yields the weakest performance. Initializing from Stage 1 pretraining alone provides a modest improvement (+0.60 AUROC, +2.80 AUPR), indicating that reconstruction-based pretraining improves general EEG feature extraction. In contrast, our full two-stage approach achieves substantially larger gains (+2.30 AUROC, +10.9 AUPR over standard fine-tuning). These results show that while Stage 1 provides a useful initialization, Stage 2 is critical for learning representations that transfer effectively to downstream artifact detection. Unlike reconstruction-based objectives, which emphasize local signal fidelity, our Stage 2 training directly optimizes latent representations across time, encouraging the hidden state to encode invariant and temporally relevant information necessary for continuous EEG inference. Table 3 : Ablations on our proposed pretraining stages and the impact of a persistent hidden state for continuous EEG inference evaluation. (a) Value of persistent hidden-state memory during continuous CHB-MIT evaluation. Streaming inference carries the hidden state across the full recording, while windowed inference resets the state every 5 s. Scores scaled by 100 Metric Continuous Windowed \Delta Seizure onset Mean prob. at onset ( \uparrow ) 25.2 11.8 +13.5 Peak prob. near onset ( \uparrow ) 38.3 27.6 +10.8 Prob. at onset patch ( \uparrow ) 21.6 6.20 +15.4 Sparse patch classification AUROC ( \uparrow ) 88.9 87.4 +1.50 BAC, T=0.5 ( \uparrow ) 72.3 66.6 +6.30 (b) Pretraining ablation results on TUAR MCC 5-class artifact detection, with scores scaled by 100. The first row shows standard downstream fine-tuning, the second adds Stage 1 pretraining, and the final row uses both Stage 1 and Stage 2. Strongest performance is obtained only when both stages are combined. Stage 1 Stage 2 AUROC \uparrow AUPR \uparrow ✗ ✗ 93.7 75.0 ✓ ✗ 94.3 (+0.60) 77.8 (+2.80) ✓ ✓ 96.0 (+2.30) 85.9 (+10.9) 5 Limitations CaMBRAIN’s design and evaluation leave several directions open for future work. First, while CaMBRAIN sets the new best result on TUAR, MAT, and CHB-MIT, it remains competitive with rather than ahead of the strongest foundation models on TUAB abnormal-EEG detection (Table 2(a) ). Closing this gap is a natural next step. Second, the scale of our pretraining corpus \sim 21k hours of TUEG is substantially smaller than that of recent EEG foundation models such as REVE [ 12 ] , which pretrains on a much larger and more heterogeneous corpus spanning many sites and montages. Scaling CaMBRAIN’s two-stage objective to corpora of comparable size, and across more diverse acquisition setups, is a direction which may yield further gains, particularly on tasks where TUEG underrepresents the target distribution. 6 Conclusion We introduced CaMBRAIN, a causal state space model for EEG that enables real-time, continuous streaming inference over arbitrarily long signals. By leveraging a Mamba-3 architecture, CaMBRAIN maintains a persistent hidden state that compactly summarizes all past EEG context, eliminating the need for sliding-window processing and redundant computation. In addition, we proposed a JEPA-style, representation-level self-supervised training framework that encourages the model to encode predictive, invariant, and long-range temporal information within its hidden state, rather than focusing on local signal reconstruction. Across a diverse set of EEG benchmarks spanning artifact detection, abnormality classification, seizure detection, and mental stress detection, CaMBRAIN achieves strong performance while providing substantial improvements in computational efficiency. These results demonstrate that modeling EEG as a continuous stream, combined with representation-level learning, leads to more effective and scalable solutions compared to existing approaches. Overall, this work highlights the importance of aligning both model architecture and training objectives with the inherent properties of EEG signals. Appendix A Appendix A.1 Implementation Details Architecture. CaMBRAIN has 36.7 M parameters with model dimension d_{\text{model}}=704 , 4 Mamba-3 blocks, state size d_{\text{state}}=64 , head dimension d_{\text{head}}=64 (giving 11 heads), and SwiGLU FFN expansion ratio 4 . The channel embedder is a cross-attention module inspired from 11 with Q=4 learnable queries and H=4 attention heads. Each block applies pre-RMSNorm followed by a residual connection: z\leftarrow z+\textsc{MambaStep}(\textsc{RMSNorm}(z)) then z\leftarrow z+\textsc{SwiGLU}(\textsc{RMSNorm}(z)) . Patches are 16 samples ( 62.5 ms at 256 Hz) and a learned cyclic positional embedding indexed by \tau\bmod 80 is added at the input of the encoder, where 80 is the patch count of a 5 s pretraining window. Classification reads the last-token hidden state through a linear head. Pretraining Stage 1 (Hybrid Causal Loss). The encoder is initialized as a strictly forward-only Mamba-3 stack with a Conv2d input adapter ( 22 channels, kernel 1{\times}16 ). Two losses are combined: causal autoregressive prediction of next-patch latents (ARM) and masked raw-EEG reconstruction with a lightweight decoder. Mask ratio is 0.4 , loss weights \lambda_{\text{ARM}}=\lambda_{\text{mask}}=0.5 . We use the LAMB optimizer with peak learning rate 1{\times}10^{-3} , weight decay 0.01 , cosine schedule, 5 warmup epochs, batch size 1024 (grad-accumulated), and bf16-mixed precision. Pretraining Stage 2 (EMA-JEPA). The student loss is the sum of (i) multi-step latent prediction with horizon K=4 and (ii) block-masked latent prediction against an EMA teacher with momentum \tau_{\text{ema}}=0.9999 ramped from 0.99 over the first 5\% of training. Both losses are Smooth- L_{1} . We use AdamW with peak learning rate 1{\times}10^{-4} , weight decay 0.05 , \beta=(0.9,0.999) , and the same cosine schedule. Both pretraining stages are strictly causal: target latents at position t are produced by the teacher conditioned only on patches \{1,\dots,t\} . Pretraining corpus. Stage 1 and Stage 2 both use the Temple University Hospital EEG corpus (TUEG, \sim 21k hours), preprocessed with the pipeline described in Section A.2 . Subjects appearing in any downstream evaluation set (TUAR, TUAB) are held out from pretraining. Finetuning. We fine-tune the entire model end-to-end with AdamW, layer-wise learning-rate decay 0.75 (encoder relative to head), cosine schedule with 5\% warmup, weight decay 0.05 . Per-task loss is cross-entropy for multiclass tasks (TUAR), binary cross-entropy for binary tasks (TUAB, MAT, CHB-MIT). Three random seeds ({42, 43, 44}) per task; we report mean values in the main text. Hardware. Pretraining on 8 \times H100 PCIe; finetuning and all inference benchmarks on a single H100 NVIDIA GPU. Streaming inference is implemented in PyTorch with the official mamba_ssm package [ 20 ] compiled with CUDA 13. A.2 Datasets and Preprocessing Table 4 summarizes the four downstream datasets. All recordings undergo a uniform preprocessing pipeline before normalization: a 4 th-order zero-phase Butterworth bandpass between 0.1 and 75 Hz, a 60 Hz notch filter for line interference, and resampling to 256 Hz. For TUH-family datasets (TUAR, TUAB) we form a 22 -channel bipolar double-banana montage by differencing the standard longitudinal pairs. CHB-MIT is delivered in bipolar form ( 16 channels) and is left as-is. MAT uses the original 19 -channel 10 – 20 unipolar montage. Causal Sliding Robust Quartile Normalization (RQN). At each sample time t and for each channel c , we compute the median m_{c,t} and interquartile range \mathrm{IQR}_{c,t}=Q_{3}-Q_{1} over the past W=1280 samples (a 5 s causal sliding buffer at 256 Hz), and normalize \hat{x}_{c,t}\;=\;\frac{x_{c,t}-m_{c,t}}{\mathrm{IQR}_{c,t}+\varepsilon}, with \varepsilon=10^{-6} . Only samples in [\max(0,\,t-W+1),\,t] enter the statistics, so the normalization is strictly causal: a sample at time t never depends on a sample at t^{\prime}>t . Compared to per-window z -scoring [ 11 ] , quantile-based statistics are insensitive to high-amplitude artifacts (eye blinks, muscle bursts, electrode pops) that dominate the channel-wise mean and standard deviation but not the quartiles. During parallel-mode processing (pretraining and finetuning, where the model sees complete 5 s windows), we use standard window-level RQN: a single median and IQR per channel per window. During streaming inference, the median and IQR are maintained over a circular buffer of the most recent W samples and updated each patch. Table 4 : Downstream datasets. All splits are at the recording level (file-level random split, train/val/test =80/10/10 ) following [ 11 , 6 ] . Dataset Subjects Channels Task Window Class balance TUAR [ 26 ] 213 22 (bipolar) 6-class artifact (MMC) 5 s artifact families TUAB [ 26 ] 2,329 22 (bipolar) binary normal/abnormal 5 s \sim 50/50 MAT [ 42 ] 36 19 ( 10 – 20 ) binary rest/stress 5 s balanced CHB-MIT [ 28 ] 24 16 (bipolar) binary seizure 5 s 0.42\% positive A.3 Persistent vs. Windowed Streaming: Single-Recording Visualization Figure 3 illustrates the persistent-vs-windowed ablation on chb22_20, a representative recording from the CHB-MIT test set. The middle panel shows that the persistent-state model begins climbing toward the seizure threshold approximately 15 s before annotated onset and saturates near probability 1.0 throughout the ictal period. The windowed model, restricted to a 5 s context window, remains near zero until onset and exhibits a substantial probability dip (down to \sim 0.3 ) during a segment of high-amplitude ictal noise around t=8\text{--}13 s — a regime where the persistent hidden state, having integrated tens of seconds of pre-ictal context, maintains its prediction. The bottom panel shows per-block hidden-state norms across the recording. Norms remain stable across the full 45 s window with no drift, indicating that the long-range integration the persistent-state model exploits does not come at the cost of unbounded state magnitude growth. Per-recording AUROC on chb22_20: persistent 0.96 , windowed 0.93 . Figure 3 : Persistent vs. windowed streaming on chb22_20. Top : raw EEG, with the annotated seizure period shaded. Middle : per-patch seizure probability for persistent streaming (blue, hidden state carried from t=0 of recording) vs. windowed streaming (red, hidden state reset every 5 s). The persistent model reaches threshold before onset and bridges the windowed model’s mid-seizure probability dip. Bottom : log hidden-state norms for the four Mamba-3 blocks; no drift over 45 s. A.4 Streaming-Parallel Equivalence Mamba’s parallel scan and recurrent step are mathematically equivalent on a complete input [ 8 , 20 ] . We verify this numerically for the full CaMBRAIN pipeline (encoder + head) across 30 random input seeds and the 3 CHB-MIT-fine-tuned checkpoints from our main results. Table 5 : Streaming-parallel equivalence on real fine-tuned weights. 30 input seeds \times 3 checkpoints = 7{,}200 forward passes. Metric Value Max logit difference 5.9\times 10^{-3} Max probability difference 3.1\times 10^{-4} Class-label agreement 100\% The probability-space difference is below the resolution of any downstream metric in this paper. A.5 Mamba-3 Innovations and EEG Intuition We adopt three innovations from Mamba-3 [ 20 ] unchanged in our encoder. None is novel to this work or designed for EEG, but each targets a structural property of streaming clinical EEG. Full derivations are in 20 ; below we summarize the EEG intuition for each. Exponential-trapezoidal discretization. Mamba-1/2 use a first-order (Euler) integration rule with local truncation error O(\Delta_{t}^{2}) ; Mamba-3 uses a second-order (trapezoidal) rule with truncation error O(\Delta_{t}^{3}) , blending B_{t}x_{t} with B_{t-1}x_{t-1} via a learned data-dependent weight \lambda_{t}\in[0,1] [ 20 , Proposition 1] . The accuracy gain matters more for continuous physical signals than for discrete-token sequence modeling: in language, B_{t}x_{t} is a learned embedding of a token and the integral being discretized is a modeling abstraction; in EEG, B_{t}x_{t} is a projection of an actual sampled voltage and the discretization approximates a real continuous-time integral. Higher-order accuracy on the state-input integral is a closer fit to the data-generating process. Complex-valued state transitions. Real-eigenvalue SSMs cannot natively track rotational hidden-state dynamics [ 20 , Sec. 3.2] , which is the relevant regime for any signal whose information is partly carried in oscillatory phase. Mamba-3’s complex-valued state transition is implemented via a data-dependent rotary embedding on the B and C projections [ 20 , Proposition 3] : h_{t}=e^{\Delta_{t}A_{t}}h_{t-1}+\big(\prod_{i\leq t}\mathbf{R}_{i}^{\top}\big)\Delta_{t}B_{t}x_{t} , where \mathbf{R}_{t} is a block-diagonal of 2{\times}2 rotations parameterized by learned, data-dependent angles. EEG is a canonical multi-band oscillatory signal — delta, theta, alpha, beta, gamma — and phase relationships across channels and bands carry information that real-eigenvalue exponential decay alone cannot represent. The data-dependent rotation angle lets the SSM advance phase by an amount that depends on the current input, tracking oscillations whose instantaneous frequency varies with the neural state. We test whether the trained state actually carries downstream-relevant long-horizon information in our hidden-state ablation in Sec. 4.3 , where we compare seizure-onset prediction from a state warmed across the full pre-recording context versus one initialized from a 5 s cold start. MIMO parameterization. SISO SSMs are memory-bound at decode time: the recurrent step’s arithmetic intensity is \Theta(1) , leaving tensor cores idle while the state read dominates wall-clock latency [ 20 , Table 2a] . The MIMO generalization extends B and C to rank R , raising arithmetic intensity to \Theta(R) at unchanged state size and approximately unchanged decode latency [ 20 , Sec. 3.3] . The streaming setting that motivates this paper is decode-only — one recurrent step per 62.5 ms patch, in perpetuity — so the per-step expressivity gain at fixed wall-clock latency translates directly into a more capable streaming model than a SISO Mamba-3 at the same latency budget would allow. We report measured per-patch latency in Sec. 4 . A.6 Two-Stage Pretraining: Geometric Argument This appendix gives the geometric argument behind the pipeline structure. It is not a theorem about our specific encoder; it is a transfer of the deep-linear analysis of 23 to the noisy-data regime EEG occupies. Setup. Following the preliminaries of 23 , consider an L -layer linear encoder with per-feature magnitude \bar{w}_{i} on each diagonalized direction i . Define the population regression coefficient \rho_{i}=\lambda_{i}/\sigma_{i}^{2} where \lambda_{i}=\mathbb{E}[y_{i}x_{i}] and \sigma_{i}^{2}=\mathbb{E}[x_{i}^{2}] . Directions with \rho_{i}\to 0 are noisy : high input variance, low cross-covariance with the prediction target. Raw EEG is dominated by such directions (line interference, drift, artifacts). Properties of the deep-linear flow. 23 establish the following properties for L -layer gradient flow on the JEPA and MAE objectives: (1) Fixed-point asymmetry: \bar{w}_{i}^{\,\text{MAE}}(\infty)=\rho_{i}^{L/(L+1)} and \bar{w}_{i}^{\,\text{JEPA}}(\infty)=\rho_{i}^{L} [ 23 , Corollary 3.3] . For any \rho_{i}\in(0,1) , the MAE fixed point is bounded away from zero by a depth-suppressed exponent, while the JEPA fixed point decays exponentially in depth. (2) JEPA critical time: starting from initialization scale \bar{w}_{i}(0)=\epsilon\ll 1 , the time for the JEPA flow to escape the small-initialization region admits the Laurent expansion t^{*}_{\text{JEPA}}\;=\;\frac{1}{\lambda}\sum_{n=1}^{2L-1}\frac{L}{n\,\rho^{2L-n-1}\,\epsilon^{n/L}}\;+\;\Theta\!\left[\log(\epsilon)\right] [ 23 , Theorem 3.4] . The leading \epsilon -singularity is of order \epsilon^{-(2L-1)/L} , with sub-leading terms carrying inverse- \rho dependence whose strength grows with depth. (3) MAE critical time is \rho -independent at leading order: t^{*}_{\text{MAE}}=\frac{L}{\lambda(L-1)\,\epsilon^{(L-1)/L}}+\Theta(1) for L>1 [ 23 , Theorem 3.5] . Every direction with non-zero \lambda is learned at comparable speed under MAE. (4) JEPA–MAE asymmetry in feature ordering: for any two directions with \rho^{\prime}>\rho at fixed \lambda , the JEPA critical-time ratio t^{*}_{\text{JEPA}}(\rho)/t^{*}_{\text{JEPA}}(\rho^{\prime})=1+\tfrac{2L-1}{2L-2}\,\Delta_{\rho}\,\epsilon^{1/L}+\Theta(\epsilon^{2/L}) , while t^{*}_{\text{MAE}}(\rho)/t^{*}_{\text{MAE}}(\rho^{\prime})=1+\Theta[\epsilon^{(L-1)/L}] [ 23 , Corollary 3.6] . JEPA’s order of feature learning is therefore sensitive to \rho at \Theta(\epsilon^{1/L}) scale and increasingly so with depth, while MAE’s is essentially \rho -agnostic. Implication for warm-starting. Substituting the MAE fixed point \bar{w}_{i}(0)=\rho_{i}^{L/(L+1)} as the JEPA initialization replaces \epsilon in property (2) with a quantity bounded by a power of \rho . The dominant \epsilon^{-(2L-1)/L} singularity becomes \rho^{-(2L-1)/(L+1)} , which is finite for any \rho>0 . This is one line of algebra on Littwin’s expression; we treat it as motivation, not proof. A.7 Spectral Band Ablation on Seizure We apply a 4th-order zero-phase Butterworth band-stop filter to the CHB-MIT test set, in turn for each canonical EEG band, and re-evaluate the seed-42 checkpoint on the filtered input. Delta-band removal causes the only large drop (17 AUROC points); other bands lie within seed-level noise. The result is consistent with the clinical role of slow-wave activity as a scalp-EEG seizure marker, and suggests the model has learned a frequency-relevant feature without explicit spectral supervision. Table 6 : Spectral band ablation on CHB-MIT (seed 42). \Delta AUROC is the change from the unperturbed baseline. Band Range (Hz) AUROC \Delta Real test — 0.935 — Delta 0.5 – 4 0.766 \mathbf{-0.169} Theta 4 – 8 0.906 -0.029 Alpha 8 – 13 0.937 +0.002 Beta 13 – 30 0.935 -0.000 Gamma 30 – 75 0.900 -0.035 A.8 Latency and Memory at Streaming Inference Single-patch streaming latency on a single H100 PCIe is 4.97 ms (mean over 1,000 patches, 50-patch warm-up, random weights), and the persistent state size is \sim 720 KB. Both are constant in context length by construction: each step processes one 16 -sample patch and updates a fixed-size hidden state, with no buffer that grows with the input. We verified constancy at context lengths from 5 s to 4 hours. Bidirectional baselines such as LUNA-Base scale linearly in latency and grow in memory with context length 11 and exceed available VRAM at hour-scale inputs on the same hardware. Table 7 : Per-component breakdown of the streaming step. FLOPs are analytical; state is the persistent memory carried across patches. Component FLOPs (M) State (KB) SwiGLU FFNs ( \times 4 ) 47.60 — Mamba-3 SSM step ( \times 4 ) 25.78 720 Channel Embedding 3.36 — RMSNorms + classifier head 0.02 — Total per step 76.76 720 Algorithm 1 CaMBRAIN Streaming Inference 1: Patch stream \{x_{1},x_{2},\dots\} , x_{t}\in\mathbb{R}^{C\times P} 2: Per-patch prediction p_{t} 3: 4: function Reset 5: h_{\ell}\leftarrow\mathbf{0} for \ell=1,\dots,L \triangleright per-block SSM state 6: \tau\leftarrow 0 \triangleright position counter 7: end function 8: 9: function Step ( x_{t} ) 10: z\leftarrow\textsc{ChannelEmbedder}(x_{t}) 11: z\leftarrow z+\mathbf{p}_{\tau\bmod 80} \triangleright cyclic position embedding 12: for \ell=1,\dots,L do 13: z,h_{\ell}\leftarrow z+\textsc{MambaStep}(\textsc{RMSNorm}(z),h_{\ell}) 14: z\leftarrow z+\textsc{SwiGLU}(\textsc{RMSNorm}(z)) 15: end for 16: p_{t}\leftarrow\sigma\bigl(\mathbf{W}_{\text{cls}}^{\top}z\bigr) \triangleright classify from last token 17: \tau\leftarrow\tau+1 ; return p_{t} 18: end function Constants for our model : L=4 blocks, C=16 or 22 channels, P=16 samples per patch. Table 8 : CaMBRAIN downstream results, mean \pm std across three random seeds ( \{42,43,44\} ). Dataset Metric Mean \pm Std TUAR (MMC, 6-class) AUROC 0.9362\pm 0.0028 AUPR 0.5651\pm 0.0125 TUAB (binary) AUROC 0.8668\pm 0.0061 AUPR 0.8757\pm 0.0046 BAC ( t=0.5 ) 0.7770\pm 0.0117 BAC (Youden) 0.7953\pm 0.0065 MAT (binary) AUROC 0.8758\pm 0.0222 AUPR 0.7345\pm 0.0518 BAC 0.7778\pm 0.0028 CHB-MIT (binary) AUROC 0.9205\pm 0.0169 AUPR 0.3888\pm 0.0282