التعرف على المشاعر بناءً على إشارات EEG عبر المواضيع باستخدام التعلم التبايني
Cross-subject EEG signals-based emotion recognition using contrastive learning

المجلة: Scientific Reports، المجلد: 15، العدد: 1
DOI: https://doi.org/10.1038/s41598-025-13289-5
PMID: https://pubmed.ncbi.nlm.nih.gov/40754610
تاريخ النشر: 2025-08-03
المؤلف: Ahmed Mohammed Alghamdi وآخرون
الموضوع الرئيسي: تخطيط الدماغ وواجهات الدماغ-الكمبيوتر

نظرة عامة

تقدم هذه الدراسة مخطط تعلم تبايني عبر الموضوعات (CSCL) جديد يهدف إلى تعزيز التعرف على المشاعر المستند إلى EEG، وهو مجال حاسم ضمن الحوسبة العاطفية. تتناول الدراسة تحدي التباين الفردي في إشارات EEG من خلال استخدام هدف تبايني مزدوج ضمن الفضاء الزائدي، مما يسمح للنموذج بتعلم ميزات محددة لكل موضوع وتمثيلات قابلة للتعميم بشكل فعال. تم اختبار إطار عمل CSCL بدقة على أربعة مجموعات بيانات مرجعية—SEED وCEED وFACED وMPED—محققًا دقة تعرف بلغت 97.70% و96.26% و65.98% و51.30%، على التوالي. تشير هذه النتائج إلى أن نهج CSCL يتفوق بشكل كبير على الطرق الحالية في إدارة التباين بين الموضوعات وضوضاء التسمية، مما يحسن من قوة أنظمة التعرف على المشاعر.

على الرغم من نتائجه الواعدة، تعترف الدراسة ببعض القيود. تتناقص أداء نموذج CSCL على مجموعات البيانات الأكثر تعقيدًا وضوضاء، مثل MPED، ولم يتم تقييم التعرف على المشاعر في الوقت الحقيقي، مما يتطلب مزيدًا من التحقق للتطبيقات عبر الإنترنت في واجهات الدماغ الحاسوبية. بالإضافة إلى ذلك، لا يزال فعالية النموذج في البيئات الطبيعية غير مختبرة، وقد تشكل المتطلبات الحاسوبية لعملية التدريب تحديات للنشر على الأجهزة الطرفية. أخيرًا، بينما يركز العمل الحالي على إشارات EEG، فإن دمج بيانات فسيولوجية متعددة الوسائط قد يعزز دقة التعرف والفهم السياقي في الأعمال المستقبلية.

مقدمة

في النموذج المقترح لتكيف المجال، يتم استخدام مميز المجال \( D \) لتصنيف مجال الميزات المشفرة (المصدر، المساعد، أو الهدف)، بينما يهدف المشفر \( G_f \) إلى خداع \( D \) في لعبة تنافسية موصوفة بـ \( G_f \min D \max \mathcal{L}_{\text{dom}} \). يشجع هذا التدريب التنافسي \( G_f \) على توليد تمثيلات غير متعلقة بالمجال، مع الحفاظ على إشارات محددة بالعاطفة أثناء تقليل الضوضاء المحددة بالموضوع. تتناوب عملية التدريب بين تحسين \( D \) لتمييز المجال و\( G_f \) للتقليل، باستخدام طبقات عكس التدرج (GRL) لتعزيز التحسين التنافسي. تم دمج حلقة تغذية راجعة لتقييم الأداء، مما يسمح بتحديثات متكررة للمعلمات التي تحسن قدرة النموذج على تعميم ميزات المشاعر المتعلمة عبر توزيعات متنوعة.

يهدف النموذج إلى معالجة تحدي تحولات التوزيع بين مجموعات بيانات التدريب والاختبار، المشار إليها بـ \( P_{\text{train}}(x) \neq P_{\text{test}}(x) \). يصنف المشاعر إلى فئات مثل السعادة، الحيادية، والحزن، الممثلة بـ \( Y = \{y_1, y_2, y_3\} \). يضمن النهج تصنيفًا قويًا على الرغم من التباين بين الموضوعات ويدعم التعلم الانتقالي من المجالات المصدر إلى الهدف، وهو أمر حاسم في التطبيقات الواقعية حيث قد تكون المعايرة المحددة بالموضوع غير متاحة. على عكس الطرق التقليدية، يدمج إطار عمل CSCL المقترح التعلم التبايني، وتكيف المجال التنافسي، والتصنيف في عملية متماسكة متكررة، مما يسهل استخراج متجهات الميزات غير المتعلقة بالمجال من عينات EEG غير المرئية مع تقليل الاعتماد على مجموعات بيانات موسعة مشروحة. قد يتم استخدام تقنيات إحصائية مثل t-SNE أو PCA لتأكيد تماسك فضاء الميزات.

الطرق

تعمل منهجية تعلم التباين عبر الموضوعات (CSCL) المقترحة لتمثيل إشارات EEG في مرحلتين رئيسيتين: مرحلة التعلم التبايني وإجراء المتنبئ. في مرحلة التعلم التبايني، تبدأ العملية بمولد بيانات ينشئ أزواج عينات إيجابية وسلبية من بيانات EEG. ثم تتم معالجة هذه البيانات من خلال ثلاثة مشفرات محددة بالمجال—المكاني، الزمني، والترددي—كل منها يلتقط جوانب مختلفة من نشاط الدماغ. يحدد المشفر المكاني العلاقات بين قنوات الأقطاب الكهربائية، ويتتبع المشفر الزمني تطور المشاعر مع مرور الوقت، ويستخرج المشفر الترددي الميزات الطيفية المرتبطة بحالات عاطفية مختلفة. يتم دمج المخرجات من هذه المشفرات وتنقيحها إلى تمثيل مضغوط مناسب للمهام اللاحقة، مما يسهل تعلم الميزات بشكل قوي.

يتضمن إجراء المتنبئ تدريب وتقييم النموذج باستخدام مصنف متعدد الطبقات (MLP) لتصنيف المشاعر بناءً على التمثيلات المتعلمة. يستخدم CSCL دالة خسارة تباينية تشجع النموذج على تقريب التمثيلات المتشابهة مع دفع غير المتشابهة بعيدًا، مما يعزز التعميم عبر الموضوعات. بالإضافة إلى ذلك، يتم دمج إطار عمل شبكة عصبية تنافسية للمجال (DANN) للتخفيف من تحولات المجال من خلال تعلم ميزات غير متعلقة بالمجال، مما يحسن أداء النموذج على الموضوعات غير المرئية. يتم تقييم المنهجية مقابل ثلاثة نماذج حديثة رائدة—CSMM وDNN_AER وDAPLP—مظهرة دقة واعدة وقوة في التعرف على المشاعر عبر مجموعات بيانات مختلفة، مع نتائج تم التحقق منها من خلال إجراءات قياسية مثل ترك موضوع واحد خارج وعشر مرات من التحقق المتقاطع.

النتائج

في قسم تقييم النتائج، يتم تقييم توقعات النموذج \( Y = G_y(z) \) باستخدام مقاييس مختلفة، بما في ذلك الدقة، الدقة، الاسترجاع، وF1-score. يتم استخدام أدوات إضافية مثل مصفوفات الارتباك ومنحنيات ROC لتحليل ميول التصنيف. يتم حساب التقييمات كمتوسط عبر عدة جولات أو طيات لضمان الأهمية الإحصائية، مما يحقق فعالية آليات تكيف المجال وإسقاط الميزات. في الحالات التي تتراجع فيها الأداء، يتم إعادة ضبط معلمات النموذج وفضاء الميزات لتحسين النتائج.

بعد التصنيف، يتم تنظيم النتائج حسب فئات المشاعر \( Y = \{ \text{سعيد}, \text{محايد}, \text{حزين} \} \) لتقييم التمييز بين الفئات. تشمل هذه التحليل تباين داخل الفئة، آثار عدم توازن الفئة، والاتجاهات في التصنيف الخاطئ. تسهل النتائج المعاد تنظيمها معايرة النموذج حسب المشاعر، بينما توفر التصورات لمجموعات الميزات رؤى حول فصل الحالات العاطفية. يعزز هذا النهج القابلية للتفسير ويقدم ملاحظات بناءة لتحسين المراحل السابقة من تطوير النموذج.

المناقشة

في قسم المناقشة من ورقة البحث، يستعرض المؤلفون الطرق الرائدة في كشف المشاعر، مع التركيز بشكل خاص على دور التعلم التبايني في التعرف على المشاعر المستند إلى EEG. يعد التعلم التبايني، نموذجًا ذاتيًا مشرفًا، فعالًا في تعلم التمثيلات التمييزية من خلال مقارنة عينات مشابهة وغير مشابهة، وهو مفيد بشكل خاص في السيناريوهات التي تحتوي على ضوضاء أو تسميات محدودة. يبرز المؤلفون طرقًا مختلفة، مثل طريقة التكيف الديناميكي التبايني متعدد المصادر (MS-DCDA) وهندسة FCLGCN، التي تستفيد من التعلم التبايني لتعزيز دقة التعرف على المشاعر وقوتها عبر مجموعات بيانات مختلفة. تظهر هذه الطرق تحسينات كبيرة في أداء التصنيف، حيث حققت MS-DCDA دقة 90% على مجموعة بيانات SEED.

يتناول المؤلفون أيضًا تحديات كشف المشاعر عبر الموضوعات، مشيرين إلى أن الطرق التقليدية في التعلم الآلي غالبًا ما تواجه صعوبة مع التباين بين الموضوعات. بالمقابل، يمكن أن ينسق التعلم التبايني التمثيلات لحالات عاطفية مشابهة عبر مستخدمين مختلفين، مما يحسن من التعميم. يناقشون التقدمات الأخيرة، مثل طريقة التعرف على المشاعر باستخدام إشارات EEG (ER)، التي تستخدم التكيف غير المشرف لتحسين الأداء عبر الموضوعات. يهدف إطار عمل تعلم التباين عبر الموضوعات (CSCL) المقترح إلى معالجة القيود الحالية من خلال استخدام خسائر تباينية مزدوجة في الفضاء الزائدي، مما يسمح بتمثيل أفضل للحالات العاطفية المعقدة وتحسين القوة ضد التباين الفردي. بشكل عام، تؤكد النتائج على إمكانيات التعلم التبايني في تطوير تقنيات التعرف على المشاعر، خاصة في التطبيقات الواقعية حيث تكون جودة البيانات وتباين الموضوعات من القضايا المهمة.

Journal: Scientific Reports, Volume: 15, Issue: 1
DOI: https://doi.org/10.1038/s41598-025-13289-5
PMID: https://pubmed.ncbi.nlm.nih.gov/40754610
Publication Date: 2025-08-03
Author(s): Ahmed Mohammed Alghamdi et al.
Primary Topic: EEG and Brain-Computer Interfaces

Overview

This research presents a novel Cross-Subject Contrastive Learning (CSCL) scheme aimed at enhancing EEG-based emotion recognition, a critical area within affective computing. The study addresses the challenge of individual variability in EEG signals by employing a dual contrastive objective within hyperbolic space, which allows the model to effectively learn both subject-specific features and generalizable representations. The CSCL framework was rigorously tested on four benchmark datasets—SEED, CEED, FACED, and MPED—yielding recognition accuracies of 97.70%, 96.26%, 65.98%, and 51.30%, respectively. These results indicate that the CSCL approach significantly outperforms existing methods in managing inter-subject variability and label noise, thereby improving the robustness of emotion recognition systems.

Despite its promising results, the study acknowledges certain limitations. The performance of the CSCL model diminishes on more complex and noisy datasets, such as MPED, and real-time emotion recognition was not assessed, necessitating further validation for online BCI applications. Additionally, the model’s effectiveness in naturalistic settings remains untested, and the computational demands of the training process may pose challenges for deployment on edge devices. Lastly, while the current focus is on EEG signals, incorporating multi-modal physiological data could enhance recognition accuracy and contextual understanding in future work.

Introduction

In the proposed model for domain adaptation, a domain discriminator \( D \) is employed to classify the domain of encoded features (source, auxiliary, or target), while the encoder \( G_f \) aims to deceive \( D \) in a min-max adversarial game described by \( G_f \min D \max \mathcal{L}_{\text{dom}} \). This adversarial training encourages \( G_f \) to generate domain-invariant embeddings, preserving emotion-specific signals while reducing subject-specific noise. The training process alternates between optimizing \( D \) for domain discrimination and \( G_f \) for minimization, utilizing gradient reversal layers (GRL) to enhance adversarial optimization. A feedback loop is incorporated for performance evaluation, allowing iterative parameter updates that improve the model’s ability to generalize learned emotion features across diverse distributions.

The model aims to address the challenge of distribution shifts between training and testing datasets, denoted as \( P_{\text{train}}(x) \neq P_{\text{test}}(x) \). It classifies emotions into categories such as happiness, neutrality, and sadness, represented as \( Y = \{y_1, y_2, y_3\} \). The approach ensures robust classification despite inter-subject variability and supports transfer learning from source to target domains, which is crucial in real-world applications where subject-specific calibration may be lacking. Unlike traditional methods, the proposed CSCL framework integrates contrastive learning, adversarial domain adaptation, and classification into a cohesive iterative process, facilitating the extraction of domain-invariant feature vectors from unseen EEG samples while minimizing reliance on extensive annotated datasets. Statistical techniques like t-SNE or PCA may be employed to confirm the coherence of the feature space.

Methods

The proposed Cross Subject Contrastive Learning (CSCL) methodology for EEG signal representation operates in two main phases: the contrastive learning phase and the predictor procedure. In the contrastive learning phase, the process begins with a data generator that creates positive and negative sample pairs from EEG data. This data is then processed through three domain-specific encoders—spatial, temporal, and frequency—each capturing different aspects of brain activity. The spatial encoder identifies relationships among electrode channels, the temporal encoder tracks the evolution of emotions over time, and the frequency encoder extracts spectral features associated with various emotional states. The outputs from these encoders are combined and refined into a compact representation suitable for downstream tasks, facilitating robust feature learning.

The predictor procedure involves training and evaluating the model using a multi-layer perceptron (MLP) classifier to classify emotions based on the learned representations. The CSCL employs a contrastive loss function that encourages the model to bring similar representations closer while pushing dissimilar ones apart, enhancing generalization across subjects. Additionally, a Domain-Adversarial Neural Network (DANN) framework is integrated to mitigate domain shifts by learning domain-invariant features, thus improving the model’s performance on unseen subjects. The methodology is evaluated against three recent state-of-the-art models—CSMM, DNN_AER, and DAPLP—demonstrating promising accuracy and robustness in emotion recognition across various datasets, with results validated through standard procedures like leave-one-subject-out and tenfold cross-validation.

Results

In the results evaluation section, the model predictions \( Y = G_y(z) \) are assessed using various metrics, including accuracy, precision, recall, and F1-score. Additional tools such as confusion matrices and ROC curves are employed to analyze classification tendencies. The evaluations are averaged across multiple runs or folds to ensure statistical significance, thereby validating the effectiveness of the domain adaptation and feature projection mechanisms. In cases where performance declines, model parameters and the feature space are re-tuned to enhance outcomes.

Following classification, results are organized by emotion classes \( Y = \{ \text{happy}, \text{neutral}, \text{sad} \} \) to evaluate interclass distinctions. This analysis encompasses intra-class variance, the effects of class imbalance, and trends in misclassification. The regrouped results facilitate emotion-wise model calibration, while visualizations of feature clusters provide insights into the separation of emotional states. This approach enhances interpretability and offers constructive feedback for refining earlier phases of the model development.

Discussion

In the discussion section of the research paper, the authors review state-of-the-art methods for emotion detection, particularly emphasizing the role of contrastive learning in EEG-based emotion recognition. Contrastive learning, a self-supervised paradigm, effectively learns discriminative representations by contrasting similar and dissimilar samples, which is particularly beneficial in scenarios with noisy or limited labels. The authors highlight various approaches, such as the multi-source dynamic contrastive domain adaptation method (MS-DCDA) and the FCLGCN architecture, which leverage contrastive learning to enhance emotion recognition accuracy and robustness across different datasets. These methods demonstrate significant improvements in classification performance, with the MS-DCDA achieving 90% accuracy on the SEED dataset.

The authors also address the challenges of cross-subject emotion detection, noting that traditional machine learning methods often struggle with inter-subject variability. In contrast, contrastive learning can align representations of similar emotional states across different users, thereby improving generalization. They discuss recent advancements, such as the Emotion Recognition using EEG signals (ER) method, which employs unsupervised domain adaptation to enhance performance across subjects. The proposed Cross-Subject Contrastive Learning (CSCL) framework aims to address existing limitations by utilizing dual contrastive losses in hyperbolic space, allowing for better representation of complex emotional states and improved robustness against individual variability. Overall, the findings underscore the potential of contrastive learning in advancing emotion recognition technologies, particularly in real-world applications where data quality and subject variability are significant concerns.