Research
PeakFlow: Peak-Guided Coarse-to-Refined Modeling for EEG-Based Dynamic Affective Trajectory Prediction
Overview Research area: EEG-based affective computing and brain–computer interfaces, specifically continuous (trajectory-level) emotion prediction from electroencephalography, with a focus on the timi
- arXiv
- 2607.18671
- Published
- 2026-07-21
- Authors
- Hao Tang, Songyun Xie, Xinzhou Xie, Can Liao, Xin Zhang, Bohan Li, Zhongyu Tian, Dalu Zheng
AI summary
Overview
Research area: EEG-based affective computing and brain–computer interfaces, specifically continuous (trajectory-level) emotion prediction from electroencephalography, with a focus on the timing and magnitude of emotional peaks.
Technical level: Advanced. The paper assumes familiarity with vector-quantized representation learning, masked temporal modeling, Transformer encoders, temporal convolutional networks, and regression evaluation metrics.
Scope: The paper proposes PeakFlow, a three-stage coarse-to-refined framework that predicts continuous affective intensity trajectories from EEG while explicitly correcting mislocalized, underestimated, or terminally biased emotional peaks.
What This Paper Is About
Most EEG emotion recognition work reduces a recording to a single discrete label (e.g., a valence or arousal category), but emotions evoked by continuous media accumulate, fluctuate, reach a maximum, and then recover. This paper targets dynamic affective trajectory prediction: estimating a continuous intensity curve from sequential EEG windows. The authors identify a specific failure mode they call terminal-peak bias, in which a model's predicted maximum intensity drifts toward the end of a trial even when the true peak occurred earlier, and they build a framework that corrects this without discarding the overall trend.
Key Contributions
-
Identification of terminal-peak bias. The authors document a structural failure mode in masked temporal trajectory prediction where predicted affective peaks concentrate at the trial ending. In their analysis on SEED-VII, only 24.75% of ground-truth peaks fall in the terminal region (the last 10% of valid temporal windows), while 76.00% of peaks predicted by the EEGDancer baseline are assigned there.
-
The PeakFlow framework. A stage-wise coarse-to-refined architecture combining (I) feature-level EEG temporal tokenization via a learnable codebook, (II) masked dynamic Transformer modeling of a coarse affective flow, and (III) a lightweight peak-guided bounded residual calibration module.
-
A peak-centered calibration objective. A training loss that jointly combines global trajectory consistency, peak-zone emphasis, peak-probability localization, terminal suppression, and residual regularization, rather than relying on point-wise fitting alone.
-
Peak-centered evaluation metrics. Normalized peak-time error, peak-value error, and false-terminal peak rate, proposed as a complement to conventional global regression metrics (MSE, MAE, PCC, R²). These are used in leave-one-subject-out (LOSO) experiments on SEED-VII, with an auxiliary evaluation on FIRMED for sparse, event-level ordinal intensity annotations.
Main Findings
-
Terminal-peak bias is quantified: On SEED-VII, only 24.75% of ground-truth affective peaks are located in the terminal region, whereas the EEGDancer baseline places 76.00% of its predicted peaks there, showing a strong drift of predicted peaks toward trial endings. The paper notes that this terminal-peak proportion differs from the false-terminal peak rate (FTR) metric, which counts only cases where the predicted peak is terminal while the ground-truth peak is non-terminal.
-
PeakFlow improves over dynamic modeling baselines: LOSO experiments on SEED-VII show that PeakFlow improves both global trajectory fitting and peak-centered temporal reliability compared with strong dynamic modeling baselines, including better peak localization, peak-value estimation, and terminal-bias suppression.
-
Auxiliary evidence on FIRMED: Evaluation on FIRMED suggests potential for sparse peak-centered ordinal intensity analysis under immediate-recall annotations, where participants report emotionally salient moments and their intensity levels after viewing a stimulus.
-
Global metrics alone are insufficient: The authors argue that point-wise objectives such as MSE do not constrain peak timing or magnitude, so a model can fit the overall curve well while still mislocating the most salient moment.
-
Specific result values are not reported in the provided content. The truncated text ends within Section IV-A (Datasets and Experimental Settings). Concrete numerical results for MSE, MAE, PCC, R², normalized peak-time error, peak-value error, and false-terminal peak rate are not included in the material available, and no dataset sizes or subject counts for SEED-VII or FIRMED appear beyond what is described above.
Methodology in Plain English
PeakFlow splits the problem into three sequential stages, each frozen before the next begins, which the authors say improves training stability and interpretability.
-
Stage I — EEG temporal tokenization. Continuous EEG window features are mapped through a small MLP encoder into a latent space and then quantized by snapping each latent vector to its nearest entry in a learned codebook of discrete prototypes. A decoder reconstructs the original EEG features from the quantized vectors, and the tokenizer is trained with a reconstruction loss plus a vector-quantization loss, using a straight-through estimator to pass gradients through the discrete selection. This stage does not predict emotion at all; its purpose is to produce compact discrete "temporal state" indices. For SEED-VII differential entropy features the input dimension is 310, the hidden dimension is 128, the latent dimension is 64, and the codebook holds 64 prototypes.
-
Stage II — Masked dynamic affective-flow modeling. With the tokenizer frozen, a Transformer encoder takes the continuous EEG features (not the discrete tokens) as input, so that no information is lost. Some valid temporal positions are randomly replaced with a learnable mask token, positional encodings are added, and the encoder produces hidden states; invalid padded positions are excluded via a key-padding mask. Two heads read out of this representation: a code head that predicts which codebook index each window belongs to (supervised by the frozen Stage I tokens), and a regression head that predicts the coarse affective intensity. The implemented Transformer uses 3 encoder layers, 4 attention heads, hidden dimension 128, feed-forward dimension 512, GELU activation, dropout of 0.1, batch-first computation, and pre-normalization. The Stage II loss is a mean-absolute trajectory regression term plus a weighted cross-entropy code-prediction term. This stage captures the global trend, but may still produce over-smoothed or terminally biased peaks.
-
Stage III — Peak-guided bounded residual calibration. With both earlier stages frozen, a lightweight temporal convolutional network refiner operates not on raw EEG but on four trajectory-level cues per window: the coarse predicted intensity, the normalized temporal position, the distance to the terminal region, and the local first-order change of the coarse prediction. The refiner's dilation rates grow as powers of two to widen the receptive field. It shares its final hidden representation between two heads: a residual head producing raw correction scores and a peak head producing a peak logit. The peak logit is turned into a soft peak-probability sequence and used as a gate that modulates the residual, rather than being added directly to the intensity. The correction is bounded by a maximum residual scale and a tanh squash, then added to the coarse trajectory and clipped to the [0, 1] intensity range. Training-time supervision for the peak head comes from a binary peak-zone label defined by whether a window lies within radius R of the ground-truth peak.
The Stage III objective combines a trajectory term (fitting plus matching of first-order temporal differences), a peak term (peak-zone fitting with extra weight around the true peak, plus binary cross-entropy supervision of the peak-probability sequence), a terminal term that penalizes only over-estimation in the last 10% of valid windows (r_term = 0.10), and a residual regularization term that limits unnecessary correction. Optimization uses AdamW, gradient clipping, and early stopping on validation performance. At inference, only the EEG feature sequence and valid mask are needed.
Why This Matters
Impact on research. The paper reframes EEG emotion decoding from static classification toward continuous trajectory estimation, and argues that the field's standard metric suite (MSE, MAE, PCC, R²) is blind to whether the most emotionally salient moment is correctly placed. By naming and quantifying terminal-peak bias, it gives the community a concrete diagnostic failure mode and a set of peak-centered metrics to test against. The peak-end and duration-neglect literature cited in the paper also connects these engineering metrics to how people actually remember emotional episodes.
Real-world applications:
- Multimedia and content analysis: identifying the moment of maximum emotional response in a video or interactive experience, which the authors link to user engagement and subsequent behavior.
- Affect-aware human–computer interaction: interfaces that adapt to when a user's emotional intensity peaks, not just its average level.
- Personalized recommendation: ranking or sequencing content by the temporal shape of emotional response rather than a single affect label.
- Adaptive user-state monitoring and closed-loop neurofeedback: tracking emotional accumulation, peak, and recovery in real time, where timing errors matter as much as magnitude errors.
Industry relevance. Any product that reads affect from biosignals — adaptive media platforms, mental-health or wellbeing monitoring, automotive or workplace attention/state systems — depends on getting temporal structure right. A bias that systematically shifts predicted emotional peaks toward the end of a session would directly corrupt the timing signals such systems act on. The paper's code is available at https://github.com/jukebox333/PeakFlow.
Future Directions
-
Extending peak-aware modeling beyond intensity trajectories. The FIRMED auxiliary evaluation suggests sparse, event-level ordinal annotations can support peak-centered analysis; whether the same calibration approach works for ordinal or event-triggered labels rather than dense curves is left open.
-
Cross-dataset and cross-subject generalization of the three-stage recipe. The main evaluation is LOSO on SEED-VII, with FIRMED used only as an auxiliary check. Broader generalization across datasets with different annotation paradigms (dense versus immediate-recall) remains to be established.
-
Choosing and tuning the peak-zone definition. The peak-zone radius R, the peak-zone weight, the terminal region proportion (fixed at 0.10), and the residual/peak modulation coefficients are design choices whose sensitivity is not characterized in the available content.
-
Understanding terminal-peak bias causally. The paper documents the bias in masked temporal trajectory prediction but the provided content does not identify the mechanism that produces it, which would be a natural target for follow-up work.
Target Audience
Researchers and graduate students in affective computing, EEG-based brain–computer interfaces, and human–computer interaction who work on continuous or temporal emotion modeling; practitioners building affect-aware systems from physiological signals; and methodologists interested in evaluation metrics that go beyond point-wise regression for temporally structured prediction tasks.
Authors’ abstract
Most existing EEG-based emotion recognition studies formulate affective decoding as static category prediction, although emotions elicited by continuous stimulation evolve over time, accumulate, reach peak intensity, and then recover. This motivates EEG-based dynamic affective trajectory prediction, which estimates continuous affective intensity curves from sequential EEG observations. Existing temporal regression models can capture coarse intensity trends but often fail to preserve peak-centered structure, leading to inaccurate peak timing and terminal-peak bias, where the predicted maximum is shifted toward the end of a trial. To address this issue, we propose PeakFlow, a peak-guided coarse-to-refined framework for EEG-based dynamic affective trajectory prediction. PeakFlow first learns a coarse affective flow through EEG temporal tokenization and masked temporal modeling, then applies a lightweight residual refiner for peak-guided bounded calibration. The refiner uses trajectory-aware cues and a peak-centered objective combining global trajectory consistency, peak-zone emphasis, peak-probability localization, terminal suppression, and residual regularization. This design preserves the global affective trend while correcting peak misalignment, peak-value deviation, and false-terminal predictions. Leave-one-subject-out experiments on SEED-VII show that PeakFlow improves both global trajectory fitting and peak-centered temporal reliability over strong dynamic modeling baselines. Auxiliary evaluation on FIRMED further suggests its potential for sparse peak-centered ordinal intensity analysis. These results highlight the importance of peak-aware modeling for temporally faithful EEG-based dynamic emotion prediction. Code is available at https://github.com/jukebox333/PeakFlow.