Cross-subject electroencephalogram signal emotion recognition method based on multi-source comparative learning

The model architecture built using a multi-source contrastive learning method, combined with a multi-dimensional loss function and dynamically updated category prototypes, solves the problems of individual specificity and inter-domain differences in EEG emotion recognition, and achieves high-precision and robust cross-subject emotion recognition.

CN121786648APending Publication Date: 2026-04-03CHONGQING LANDSCAPE & GARDENING RES INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-19
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Existing EEG emotion recognition technology suffers from several problems in cross-subject scenarios, including insufficient capture of individual-specific features, inadequate generalization performance due to differences in distribution across domains, and sensitivity to noise labels and lack of robustness.

Method used

A multi-source contrastive learning approach is adopted to construct a model architecture consisting of a common space mapper, a multi-subject subspace module, and a multi-classifier. By combining inter-class contrastive learning, intra-class contrastive learning, MMD domain adaptation, and GCE classification loss, a multi-dimensional loss function is formed, which dynamically updates the category prototype and performs weighted fusion recognition results.

Benefits of technology

It significantly improves the accuracy, generalization ability and robustness of EEG signal emotion recognition in cross-subject scenarios, effectively extracts common emotion features and accurately captures individual-specific features, reduces noise label interference and reduces inter-domain distribution differences.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121786648A_ABST
    Figure CN121786648A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of brain-computer interface emotion recognition, relates to a cross-subject electroencephalogram signal emotion recognition method based on multi-source contrast learning, and aims to solve the problems that electroencephalogram signal emotion recognition generalization performance is insufficient in a cross-subject scene, the influence of individual differences is obvious, a model is sensitive to noise labels, robustness is poor and the like. The method comprises the following steps: firstly, constructing a model comprising a common space mapper, N tested subspace modules and corresponding classifiers, extracting common space features of a source domain and a target domain through the common space mapper, then obtaining subspace features through each tested subspace module, synchronously constructing inter-class contrast learning, intra-class contrast learning, MMD and a classification multi-dimensional loss function, and finally obtaining the classification multi-dimensional loss function. And dynamically updating the category prototype and completing model training, and finally, performing weighted fusion on all classifier results according to the data volume to obtain a final recognition result. The method effectively balances emotion common features and individual specific features, reduces the distribution difference between a source domain and a target domain, reduces the interference of noise tags, remarkably improves the precision, generalization ability and model robustness of cross-subject emotion recognition, and is suitable for large-scale cross-subject emotion recognition related scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of brain-computer interface emotion recognition technology, and in particular relates to a multi-source contrastive learning method for emotion recognition across subject EEG signals. Background Technology

[0002] Emotion recognition is a core supporting technology in fields such as brain-computer interfaces and intelligent human-computer interaction. Electroencephalogram (EEG) signals have become the core data source for emotion recognition due to their advantages of directly reflecting the state of brain neural activity, strong objectivity, difficulty in faking, and portable and low-cost acquisition equipment. EEG emotion recognition across subject scenarios can overcome the limitations of individual adaptation and realize the large-scale application of the technology, which has important practical value for assisting in psychological state assessment and optimizing human-computer interaction experience.

[0003] In existing EEG emotion recognition technologies, traditional solutions often use machine learning models such as support vector machines and artificial neural networks to directly extract features and classify them. To address the challenge of cross-subject generalization, researchers have proposed optimization approaches such as transfer learning, domain adaptation, and contrastive learning. Domain adaptation improves transferability by reducing the data distribution differences between the source and target domains, while contrastive learning mines data commonalities by constructing a feature space. Some solutions attempt to combine shared feature spaces with individual-specific feature spaces to optimize recognition performance.

[0004] However, EEG signals exhibit significant individual specificity, with different subjects showing marked differences in their neural responses to the same emotional stimuli. Existing domain adaptation methods often focus on domain-level distribution alignment, failing to fully capture individual-specific features. Furthermore, label noise is prone to occur in emotion-induced experiments, and existing models have low tolerance for noise. Moreover, they are deficient in balancing common features with individual specificity and improving model robustness, resulting in generalization performance and recognition accuracy in cross-subject emotion recognition that are difficult to meet the needs of practical applications. Summary of the Invention

[0005] To address the problems existing in the background art, one aspect of the present invention provides a method for emotion recognition across subject EEG signals using multi-source contrastive learning, comprising:

[0006] S1: Obtain EEG signal data from N source domain subjects and EEG signal data from target domain subjects, and construct an EEG signal emotion recognition model; wherein, the EEG signal emotion recognition model includes: a common space mapper, N subject subspace modules and N classifier modules, with each source domain subject corresponding to one subject subspace module and one classifier module;

[0007] S2: Input the EEG signal data of N source domain subjects and the EEG signal data of the target domain subjects into the cospatial mapper to extract the cospatial features of the N source domain subjects and the target domain subjects; and construct an inter-class contrastive learning loss function based on the cospatial features of the N source domain subjects;

[0008] S3: Input the cospace features of each source domain subject and the cospace features of the target domain subject into the subject subspace module corresponding to the source domain subject to extract the subspace features of the source domain subject and the target domain subject, and construct the MMD loss function based on the subspace features of the source domain subject and the target domain subject.

[0009] S4: Input the subspace features of each source domain subject and the subspace features of the target domain subject into the classification module corresponding to the source domain subject for prediction, and update the category prototypes of each category and construct the classification loss function based on the prediction results of the subspace features of the source domain subject. The initial category prototype of each category is the mean of all subspace features of the source domain subject under that category.

[0010] S5: If the probability prediction result of the subject subspace feature in the target domain in category c is greater than the set threshold, then the subject subspace feature in the target domain and the category prototype of category c are used as positive sample pairs to construct an intra-class contrastive learning loss function.

[0011] S6: Obtain the total loss function based on the constructed inter-class contrastive learning loss function, MMD loss function, intra-class contrastive learning loss function, and classification loss function; train the EEG signal emotion recognition model based on the total loss function;

[0012] S7: Input the EEG signal data of N source domain subjects and the EEG signal data of target domain subjects into the trained EEG signal emotion recognition model. Based on the amount of EEG signal data of each subject subspace module, the recognition results of the target domain subject's EEG signal data are weighted and fused to obtain the final recognition result of the target domain subject's EEG signal data.

[0013] Another aspect of the present invention provides a multi-source contrastive learning cross-subject EEG signal emotion recognition system, the system comprising a memory and a processor; the memory is used to store an application program; the processor is used to run the application program and execute the multi-source contrastive learning cross-subject EEG signal emotion recognition method.

[0014] The present invention has at least the following beneficial effects

[0015] This invention addresses the problems in cross-subject EEG emotion recognition, such as insufficient capture of individual-specific features, inadequate generalization performance due to inter-domain distribution differences, and model sensitivity to noise labels and lack of robustness. It constructs a model architecture consisting of a common space mapper, a multi-subject subspace module, and a multi-classifier. By combining inter-class contrastive learning, intra-class contrastive learning, MMD domain adaptation, and a GCE classification loss function, it effectively extracts common emotional features among different subjects while accurately capturing individual-specific features. Furthermore, through dynamically updating category prototypes and weighted fusion of recognition results, it significantly reduces the interference of noise labels and minimizes the distribution differences between the source and target domains. Ultimately, this greatly improves the accuracy, generalization ability, and robustness of EEG emotion recognition in cross-subject scenarios. Attached Figure Description

[0016] Figure 1 This is a schematic diagram of the method flow of the present invention;

[0017] Figure 2 This is a schematic diagram of the structure of the EEG signal emotion recognition model of the present invention. Detailed Implementation

[0018] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0019] Please see Figure 1 and Figure 2 One aspect of the present invention provides a method for emotion recognition across subject EEG signals using multi-source contrastive learning, comprising:

[0020] S1: Obtain EEG signal data from N source domain subjects and EEG signal data from target domain subjects, and construct an EEG signal emotion recognition model; wherein, the EEG signal emotion recognition model includes: a common space mapper, N subject subspace modules and N classifier modules, with each source domain subject corresponding to one subject subspace module and one classifier module;

[0021] In this embodiment, by acquiring EEG signal data from N source domain subjects with emotion labels and unlabeled target domain subjects, an EEG signal emotion recognition model was constructed, comprising a common space mapper, N subject subspace modules, and N classifier modules (each source domain subject corresponds to a set of exclusive subject subspace modules and classifier modules). Its core effect lies in building a basic architecture that takes into account both the extraction of common emotion features and the capture of individual-specific features. It provides a unified feature extraction channel for signals from different subjects through the common space mapper, and adapts to individual differences in the source domain through exclusive subspace modules and classifiers. This lays a structured foundation for subsequent feature alignment, loss optimization, and accurate recognition in cross-subject scenarios, and initially addresses the problem of insufficient generalization performance caused by individual differences from an architectural perspective.

[0022] Preferably, the common space mapper includes: three cascaded linear layers, each followed by a LeakyReLU activation function layer; the classifier module includes: a fully connected layer and a Sofmax layer; the subject subspace module includes: cascaded linear layers, a BatchNorm layer, and a LeakyReLU activation function layer.

[0023] In this embodiment, the common space mapper employs a three-layer cascaded Linear layer, with each Linear layer followed by a LeakyReLU activation function. The classifier module consists of a fully connected layer and a Softmax layer. The subject subspace module is a cascaded structure of Linear layers, BatchNorm layers, and a LeakyReLU activation function. This structural design is both reasonable and targeted. The LeakyReLU activation function can effectively alleviate the gradient vanishing problem, retaining more feature details to support the extraction of common and specific features. The BatchNorm layer can stabilize the model training process, reduce feature distribution fluctuations caused by individual differences, and improve the model's adaptability to changes in data distribution. The combination of fully connected layers and Softmax layers can efficiently complete the mapping from features to emotion categories and probability output. The overall structure not only ensures the sufficiency of feature extraction and the stability of training, but also provides highly adaptable structural support for subsequent multi-loss function optimization and cross-subject feature alignment, helping the model accurately achieve the goal of emotion recognition.

[0024] S2: Input the EEG signal data of N source domain subjects and the EEG signal data of the target domain subjects into the cospatial mapper to extract the cospatial features of the N source domain subjects and the target domain subjects; and construct an inter-class contrastive learning loss function based on the cospatial features of the N source domain subjects;

[0025] Preferably, the inter-class contrastive learning loss function includes:

[0026]

[0027] in, This represents the inter-class comparison learning loss function; Represents the first subject of the source domain Shared spatial characteristics; Indicates and The set of shared spatial features among source domain subjects with the same emotion category; Represents a set The shared space characteristics in This represents the set of all cosine features of the subjects in the source domain. Represents a set The shared space characteristics in Represents the source domain. These are adjustable hyperparameters; This represents an exponential function.

[0028] In this embodiment, EEG signal data from N source domain subjects and target domain subjects are input into a cospace mapper to uniformly extract cospace features from both types of subjects. Simultaneously, an inter-class contrastive learning loss function is constructed based on the cospace features of the source domain subjects. Its core function is to mine common features of emotional expression among different subjects through the cospace mapper, breaking down feature fragmentation caused by individual differences. The inter-class contrastive learning loss function can enhance the feature discrimination between different emotion categories, enabling the model to accurately identify the boundaries of emotion categories. This provides a high-quality common feature foundation for subsequent cross-subject feature alignment and model training, initially alleviating the problem of insufficient cross-subject generalization performance from the feature level.

[0029] S3: Input the cospace features of each source domain subject and the cospace features of the target domain subject into the subject subspace module corresponding to the source domain subject to extract the subspace features of the source domain subject and the target domain subject, and construct the MMD loss function based on the subspace features of the source domain subject and the target domain subject.

[0030] Preferably, the MMD loss function includes:

[0031]

[0032] in, Indicates the first MMD loss function for each subject subspace module Indicates the first The number of EEG signal data from each source domain subject; Indicates the first The first source domain subject Shared spatial characteristics; This indicates the number of EEG signal data points of the subjects in the target domain. The first subject of the target domain Shared spatial characteristics; Indicates the first One subject subspace module; Indicates the target domain; This represents the L2 norm in the RKHS space.

[0033] In this embodiment, the cospace features of each source domain participant and the cospace features of the target domain participant are input into the dedicated participant subspace module of the corresponding source domain participant. Individual-specific subspace features of each source domain participant and fit subspace features of the target domain participant are extracted in a targeted manner. At the same time, an MMD loss function is constructed based on the two types of subspace features. Its core effect is that it accurately captures the unique emotional neural response features of individuals through the dedicated subspace module, making up for the shortcomings of traditional methods that do not pay enough attention to individual specificity. The MMD loss function can effectively reduce the distribution difference between the source domain and the target domain at the subspace level, realize the alignment of features between domains, and provide high-quality features with commonality, specificity and distribution consistency for subsequent model training, further alleviating the problem of insufficient generalization performance in cross-participant scenarios.

[0034] S4: Input the subspace features of each source domain subject and the subspace features of the target domain subject into the classification module corresponding to the source domain subject for prediction, and update the category prototypes of each category and construct the classification loss function based on the prediction results of the subspace features of the source domain subject. The initial category prototype of each category is the mean of all subspace features of the source domain subject under that category.

[0035] Preferably, the category The category prototype is the mean of all subspace features of the source domain subjects under that category, in the th... During the next iteration of training, the category The category prototype is updated using the following formula:

[0036]

[0037] in, Indicates the updated number Categories in each subject's subspace module Category prototype, This indicates normalization processing; Indicates the first Weight parameters corresponding to each subject subspace module; Indicates the number before the update Categories in each subject's subspace module Category prototype, Indicates the first In each subject's subspace module, both the predicted result and the true label are category. The source domain and the characteristics of the test space.

[0038] Preferably, the classification loss function includes:

[0039]

[0040] in, Indicates the first The first subject in the subject subspace module, the source domain subject Subspace characteristics; Indicates the first One classifier module; Indicates the first Each classifier module The prediction results in its true category The probability of; This indicates an adjustable weight parameter; Indicates the first The number of subspace features of the source domain subjects in each subject subspace module; This represents the classification loss function.

[0041] In this embodiment, the subspace features of each source domain participant and the subspace features of the target domain participant are input into the dedicated classification module of the corresponding source domain participant for emotion category prediction. The mean of all subspace features of the source domain participant under the category is used as the initial category prototype for each category. The category prototype is dynamically updated based on the prediction results of the source domain participant's subspace features. At the same time, a classification loss function is constructed. Its core effect is that by adapting to individual classification needs through a dedicated classification module, the dynamically updated category prototype can continuously optimize the emotion category representation and fit the distribution of real emotion features. The classification loss function can enhance the model's ability to distinguish the emotion categories of the source domain, effectively reduce the interference of noise labels on category judgment, and provide a reliable category benchmark and classification guidance for subsequent intra-class comparison learning, total loss optimization, and cross-participant accurate identification, further compensating for the identification bias caused by individual differences.

[0042] S5: If the probability prediction result of the subject subspace feature in the target domain in category c is greater than the set threshold, then the subject subspace feature in the target domain and the category prototype of category c are used as positive sample pairs to construct an intra-class contrastive learning loss function.

[0043] Preferably, the intra-domain contrastive loss function includes:

[0044]

[0045] in, Indicates the target domain participants in the first... The subspace characteristics of the first subject's subspace module and the first subject's subspace module Categories in each subject's subspace module Category prototype The number of positive sample pairs formed; Indicates the first Intra-class contrastive learning loss function for each subject subspace module; ; ; Indicates the first Category in each subject's subspace module The probability prediction result is greater than the target domain subject subspace features that meet the set threshold. Indicates the first The set of all category prototypes in each subject's subspace module; Indicates the first Subspace feature set of source domain subjects in each subject subspace module; Represents an exponential function; Indicates the first Categories in each subject's subspace module The category prototype; Indicates the first Adjustable hyperparameters corresponding to each subject subspace module.

[0046] In this embodiment, by judging whether the probability prediction result of the subject subspace feature of the target domain in category c is greater than a set threshold, high-confidence target domain features are selected and constructed as positive sample pairs with the corresponding category prototype of category c. Then, an intra-class contrastive learning loss function is constructed. Its core effect is to make full use of the effective information of the unlabeled target domain, strengthen the clustering of similar features through high-confidence sample pairs, and avoid the interference of low-confidence noise samples. This makes up for the lack of label supervision in the target domain, allowing the model to more accurately capture the common features of similar emotions. It provides targeted intra-class feature constraints for the optimization of the total loss function, and further improves the consistency of emotion category recognition and model robustness in cross-subject scenarios.

[0047] S6: Obtain the total loss function based on the constructed inter-class contrastive learning loss function, MMD loss function, intra-class contrastive learning loss function, and classification loss function; train the EEG signal emotion recognition model based on the total loss function;

[0048] Preferably, the total loss function includes:

[0049]

[0050] in, Represents the loss function; Represents the classification loss function; , and Indicates the weighting parameter; Represents the MMD loss function; Indicates the first Inter-class contrastive learning loss function for each subject subspace module; Indicates the first Intra-class contrastive learning loss function for each subject subspace module.

[0051] In this embodiment, a multi-dimensional collaborative total loss function is constructed by integrating the inter-class contrastive learning loss function, the MMD loss function, the intra-class contrastive learning loss function, and the classification loss function. The EEG signal emotion recognition model is then trained as a whole based on this total loss function. The core effect is that it achieves the organic unity of multi-objective optimization. It strengthens the boundaries of emotion categories through inter-class contrastive loss and reduces the differences in distribution between domains through MMD loss. It also improves the clustering of similar features through intra-class contrastive loss and ensures basic classification accuracy through classification loss. This avoids the limitations of optimizing a single loss function. The model can simultaneously take into account multiple needs such as common feature extraction, individual difference adaptation, domain distribution alignment, and anti-noise interference during training, and promotes the iteration of model parameters towards a better direction. It systematically solves the core problems of insufficient generalization and lack of robustness in cross-subject scenarios from the training level.

[0052] S7: Input the EEG signal data of N source domain subjects and the EEG signal data of target domain subjects into the trained EEG signal emotion recognition model. Based on the amount of EEG signal data of each subject subspace module, the recognition results of the target domain subject's EEG signal data are weighted and fused to obtain the final recognition result of the target domain subject's EEG signal data.

[0053] Preferably, the final identification result of the target domain subject's EEG signal data includes:

[0054]

[0055]

[0056] in, This indicates that the target domain's EEG signal data is in the first... Subspace characteristics of each subject's subspace module; Indicates the first One classifier module; Indicates the first Weight parameters of each classifier module; Indicates the target domain participants in the first... The subspace characteristics of the first subject's subspace module and the first subject's subspace module The number of positive sample pairs formed by the category prototypes in each subject's subspace module; Indicates the current batch number The total number of EEG signal data from the target domain and the source domain in each subject subspace module.

[0057] In this embodiment, EEG signal data from N source domain subjects and target domain subjects are input into a trained EEG signal emotion recognition model. Based on the amount of EEG signal data input to each subject's subspace module, the target domain emotion recognition results output by each classifier are weighted and fused to ultimately obtain the emotion recognition result of the target domain subject's EEG signal. Its core effect lies in fully integrating the feature adaptation advantages of each source domain's dedicated modules through a data-weighted fusion method, avoiding the recognition bias of a single classifier, and ensuring that data contribution matches recognition reliability. This maximizes the utilization of the results of multi-source contrastive learning and domain adaptation training, while further balancing the influence of individual differences and common features, ensuring the accuracy, stability, and robustness of the final recognition result, and providing a reliable output guarantee for the practical application of cross-subject emotion recognition.

[0058] Another aspect of the present invention provides a multi-source contrastive learning cross-subject EEG signal emotion recognition system, the system comprising a memory and a processor; the memory is used to store an application program; the processor is used to run the application program and execute the multi-source contrastive learning cross-subject EEG signal emotion recognition method.

[0059] To intuitively verify the performance advantages of the method of this invention, the classification accuracy of different models on the SEED public dataset was compared across subjects. The comparison results are shown in Table 1:

[0060] Table 1. Comparison of cross-subject classification accuracy of different models and this invention on the SEED dataset.

[0061]

[0062] The comparative experiments selected two mainstream baseline schemes: one is traditional domain adaptation techniques (DAN, MS-MDA, DDA), and the other is contrastive learning methods that have emerged in recent years (SeqCLR, CLISA, PCDG), with classification accuracy and variance as the core evaluation indicators. Data shows that the accuracy of traditional domain adaptation methods is generally low, with DAN at only 66.29%, MS-MDA at 83.85%, and DDA at 78.14%, respectively. Furthermore, some models exhibited large variances (e.g., DDA's variance reached 10.71%), reflecting that simply relying on domain-level distribution alignment is insufficient to adequately address individual differences. While contrastive learning methods showed improved performance, with SeqCLR, CLISA, and PCDG achieving accuracies of 85.77%, 86.40%, and 87.3%, respectively, there is still room for optimization. In contrast, the method of this invention achieved a cross-subject classification accuracy of 88.18%, significantly higher than all the comparative models, and the variance was controlled within a reasonable range, demonstrating the model's stability. The experimental results fully demonstrate that the present invention effectively solves the shortcomings of existing methods in terms of individual difference processing, inter-domain distribution alignment and noise interference resistance, and has better performance and practicality in cross-subject EEG signal emotion recognition tasks.

[0063] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0064] In summary, this invention addresses the problems in cross-subject EEG emotion recognition, such as insufficient capture of individual-specific features, inadequate generalization performance due to inter-domain distribution differences, and model sensitivity to noise labels and lack of robustness. By constructing a model architecture of a common space mapper + multi-subject subspace module + multi-classifier, and combining inter-class contrastive learning, intra-class contrastive learning, MMD domain adaptation, and GCE classification loss into a multi-dimensional loss function, it effectively extracts common emotional features among different subjects while accurately capturing individual-specific features. Furthermore, through dynamically updating category prototypes and weighted fusion of recognition results, it significantly reduces the interference of noise labels and minimizes the distribution differences between the source and target domains. Ultimately, this invention greatly improves the accuracy, generalization ability, and robustness of EEG emotion recognition in cross-subject scenarios.

[0065] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for emotion recognition across subject EEG signals using multi-source contrastive learning, characterized in that, include: S1: Obtain EEG signal data from N source domain subjects and EEG signal data from target domain subjects, and construct an EEG signal emotion recognition model; wherein, the EEG signal emotion recognition model includes: a common space mapper, N subject subspace modules and N classifier modules, with each source domain subject corresponding to one subject subspace module and one classifier module; S2: Input the EEG signal data of N source domain subjects and the EEG signal data of the target domain subjects into the cospatial mapper to extract the cospatial features of the N source domain subjects and the target domain subjects; and construct an inter-class contrastive learning loss function based on the cospatial features of the N source domain subjects; S3: Input the cospace features of each source domain subject and the cospace features of the target domain subject into the subject subspace module corresponding to the source domain subject to extract the subspace features of the source domain subject and the target domain subject, and construct the MMD loss function based on the subspace features of the source domain subject and the target domain subject. S4: Input the subspace features of each source domain subject and the subspace features of the target domain subject into the classification module corresponding to the source domain subject for prediction, and update the category prototypes of each category and construct the classification loss function based on the prediction results of the subspace features of the source domain subject. The initial category prototype of each category is the mean of all subspace features of the source domain subject under that category. S5: If the probability prediction result of the subject subspace feature in the target domain in category c is greater than the set threshold, then the subject subspace feature in the target domain and the category prototype of category c are used as positive sample pairs to construct an intra-class contrastive learning loss function. S6: Obtain the total loss function based on the constructed inter-class contrastive learning loss function, MMD loss function, intra-class contrastive learning loss function, and classification loss function; train the EEG signal emotion recognition model based on the total loss function; S7: Input the EEG signal data of N source domain subjects and the EEG signal data of target domain subjects into the trained EEG signal emotion recognition model. Based on the amount of EEG signal data of each subject subspace module, the recognition results of the target domain subject's EEG signal data are weighted and fused to obtain the final recognition result of the target domain subject's EEG signal data.

2. The method for emotion recognition across subject EEG signals using multi-source contrastive learning according to claim 1, characterized in that, The inter-class contrastive learning loss function includes: in, This represents the inter-class comparison learning loss function; Represents the first subject of the source domain Shared spatial characteristics; Indicates and The set of shared spatial features among source domain subjects with the same emotion category; Represents a set The shared space characteristics in This represents the set of all cosine features of the subjects in the source domain. Represents a set The shared space characteristics in Represents the source domain. These are adjustable hyperparameters; This represents an exponential function.

3. The method for emotion recognition based on multi-source contrastive learning across subject EEG signals according to claim 1, characterized in that, The common space mapper includes: three cascaded linear layers, each followed by a LeakyReLU activation function layer; the classifier module includes: a fully connected layer and a Sofmax layer; the subject subspace module includes: cascaded linear layers, a BatchNorm layer, and a LeakyReLU activation function layer.

4. The method for emotion recognition across subject EEG signals using multi-source contrastive learning according to claim 1, characterized in that, The MMD loss function includes: in, Indicates the first MMD loss function for each subject subspace module Indicates the first The number of EEG signal data from each source domain subject; Indicates the first The first source domain subject Shared spatial characteristics; This indicates the number of EEG signal data from the subjects in the target domain. The first subject of the target domain Shared spatial characteristics; Indicates the first One subject subspace module; Indicates the target domain; This represents the L2 norm in the RKHS space.

5. The method for emotion recognition across subject EEG signals using multi-source contrastive learning according to claim 1, characterized in that, The intra-domain contrastive loss function includes: in, Indicates the target domain participants in the first... The subspace characteristics of the first subject's subspace module and the first subject's subspace module Categories in each subject's subspace module Category prototype The number of positive sample pairs formed; Indicates the first Intra-class contrastive learning loss function for each subject subspace module; ; ; Indicates the first Category in each subject's subspace module The probability prediction result is greater than the target domain subject subspace features that meet the set threshold. Indicates the first The set of all category prototypes in each subject's subspace module; Indicates the first Subspace feature set of source domain subjects in each subject subspace module; Represents an exponential function; Indicates the first Categories in each subject's subspace module The category prototype; Indicates the first Adjustable hyperparameters corresponding to each subject subspace module.

6. A method for emotion recognition across subject EEG signals using multi-source contrastive learning according to claim 1 or 5, characterized in that, During the first iteration of training, the category The category prototype is the mean of all subspace features of the source domain subjects under that category, in the th... During the next iteration of training, the category The category prototype is updated using the following formula: in, Indicates the updated number Categories in each subject's subspace module Category prototype, This indicates normalization processing; Indicates the first Weight parameters corresponding to each subject subspace module; Indicates the number before the update Categories in each subject's subspace module Category prototype, Indicates the first In each subject's subspace module, both the predicted result and the true label are category. The source domain and the characteristics of the test space.

7. The method for emotion recognition across subject EEG signals using multi-source contrastive learning according to claim 1, characterized in that, The classification loss function includes: in, Indicates the first The first subject in the subject subspace module, the source domain subject Subspace characteristics; Indicates the first One classifier module; Indicates the first Each classifier module The prediction results in its true category The probability of; This indicates an adjustable weight parameter; Indicates the first The number of subspace features of the source domain subjects in each subject subspace module; This represents the classification loss function.

8. The method for emotion recognition across subject EEG signals using multi-source contrastive learning according to claim 1, characterized in that, The total loss function includes: in, Represents the loss function; Represents the classification loss function; , and Indicates the weighting parameter; Represents the MMD loss function; Indicates the first Inter-class contrastive learning loss function for each subject subspace module; Indicates the first Intra-class contrastive learning loss function for each subject subspace module.

9. The method for emotion recognition across subject EEG signals using multi-source contrastive learning according to claim 1, characterized in that, The final identification results of the target domain subject EEG signal data include: in, This indicates that the target domain's subject's EEG signal data is in the first... Subspace characteristics of each subject's subspace module; Indicates the first One classifier module; Indicates the first Weight parameters of each classifier module; Indicates the target domain participants in the first... The subspace characteristics of the first subject's subspace module and the first subject's subspace module The number of positive sample pairs formed by the category prototypes in each subject's subspace module; Indicates the current batch number The total number of EEG signal data from the target domain and the source domain in each subject subspace module.

10. A multi-source contrastive learning-based emotion recognition system for cross-subject EEG signals, characterized in that, The system includes a memory and a processor; the memory is used to store an application program; the processor is used to run the application program and execute a multi-source contrastive learning method for emotion recognition across subject EEG signals as described in any one of claims 1 to 9.