Non-equilibrium cognitive load state detection method based on deep metric learning

By constructing balanced sample pairs and introducing a circular loss function, a deep metric learning method was developed to address the class imbalance problem in EEG data, thereby improving the accuracy and robustness of cognitive load detection, particularly its ability to identify minority class samples.

CN121765534APending Publication Date: 2026-03-31BEIJING UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511745294.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-26
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing EEG-based cognitive load detection methods suffer from insufficient minority class recognition performance and limited feature representation capabilities when processing imbalanced data. This is especially true in flight missions where the number of high-load samples is small, causing the model to overly favor the majority class samples and reduce its ability to recognize the minority class.

Method used

By employing a deep metric learning-based approach, we construct balanced sample pairs and introduce a circular loss function to explicitly enhance the similarity of samples of the same class and the discriminativeness of samples of different classes, thereby optimizing the feature space and enabling the model to more effectively distinguish between samples of different classes.

Benefits of technology

It significantly improves the classification accuracy and robustness of the model under complex task conditions, increases the recognition accuracy of minority class samples, and achieves high-precision and reliable recognition of cognitive load states.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121765534A_ABST
    Figure CN121765534A_ABST
Patent Text Reader

Abstract

The invention provides an unbalanced cognitive load state detection method based on deep metric learning. According to the method, a deep learning framework combining sample pair construction and feature space optimization is designed for the problem of unbalanced category distribution in electroencephalogram (EEG) cognitive load data. Firstly, a balance sample pair is constructed to relieve deviation of model training caused by proportional imbalance of high and low load categories. And then introducing circle loss into the deep metric learning framework, so that the model obtains more compact and distinguishable embedded representation in the feature space. And finally, the optimized feature extraction model is utilized to carry out classification identification on the test samples, and accurate detection of high and low cognitive load states is realized. According to the method, the recognition performance of the model under the unbalanced data is effectively improved, and an efficient and explainable detection means with practical application value is provided for the field of brain-computer interface and flight cognition monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention proposes a cognitive load state identification method based on physiological signals. Combining deep learning and metric learning techniques, it studies an effective method for detecting cognitive states during flight missions, addressing the performance bottleneck faced by unbalanced cognitive load data in training and detection. The method addresses the original unbalanced data distribution by designing and constructing balanced data pairs to mitigate the bias caused by class imbalance in model learning. Then, an improved metric learning framework is introduced, and the similarity loss function is optimized to simultaneously enhance the similarity representation between similar samples and the distinguishability between dissimilar samples, thereby significantly improving the model's discrimination and representation capabilities. Finally, the representation capabilities obtained by the optimized model are used to extract physiological signal features, providing support for subsequent cognitive load state detection and classification. This invention belongs to the interdisciplinary research field of physiological signal processing and computer science, specifically involving deep learning, metric learning, and related technologies. Background Technology

[0002] With the rapid development of artificial intelligence and signal processing technologies, brain-computer interfaces (BCIs) have become a hot research topic. BCIs acquire brain activity information through non-invasive or invasive signal acquisition methods and convert it into signals that can be processed by computers, thereby enabling direct human-computer interaction. Cognitive load detection based on electroencephalograms (EEGs) has received widespread attention.

[0003] Cognitive load is a crucial indicator describing the relationship between the psychological resources required by an individual during task execution and the actual available resources. As part of the human psychological state, accurate identification of cognitive load is essential for improving operational safety and task efficiency. For example, in scenarios such as air traffic control, driving, and medical monitoring, operators often need to maintain concentration under high-intensity tasks; both excessively high and low cognitive load can lead to operational errors and risks. Therefore, how to accurately detect and assess cognitive load has become a critical issue in brain-computer interfaces and intelligent human-computer interaction.

[0004] Currently, EEG-based cognitive load detection faces several challenges. The most significant is the often imbalanced class distribution of EEG data collected during flight missions; for example, the number of samples under low load conditions is far greater than those under high load conditions. This imbalanced data distribution leads to traditional classifiers being overly biased towards the majority class during training, thus reducing their ability to identify the minority class. Secondly, EEG signals themselves are characterized by high dimensionality, non-stationarity, and significant individual variability. Traditional feature extraction-based classification algorithms struggle to guarantee robustness and generalization in complex scenarios. Even with the introduction of deep learning models, directly using conventional classification loss functions such as cross-entropy for training often results in models only learning the dominant pattern of the overall distribution while neglecting the discriminative features of minority class samples, leading to a decline in classification performance.

[0005] To address the shortcomings of existing EEG signal cognitive load identification methods in handling imbalanced data, such as insufficient minority class recognition performance and limited feature representation capabilities, this invention proposes an improved training scheme based on metric learning. The core of metric learning lies in learning an appropriate feature space or similarity metric to make the distances between samples of the same class as close as possible, while maximizing the distances between samples of different classes, thereby improving the model's ability to distinguish features. This invention explicitly enhances the contrast relationship between the minority and majority classes during training by constructing balanced sample pairs or groups. Simultaneously, it introduces Circle Loss during training to finely optimize the similarity between samples at the feature level, enabling the model to more effectively distinguish samples of different classes. This method not only alleviates the impact of class imbalance on model performance but also significantly improves the discriminative power of EEG signal features and the robustness of the model, providing technical support for high-precision and reliable cognitive load state identification. Summary of the Invention

[0006] This invention differs from existing cognitive load detection methods based on EEG signals by proposing a cognitive load state recognition method that incorporates deep metric learning. Addressing issues such as imbalanced EEG signal category distribution and insufficient feature discrimination ability, this method utilizes sample pairing construction, improved loss function optimization, and deep representation learning to significantly enhance the model's classification accuracy and robustness under complex task conditions.

[0007] This invention first processes imbalanced cognitive load data to construct balanced sample pairs. By explicitly generating positive and negative sample pairs during the training phase, it effectively alleviates the problem of large differences in the number of samples from different cognitive load categories in the original data, ensuring a more balanced category distribution during training. Then, within a deep metric learning framework, circular loss is introduced, proposing an optimized training strategy based on metric learning and circular loss. This strategy simultaneously constrains intra-class compactness and inter-class separability in the feature space, making the representation of samples of the same class more concentrated and the distinction between samples of different classes more obvious, thereby enhancing the model's representational ability at the feature level and effectively improving the recognition accuracy of minority class samples. Finally, the optimized model is used to identify and detect cognitive load states in EEG signals. By extracting the metric-optimized EEG features and performing state discrimination during the classification phase, different cognitive load levels can be distinguished more accurately. The main process of this method is shown in the appendix. Figure 1 As shown, it can be divided into the following three steps: constructing sample pairs of unbalanced cognitive load data, optimizing training strategies based on metric learning and circular loss, and identifying cognitive load states.

[0008] Compared with existing EEG signal cognitive load identification methods, this invention has the following significant advantages and beneficial effects:

[0009] Compared to traditional EEG cognitive load identification methods that rely on manual features or conventional classifiers, this invention utilizes a deep metric learning framework combined with circular loss to construct a model, achieving effective processing of unbalanced cognitive load data and significantly improving the identification accuracy of minority class samples. During the training phase, by constructing balanced sample pairs, this invention alleviates the problem of large differences in the number of samples from different cognitive load categories in the original data, enabling the model to achieve good discriminative ability across all sample types.

[0010] This invention introduces circular loss into a deep metric learning model, simultaneously optimizing intra-class compactness and inter-class separability in the feature space. This makes features of similar samples more concentrated and features of dissimilar samples more dispersed, thereby significantly improving the model's feature representation ability and discrimination accuracy. Experiments demonstrate that this method effectively improves the accuracy and robustness of cognitive load state recognition on the EEG dataset, and can stably output reliable recognition results even under conditions of few samples or complex tasks.

[0011] This invention utilizes an optimized model to identify the cognitive load status of EEG signals in real time, enabling rapid and accurate judgment of the operator's current load status. This provides reliable support for real-time feedback in intelligent task control, attention monitoring, and brain-computer interface systems. Experimental results show that this method achieves high-precision identification on a self-built task dataset, significantly improving accuracy compared to traditional methods. Therefore, the method of this invention has significant application value, providing a practical and feasible technical means for efficient, accurate, and real-time cognitive load monitoring. Attached image description:

[0012] Figure 1 Flowchart of a method for detecting unbalanced cognitive load based on quantitative learning

[0013] Figure 2 Diagram of the process of constructing balance pairs from unbalanced samples

[0014] Figure 3 Extracting Sample Feature Model Diagram Detailed Implementation

[0015] Based on the above description, the following is a specific implementation process, but the scope of protection of this patent is not limited to this implementation process.

[0016] Step 1: Constructing Balanced Pairs of Unbalanced Cognitive Load Samples

[0017] This step addresses the issue of uneven distribution of EEG data samples obtained from pilot mission experiments between high-load and low-load classes by proposing a sample pair-based balancing construction method.

[0018] Step 1.1: EEG Data Acquisition and Preprocessing

[0019] Step 1.1.1: Data Acquisition Paradigm

[0020] This invention employs a simulated pilot mission as the experimental paradigm. By setting multi-dimensional mission complexity parameters (such as the number of enemy aircraft, enemy attack frequency, number of friendly aircraft, mission duration, and changes in flight speed), it gradually induces subjects into different levels of cognitive load. Under low-load mission conditions, the number of enemy aircraft is small, the enemy attack frequency is low, the number of friendly aircraft is large, and the flight speed is stable; subjects need to focus on fewer targets, and the operational difficulty is limited. Under high-load mission conditions, the number of enemy aircraft increases significantly, the attack frequency accelerates, the number of friendly aircraft decreases or interference factors increase, and flight speed and target switching become frequent. Subjects must allocate more attentional resources to complete the mission, thus generating a distinctly high-load state.

[0021] In the experimental procedure, subjects wore standard EEG acquisition equipment and completed tasks in a relatively quiet laboratory with controlled lighting and environmental conditions. The experiment employed a phased design, with each subject sequentially performing multiple flight mission scenarios of varying complexity, each lasting approximately 3–5 minutes. Rest intervals were provided between scenarios to avoid fatigue interfering with the results. The entire experimental process involved synchronous recording of raw EEG signals via the acquisition system.

[0022] Immediately after completing the task, participants filled out the NASA-TLX Subjective Workload Scale, which allows for self-assessment of perceived task workload across multiple dimensions (such as psychological needs, operational needs, time pressure, performance, effort, and frustration). Based on the weighted scores and the complexity of the task design, a threshold method was used to label the experimental data: task data with scores exceeding a preset threshold were defined as "high workload" samples, and task data with scores below the threshold were defined as "low workload" samples. To ensure that each participant had both high and low workload data in each trial, a score threshold of 6 was set.

[0023] Step 1.1.2: Data Preprocessing

[0024] The constructed dataset was derived from 9 healthy participants who completed a total of 11 full experiments. Each experiment consisted of 8–10 rounds of tasks, with different cognitive load states occurring in each round. This invention employs Leave-One-Out-Cross-Validation, where one round of task data from each participant is consistently selected as the test set, and the remaining rounds are used as the training set, ultimately yielding the results for each participant.

[0025] The original experimental data included 69 channels of EEG and multimodal physiological signals, with 60 valid EEG channels retained for analysis. The signal sampling rate was 500Hz. To address common noise and interference in EEG signals, this invention first applied a bandpass filter of 0.5–40Hz to effectively remove low-frequency drift and high-frequency power line interference, preserving frequency band characteristics related to cognitive processes. Then, a moving average reference (MAR) was used to reconstruct the signals across all channels, thereby reducing global bias caused by differences in electrode placement and improving the consistency and comparability of cross-channel signals.

[0026] To adapt the data to the input structure of the deep learning model, this invention performs sliding time window segmentation on the EEG data for each round of the task. Specifically, a non-overlapping sliding window strategy is used to generate continuous sample segments with a window length of 1 second (corresponding to 500 sampling points). After segmentation, each EEG sample has a dimension of (60×500), that is, a two-dimensional signal matrix containing 60 channels and 500 sampling points per channel. To reduce the computational overhead during training and improve iteration efficiency, this invention further downsamples the data, reducing the original 500Hz sampling rate to 250Hz, resulting in a final sample dimension of (60×250). This downsampling operation effectively reduces the amount of data and shortens the model training time while ensuring that key information is not lost.

[0027] Step 1.2: Construction of Balanced Sample Pairs

[0028] Each preprocessed EEG data sample corresponds to its cognitive load label. Among all samples, low-load samples significantly outnumber high-load samples, with a ratio of approximately 5:1. This class imbalance affects the feature representations learned by the model during training, leading to insufficient recognition of high-load samples and ultimately a low detection rate for high-load states. To address this problem, this invention proposes a sample pair-based reconstruction method that transforms the original imbalanced sample set into a balanced set of sample pairs, which are divided into two categories:

[0029] (1) Positive sample pairs: consisting of EEG fragments of the same category, including two combinations: "high load - high load" and "low load - low load", with the label set to 0;

[0030] (2) Negative sample pairs: composed of different types of EEG fragments, including two combinations: "high load - low load" and "low load - high load", with the label set to 1.

[0031] Each sample pair is composed of two EEG data segments concatenated, with dimensions of (2×60×250), where "2" represents the two EEG segments in the sample pair, "60" represents the number of effective EEG channels, and "250" represents the number of sampling points for each channel after downsampling. This invention ensures that the model can simultaneously receive and compare two EEG signals, thereby learning more discriminative intra-class similarity and inter-class differences in the feature space.

[0032] Step 2: Training strategy based on metric learning and circular loss optimization

[0033] In traditional end-to-end deep learning frameworks, due to the class imbalance problem, models often over-bias the majority class during training, leading to insufficient learning of the minority class, thus hindering further improvements in classification performance and recall. To overcome this problem, this invention proposes a training strategy based on metric learning and circular loss optimization.

[0034] Step 2.1: Sample Pair-Driven Metric Learning Mechanism

[0035] This invention proposes a sample-pair-driven metric learning mechanism to address the classification performance degradation caused by imbalanced class distribution of EEG cognitive load samples. This mechanism transforms the traditional single-sample classification task into a sample-pair-based similarity measurement problem, thereby explicitly constraining the feature distance relationship between similar and dissimilar samples during training. Step 1 achieves class balance and structural symmetry, enabling the model to simultaneously learn both intra-class compact and inter-class separated feature distributions during optimization. Each EEG sample input dimension is (60×250), i.e., 60 EEG channels, 250 sampling points, corresponding to a 1-second time window. During training, the model is input in the form of sample pairs, with an input batch dimension of (2×60×250), allowing the network to learn similarity measurement features between samples during optimization.

[0036] This invention employs an improved lightweight EEG feature extraction network, Sinc-ShallowNet, as the feature extractor to extract discriminative multidimensional spatiotemporal features from EEG signals. This network combines interpretable frequency-domain filters based on the Sinc function with shallow convolutional structures, preserving the physiological interpretability of EEG signals while significantly reducing the number of model parameters. Input samples first pass through a Sinc-based temporal convolutional layer containing 32 filters, a kernel length of 31, a sampling rate of 250Hz, and a frequency band set to 4–38Hz. This layer automatically learns the most discriminative spectral bandpass features, with an output dimension of approximately (32×60×220). Subsequently, a batch normalization layer standardizes the channel outputs, making model training more stable. The model then extracts spatial coordination patterns between different brain regions through a spatial convolutional layer. This layer has a kernel size of (60×1), and the depthwise separable convolution method allows each channel group to extract features independently, resulting in 64 output channels and an output dimension of (64×1×220). Next, the non-linear expressive power of the features is enhanced by the ELU activation function, and temporal downsampling is performed through an average pooling layer with a pooling window size of (1×57) and a stride of (1×11), compressing the time dimension to approximately 15 steps and resulting in an output dimension of (64×1×15). A Dropout layer (with a dropout rate of 0.5) is then introduced to prevent overfitting and enhance feature stability. Finally, the flattened features are input into a fully connected layer, generating a high-dimensional feature vector for similarity measurement, rather than a classification result, with an output dimension of (1×1000).

[0037] This invention uses sample pairs as inputs to a feature extractor with shared weights during the training phase. After extracting their respective feature vectors, the similarity between sample pairs is compared in the feature space by calculating cosine similarity. The model is optimized using a corresponding loss function to minimize the feature vector distance between similar sample pairs and maximize the distance between dissimilar sample pairs, thereby automatically constructing a discriminative embedding space during training. This sample pair-driven metric learning mechanism effectively improves the separability and robustness of EEG cognitive load features, maintaining a high detection rate and overall recognition accuracy even when facing imbalanced class data.

[0038] Step 2.2: Feature space optimization by introducing circular loss

[0039] This invention employs a circular loss-based optimization strategy, addressing the issue of limited optimization strategies in commonly used cosine similarity loss functions and their variants. Circular loss introduces an adjustable similarity boundary parameter to differentiate the optimization intensity for positive and negative sample pairs. This strategy operates on the feature vectors of EEG sample pairs extracted by the network in step 2.1, significantly improving the model's ability to discriminate against imbalanced cognitive load data by finely controlling the similarity relationships in the feature space.

[0040] In this invention, a sample pair x refers to an EEG data pair with dimensions (2×60×250), constructed in step 1.2, and labeled as either a positive sample pair (label 0) or a negative sample pair (label 1). Each sample pair, after being processed by the feature extraction network, outputs two high-dimensional feature vectors, and the cosine similarity between them is denoted as the similarity score s. For all sample pairs x, the similarity scores of samples of the same class are obtained. Similarity score with outlier samples The superscripts i and j are used to index multiple samples. To minimize... Simultaneously maximize The circular loss function expression adopted in this invention is as follows:

[0041]

[0042] The scaling factor γ in this function controls the sensitivity of the loss function to similarity deviations. A larger value indicates a stronger response to small differences in similarity. In this invention, this value is set to 70.0 to achieve a balance between optimization intensity and training stability. The boundary relaxation factor m is another key hyperparameter, defining the ideal boundaries of intra-class and inter-class similarity desired by the model. The intra-class similarity target threshold Δp is set to 1-m, meaning we want the similarity of positive sample pairs (i.e., EEG samples of the same cognitive load state) to be higher than this threshold; the inter-class similarity target threshold Δn is set to m, meaning we want the similarity of negative sample pairs (i.e., EEG samples of different cognitive load states) to be lower than this threshold. In this invention, m is set to 0.3, where the model is optimized to make the similarity of similar EEG sample pairs higher than 0.7, and the similarity of dissimilar sample pairs lower than 0.3. The most distinctive feature of this invention is the introduction of an adaptive weighting factor. and These two factors are not fixed, but dynamically depend on the current similarity score and their respective optimal points O. p and O n The distance between O and O. p Set to 1+m (i.e., 1.3), representing the ideal target for similarity among samples of the same class; O n The weighting factor is set to -m (i.e., -0.3), representing the ideal target for the similarity between dissimilar samples. The weighting factor is calculated as follows:

[0043]

[0044] in[·] + This indicates truncation at 0, ensuring and Both are non-negative numbers. Previously, the loss function had the same weight for similarity scores. Circular loss uses these two weights for adaptive weighting, making optimization more flexible. In the circular loss formula, Δp and Δn are the "passing grades" the model must achieve, while O... p and O n This is the "perfect score target" that the model strives for. The further the current similarity is from the "perfect score target," the larger its corresponding weighting factor becomes, and the higher the weight of that sample pair in the loss function, thus resulting in more powerful optimization of the model. This mechanism allows sample pairs whose current similarity is far from their ideal target (i.e., "hard examples" that are difficult to distinguish) to receive more attention during training, thereby achieving fine-grained control of the feature space.

[0045] Circular loss addresses the limitation of cosine similarity in treating positive and negative sample pairs equally. It assigns greater optimization weights to samples with similarity close to the boundary (difficult examples), significantly enhancing the ability to distinguish difficult examples. Furthermore, it strengthens the learning ability for minority classes or difficult examples through weighted methods. By using circular loss, it can more effectively separate dissimilar sample pairs and aggregate similar sample pairs, ensuring that the model can better extract more unique features of positive and negative classes. This improves the model's adaptability to imbalanced data, reducing the burden on the classifier and allowing the use of downsampled balanced data for classification, thereby improving the recall metric for recognizing cognitive states.

[0046] Step 3: Identification and Assessment of Cognitive Load

[0047] After completing the training of the model based on metric learning and circular loss optimization according to this invention, the model can effectively distinguish between high and low cognitive load samples at the feature level, achieving more discriminative EEG signal feature extraction. This step utilizes the trained feature extraction model to classify and identify test set samples, and comprehensively evaluates the model's detection performance in conjunction with performance indicators, thereby verifying the effectiveness and robustness of the method of this invention.

[0048] Step 3.1: Feature Extraction and Classification Based on Deep Learning Model

[0049] This invention uses a metric-learning optimized encoder as the feature extraction network to extract high-level features from input EEG signal samples. The original dimension of the input sample is (60×250), corresponding to 60 EEG channels and 250 sampling points. The signal first undergoes layer-by-layer feature transformation and spatial compression through a multi-layer convolutional structure of the feature extractor to extract high-dimensional representation vectors that can characterize different cognitive load states. The extracted feature vector has a dimension of F1×D×L, where F1=32 represents the number of output channels of the first convolutional layer, D=2 is the depth multiplication factor, and L=15 is the feature length after temporal pooling. This feature vector is input into a linear classification layer for classification calculation. The structure of the classification layer is nn.Linear(F1×D×L,nClass), where nClass=2, corresponding to the two cognitive states of "high load" and "low load".

[0050] In the inference process of this invention, the model adopts a parameter-freezing mode (i.e., gradient updates are disabled) to ensure stability during the testing phase. A single EEG sample is mapped by the model and outputs predicted values ​​for two categories. The model then outputs the final cognitive load state determination result based on the magnitude of the category response value. Through this decoupled structural design, the model significantly improves the recognition accuracy and generalization performance of high-load samples while maintaining feature discriminativeness.

[0051] Step 3.2: Identify performance evaluation metrics

[0052] To quantitatively evaluate the model's performance in the cognitive load state recognition task, this invention uses recall as the primary evaluation metric. Recall reflects the model's ability to detect high-load samples and is defined as:

[0053]

[0054] Where TP represents the number of samples correctly identified as high-load, and FN represents the number of samples that were actually high-load but were misclassified as low-load. A higher recall rate means that the model can more accurately identify high-load states under complex task conditions, thus possessing greater application value in scenarios such as flight monitoring and fatigue warning. To further verify the model's overall performance, this invention also references accuracy metrics to comprehensively analyze the model's balanced performance across different categories of samples.

[0055] Experimental results show that, compared with the baseline model that did not employ metric learning optimization, the method of this invention improves the overall recognition accuracy by approximately 0.8% and the recall rate of high-load samples by 1.1%. This result demonstrates that the present invention can effectively enhance the model's sensitivity to high-load cognitive states while ensuring the overall performance stability of the model, thus verifying the practical value of the proposed optimization strategy.

Claims

1. A method for detecting unbalanced cognitive load states based on deep metric learning, characterized in that: For the EEG data collected during the flight mission experiment, signal preprocessing was first performed, including bandpass filtering of 0.5–40 Hz to remove low-frequency drift and high-frequency noise, channel re-reference using moving average reference (MAR) to reduce electrode bias, and window segmentation with a 1-second sliding time window and a 250 Hz sampling rate to generate EEG segments containing 60 effective channels. In the sample construction stage, a balanced sample pair set was generated based on high and low cognitive load labels. Positive sample pairs consisted of segments of the same type, i.e., high-high or low-low, while negative sample pairs consisted of segments of different types, i.e., high-low or low-high. The labels were set to 0 and 1, respectively, to achieve a balanced representation of the unbalanced data. The constructed sample-shared input weight deep feature extraction network Sinc-ShallowNet independently extracts high-dimensional feature vectors for each EEG segment, and measures the similarity between samples by calculating the cosine similarity between the two; in the loss design, circular loss is introduced to dynamically allocate positive and negative sample weights according to the optimization state of the samples; The optimized and trained model is applied to cognitive load state recognition. The high-dimensional feature vectors output by the feature extractor are used to perform classification calculations through a linear classification layer to output prediction results of high or low load. The recall rate is used as a performance indicator to evaluate the detection accuracy of the model in high load sample recognition, thereby realizing the detection and real-time recognition of the cognitive load state of pilots.

2. The detection method according to claim 1, characterized in that: Step 1: Constructing Balanced Pairs of Unbalanced Cognitive Load Samples Step 1.1: EEG Data Acquisition and Preprocessing Multi-channel EEG signals were acquired at a sampling rate of 500Hz. During the acquisition process, the raw potential changes of each channel were recorded synchronously and saved as a continuous signal sequence. The acquired raw signals were first downsampled, with the sampling rate reduced from 500Hz to 250Hz to reduce the amount of data and improve the training and inference efficiency of the subsequent model. The downsampled signals were then input to a 0.5–40Hz bandpass filter module, where digital filters were used to remove low-frequency drift and high-frequency noise components, while retaining frequency band features closely related to cognitive activities. The filtered signal is subjected to channel rereference operation through the moving average reference (MAR) algorithm to calculate the average potential of each channel and recalibrate the reference baseline to reduce the bias effect caused by the difference in electrode layout. The reconstructed signal is divided into fixed-length segments in chronological order. The sliding window length is 1 second, the step size is 1 second, and continuous segments are generated in a non-overlapping sliding manner. The dimension of each sample segment is (60×250), where 60 represents the number of effective EEG channels and 250 represents the number of sampling points per channel. The resulting signal segments constitute a structured EEG dataset, which is used for the input and training of subsequent deep learning networks. Step 1.2: Construction of Balanced Sample Pairs Signal segments under high and low load conditions are randomly selected from the original EEG dataset, and positive and negative sample pairs are generated according to a preset ratio. Positive sample pairs consist of EEG segments of the same category, while negative sample pairs are formed by combining segments of different categories. During sample pairing, the number of sample pairs in both classes is kept consistent to ensure a balanced distribution of training data at the class level. The input dimension of each sample pair is set to (2×60×250), where "2" indicates that the sample pair contains two EEG signal segments, "60" indicates the number of effective channels, and "250" indicates the number of sampling points per channel. In the data loading stage, a label matching and dynamic pairing mechanism is adopted to automatically generate a sample pair list based on the sample labels, making the combination coverage of samples from different classes more uniform. The final sample pair input structure enables the network to receive two EEG signals simultaneously during training and extract intra-class similarity and inter-class difference features in the feature space through metric learning.

3. The detection method according to claim 1, characterized in that: Step 2: Training strategy based on metric learning and circular loss optimization Step 2.1: Sample Pair-Driven Metric Learning Mechanism The preprocessed EEG signal sample pairs are sequentially fed into a Sinc-ShallowNet-based feature extraction network for feature computation. First, a temporal convolutional layer based on the Sinc function extracts filtered features within the 4–38 Hz frequency band, with a kernel length of 31 and 32 filters. Then, a batch normalization layer standardizes the channel outputs to stabilize the feature distribution and facilitate subsequent activation operations. The standardized features are then input into a spatial convolutional layer with a kernel size of (60×1) to extract spatially relevant features across different brain regions. Finally, the ELU activation function enhances the nonlinear expression of the features. The network continues to undergo temporal downsampling through average pooling layers, with a pooling window size of (1×57) and a stride of (1×11), reducing the temporal dimension while preserving the main temporal information. Then, a Dropout layer is added with a dropout rate of 0.

5. After processing by the above layer structure, the feature map is flattened and input into a fully connected layer, with an output dimension of (1×1000), forming a high-dimensional embedded feature vector for the sample pair. During the training phase, two EEG segments are input into a Sinc-ShallowNet module with shared weights to extract features, and then a cosine similarity calculation module is used to obtain similarity scores, which are used for metric learning optimization and subsequent circular loss calculation. Step 2.2: Feature space optimization by introducing circular loss Circular loss is used to optimize the feature space during the learning phase. By weighting the similarity of positive and negative samples, the similarity of samples within a class gradually approaches 1, and the similarity of samples between classes approaches 0, thus forming clear class boundaries in the embedding space. When the similarity of a sample deviates from the ideal range, the loss function adaptively increases the optimization weight of that sample to enhance the model's ability to distinguish difficult samples. Adjustable hyperparameters α and m are introduced into the loss function to control the boundary radius and relaxation factor of the loss function.

4. The detection method according to claim 1, characterized in that: Step 3: Identification and Assessment of Cognitive Load Step 3.1: Feature Extraction and Classification Based on Deep Learning Model EEG signal samples with an original dimension of 60×250 (where 60 is the number of EEG channels and 250 is the number of sampling points) are input into a feature extraction model optimized by metric learning. The network structure is used to perform layer-by-layer feature transformation and spatial compression on the input samples to extract high-dimensional representation vectors that can characterize different cognitive load states. After processing by the network structure, the generated high-dimensional feature vector has a dimension of F1×D×L, where F1=32 represents the number of output channels of the first convolution layer, D=2 is the depth multiplication factor, and L=15 is the feature length after temporal pooling. The feature vector is then input into a linear classifier with the structure nn.Linear(F1×D×L,nclass), where nclass=2, corresponding to high-load cognitive states and low-load cognitive states, respectively, to classify the cognitive load of the input samples. Step 3.2: Identify performance evaluation metrics In the model performance evaluation phase, recall is used as the primary evaluation metric. Recall measures the model's ability to detect high-load samples and is defined as follows: Where TP represents the number of samples correctly identified as high-load, and FN represents the number of high-load samples misclassified as low-load.