A method for predicting interpersonal relationships based on resting-state EEG neural synchronization
By constructing a four-quadrant dual-brain connectivity matrix and heat map, combined with the Vision Transformer model, the accuracy and generalization problems in interpersonal relationship prediction are solved, and a more objective relationship evaluation is achieved, which is suitable for neural adaptation analysis of partner relationships.
Patent Information
- Application Number
- CN202510984143.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-17
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2045-07-17
AI Technical Summary
Existing technologies have low prediction accuracy and poor generalization ability in interpersonal relationship prediction. Traditional methods are affected by subjective biases. CNN has difficulty capturing the global linkage characteristics between brain regions, and the topological information of neural synchronization maps is lost.
A four-quadrant dual-brain connectivity matrix and dual-brain heat map were constructed based on resting-state EEG data, and interpersonal relationship prediction was performed in combination with the Vision Transformer model. Neural synchronization was quantified using the Pearson correlation coefficient, and the unique design of the four-quadrant matrix was used to integrate the connections within a single brain and between the two brains, converting them into machine-recognizable image features.
It provides a more objective and accurate method for predicting interpersonal relationships, avoids subjective bias, has strong generalization ability, can objectively evaluate the degree of neural adaptation of partner relationships, provide quantitative reference for marriage counseling, and identify changes in neural signals in the early stages of relationships.
Smart Images

Figure CN120458601B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of biomedical signal intelligent processing, and in particular to a method for predicting interpersonal relationships based on resting-state EEG neural synchronization. Background Art
[0002] In recent years, the application of neurophysiological techniques, particularly electroencephalography (EEG), in the study of interpersonal interaction has garnered increasing attention. Inter-brain synchronization, a metric that quantifies the coordinated brain activity across individuals, has become a key method for analyzing social cognition and emotional connections. Previous research has primarily focused on task-based EEG synchronization, such as in collaborative tasks, musical interactions, or parent-child problem-solving situations. Researchers have used EEG synchronization to understand the mechanisms of interpersonal interaction, emotional resonance, and relationship development. However, task-based neural synchronization often reflects temporary, state-dependent synchronization driven by specific task or situational factors, rather than the more stable, endogenous neural adaptation characteristics between individuals, especially those in close relationships.
[0003] Research on EEG synchronization characteristics in the resting state (i.e., baseline conditions without explicit task guidance) remains largely unresolved, particularly in predicting interpersonal relationships (e.g., romantic partnerships). Traditional interpersonal assessment methods (e.g., questionnaires) can be influenced by the subject's subjective will, social desirability, or behavioral masking, resulting in low predictive accuracy. Furthermore, convolutional neural network (CNN)-based interpersonal prediction methods struggle to directly capture global linkage features across brain regions or individuals. CNN inputs have a Euclidean grid structure, but neural synchronization maps are inherently non-Euclidean and network-like. Consequently, CNNs lose topological information from these synchronization matrices. For high-dimensional, cross-brain region, and high-frequency mixed synchronization matrices, CNNs often rely on manual parameter tuning (kernel size, number of layers) for feature fusion, resulting in limited generalization. Summary of the Invention
[0004] In order to overcome the defects of low prediction accuracy and poor generalization ability in the above-mentioned prior art in interpersonal relationship prediction, the present invention proposes an interpersonal relationship prediction method based on resting-state EEG neural synchronization.
[0005] To achieve the above objectives, the present invention adopts the following technical solutions: a method for predicting interpersonal relationships based on resting-state EEG neural synchronization, comprising:
[0006] S1: Use the EEG acquisition system to synchronously collect resting-state EEG data of both subjects within a set time;
[0007] S2: Preprocessing the EEG data of both subjects to obtain the preprocessed EEG data of both subjects;
[0008] S3: Construct a four-quadrant dual-brain connectivity matrix and dual-brain heat map based on the pre-processed EEG data of both subjects, including:
[0009] S31: Based on the number of channels s1 of the EEG acquisition system, set an empty matrix with a dimension of 2s1×2s1, and divide the empty matrix into four quadrant matrices, with the matrix dimension of each quadrant being s1×s1;
[0010] S32: performing EEG data correlation calculation on the EEG data of each channel after preprocessing of both subjects, obtaining the element values in each quadrant of the four-quadrant matrix, and obtaining the four-quadrant dual-brain connectivity matrix;
[0011] S33: Perform element value-color mapping based on the four-quadrant dual-brain connectivity matrix to obtain the dual-brain heat map;
[0012] S4: Input the dual-brain heat map into the Vision Transformer model to obtain the predicted results of the interpersonal relationship between the two subjects.
[0013] Preferably, step S1 includes:
[0014] S11: Set the channels, reference electrodes and sampling frequency of the EEG acquisition system;
[0015] S12: Synchronously collect resting-state EEG data of both subjects within a set time; the EEG data includes time signal sequences of all channels.
[0016] Preferably, step S2 includes:
[0017] S21: bandpass filtering of the EEG data of both subjects;
[0018] S22: Using the independent component analysis method to identify and remove artifacts in the EEG data of both subjects, and obtain the pre-processed EEG data of both subjects; the artifacts include artifacts caused by electrooculography and electromyography and artifacts caused by poor contact of electrodes in the EEG acquisition system.
[0019] Preferably, in step S32, the four-quadrant matrix includes an upper left quadrant matrix, a lower left quadrant matrix, an upper right quadrant matrix and a lower right quadrant matrix; the upper left quadrant matrix is used to represent the correlation between the EEG data of each channel of subject 1, the lower right quadrant matrix is used to represent the correlation between the EEG data of each channel of subject 2, the lower left quadrant matrix is used to represent the correlation between the EEG data of each channel of subject 2 and each channel of subject 1, and the upper right quadrant is used to represent the correlation between the EEG data of each channel of subject 1 and each channel of subject 2; the element value in each quadrant matrix is the correlation between the EEG data of the two channels.
[0020] Preferably, the calculation formula for the element value r(X,Y) in each quadrant matrix is:
[0021] ;
[0022] Where X and Y are the EEG data of the two channels respectively; cov(X,Y) is the covariance of the EEG data in the two channels; and are the standard deviations of the EEG data in the two channels, respectively.
[0023] Preferably, step S33 includes:
[0024] S331: normalizing the elements in the four-quadrant dual-brain connectivity matrix to obtain a normalized four-quadrant dual-brain connectivity matrix;
[0025] S332: Perform coolwarm color matching on the normalized four-quadrant dual-brain connectivity matrix to obtain a grayscale value image;
[0026] S333: Perform channel duplication and weighted transformation on the grayscale image to generate a dual-brain heat map.
[0027] Preferably, step S332 includes:
[0028] S3321: Determine the element value N of each position in the normalized four-quadrant dual-brain connectivity matrix ij ≤0.5; yes, the gray value V of the current element position ij =S l +α l ×N ij ×Q l ; No, the gray value V of the current element position ij =S n +α n ×N ij ×Q n ;
[0029] Where i represents the i-th row of the normalized four-quadrant dual-brain connectivity matrix; j represents the j-th column of the normalized four-quadrant dual-brain connectivity matrix; S l is the basic cool color value; α l Q is the cool color coefficient; l The visual weight of blue tone; S n is the base warm color value; α n Q is the warm color coefficient; n Gives visual weight to the red hue;
[0030] S3322: Based on the grayscale values of all element positions, obtain the grayscale value image corresponding to the normalized four-quadrant dual-brain connectivity matrix;
[0031] Step S333 includes:
[0032] S3331: Copy the grayscale image into three RGB channels, and then perform a weighted transformation on each channel to obtain the channel value T of each channel. The calculation formula is:
[0033] T=s+k×V ij +q×(V ij -0.5) 2 ;
[0034] Where s is the channel base offset; k is the channel slope; q is the channel curvature;
[0035] S3332: Generate a dual-brain heat map based on the channel values of the RGB three channels.
[0036] Preferably, the Vision Transformer model includes a block embedding network, a position encoding layer, an attention encoder and a classification output module connected in sequence; the attention encoder is composed of a plurality of stacked Transformer encoder modules, and between two adjacent Transformer encoder modules, the output of the previous Transformer encoder module serves as the input of the next Transformer encoder module, and each Transformer encoder module includes a standardization layer, a multi-head attention layer, a normalization layer and a feedforward network layer connected in sequence.
[0037] Preferably, the block embedding network is used to evenly divide the dual-brain heat map into blocks and flatten it, and then map each flattened image block to obtain a block embedding sequence; the position encoding layer is used to position encode the block embedding sequence; the attention encoder is used to capture the complex dependencies between image blocks; the multi-head attention layer is used to capture the contextual relationship between image blocks; the feedforward network layer is used to further process the image block features; and the classification output layer is used to perform image classification prediction on the class embedding vector obtained after processing by several Transformer encoder modules.
[0038] A system for predicting interpersonal relationships based on resting-state EEG neural synchronization is provided to implement a method for predicting interpersonal relationships based on resting-state EEG neural synchronization, comprising an EEG data acquisition module, an EEG data preprocessing module, a feature extraction module, and a classification output module; the EEG data acquisition module is used to synchronously acquire resting-state EEG data of both subjects within a set time; the EEG data preprocessing module is used to preprocess the EEG data of both subjects and obtain the preprocessed EEG data of both subjects; the feature extraction module is used to extract features from the preprocessed EEG data of both subjects; and the classification output module outputs the extracted features for predicting interpersonal relationships.
[0039] The advantages of the present invention are:
[0040] (1) The present invention directly collects EEG data from both subjects in a resting state, constructs a four-quadrant dual-brain connectivity matrix and a dual-brain heat map, and then performs interpersonal relationship analysis on them. This provides a more objective means, avoids the subjective bias and behavioral concealment existing in traditional questionnaire methods or behavioral observation methods, and makes the prediction of interpersonal relationships more accurate and has a strong generalization ability.
[0041] (2) The present invention collects resting-state EEG data from both subjects within a set time, constructs a four-quadrant dual-brain connectivity matrix and a dual-brain heat map based on the pre-processed EEG data of both subjects, and then uses the Vision Transformer model to predict interpersonal relationships. It combines neuroscience (EEG synchronization analysis) with artificial intelligence (Vision Transformer) and, through the unique design of the four-quadrant dual-brain connectivity matrix, extracts interpersonal neural synchronization features from resting-state EEG signals and converts them into a visual heat map, providing objective physiological indicators for traditional interpersonal relationship research.
[0042] (3) The present invention utilizes a four-quadrant dual-brain connectivity matrix to integrate the internal connections of a single brain and the connections between the two brains in a breakthrough way, quantifies neural synchronization through the Pearson correlation coefficient method, and forms a multi-dimensional coupling feature expression.
[0043] (4) The present invention solves the difficulty of direct modeling of EEG time series data by converting the four-quadrant dual-brain connectivity matrix into a heat map and converting abstract EEG correlation into machine-recognizable image features.
[0044] (5) This invention can be used to objectively assess the degree of neural adaptation in a relationship, provide a quantitative reference for marriage counselors, and assist in judging the state of a relationship. For example, it can identify early neural signals of relationship deterioration (such as a trust crisis), and provide ideas for future exploration of neural mechanisms and intervention effect evaluation in areas such as social disorders. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 Flow chart of the steps of the method of the present invention;
[0046] Figure 2 This is a dual-brain heat map of two subjects who are not in a romantic relationship in an embodiment of the present invention;
[0047] Figure 3 This is a dual-brain heat map of two subjects in a romantic relationship according to an embodiment of the present invention;
[0048] Figure 4 This is a probability graph for predicting and classifying interpersonal relationships in an embodiment of the present invention;
[0049] Figure 5This is a system architecture diagram of the present invention;
[0050] Figure 6 This is the four-quadrant dual-brain connectivity matrix diagram of the present invention. DETAILED DESCRIPTION
[0051] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0052] Example 1
[0053] like Figure 1 As shown, the present invention proposes a method for predicting interpersonal relationships based on resting-state EEG neural synchronization, comprising:
[0054] S1: Synchronously collect resting-state EEG data from both subjects within a set time, including:
[0055] S11: Set up the EEG acquisition system;
[0056] Use a multi-channel (e.g., 32 channels, conforming to the 10-20 international standard electrode system) EEG acquisition system; set a reference electrode (e.g., FCz electrode) to ensure that the impedance between each electrode and the scalp is below a preset threshold (e.g., 5 kΩ); and set the sampling frequency (e.g., 500 Hz).
[0057] S12: synchronously collecting resting-state EEG data of both subjects within a set time; the EEG data includes EEG data of all channels of the EEG acquisition system;
[0058] Instruct both participants to close their eyes, relax, remain still, and avoid verbal or physical communication. Simultaneously record EEG data from both participants while they are in a resting state for a period of time (e.g., 3 minutes).
[0059] Hyperscanning technology was used to ensure that the EEG data of both subjects were precisely synchronized in time.
[0060] In this embodiment, taking the relationship between lovers as an example, the interpersonal relationship between the two subjects is a relationship between lovers or a relationship between non-lovers; the EEG data is digital EEG data.
[0061] This invention uses a time-window segmentation method to process continuous signal data. Specifically, the resting-state EEG data of both subjects are divided into continuous time segments of a self-selected duration (typically 2-10 seconds) to form multiple independent analysis units. Each independent analysis unit contains the resting-state EEG data for a set period of time.
[0062] Resting-state data can better reflect an individual's inherent neural activity patterns and may be more suitable for revealing the deep neural connections between couples. Neurophysiological indicators are expected to provide more objective predictive assessments of interpersonal relationships.
[0063] S2: Preprocess the EEG data of both subjects to obtain the preprocessed EEG data of both subjects, including:
[0064] S21: Bandpass filtering (e.g., 0.5-45 Hz) is performed on the EEG data of both participants to remove baseline drift and high-frequency noise, and notch filtering (e.g., 50 Hz) is performed to eliminate the influence of power frequency.
[0065] S22: Use independent component analysis (ICA) and other methods to identify and remove physiological artifacts such as electrooculogram (EOG) and electromyography (EMG) in the EEG data of both subjects, as well as other artifacts caused by poor electrode contact in the EEG acquisition system, to obtain pre-processed EEG data of both subjects;
[0066] During the pre-processing of the EEG data of both subjects, data segmentation and re-reference can also be performed, that is, the continuous EEG data is segmented and re-referenced (for example, whole-brain average reference).
[0067] S3: Construct a four-quadrant dual-brain connectivity matrix and dual-brain heat map based on the pre-processed EEG data of both subjects, including:
[0068] S31: Based on the number of channels s1 of the EEG acquisition system, set an empty matrix with a dimension of 2s1×2s1, and divide the empty matrix into four quadrant matrices, with the matrix dimension of each quadrant being s1×s1;
[0069] This empty matrix is like a "canvas" used to carry the correlation information of the two subjects in the current time period. In the present invention, s1 is 32.
[0070] S32: Based on the EEG data of each channel after preprocessing of both subjects, the element values in each quadrant of the four-quadrant matrix are obtained by using the Pearson correlation coefficient method to obtain the four-quadrant bilateral brain connectivity matrix;
[0071] The element values of the upper left quadrant and the lower right quadrant in the four-quadrant matrix are respectively the correlation between the EEG data of each channel after preprocessing of the two subjects; the element values of the lower left quadrant and the upper right quadrant in the four-quadrant matrix are respectively the correlation between the EEG data of each channel after preprocessing of the two subjects;
[0072] The calculation formula of the element value r(X,Y) in each quadrant matrix is:
[0073] ;
[0074] Where X and Y are the EEG data of the two channels respectively; cov(X,Y) is the covariance of the EEG data in the two channels; and are the standard deviations of the EEG data in the two channels respectively;
[0075] The results of EEG data acquisition are represented as a time signal sequence of all channels, similar to a vector, so r(X,Y) between two channel signals can be calculated.
[0076] like Figure 6 As shown, in the four-quadrant dual-brain connectivity matrix (also known as the correlation coefficient matrix (x1, x2, ..., x32 and y1, y2, ..., y32)), the upper left quadrant represents the intra-brain connection correlation between the various channels of subject 1, and the lower right quadrant represents the intra-brain connection correlation between the various channels of subject 2. Both the upper left quadrant and the lower right quadrant reflect the functional connections within the subjects' brains; both the lower left quadrant and the upper right quadrant represent the correlation between the EEG data of each channel between the two subjects, reflecting the synchronization state of the two brains and revealing the coordination of the brain activities of the two subjects.
[0077] The Python numpy.corrcoef function was used to perform a strict Pearson correlation calculation to quantify the linear correlation between the two signals (the EEG signals within the time period selected above).
[0078] To ensure computational fairness, we retrieved EEG data from both subjects over the same time period. Next, we iterated over each pair of channels from Subject 1 and Subject 2, calculated the correlation between their EEG data over that time period based on the Pearson correlation coefficient, and filled the results into the corresponding positions in the lower left and upper right quadrants. The lower left quadrant is the transpose of the upper right quadrant to ensure symmetry in the joint matrix.
[0079] The element values of the four-quadrant bilateral brain connectivity matrix are between [-1, 1], where -1 represents complete negative correlation, 0 represents no correlation, and 1 represents complete positive correlation, reflecting the synchronization between signals and the strength of functional connectivity.
[0080] The above processing flow ensures high quality and consistency of EEG signals from both subjects. A four-quadrant bilateral brain connectivity matrix based on the Pearson correlation coefficient further reveals the dynamic connectivity characteristics between the two brains. These methods together form the core technical framework of this research, providing the necessary image support for subsequent analysis based on the Vision Transformer (ViT) model.
[0081] S33: Based on the four-quadrant dual-brain connectivity matrix, channel replication and weighted transformation techniques are used to obtain dual-brain heat maps using coolwarm color matching;
[0082] Each element value in the four-quadrant dual-brain connectivity matrix obtained above is between [-1, 1]. In order to meet the subsequent color matching requirements, the matrix needs to be linearly transformed and normalized so that all element values in the matrix are between [0, 1].
[0083] S331: Normalize the elements in the four-quadrant dual-brain connectivity matrix to obtain the normalized four-quadrant dual-brain connectivity matrix, and normalize the element value N in the matrix N. ij The calculation formula is:
[0084] N ij =(M ij -M min ) / (M max -M min );
[0085] Among them, M ij is the element value of the i-th row and j-th column of the four-quadrant dual-brain connectivity matrix; M min is the minimum element value in the four-quadrant dual-brain connectivity matrix; M max is the maximum element value in the four-quadrant matrix.
[0086] S332: Perform coolwarm color matching on the normalized four-quadrant dual-brain connectivity matrix to obtain a grayscale image, including:
[0087] Determine the element value N at each position in the normalized four-quadrant dual-brain connectivity matrix ij ≤0.5; yes, the gray value V of the current element position ij =S l +α l ×N ij ×Q l ; No, the gray value V of the current element position ij =S n +α n ×N ij ×Q n。
[0088] Among them, S lis the basic cool color value; α l Q is the cool color coefficient; l The visual weight of blue tone; S n is the base warm color value; α n Q is the warm color coefficient; n Gives visual weight to the red hue;
[0089] Based on the grayscale values of all element positions, the grayscale value image corresponding to the normalized four-quadrant dual-brain connectivity matrix is obtained.
[0090] In this embodiment, when the matrix element value M ij When ≤0.5, it corresponds to the cool color zone, emphasizing the visual weight of blue tones; the gray value V ij =Basic cool color value (0.299) + cool color coefficient (0.699) × M ij × Blue tone visual weight (0.299);
[0091] When the matrix element value M ij When it is >0.5, it corresponds to the warm color area: emphasizes the visual weight of red tones; gray value V ij =Basic warm color value (0.587) + warm color coefficient (0.414) × M ij × Red hue visual weight (0.587).
[0092] S333: Perform channel duplication and weighted transformation on the grayscale image to generate a dual-brain heat map, including:
[0093] The grayscale image is copied into three RGB channels, and then each channel is weighted transformed to obtain the channel value T of each channel. The calculation formula is:
[0094] T=s+k×V ij +q×(V ij -0.5) 2 ;
[0095] Where s is the channel base offset; k is the channel slope; q is the channel curvature;
[0096] In this embodiment, the channel value T of the R channel Rij =0.230+1.540×V ij -0.500×(V ij -0.5) 2 ;
[0097] Channel value T of G channel Gij =0.299+0.704×V ij -1.968×(V ij -0.5) 2 ;
[0098] Channel value T of channel B Bij =0.754-0.508×V ij -1.430×(V ij -0.5) 2 .
[0099] The channel values of the three RGB channels are fused to generate a dual-brain heat map, such as Figure 2 and Figure 3 As shown, it is the dual brain heat map of the subjects with different interpersonal relationships in the embodiment of the present invention. Figure 2 This is a heat map of the two brains of the subjects who are not in a romantic relationship. Figure 3 This is a heat map of the two brains of the subjects in a romantic relationship. Figure 2 and Figure 3 The horizontal and vertical coordinates are channels, and the bar on the right represents the relationship between the color in the heat map and the corresponding EEG data.
[0100] Through channel replication and weighted transformation technology, the four-quadrant dual-brain connectivity matrix is expanded into a three-channel dual-brain heat map (similar to an RGB image), which enhances the visual expression ability of the features while retaining the correlation strength.
[0101] S4: Input the dual-brain heat map into the Vision Transformer model to obtain the predicted results of the interpersonal relationship between the two subjects;
[0102] To ensure compatibility with the standard input size of the Vision Transformer model and enable larger training scales, all dual-brain heatmaps were uniformly resized to 256×256 pixels. This process was achieved through bilinear interpolation, which not only preserved the distribution characteristics of the original connection strength but also met the computational requirements of the model.
[0103] The Vision Transformer model includes a sequentially connected block embedding network, a position encoding layer, an attention encoder, and a classification output module; the attention encoder is composed of multiple stacked Transformer encoder modules. Between two adjacent Transformer encoder modules, the output of the previous Transformer encoder module serves as the input of the next Transformer encoder module. Each Transformer encoder module includes a sequentially connected normalization layer, a multi-head attention layer, a normalization layer, and a feedforward network layer.
[0104] The block embedding network is used to evenly divide the dual-brain heat map into blocks and flatten them, and then map each flattened image block to obtain a block embedding sequence; the position encoding layer is used to positionally encode the block embedding sequence; the attention encoder is used to capture the complex dependencies between image blocks; the multi-head attention layer is used to capture the contextual relationships between image blocks; the feedforward network layer is used to further process the image block features; and the classification output layer is used to perform image classification prediction on the class embedding vector obtained after processing by several Transformer encoder modules.
[0105] In the block embedding network, the dual-brain heatmap is evenly divided into fixed-size image blocks. These local spatial regions are mapped into a D-dimensional embedding vector sequence through a linear projection layer. This process converts the two-dimensional structure of the original matrix into a one-dimensional serialized representation, providing basic features for subsequent processing.
[0106] For each dual-brain heat map, when performing image segmentation, the embodiment of the present invention sets the size of a segmented image block to 4×4, so each dual-brain heat map can be divided into 64×64=4096 image blocks.
[0107] To preserve the spatial position information of image patches, a learnable position encoding vector is added to each embedding vector. Furthermore, a trainable [CLS] classification token is explicitly inserted at the beginning of the sequence. This operation forms a complete input sequence that contains spatial structure information and global representation anchors, providing spatially aware input to the attention encoder.
[0108] In each Transformer encoder module of the attention encoder, input features are normalized and fed into a multi-head self-attention layer (typically 8-12 heads). This parallel attention mechanism captures global dependencies between sequence elements. The self-attention output is added to the original input features via a residual connection to achieve primary feature fusion. The fused features are then normalized using LayerNorm and fed into a feedforward network consisting of two fully connected layers with a GELU nonlinear activation. The output of this network is then fused again with the previous-level features via a residual connection. After this multi-layer stacking process, the feature vector of the [CLS] token aggregates the global high-order interaction information of the entire connection matrix, serving as the core representation for the classification task. The [CLS] token features are ultimately fed into the classification output module for image classification prediction.
[0109] Based on the global context features extracted by the attention encoder, a multi-layer perceptron (MLP) classification head is used for nonlinear mapping and probability calculation. The [CLS] token features are input into the MLP classification head (a fully connected layer with Dropout) to generate a two-dimensional probability distribution. At the same time, the Softmax function is used to generate the probabilities of each category, and the classification prediction results of the interpersonal relationship type (couple / non-couple) are output.
[0110] In this embodiment of the present invention, the core parameters of the Vision Transformer model are configured as follows:
[0111] Embedding dimension (embed_dim): 768, which determines the representation power of each feature vector.
[0112] Transformer depth: 12 Transformer encoder modules provide sufficient layer depth to capture complex patterns.
[0113] Number of attention heads (num_heads): 12, using a multi-head mechanism to achieve parallel attention to different feature subspaces.
[0114] MLP expansion ratio (mlp_ratio): 4.0, controls the capacity of the feedforward network to enhance nonlinear expression.
[0115] During the training of the Vision Transformer model, we designed a series of academic training and optimization strategies based on the unique data characteristics of the four-quadrant dual-brain connectivity matrix to improve model performance and ensure its applicability to neuroscience tasks:
[0116] Data augmentation and preprocessing:
[0117] The Random Resized Crop technique is applied to enhance the model’s sensitivity to connectivity matrix details by extracting local features at different scales.
[0118] Random Horizontal Flip is introduced to utilize the symmetry between brain regions to improve the robustness of the model to topological transformations.
[0119] Standardization is performed, and the mean and standard deviation are set to [0.5, 0.5, 0.5] respectively to unify the statistical distribution of the input data and reduce numerical instability during training.
[0120] Transfer learning framework:
[0121] A selective weight loading strategy was adopted to retain only the parameters related to feature extraction of the four-quadrant dual-brain connectivity matrix (connectivity matrix), while removing the task-irrelevant parts of the original classification head.
[0122] Set the parameter freezing mechanism (freeze_layers=True) to keep the pre-trained weights of the network unchanged and only fine-tune the classification head to fully utilize the feature extraction capabilities of the pre-trained model and reduce the risk of overfitting.
[0123] ;
[0124] in, Represents the frozen parameters, L is the loss function; t is the number of training iterations; the loss function L is the frozen parameters The partial differential of 0 means that the frozen parameters exist as constants in the loss function.
[0125] like Figure 4 As shown in the figure, the experimental results of the change of the predicted probability of each category with time period in an embodiment of the present invention are shown. Couple indicates that the two subjects are in a romantic relationship, and stranger indicates that the two subjects are not in a romantic relationship. The model achieved a classification accuracy of 95% in distinguishing between couples and non-couples, showing high prediction efficiency.
[0126] Example 2
[0127] like Figure 5 As shown, the present invention also provides an interpersonal relationship prediction system based on resting-state EEG neural synchronization to realize the above-mentioned interpersonal relationship prediction method based on resting-state EEG neural synchronization, including an EEG data acquisition module, an EEG data preprocessing module, a feature extraction module and a classification output module.
[0128] The EEG data acquisition module is used to synchronously collect the resting-state EEG data of both subjects within a set time, and use EEG electrode cap A and EEG electrode cap B to simultaneously collect original EEG signals, and then amplify the EEG signals through EEG signal amplifier A and EEG signal amplifier B respectively, and then convert the analog signals to digital signals through analog-to-digital converter A and analog-to-digital converter B to obtain synchronized EEG signals; the EEG data preprocessing module is used to preprocess the EEG data of both subjects and obtain the preprocessed EEG data of both subjects; the feature extraction module is used to extract features from the preprocessed EEG data of both subjects; the classification output module uses the extracted features to predict and output interpersonal relationships.
[0129] Of course, it will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, but also encompasses the same or similar structures that can be implemented in other specific forms without departing from the spirit or essential characteristics of the invention. Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the invention is defined by the appended claims, not the foregoing description, and it is intended that all variations that fall within the meaning and range of equivalents of the claims be encompassed within the present invention. Any reference signs in the claims should not be construed as limiting the claim to which they relate.
[0130] In addition, it should be understood that although this specification is described in terms of implementation methods, not every implementation method contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment can also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
[0131] The technology, shape, and structure not described in detail in the present invention are all well-known technologies.
Claims
1. A method for predicting interpersonal relationships based on resting-state EEG neural synchronization, characterized in that: include: S1: Use the EEG acquisition system to synchronously collect resting-state EEG data of both subjects within a set time; S2: Preprocessing the EEG data of both subjects to obtain the preprocessed EEG data of both subjects; S3: Construct a four-quadrant dual-brain connectivity matrix and dual-brain heat map based on the pre-processed EEG data of both subjects, including: S31: Based on the number of channels s1 of the EEG acquisition system, set an empty matrix with a dimension of 2s1×2s1, and divide the empty matrix into four quadrant matrices, with the matrix dimension of each quadrant being s1×s1; S32: performing EEG data correlation calculation on the EEG data of each channel after preprocessing of both subjects, obtaining the element values in each quadrant of the four-quadrant matrix, and obtaining the four-quadrant dual-brain connectivity matrix; The four-quadrant matrix includes an upper left quadrant matrix, a lower left quadrant matrix, an upper right quadrant matrix, and a lower right quadrant matrix; the upper left quadrant matrix is used to represent the EEG data correlation between the channels of subject 1, the lower right quadrant matrix is used to represent the EEG data correlation between the channels of subject 2, the lower left quadrant matrix is used to represent the EEG data correlation between the channels of subject 2 and the channels of subject 1, and the upper right quadrant is used to represent the EEG data correlation between the channels of subject 1 and the channels of subject 2; the element value in each quadrant matrix is the EEG data correlation between the two channels; S33: Perform element value-color mapping based on the four-quadrant dual-brain connectivity matrix to obtain the dual-brain heat map; S4: Input the dual-brain heat map into the Vision Transformer model to obtain the predicted results of the interpersonal relationship between the two subjects.
2. The interpersonal relationship prediction method based on resting-state EEG neural synchronization according to claim 1, characterized in that: Step S1 includes: S11: Set the channels, reference electrodes and sampling frequency of the EEG acquisition system; S12: Synchronously collect resting-state EEG data of both subjects within a set time; the EEG data includes time signal sequences of all channels.
3. The interpersonal relationship prediction method based on resting-state EEG neural synchronization according to claim 1, characterized in that: Step S2 includes: S21: bandpass filtering of the EEG data of both subjects; S22: Using the independent component analysis method to identify and remove artifacts in the EEG data of both subjects, and obtain the pre-processed EEG data of both subjects; the artifacts include artifacts caused by electrooculography and electromyography and artifacts caused by poor contact of electrodes in the EEG acquisition system.
4. The interpersonal relationship prediction method based on resting-state EEG neural synchronization according to claim 1, characterized in that: The calculation formula for the element value r(X,Y) in each quadrant matrix is: Where X and Y are the EEG data of the two channels respectively; cov(X,Y) is the covariance of the EEG data in the two channels; and are the standard deviations of the EEG data in the two channels, respectively.
5. The interpersonal relationship prediction method based on resting-state EEG neural synchronization according to claim 1, characterized in that: Step S33 includes: S331: normalizing the elements in the four-quadrant dual-brain connectivity matrix to obtain a normalized four-quadrant dual-brain connectivity matrix; S332: Perform coolwarm color matching on the normalized four-quadrant dual-brain connectivity matrix to obtain a grayscale value image; S333: Perform channel duplication and weighted transformation on the grayscale image to generate a dual-brain heat map.
6. The interpersonal relationship prediction method based on resting-state EEG neural synchronization according to claim 5, characterized in that: Step S332 includes: S3321: Determine the element value N of each position in the normalized four-quadrant dual-brain connectivity matrix ij ≤0.5; yes, the gray value V of the current element position ij =S l +α l ×N ij ×Q l ; No, the gray value V of the current element position ij =S n +α n ×N ij ×Q n ; Where i represents the i-th row of the normalized four-quadrant dual-brain connectivity matrix; j represents the j-th column of the normalized four-quadrant dual-brain connectivity matrix; S l is the basic cool color value; α l Q is the cool color coefficient; l The visual weight of blue tone; S n is the base warm color value; α n Q is the warm color coefficient; n Gives visual weight to the red hue; S3322: Based on the grayscale values of all element positions, obtain the grayscale value image corresponding to the normalized four-quadrant dual-brain connectivity matrix; Step S333 includes: S3331: Copy the grayscale image into three RGB channels, and then perform a weighted transformation on each channel to obtain the channel value T of each channel. The calculation formula is: T=s+k×V ij +q×(V ij -0.5) 2 Where s is the channel base offset; k is the channel slope; q is the channel curvature; S3332: Generate a dual-brain heat map based on the channel values of the RGB three channels.
7. The interpersonal relationship prediction method based on resting-state EEG neural synchronization according to claim 1, characterized in that: The Vision Transformer model includes a block embedding network, a position encoding layer, an attention encoder, and a classification output module connected in sequence; the attention encoder is composed of multiple stacked Transformer encoder modules. Between two adjacent Transformer encoder modules, the output of the previous Transformer encoder module serves as the input of the next Transformer encoder module. Each Transformer encoder module includes a standardization layer, a multi-head attention layer, a normalization layer, and a feedforward network layer connected in sequence.
8. The interpersonal relationship prediction method based on resting-state EEG neural synchronization according to claim 7, characterized in that: The block embedding network is used to evenly divide and flatten the dual-brain heat map, and then map each flattened image block to obtain a block embedding sequence; the position encoding layer is used to position encode the block embedding sequence; The attention encoder is used to capture the complex dependencies between image blocks; the multi-head attention layer is used to capture the contextual relationships between image blocks; the feedforward network layer is used to further process the image block features; and the classification output layer is used to perform image classification prediction on the class embedding vectors obtained after processing by several Transformer encoder modules.
9. A system for predicting interpersonal relationships based on resting-state EEG neural synchronization, characterized in that: To implement a method for predicting interpersonal relationships based on resting-state EEG neural synchronization as described in any one of claims 1 to 8, comprising an EEG data acquisition module, an EEG data preprocessing module, a feature extraction module, and a classification output module; the EEG data acquisition module is used to synchronously acquire resting-state EEG data of both subjects within a set time; the EEG data preprocessing module is used to preprocess the EEG data of both subjects to obtain preprocessed EEG data of both subjects; and the feature extraction module is used to extract features from the preprocessed EEG data of both subjects; The classification output module outputs interpersonal relationship prediction based on the extracted features.
Citation Information
Patent Citations
Integrating EEG and Blood Biomarkers using Deep Learning for Personalised and Explainable Meditation Impact Assessments
IN202521014492A
Apparatus and method for monitoring interpersonal interaction based on multiple neurophysiological signals
KR1020180099984A