Beyond Static Representations: Learning Electroencephalogram Spatiotemporal Dynamics for Enhanced Emotion Recognition.
The 9 matches
- [1] § Methods › Experiments › Implementation details ↔ Train.py, lines 44 to 91 · score 0.69 · RMSprop, weight decay, alpha, optimizer, epochs, trained · Report a mismatch
- [2] § Results › Decoding accuracies ↔ Train.py, lines 229 to 255 · score 0.66 · LGGNet, TSception, DSE TAM, Deformer, DGCNN, Conformer · Report a mismatch
- [3] § Results › Decoding accuracies ↔ ChooseNet.py, lines 10 to 76 · score 0.62 · LGGNet, TSception, DSE TAM, Deformer, DGCNN, Conformer · Report a mismatch
- [4] § Methods › [CLS] token classifier ↔ Train.py, lines 44 to 91 · score 0.60 · cross entropy, loss function, predicted, train · Report a mismatch
- [5] § Results › Decoding accuracies ↔ ChooseNet.py, lines 10 to 76 · score 0.58 · LGGNet, TSception, DSE TAM, Deformer, DGCNN, Conformer · Report a mismatch
- [6] § Results › Decoding accuracies ↔ Train.py, lines 229 to 255 · score 0.57 · TSception, DSE TAM, LOSO, DGCNN, Conformer, ACRNN · Report a mismatch
- [7] § Methods ↔ net/DSE_TAM.py, lines 231 to 264 · score 0.55 · pre STM, DSE TAM, classifier, CLS, embedding, layer · Report a mismatch
- [8] § Methods › Dynamic Spatial Embedding ↔ net/LGGNet.py, lines 56 to 182 · score 0.52 · convolutional kernel, power, aggregated, filtered, stride, batch · Report a mismatch
- [9] § Methods › Experiments › Implementation details ↔ net/DGCNN.py, lines 89 to 129 · score 0.51 · graph convolutional layers, EEG signals, dimension, channels, module · Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 272 lines · 10 KB · no license · 4 matches
- from torch import nn
- from Dataset.LOSO import *
- from Dataset.KFold import *
- from ChooseNet import *
- from utils import *
- from sklearn.metrics import confusion_matrix
- def evaluate_model(model, dataloader, lossFunction, device):
- model.eval() # 将模型设为评估模式
- running_loss = 0.0
- correct_preds = 0
- total_preds = 0
- all_labels = []
- all_predictions = []
- with torch.no_grad():
- for inputs, labels in dataloader:
- inputs, labels = inputs.to(device), labels.to(device)
- # 前向传播
- outputs = model(inputs)
- # 计算损失
- loss = lossFunction(outputs, labels)
- # 统计损失
- running_loss += loss.item() * inputs.size(0)
- # 统计正确预测的样本数量
- _, predicted = torch.max(outputs, 1)
- correct_preds += (predicted == labels).sum().item()
- total_preds += labels.size(0)
- # 保存真实标签和预测标签
- all_labels.extend(labels.cpu().numpy())
- all_predictions.extend(predicted.cpu().numpy())
- # 计算平均损失和准确率
- avg_loss = running_loss / len(dataloader.dataset)
- accuracy = correct_preds / total_preds
- labels_range = list(range(3))
- cm = confusion_matrix(all_labels, all_predictions, labels=labels_range)
- return avg_loss, accuracy, cm
- def train_and_validation(net, train_iter, test_iter, num_epochs, lr, weight_decay, device):
- lossFunction = nn.CrossEntropyLoss()
- optimizer = torch.optim.RMSprop(net.parameters(), lr=lr, weight_decay=weight_decay, alpha=0.99)
- net.to(device)
- new_lr = None
- state = None
- max_acc = 0.0
- train_losses, val_losses, val_accs = [], [], [] # 用于存储每个 epoch 的训练损失
- val_cm = []
- for epoch in range(num_epochs):
- net.train() # 将模型设为训练模式
- running_loss = 0.0
- correct_preds = 0
- total_preds = 0
- for inputs, labels in train_iter:
- inputs, labels = inputs.to(device), labels.to(device)
- # inputs = inputs.reshape(32, 5, 62, 5)
- # labels = labels.reshape(32, 5)
- # 前向传播
- outputs = net(inputs)
- # 计算损失
- loss = lossFunction(outputs, labels)
- # 反向传播和优化
- optimizer.zero_grad()
- loss.backward()
- optimizer.step()
- # 统计损失
- running_loss += loss.item() * inputs.size(0)
- # 统计正确预测的样本数量
- _, predicted = torch.max(outputs, 1)
- correct_preds += (predicted == labels).sum().item()
- total_preds += labels.size(0)
- epoch_acc = correct_preds / total_preds
- epoch_loss = running_loss / len(train_iter.dataset)
- print(f'Train Epoch [{epoch + 1}/{num_epochs}], Loss: {epoch_loss:.4f}, Accuracy: {epoch_acc:.4f}')
- val_loss, val_acc, cm = evaluate_model(net, test_iter, lossFunction, device)
- print(f'Validation Epoch [{epoch + 1}/{num_epochs}], Loss: {val_loss:.4f}, Accuracy: {val_acc:.4f}')
- train_losses.append(epoch_loss)
- val_losses.append(val_loss)
- val_accs.append(val_acc)
- val_cm.append(cm)
- val_cm = np.array(val_cm)
- return train_losses, val_losses, val_accs, val_cm
- def train_by_LOSO(params):
- torch.autograd.set_detect_anomaly(True)
- sub_train_loss, sub_val_loss, sub_val_acc = [], [], []
- sub_cm = []
- subjects = params['subjects']
- print(f"Starting LOSO training for {subjects} subjects.")
- for i in range(1, subjects + 1):
- print(f"Training for Subject {i}")
- net = choose_net(params)
- train_dataset, test_dataset = Dataset_LOSO(params['dataset'], params['data_dir'], params['session'],
- params['subjects'], params['trial'], i)
- loader_train = Data.DataLoader(
- dataset=train_dataset,
- batch_size=params['batch_size'],
- shuffle=True,
- num_workers=0
- )
- loader_test = Data.DataLoader(
- dataset=test_dataset,
- batch_size=params['batch_size'],
- shuffle=True,
- num_workers=0
- )
- print("============================================================================")
- print(f"Subject: {i}")
- train_losses, val_losses, val_accs, val_cm= train_and_validation(net,
- loader_train,
- loader_test,
- num_epochs=params['epoch'],
- lr=params['lr'],
- weight_decay=params['weight_decay'],
- device=params['device'])
- sub_train_loss.append(train_losses)
- sub_val_loss.append(val_losses)
- sub_val_acc.append(val_accs)
- sub_cm.append(val_cm)
- # 避免params中的device在保存时出错
- params_copy = params.copy()
- if 'device' in params_copy:
- del params_copy['device']
- results = {
- 'train_loss': sub_train_loss,
- 'val_loss': sub_val_loss,
- 'val_acc': sub_val_acc,
- 'params': params_copy,
- 'cm': sub_cm
- }
- return results
- def train_by_KFold(params):
- torch.autograd.set_detect_anomaly(True)
- sub_train_loss, sub_val_loss, sub_val_acc = [], [], []
- sub_cm = []
- subjects = params['subjects']
- print(f"Starting KFold training for {subjects} subjects with {params['KFold']} folds.")
- for i in range(1, subjects + 1):
- fold_train_loss, fold_val_loss, fold_val_acc = [], [], []
- fold_cm = []
- print(f"Training for Subject {i}")
- for fold in range(params['KFold']):
- net = choose_net(params)
- if params['shuffle'] == 'Sample':
- train_dataset, test_dataset = Dataset_KFold_Sample(params['dataset'], params['data_dir'],
- params['session'], i, params['trial'],
- params['KFold'], fold)
- elif params['shuffle'] == 'Trial':
- train_dataset, test_dataset = Dataset_KFold_Trial(params['dataset'], params['data_dir'],
- params['session'], i, params['trial'],
- params['KFold'], fold)
- loader_train = Data.DataLoader(
- dataset=train_dataset,
- batch_size=params['batch_size'],
- shuffle=True,
- num_workers=0
- )
- loader_test = Data.DataLoader(
- dataset=test_dataset,
- batch_size=params['batch_size'],
- shuffle=True,
- num_workers=0
- )
- print("============================================================================")
- print(f"Subject: {i} Fold: {fold}")
- train_losses, val_losses, val_accs, val_cm = train_and_validation(net,
- loader_train,
- loader_test,
- num_epochs=params['epoch'],
- lr=params['lr'],
- weight_decay=params['weight_decay'],
- device=params['device'])
- fold_train_loss.append(train_losses)
- fold_val_loss.append(val_losses)
- fold_val_acc.append(val_accs)
- fold_cm.append(val_cm)
- sub_train_loss.append(fold_train_loss)
- sub_val_loss.append(fold_val_loss)
- sub_val_acc.append(fold_val_acc)
- sub_cm.append(fold_cm)
- # 避免params中的device在保存时出错
- params_copy = params.copy()
- if 'device' in params_copy:
- del params_copy['device']
- results = {
- 'train_loss': sub_train_loss,
- 'val_loss': sub_val_loss,
- 'val_acc': sub_val_acc,
- 'params': params_copy,
- 'cm': sub_cm,
- }
- return results
- # 代码运行开始-设置参数
- params = {
- # -----------网络参数-------------------------------------------------------
- 'emb_dim': 48, # embedding dimension of Embedding, Self-Attention, Mamba
- 'emb_kernel': 4, # 2D-conv embedding length of Embedding
- 'pool': 4, # pool kernel size
- 'd_state': 16, # d_state of Mamba
- 'd_conv': 4, # d_conv of Mamba
- 'expand': 8, # expand of Mamba
- 'num_layers': 2, # layer of TAM
- 'num_heads': 8, # num head of Self-Attention
- 'g_layers': 4, # graph embedding layers
- 'dropout': 0.5, # dropout of Embedding, Self-Attention, Mamba
- 'lr': 1e-4, # learning rate
- 'weight_decay': 1e-6, # L2-norm
- 'time': 384, # window size of EEG
- # -----------训练参数-------------------------------------------------------
- 'seed': 20, # random seed
- 'epoch': 500, # training epoch
- 'batch_size': 256, # training batch size
- 'session': 1, # dataset session: 1/2 (DEAP:Arousal/Valence, DREAMER:Arousal/Valence, CEED)
- 'val': "KFold", # experiment validation:LOSO/KFold
- 'shuffle': 'Trial', # validation shuffle way: Sample/Trial
- 'net': "DSE-TAM", # Choose net:ACRNN/DSE-TAM/Conformer/Deformer/DGCNN/LGGNet/TSception
- 'dataset': 'DEAP', # choose dataset: DEAP/DREAMER/CEED
- 'feature': "Time", # input feature: Time/DE
- }
- # 定义一个训练函数映射,根据 params['val'] 选择相应的训练方式
- train_funcs = {
- "LOSO": train_by_LOSO,
- "KFold": train_by_KFold
- }
- if __name__ == '__main__':
- setup_seed(params['seed'])
- params = init_params(params)
- # 根据 params['val'] 选择对应的训练函数,并执行
- train_func = train_funcs.get(params['val'])
- if train_func:
- results = train_func(params)
- save_results(params, results)
Train.py at commit 2a6e199, no license · at the source
Overview
- Chongqing Key Laboratory of Computational Intelligence, Chongqing University of Posts and Telecommunications, Chongqing 400065, China
- Key Laboratory of Big Data Intelligent Computing, Chongqing University of Posts and Telecommunications, Chongqing 400065, China
- School of Computer Science and Technology, Chongqing University of Posts and Telecommunications, Chongqing 400065, China
- Department of Neurology, Songjiang Hospital and Songjiang Research Institute, Shanghai Key Laboratory of Emotions and Affective Disorders, Shanghai Jiao Tong University School of Medicine, Shanghai 201600, China
- College of Automation Science and Engineering, South China University of Technology, Guangzhou 510641, China
Abstract
Electroencephalogram (EEG)-based emotion recognition plays a pivotal role in brain–computer interfaces and mental health monitoring. However, conventional approaches often neglect the intrinsic spatial correlations among EEG channels and fail to effectively model both global temporal dependencies and the continuity of neural oscillations. To overcome these challenges, we propose the Dynamic Spatial Embedding and Temporal Attention Mamba (DSE-TAM) framework. Our Dynamic Spatial Embedding (DSE) module leverages graph convolutional networks to dynamically capture inter-channel relationships, preserving spatial coherence in EEG representations. Subsequently, the Temporal Attention Mamba module integrates self-attention with state-space models to jointly optimize long-range temporal dependencies and smooth transition dynamics. Extensive experiments on 2 public benchmarks (DEAP and DREAMER) and an in-house CEED dataset demonstrate that DSE-TAM surpasses state-of-the-art methods, achieving accuracies of 79.75% (arousal) and 78.27% (valence) on DEAP, 80.55% (arousal) and 83.91% (valence) on DREAMER, and 73.75% (3-class) on CEED. These results validate the framework’s efficacy in advancing EEG-based emotion decoding for brain–computer interfaces. The source code is available at https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 9 matches between paragraphs and lines of code.
Raizeroko/DSE-TAM
2a6e199978b0a3a87d16a057c42313a78de091ed, 10 December 2025Availability: 1 check, the latest on 30 October 2026: the link answers
- 30 October 2026: the link answers
16 files
- ChooseNet.py, Python, 76 lines, 2 matches
- Dataset/
KFold.py , Python, 155 lines - Dataset/
LOSO.py , Python, 67 lines - Train.py, Python, 272 lines, 4 matches
- net/
ACRNN.py , Python, 175 lines - net/
ACRNN_CEED.py , Python, 176 lines - net/
ACRNN_DREAMER.py , Python, 184 lines - net/
Conformer.py , Python, 455 lines - net/
DGCNN.py , Python, 129 lines, 1 match - net/
DSE_TAM.py , Python, 264 lines, 1 match - net/
Deformer.py , Python, 187 lines - net/
LGGNet.py , Python, 247 lines, 1 match - net/
TSception.py , Python, 100 lines - preprocess/
Preprocess_DEAP_Time.py , Python, 129 lines - utils.py, Python, 70 lines
- README.md, Text, 50 lines
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 15 scripts, each with its path and the digest of its content;
- 9 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
Datasets cited
- zenodo:546113, at Zenodo; found in “Data Availability”
Data Availability
The DREAMER dataset is accessible via https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 30 October 2026: the first record
Recorded: type, language, journal, volume, pages, dates, 6 authors, 15 references.
Cite
This paper
Liu, K., Zhu, W., Xu, R., Wang, W., Yu, Z., & Wu, W. (2026). Beyond Static Representations: Learning Electroencephalogram Spatiotemporal Dynamics for Enhanced Emotion Recognition. Cyborg and bionic systems (Washington, D.C.), 7, 0701. https://
BibTeX
@article{liu2026beyond,
author = {Liu, Ke and Zhu, Wenrui and Xu, Rui and Wang, Wenlong and Yu, Zhuliang and Wu, Wei},
title = {{Beyond Static Representations: Learning Electroencephalogram Spatiotemporal Dynamics for Enhanced Emotion Recognition}},
journal = {Cyborg and bionic systems (Washington, D.C.)},
year = {2026},
month = oct,
volume = {7},
pages = {0701},
publisher = {AAAS Science Partner Journal Program},
issn = {2097-1087},
doi = {10.34133/
url = {https://
pmid = {42953001},
pmcid = {PMC13714321}
}
RIS
TY - JOUR
AU - Liu, Ke
AU - Zhu, Wenrui
AU - Xu, Rui
AU - Wang, Wenlong
AU - Yu, Zhuliang
AU - Wu, Wei
TI - Beyond Static Representations: Learning Electroencephalogram Spatiotemporal Dynamics for Enhanced Emotion Recognition
T2 - Cyborg and bionic systems (Washington, D.C.)
J2 - Cyborg Bionic Syst
PY - 2026
DA - 2026/
VL - 7
SP - 0701
SN - 2097-1087
PB - AAAS Science Partner Journal Program
DO - 10.34133/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.34133/
"type": "article-journal",
"title": "Beyond Static Representations: Learning Electroencephalogram Spatiotemporal Dynamics for Enhanced Emotion Recognition",
"container-title": "Cyborg and bionic systems (Washington, D.C.)",
"author": [
{
"family": "Liu",
"given": "Ke"
},
{
"family": "Zhu",
"given": "Wenrui"
},
{
"family": "Xu",
"given": "Rui"
},
{
"family": "Wang",
"given": "Wenlong"
},
{
"family": "Yu",
"given": "Zhuliang"
},
{
"family": "Wu",
"given": "Wei"
}
],
"container-title-short":
"volume": "7",
"page": "0701",
"DOI": "10.34133/
"PMID": "42953001",
"PMCID": "PMC13714321",
"ISSN": "2097-1087",
"publisher": "AAAS Science Partner Journal Program",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
10,
28
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.3390/s25072029
- MSDSANet: Multimodal Emotion Recognition Based on Multi-Stream Network and Dual-Scale Attention Network Feature Representation.Journal: Sensors (Basel, Switzerland)In common: Zenodo 546113, EEG, cognitive, 3 references
- [2] doi:10.3390/s26175327 [code]
- Subject Identity Confounds qEEG Emotion Recognition on DEAP and DREAMER.Journal: Sensors (Basel, Switzerland)In common: scikit-learn, SciPy, Matplotlib, 1 other tool, Zenodo 546113, EEG, cognitive, 1 reference
- [3] doi:10.1038/s41598-025-34211-z
- A multi-task EEG emotion recognition method based on emotion-dimension coupling constraints.Journal: Scientific reportsIn common: Zenodo 546113, EEG, cognitive, 2 references
- [4] doi:10.3390/s24061979
- FC-TFS-CGRU: A Temporal-Frequency-Spati
al Electroencephalography Emotion Recognition Model Based on Functional Connectivity and a Convolutional Gated Recurrent Unit Hybrid Architecture. Journal: Sensors (Basel, Switzerland)In common: Zenodo 546113, EEG, cognitive, 2 references - [5] doi:10.3389/fnins.2026.1810609
- A dual-branch network with brain region-constrained attention for EEG emotion recognition.Journal: Frontiers in neuroscienceIn common: Zenodo 546113, EEG, cognitive, 2 references
- [6] doi:10.1038/s41598-025-16219-7 [code]
- Temporal convolutional transformer for EEG based motor imagery decoding.Journal: Scientific reportsIn common: PyTorch, scikit-learn, SciPy, 2 other tools, EEG, 2 references
- [7] doi:10.3390/s25216541 [code]
- STCCA: Spatial-Temporal Coupled Cross-Attention Through Hierarchical Network for EEG-Based Speech Recognition.Journal: Sensors (Basel, Switzerland)In common: PyTorch, scikit-learn, SciPy, 1 other tool, EEG, cognitive, 2 references
- [8] doi:10.1038/s41597-025-05349-2 [code]
- A Multi-Context Emotional EEG Dataset for Cross-Context Emotion Decoding.Journal: Scientific dataIn common: Pillow, PyTorch, scikit-learn, 3 other tools, EEG, 1 reference
- [9] doi:10.1038/s41597-024-03838-4 [code]
- EAV: EEG-Audio-Video Dataset for Emotion Recognition in Conversational Contexts.Journal: Scientific dataIn common: Pillow, PyTorch, scikit-learn, 3 other tools, EEG, 1 reference
- [10] doi:10.3390/brainsci16070716
- RGB-Style Input Representations for EEG: Evaluating Spatial Concatenation Versus Band-Wise Stacking in Deep Emotion Recognition.Journal: Brain sciencesIn common: Zenodo 546113, EEG, cognitive, 1 reference
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 15 scripts, and 9 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:830b4000e1b7357d…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.34133/cbsystems.0701)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.34133/cbsystems.0701.svg
:target: https://openscicode.org/badge/doi/10.34133/cbsystems.0701
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.34133/cbsystems.0701"><img src="https://openscicode.org/badge/doi/10.34133/cbsystems.0701.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->On GitHub, open the README, choose Edit (the pencil), paste the snippet under the title, then "Commit changes".
If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Versions of its code: the releases of its code tied to a version of this paper (the preprint, the accepted manuscript, the version of record…), each with the tracing map versioned with it.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
