Computer system based on a quantified pain model
By employing a parallel processing architecture combining local temporal and cross-domain global pathways, and integrating multi-scale convolution and wavelet transform, deep fusion of time-frequency domain features in EEG signals is achieved. This addresses the problem of insufficient integration of time-domain and frequency-domain features in existing technologies, thereby improving the stability and generalization ability of pain assessment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG UNIV OF TECH
- Filing Date
- 2026-05-08
- Publication Date
- 2026-07-14
AI Technical Summary
Existing technologies struggle to effectively integrate time-domain and frequency-domain features in EEG pain assessment, resulting in insufficient measurement stability and generalization ability, with significant performance fluctuations, especially among different pain types and individuals.
A parallel processing architecture of local temporal pathways and cross-domain global pathways is adopted. Temporal features are extracted through multi-scale convolution and sliding window temporal modeling, frequency domain features are extracted by combining wavelet transform and attention mechanism, and deep fusion of time and frequency domain features is achieved through cross-domain interactive encoder.
It achieves high-precision and robust quantification of pain status, reduces reliance on individual baseline tests, is suitable for rapid clinical screening and home dynamic monitoring, and is easy to deploy on embedded devices.
Smart Images

Figure CN122133091B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a computer system based on a quantitative pain model. Background Technology
[0002] Pain, as a complex subjective experience, has long been a challenge to objectively quantify in clinical medicine and neuroengineering. Currently, the widely used "gold standard" for pain assessment in clinical practice relies primarily on patient self-reports, such as the Visual Analogue Scale (VAS) and the Numerical Rating Scale (NRS). However, these subjective assessment methods have significant limitations: firstly, they are completely ineffective for groups unable to communicate effectively, such as infants, comatose patients, and those with cognitive impairments; secondly, even for patients who can express themselves, assessment results are easily influenced by individual psychological state, cultural background, emotional factors, and social expectations, leading to a lack of objectivity, repeatability, and cross-individual comparability. Therefore, developing an objective and quantifiable pain assessment technique based on physiological signals has become an urgent need in clinical medicine and precision medicine.
[0003] Among numerous physiological signals, electroencephalography (EEG) is considered an ideal signal source for objectively quantifying pain due to its advantages such as millisecond-level temporal resolution, direct reflection of cortical neural electrical activity, and relatively portable acquisition equipment. Current technology shows that painful stimuli cause characteristic energy redistribution and oscillation pattern changes in EEG signals across multiple frequency bands. This provides a theoretical basis for decoding pain states through EEG signal analysis.
[0004] Regarding the objective quantification of pain based on electroencephalography (EEG), existing technologies mainly follow two technical paths. The first path is based on traditional signal processing and machine learning methods. These methods typically preprocess the raw EEG signal and then manually extract time-domain, frequency-domain, or time-frequency-domain features using time-frequency analysis techniques such as wavelet transform and power spectral density estimation. These features include power values, entropy characteristics, or amplitude and latency of event-related potential components at specific frequency bands. Subsequently, these manually designed features are input into traditional classifiers such as support vector machines (SVMs) and random forests for pain state identification or intensity regression. The advantage of this approach is that the features have clear physiological interpretations, but its performance is highly dependent on the prior knowledge of experts and a deep understanding of signal characteristics. The extracted features often only reflect the superficial statistical properties of the signal, making it difficult to capture the high-order nonlinear dynamics and complex spatiotemporal evolution patterns involved in the processing of pain information in the cerebral cortex. Therefore, the generalization ability of this approach is generally poor; its recognition performance often fluctuates significantly among different subjects and experimental paradigms, making it difficult to construct a stable and universal pain measurement model.
[0005] The second approach is the end-to-end neural network-based method, which has emerged with the development of deep learning technology. This type of method aims to avoid tedious and experience-dependent manual feature engineering by building models such as deep convolutional neural networks (CNNs), recurrent neural networks (RNNs), or Transformers to automatically learn deep feature representations related to pain directly from raw EEG signals or their simple transformations. For example, multi-band CNNs are used to assess cold pain, and CNNs are used to detect chronic back pain from scalp EEG. Deep learning methods have demonstrated a powerful ability to model complex nonlinear relationships, improving the decoding performance of pain states to some extent. However, most existing deep learning models employ a single dataflow processing architecture, and their receptive fields are typically fixed or limited. Pain-related EEG activity simultaneously includes transient high-frequency responses and sustained low-frequency oscillations. This multi-scale characteristic makes it difficult for single-architecture models to effectively capture both rapid transient components and slow rhythmic components. Furthermore, the time-domain waveform and frequency-domain spectrum of EEG signals are essentially projections of the same physiological process onto different mathematical spaces, and there is an inherent and tightly coupled physical connection between the two. However, some existing hybrid models, while attempting to utilize both time-domain and frequency-domain information simultaneously, typically extract time-domain and frequency-domain features using separate sub-network branches, fusing them only at the final layer of the network through simple feature vector concatenation or weighted summation. For example, the GLEAM framework combines graph learning with wavelet features, the ARCNN model combines an autoregressive model with a CNN, and WCNN-LSTM cascades a wavelet CNN with an LSTM network. This "loosely coupled" design strategy essentially treats time-domain and frequency-domain information as independent feature sources, failing to explicitly model and utilize the deep cross-domain interactions and consistency between them. This information fusion method is insufficient, leading to redundancy or missing information in the learned feature representations, limiting the model's final discriminative ability and robustness. Recent system reviews further point out that both traditional methods and existing deep learning models still exhibit significant deficiencies in measurement stability and generalization ability when facing different pain paradigms, such as chronic pain and experimental pain.
[0006] In summary, both traditional feature engineering-based methods and existing deep learning architectures face significant technical bottlenecks in achieving high-precision, robust, and cross-individual generalization of objective pain quantification. The core issue lies in the failure to effectively and synergistically integrate the multi-scale temporal dynamics and global frequency domain patterns inherent in EEG signals, particularly neglecting the inherent, non-linear coupling between temporal and frequency domain features. This results in severely inadequate measurement stability and universality when dealing with the inherent non-stationarity, high noise levels, and significant data distribution differences arising from different pain types in EEG signals.
[0007] Therefore, there is an urgent need for a completely new model that can fundamentally overcome the above limitations and achieve stable, reliable and generalizable objective pain measurement through a tightly coupled computational framework that can deeply explore the interaction between the time and frequency domains. Summary of the Invention
[0008] The purpose of this disclosure is to provide a computer system based on a quantitative pain model to at least solve one technical problem in the prior art.
[0009] The technical solution disclosed herein is:
[0010] A computer system based on a quantitative pain model, comprising:
[0011] The preprocessing module is used to preprocess the input raw EEG signal to obtain a preprocessed enhanced signal;
[0012] The local temporal feature extraction module interacts with the preprocessing module to input the preprocessed enhanced signal into the local temporal pathway. Through multi-scale spatiotemporal convolution and sliding window temporal convolution, it extracts pain-related temporal feature sequences and outputs global temporal features.
[0013] The cross-domain global frequency domain feature extraction module interacts with the preprocessing module to input the preprocessed enhanced signal into the cross-domain global path, perform multi-band decomposition through discrete wavelet transform, and obtain a frequency domain feature sequence containing frequency domain physiological information and spatial domain function through multi-scale wavelet dual attention and spectral-spatial convolution coding.
[0014] The cross-domain interactive fusion module interacts with the local time-domain feature extraction module and the cross-domain global frequency-domain feature extraction module respectively, and is used to input the time-series feature sequence and frequency-domain feature sequence into the wavelet time interactive coding module for cross-domain deep interactive fusion to obtain global cross-domain features.
[0015] The feature fusion module interacts with the cross-domain interaction fusion module to fuse the global temporal features and the global cross-domain features to obtain classification features;
[0016] The classification output module interacts with the feature fusion module to input the classification features into the classifier and output an objective quantitative result of the pain state.
[0017] The preprocessing module is specifically used for:
[0018] Acquire the raw EEG signals;
[0019] Divide any segment of the original EEG signal evenly along the time axis into at least two sub-segments;
[0020] Randomly select segments from different samples of the same category and recombine them to obtain enhanced new samples;
[0021] Gaussian noise is added to the new sample to simulate real-world environmental interference, resulting in a preprocessed enhanced signal.
[0022] The local temporal feature extraction module is specifically used for:
[0023] The preprocessed enhanced signal is input into the multi-scale spatiotemporal convolution module to obtain the feature sequences output by each convolution branch, and then concatenated to obtain the concatenated features.
[0024] The feature sequences are weighted and fused using a channel attention mechanism module to dynamically calibrate the contribution of each convolutional branch and obtain the weighted features of each convolutional branch.
[0025] The spatiotemporal feature refinement module aggregates any of the weighted features into an abstract spatiotemporal representation;
[0026] The feature sequence is divided into N overlapping time windows using a sliding window temporal coding module.
[0027] The feature slices within each time window are individually fed into a dilated causal convolutional network for feature encoding to obtain the window feature vector;
[0028] The window attention fusion module stacks a preset number of window feature vectors to form feature blocks, which serve as global temporal features related to pain.
[0029] The preprocessed and enhanced signal is input into a multi-scale spatiotemporal convolution module to obtain the feature sequences output by each convolution branch, including:
[0030] The multi-scale spatiotemporal convolution module includes three parallel temporal convolutional layers. Each branch uses convolutional kernels of different scales to capture instantaneous high-frequency fluctuations with smaller kernels and capture non-instantaneous low-frequency fluctuations with larger kernels.
[0031] The preprocessed enhanced signal After being decomposed into multi-scale representations by the multi-scale spatiotemporal convolution module, the representations are then concatenated; wherein, This represents the number of electrode channels. For time points;
[0032] In the The operations of preprocessing the enhanced signal and the convolution kernel in each branch are represented as follows: ;
[0033] in, Let be the kernel size of the i-th branch; For the first The output of each branch.
[0034] The step of using a channel attention mechanism module to perform weighted fusion of the feature sequences, dynamically calibrating the contribution of each convolutional branch, and obtaining the weighted features of each convolutional branch includes:
[0035] The channel attention mechanism module uses global average pooling to process the concatenated features. Compressed into a channel descriptor; then via two The bottleneck structure of the convolutional layer is handled to map the non-linear dependencies between features and generate attention weights. , represented as: ;
[0036] in, For the Sigmoid function, For ELU activation function; For the features after splicing Channel descriptors obtained by global average pooling; The first in the bottleneck structure Convolutional layers are used to perform channel mapping and non-linear dependency modeling on the channel descriptors; The second in the bottleneck structure Convolutional layers are used to generate attention weights for each channel.
[0037] The dilated causal convolution operation is defined as follows: ;
[0038] in, It is the expansion factor. The kernel size is [size]. x represents the current time point; x represents the input time series. For the convolution kernel in the th Filter coefficients at each position;
[0039] The global temporal features , represented as:
[0040] ;
[0041] in, For the first Features of each window For its corresponding attention weight, This represents the total number of windows.
[0042] The cross-domain global frequency domain feature extraction module is specifically used for:
[0043] The preprocessed enhanced signal Frequency domain decomposition is performed using a discrete wavelet transform module to obtain the frequency band energy map; among which... This represents the number of electrode channels. For time points;
[0044] The frequency band energy map is processed by a dual attention mechanism module to obtain a calibrated frequency domain feature map;
[0045] The calibrated frequency domain feature map is input into the spectral-spatial multi-branch convolutional coding module to obtain a frequency domain feature sequence containing frequency domain physiological information and spatial domain function.
[0046] The cross-domain interaction and fusion module is specifically used for:
[0047] The temporal feature sequence output by the multi-scale spatiotemporal convolution module in the local temporal path is concatenated with the frequency domain feature sequence extracted from the cross-domain global path to obtain a cross-domain hybrid feature sequence.
[0048] The hybrid feature sequence is input into the Transformer encoder for processing to obtain global cross-domain features containing global cross-domain context information.
[0049] Output temporal feature sequences using multi-scale spatiotemporal convolution in the local temporal pathway , and the frequency domain feature sequences extracted from the cross-domain global pathway Forming cross-domain hybrid feature sequences : ;
[0050] in, The length of the time series feature. The length of the frequency domain feature. The dimension of the feature vector;
[0051] The hybrid feature sequence is input into the Transformer encoder, and global average pooling is used to obtain a cross-domain feature vector containing global cross-domain context information. The multi-head self-attention mechanism in the Transformer encoder is represented as follows: ;
[0052] Where Q is the query matrix; K is the key matrix; V is the value matrix; and T represents the matrix transpose. is the dimension of the key vector.
[0053] The feature fusion module and the classification output module are configured as follows:
[0054] Global temporal characteristics of local time domain path output Global cross-domain features of cross-domain global path output The classification features are obtained by fusing them through residual connections. ;
[0055] ;
[0056] Classification features Input a fully connected classifier and output the final pain state classification probability through a Softmax function. : ; in, and These are the learnable parameters of the classifier.
[0057] The beneficial effects of this disclosure include at least the following:
[0058] The computer system based on a quantified pain model disclosed herein addresses the problem that existing single-path deep learning models struggle to simultaneously capture temporal details (such as transient evoked potentials) and frequency rhythms (such as sustained oscillatory activity) when processing non-stationary, low signal-to-noise ratio EEG signals. It proposes a dual-parallel processing architecture of a "local temporal pathway" and a "cross-domain global pathway." The former accurately captures pain-related transient and evolutionary temporal features through multi-scale convolution and sliding window temporal modeling; the latter explicitly extracts frequency-domain oscillation energy closely related to the physiological mechanisms of pain through wavelet transform and attention mechanisms. These two pathways are deeply fused through a unique "cross-domain interactive encoder," achieving complementarity and enhancement of temporal and frequency-domain features. Furthermore, the model disclosed herein can significantly reduce or even eliminate the reliance on subjective calibration for individual baseline tests in practical clinical applications, better meeting the needs of rapid clinical screening or home-based dynamic monitoring. It effectively controls computational scale while maintaining high-precision classification, and compared to large Transformer models, it is easier to deploy lightweight and perform real-time inference on embedded devices or mobile medical terminals, demonstrating significant practical value. Attached Figure Description
[0059] Figure 1 This is a flowchart illustrating the overall architecture of the computer system described in this disclosure;
[0060] Figure 2 A diagram of a multi-scale spatiotemporal convolution module;
[0061] Figure 3 Diagram of the sliding window temporal convolution module;
[0062] Figure 4 A diagram of a multi-scale wavelet dual attention module;
[0063] Figure 5 Diagram of wavelet time-interactive coding module;
[0064] Figure 6This is a distribution diagram of the frequency band channel attention weights for a multi-scale wavelet dual attention module.
[0065] Figure 7 The channel attention weight distribution of the electrode channels in the multi-scale wavelet dual attention module;
[0066] Figure 8 This is a diagram showing the attention weight distribution of the wavelet time interactive coding module. Detailed Implementation
[0067] The technical solution of this disclosure will be further described below with reference to the accompanying drawings.
[0068] This disclosure aims to provide a novel computer system with an objective pain quantification model based on electroencephalogram (EEG) signals. By constructing a tightly coupled, collaboratively interactive deep neural network architecture, it overcomes the technical bottlenecks of insufficient fusion of time-domain and frequency-domain information and inadequate capture of multi-scale features in existing technologies, thereby achieving high-precision, high-robustness, and stable quantitative assessment of pain states across individuals and pain paradigms.
[0069] Specifically, addressing the "loosely coupled" design problem commonly found in existing hybrid models, this disclosure aims to provide a novel dual-stream collaborative network architecture. This architecture not only includes independent local temporal paths and cross-domain global paths to capture the fine-grained temporal dynamics of the original EEG signals and the physiological oscillation features based on wavelet transform, but more importantly, it introduces an attention-based interactive coding module to achieve dynamic alignment and complementary fusion of temporal and frequency domain features in the deep network. This fully explores the intrinsic physical connections between the time and frequency domains, improving the consistency of feature representations.
[0070] To address the issue of fixed receptive fields and difficulty in capturing both transient and sustained oscillatory components in single-architecture models, this disclosure constructs a multi-scale feature extraction mechanism. In the time domain, a hierarchical convolutional design is employed to capture dynamics at different time scales, ranging from millisecond-level transients to second-level trends. In the frequency domain, the multi-resolution characteristics of discrete wavelet transform are utilized to adaptively analyze rhythmic activity across different frequency bands. Simultaneously, a multi-scale wavelet dual attention mechanism is designed to dynamically calibrate the importance of different EEG channels and key frequency bands in pain representation, enhancing the model's sensitivity to key physiological biomarkers.
[0071] To address the issue of significant performance fluctuations in existing technologies across different subjects and pain types, such as chronic pathological pain and acute experimental pain, this disclosure aims to learn more discriminative and robust cross-individual shared feature representations through the aforementioned deeply coupled architecture design. A rigorous leave-one-out cross-validation paradigm is employed to train and evaluate the model on multiple independent datasets containing different pain mechanisms, thereby validating the model's stable classification performance on untested subjects. This will advance the development of an objective pain measurement tool that requires no individual calibration and possesses clinical universality.
[0072] Enhancing measurement stability in low signal-to-noise ratio and non-stationary EEG signal environments: Addressing the inherent noise interference and non-stationarity of EEG signals, this disclosure enhances the model's ability to focus on effective pain-related information and suppresses interference from noise and irrelevant physiological activities through cross-domain feature interaction and attention weighting mechanisms. By co-validating and complementing time-domain and frequency-domain features, the robustness of feature extraction is improved, ensuring reliable measurement accuracy even in complex physiological environments.
[0073] In summary, this disclosure aims to overcome the limitations of existing subjective assessment methods and the shortcomings of existing objective technical solutions, and to provide a new EEG pain quantification method based on deep learning that can tightly couple time-frequency domain information, adaptively analyze multi-scale features, and has strong generalization and noise resistance capabilities, providing reliable technical support for pain assessment of patients who cannot speak and the development of precision pain medicine. Specific Implementation Example 1:
[0075] This disclosure provides an embodiment:
[0076] A computer system based on a quantitative pain model includes: a preprocessing module, a local temporal feature extraction module, a cross-domain global frequency domain feature extraction module, a cross-domain interactive fusion module, a feature fusion module, and a classification output module. The preprocessing module preprocesses the input raw EEG signal to obtain a preprocessed enhanced signal. The local temporal feature extraction module interacts with the preprocessing module, inputting the preprocessed enhanced signal into a local temporal pathway. Through multi-scale spatiotemporal convolution and sliding window temporal convolution, it extracts pain-related temporal feature sequences and outputs global temporal features. The cross-domain global frequency domain feature extraction module interacts with the preprocessing module, inputting the preprocessed enhanced signal into a cross-domain global pathway and using discrete wavelets... The transformation performs multi-band decomposition and then undergoes multi-scale wavelet dual attention and spectral-spatial convolutional coding to obtain a frequency domain feature sequence containing frequency domain physiological information and spatial domain function. The cross-domain interactive fusion module interacts with the local temporal feature extraction module and the cross-domain global frequency domain feature extraction module to input the temporal feature sequence and frequency domain feature sequence into the wavelet time interactive coding module for cross-domain deep interactive fusion to obtain global cross-domain features. The feature fusion module interacts with the cross-domain interactive fusion module to fuse the global temporal features and the global cross-domain features to obtain classification features. The classification output module interacts with the feature fusion module to input the classification features into the classifier and output the objective quantitative result of the pain state.
[0077] The computer system described in this embodiment mainly consists of two parallel processing paths: a local temporal path and a cross-domain global path. Deep information fusion is achieved through an interactive coding mechanism. The specific steps of its operation are as follows:
[0078] S1. Preprocessing steps: Signal segmentation and reconstruction, and noise removal.
[0079] Before entering the two parallel pathways, the raw EEG signals are preprocessed, including signal segmentation and reconstruction and Gaussian noise addition.
[0080] S101. Signal Segmentation and Recombination (S&R): Each EEG signal is uniformly divided into several sub-segments along the time axis. Sub-segments are randomly selected from different samples of the same category and recombined to generate enhanced new samples, thereby expanding the dataset without changing the category semantics. This operation can simulate reasonable combinations of signal segments from different subjects or at different times, improving the model's adaptability to individual differences.
[0081] S102. Add Gaussian noise: After the signal is segmented and reassembled, Gaussian noise with a mean of 0 and a standard deviation of 1% of the signal amplitude is added to the generated samples to simulate real-world interference and enhance the robustness of the model.
[0082] S2. Local Temporal Path: Multi-scale Spatiotemporal Convolution Module and Sliding Window Temporal Convolution Module
[0083] The primary task of the local temporal pathway is to extract multi-scale temporal dynamic features from EEG signals. This process consists of the following stages:
[0084] S201. Multi-scale Spatiotemporal Convolution Module
[0085] The multi-scale spatiotemporal convolution module is shown in the appendix. Figure 2 Used to input EEG signals Decomposed into multi-scale representations, where This represents the number of electrode channels. For the number of time points. Multi-scale temporal convolution module 21, see appendix. Figure 2 Three parallel temporal convolutional layers were designed, each branch employing a convolutional kernel of a different scale, to capture multi-level neural dynamic features ranging from local transients to global trends. Smaller convolutional kernels are able to capture instantaneous high-frequency fluctuations, while larger kernels help capture low-frequency trends that last for longer periods.
[0086] In the The operations of the signal and convolution kernel in each branch are represented as follows: ;
[0087] in, This is the kernel size. The outputs of all convolution branches will be concatenated.
[0088] Furthermore, through channel attention mechanism module 22, see Appendix Figure 2 Weighted fusion is performed to dynamically recalibrate the contribution of each feature branch. This channel attention mechanism includes a bottleneck structure, which uses global average pooling (GAP) to weight the concatenated features. Compressed into a channel descriptor, then via two... The bottleneck structure of the convolutional layer is handled to map the non-linear dependencies between features and generate attention weights. The calculation formula is: ;
[0089] in, For the Sigmoid function, This is the ELU activation function.
[0090] After obtaining the weighted features, a spatiotemporal feature refinement module 23 is further introduced. This is achieved by using a convolution kernel size of... The convolutional layers fuse weighted features, restoring the channel dimension to a preset value while achieving deep interaction of multi-scale information, thus generating refined temporal features. Subsequently, the module employs a (1,C) deep convolutional layer to extract spatial topological features. By independently applying spatial filters to each feature map and learning association weights along the electrode dimension, the spatial distribution patterns of EEG signals are captured without introducing temporal obfuscation. Finally, the module constructs a semantic refinement module, which processes the features sequentially through a 16×1 convolutional layer, a batch normalization layer, an ELU activation layer, an average pooling layer, and a random deactivation layer, aggregating the aforementioned features into a highly abstract spatiotemporal representation, laying a robust foundation for subsequent temporal modeling.
[0091] S202. Sliding Window Temporal Convolution Module
[0092] To further explore temporal dependencies over a long period, this embodiment employs a sliding window temporal coding module 31, as shown in the appendix. Figure 3 This module uses a sliding window strategy to divide the feature sequence output by the multi-scale spatiotemporal convolution module into N overlapping time windows, enabling the model to perform fine-grained analysis for different dynamic evolution stages of the signal, such as the beginning, middle, and end segments.
[0093] The feature slices within each window are independently fed into a dilated causal convolutional network for feature encoding. To expand the receptive field without significantly increasing the number of model parameters, the dilated causal convolution introduces a dilation factor into the convolutional kernel. This allows it to cover a longer time span. At the same time, by introducing causal constraints, it ensures that time... Feature computation at a location depends only on time. Historical information is used to effectively prevent future information leakage. The dilated causal convolution operation is defined as follows: ;
[0094] in It is the expansion factor. The kernel size is [size]. This represents the current time point. The network employs a residual connection structure, where each residual block contains two dilated convolutional layers, sequentially connected in a batch normalization layer, a ReLU activation layer, and a random deactivation layer to suppress the vanishing gradient problem in deep networks and ensure the effective propagation of long-range temporal features. After processing by this module, the output feature vector of each window is extracted. As a representation of advanced temporal features.
[0095] To integrate information from different time-series stages, a window attention fusion module (module 32) is introduced (see appendix). Figure 3 This module combines N window feature vectors into a feature block through a stacking operation. By using global average pooling and two fully connected layers (FC layers), the importance weight vector of each window is adaptively learned. :
[0096] ;
[0097] in It is the Sigmoid activation function. It is the ReLU activation function. , This is the weighted matrix. Finally, the feature aggregation module 33 is responsible for performing the final feature integration. It aggregates the weighted window features through element-wise addition to generate a global temporal feature representation. : ;
[0098] in For the first Features of each window For its corresponding attention weight, This represents the total number of windows. The design enables the model to intelligently focus on the time segment with the strongest pain information discrimination based on the dynamic characteristics of the input signal, significantly improving the model's classification accuracy under non-stationary EEG signals.
[0099] S3. Cross-domain global pathway: Multi-scale wavelet dual attention module and wavelet time interactive coding module
[0100] The core objective of cross-domain global pathways is to explicitly model the physiological oscillations associated with pain and establish the intrinsic relationship between their temporal and frequency domain characteristics.
[0101] S301. Multi-scale wavelet dual attention module
[0102] The EEG signal is first processed by discrete wavelet transform module 41, see appendix. Figure 4 Frequency domain decomposition was performed. In this embodiment, the Daubechies 4 (Db4) wavelet basis function was used to perform 8-level decomposition on the original signal at a sampling rate of 250Hz to obtain the target frequency domain signal, which was then divided into 6 typical physiological frequency bands, including: Delta wave (0.5–4 Hz), Theta wave (4–8 Hz), Alpha wave (8–13 Hz), Beta wave (13–30 Hz), low-frequency Gamma wave (30–60 Hz), and high-frequency Gamma wave (60–100 Hz). For each electrode channel... and frequency band Calculate its energy characteristics within the time window. This forms a two-dimensional energy map of "channel-frequency band". Where M=6 is the number of frequency bands. The energy calculation formula is:
[0103] ;
[0104] in, Represents the wavelet reconstruction coefficients. The length of the coefficient sequence is denoted as . This processing mechanism not only effectively preserves the non-stationary physiological rhythms of EEG signals, but also provides high-dimensional spectral space input for subsequent feature extraction through its multi-resolution characteristics.
[0105] The dual attention mechanism module 42 further processes the aforementioned frequency band energy map. To adaptively highlight discriminative features highly correlated with pain and suppress background noise, a channel attention unit and a frequency band attention unit, composed of channel attention branches and frequency band attention branches, are introduced. The dual attention mechanism processes the energy map along both the channel and frequency band dimensions. Perform feature weighting, The calculation logic is as follows:
[0106] ;
[0107] in, This indicates the average pooling operation. Represents a multilayer perceptron mapping. This represents the Sigmoid activation function. Similarly, band attention generates weights for each physiological band by analyzing global information across all channels. The frequency domain feature map after calibration using the dual attention mechanism is represented as follows: ;
[0108] in, This represents an element-wise multiplication operation. Through the above mechanism, the model achieves real-time screening and calibration of key physiological frequencies and spatial topological regions.
[0109] To capture cross-electrode spatial correlations and complex inter-spectral interactions, calibrated feature maps The two-dimensional "spectral-spatial image" is input to the spectral-spatial multi-branch convolutional coding module 43. This module performs the following three types of convolution operations in parallel:
[0110] 1×1 convolutional layer: Models cross-channel interactions within a frequency band, learning the functional connectivity patterns of different electrodes in the same physiological frequency band;
[0111] 3×3 convolutional layer: Simultaneously integrates the covariance of adjacent electrode topological signals and nearby physiological frequency bands to capture local spectral-spatial correlations;
[0112] 3×1 convolutional layers: Focusing on the local spatial distribution within a single frequency band, these layers explicitly enhance the discriminative dimension of single-frequency features to prevent spectral information confusion. The outputs of the above convolutional branches are concatenated and then sequentially passed through a fusion convolutional layer and channel average pooling operations to extract a compact spectral-spatial feature vector. This process achieves efficient integration of frequency domain physiological information and spatial domain functional connectivity.
[0113] S302. Wavelet Time Interactive Encoding Module
[0114] To fully utilize the complementary information in the time and frequency domains, a wavelet time-interactive coding module was designed (see appendix). Figure 5 This module converts the temporal feature sequences output by the multi-scale spatiotemporal convolution module in the local temporal domain path. , and the frequency domain feature sequences extracted from the cross-domain global pathway This forms a unified cross-domain hybrid feature sequence. : ;
[0115] in The length of the time series feature. The length of the frequency domain feature. is the dimension of the feature vector.
[0116] This mixed feature sequence is then fed into a Transformer encoder for processing. The multi-head self-attention mechanism in the Transformer can automatically learn the complex nonlinear relationship between time-domain and frequency-domain features: ;
[0117] After multi-layer Transformer encoding, global average pooling is used to obtain a cross-domain feature vector containing global cross-domain context information. .
[0118] S4. Feature Fusion and Classification Output
[0119] The results after time-domain and frequency-domain feature extraction will be fused to form the final classification features. The global temporal features output from the local time-domain path are also considered. Global cross-domain features enhanced by cross-domain interaction and output from the cross-domain global path. Fusion is performed through residual connections: This fusion strategy preserves the sensitivity of the temporal pathway to local details and dynamic evolution while incorporating the global physiological rhythm context information provided by the frequency domain pathway. The fused feature vector is fed into a fully connected classifier, and the final pain state classification probability is output through a softmax function. ; in, and These are the learnable parameters of the classifier.
[0120] During the training process, the entire network comprehensively employs techniques such as exponential linear unit activation function, label smoothing, batch normalization, and random deactivation to prevent overfitting and improve the model's generalization ability.
[0121] The technical solution proposed in this embodiment fully exploits the multi-scale features related to pain in electroencephalogram (EEG) signals through a tightly coupled time-domain and frequency-domain dual-path structure. By employing multi-level, multi-dimensional information fusion and deep learning techniques, it successfully achieves objective, stable, and efficient quantitative identification of pain states.
[0122] Verification process
[0123] To comprehensively evaluate the practical performance of this invention, rigorous performance validation was conducted on the publicly available "Brain Function in Chronic Pain (BFCP)" clinical dataset. The experiment employed a "Leave One-out-of-Subjects Cross-Validation (LOSO)" strategy to ensure the model's generalization ability and the fairness of the evaluation on completely independent subjects. As shown in Table 1, compared with mainstream deep learning models such as EEGNet, DeepConvNet, EEGConFormer, and MFDFormer, this embodiment demonstrates superior overall classification performance: it achieves a classification accuracy of 90.62% and a Kappa coefficient of 0.8593 on the BFCP dataset, significantly outperforming these advanced models. This proves that the multi-level feature extraction and fusion mechanism proposed in this embodiment can effectively suppress noise interference and accurately identify the neurophysiological characteristics of chronic pain.
[0124] Individual differences in EEG signals are a core bottleneck hindering the widespread adoption of objective pain assessment technologies in clinical practice. The model provided in this embodiment maintains a high accuracy rate of 90.62% even under the rigorous validation paradigm of "leave one subject behind"—meaning all test data comes from entirely new individuals not previously used in model training. This demonstrates the excellent subject-independent generalization ability of this embodiment, significantly reducing or even eliminating reliance on subjective calibration of individual baseline tests in practical clinical applications, thus better meeting the needs of rapid clinical screening or home-based dynamic monitoring. Furthermore, the model architecture of this embodiment is optimized, effectively controlling computational scale while maintaining high-precision classification. Compared to large Transformer models, it is easier to deploy lightweight and perform real-time inference on embedded devices or mobile medical terminals, demonstrating significant practical value.
[0125] To rigorously verify the technical effectiveness of each core module in this embodiment, a systematic ablation experiment was conducted on the BFCP dataset. The results are shown in Table 2, which strongly support the scientific nature of the overall scheme: (1) Removal of data augmentation strategy (w / o Augmentation): After removing the signal segmentation and reconstruction and noise addition strategies, the model accuracy fluctuated and dropped to 86.97%, proving the key role of this strategy in suppressing overfitting and improving the robustness of the model. (2) Removal of wavelet branch (w / o Wavelet Branch): Verified the contribution of frequency domain feature extraction to the overall performance. After its absence, the model is unable to capture key physiological oscillation information, and the accuracy drops. (3) Removal of sliding window temporal convolution module (w / o SW-TCM): After the absence of this module, the model cannot effectively model long-range temporal dependencies, resulting in a significant drop in accuracy to 82.84%, which confirms the core value of this structure in capturing dynamic evolution features. (4) Removal of the multi-scale wavelet dual attention module (w / o MS-WDAM): This demonstrates the necessity of this module as a dynamic "space spectrum filter," and its absence reduces the efficiency of feature extraction. (5) Removal of the wavelet time interactive coding module (w / o Cross-Encoder): After degrading the wavelet time interactive coding module to simple feature concatenation, the model accuracy decreased from 90.62% to 89.58%, which further confirms the complex nonlinear dependency between time-domain and frequency-domain features. The interactive encoder disclosed in this paper is crucial for achieving deep cross-domain information fusion.
[0126] Table 1: Performance comparison of different models on the publicly available chronic pain (BFCP) dataset
[0127] Model Acc (%) Kappa WF1 (%) EEGNet 86.33 0.7950 86.28 DeepConvNet 86.24 0.7936 79.36 EEgconFormer 80.59 0.7857 85.69 MFDFormer 88.27 0.824 88.25 MSTW_Net (This Publication) 90.62 0.8593 90.62
[0128] Table 2: Ablation experimental results of the model disclosed herein on the publicly available chronic pain (BFCP) dataset.
[0129] Model Acc (%) Kappa WF1 (%) w / o Augmentation 86.97 0.8045 86.86 w / o Wavelet Branch 86.64 0.7995 86.67 w / o SW-TCM 82.84 0.7427 82.67 w / o MS-WDAM 87.11 0.8066 87.04 w / o Cross-Encoder 89.58 0.8436 89.55 MSTW_Net (This Publication) 90.62 0.8593 90.62
[0130] As can be seen, this embodiment not only focuses on the final classification accuracy, but also further verifies the physiological interpretability of the model's extracted features (see Appendix). Figure 6-8 As attached Figure 6 As shown, the frequency band attention weights learned adaptively by the model indicate that Delta waves (0.5–4 Hz) and Alpha waves (8–13 Hz) exhibit higher weights in pain discrimination. (See attached image.) Figure 7 As shown in the visualization results of electrode channel weights, the parietal and central electrode regions clearly demonstrate that they play a dominant role in pain signal capture, which is consistent with the physiological characteristics of brain region activation induced by pain. (See attached image) Figure 8As shown, analysis of the attention weight map of the Transformer encoder reveals a significant cross-spatial coupling between the time window and frequency domain features, demonstrating that the time-frequency interaction mechanism proposed in this embodiment successfully utilizes the nonlinear mapping relationship between the two for decision-making. In summary, the above visualization verification not only proves the accuracy of the model provided in capturing pain physiological features but also provides solid theoretical support for the practical application of this embodiment in the clinical medical field.
[0131] It needs to be clarified that:
[0132] Under the premise of achieving the same inventive purpose, the technical solution described in this embodiment can be replaced as follows:
[0133] 1. Alternatives to cross-domain interaction mechanisms
[0134] As attached Figure 5 The wavelet time-interactive coding module described herein, used to fuse time-domain feature sequences and frequency-domain feature sequences in a Transformer encoder, can be replaced with other network structures capable of modeling complex relationships between sequences or features. For example, time-domain feature points and frequency-band feature points can be considered as nodes in a graph structure, and graph neural networks can be used to achieve cross-domain information interaction and fusion by modeling the functional connectivity between nodes.
[0135] 2. Alternatives to frequency domain feature generation methods
[0136] As attached Figure 4 The discrete wavelet transform module 41 described above, used to decompose the EEG signal into multiple physiological frequency bands, can be replaced by other time-frequency analysis or spectrum analysis methods. For example, continuous wavelet transform, empirical mode decomposition, Hilbert-Huang transform, or short-time Fourier transform can be used to generate a "channel-band" energy map or other forms of frequency domain feature representation that characterize the frequency domain properties of the signal.
[0137] 3. Alternatives to the final feature fusion strategy
[0138] As described in the feature fusion module, local temporal path features are... Cross-domain global pathway characteristics Perform residual summation, i.e. The fusion method described above can be replaced with other feature fusion strategies. For example, attention-weighted fusion, gating-based feature selection fusion, or tensor decomposition-based fusion methods can be used to adaptively integrate dual-path information.
[0139] 4. Alternatives to multi-scale spatiotemporal feature extraction structures
[0140] As attached Figure 2The multi-scale temporal convolution module 21 described above employs a structure that uses multiple branches with convolutional kernels of different sizes to process in parallel to extract multi-scale temporal features. This structure can be replaced with other convolutional architectures capable of obtaining multi-scale receptive fields. For example, a dilated convolutional pyramid structure with different dilation rates can be used, or deformable convolutions can be used to adaptively learn the location of convolutional sampling, thereby capturing multi-scale contextual information.
[0141] 5. Alternative solutions for attention mechanism implementation
[0142] As attached Figure 4 In the dual attention mechanism module 42 described above, the dual attention mechanism that sequentially applies channel attention and frequency band attention to the "channel-band" energy map can be replaced with other attention implementation forms. For example, it can be replaced with a self-attention mechanism, an external memory-enhanced attention mechanism, or a hard attention weighting mechanism based on prior physiological knowledge, such as a specific pain-related frequency band. Specific Implementation Example 2:
[0144] This disclosure also provides an embodiment:
[0145] An objective quantification method for pain based on a multi-scale time-frequency network, using the computer system described in Specific Embodiment 1, includes: preprocessing the input raw EEG signal to obtain a preprocessed enhanced signal; inputting the preprocessed enhanced signal into a local temporal domain pathway, extracting pain-related temporal feature sequences through multi-scale spatiotemporal convolution and sliding window temporal convolution, and outputting global temporal features; inputting the preprocessed enhanced signal into a cross-domain global pathway, performing multi-frequency band decomposition through discrete wavelet transform, and obtaining a frequency domain feature sequence containing frequency domain physiological information and spatial domain function through multi-scale wavelet dual attention and spectral-spatial convolutional encoding; inputting the temporal feature sequence and the frequency domain feature sequence into a wavelet time interactive encoding module for cross-domain deep interactive fusion to obtain global cross-domain features; fusing the global temporal features and the global cross-domain features to obtain classification features; and inputting the classification features into a classifier to output the objective quantification result of the pain state. Specific Implementation Example 3:
[0147] This disclosure also provides an embodiment:
[0148] An electronic device includes: a storage medium and a processing unit; wherein the storage medium is used to store a computer program, and the processing unit exchanges data with the storage medium for executing the computer program through the processing unit to perform the steps of the method as described in Specific Embodiment 2 when pain is objectively quantified. Specific Implementation Example 4:
[0150] A computer-readable storage medium storing a computer program; when the computer program is run, it performs the steps of the method as described in Specific Embodiment 2.
[0151] In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wireline, optical fiber, RF, etc., or any suitable combination thereof.
[0152] The above disclosure only discloses a few specific implementation scenarios. However, this disclosure is not limited to these. Any variations that can be conceived by those skilled in the art should fall within the protection scope of this disclosure.
Claims
1. A computer system based on a quantitative pain model, characterized in that, include: The preprocessing module is used to preprocess the input raw EEG signal to obtain a preprocessed enhanced signal; The local temporal feature extraction module interacts with the preprocessing module to input the preprocessed enhanced signal into the local temporal pathway, extract pain-related temporal feature sequences through multi-scale spatiotemporal convolution, and output global temporal features through multi-scale spatiotemporal convolution and sliding window temporal convolution. The cross-domain global frequency domain feature extraction module interacts with the preprocessing module to input the preprocessed enhanced signal into the cross-domain global path, perform multi-band decomposition through discrete wavelet transform, and obtain a frequency domain feature sequence containing frequency domain physiological information and spatial domain function through multi-scale wavelet dual attention and spectral-spatial convolution coding. The cross-domain interactive fusion module interacts with the local time-domain feature extraction module and the cross-domain global frequency-domain feature extraction module respectively, and is used to input the time-series feature sequence and frequency-domain feature sequence into the wavelet-time interactive coding module for cross-domain deep interactive fusion to obtain global cross-domain features. The feature fusion module interacts with the cross-domain interaction fusion module to fuse the global temporal features and the global cross-domain features to obtain classification features; The classification output module interacts with the feature fusion module to input the classification features into the classifier and output an objective quantitative result of the pain state.
2. The computer system based on a quantitative pain model according to claim 1, characterized in that, The preprocessing module is specifically used for: Acquire the raw EEG signals; Divide any segment of the original EEG signal evenly along the time axis into at least two sub-segments; Randomly select segments from different samples of the same category and recombine them to obtain enhanced new samples; Gaussian noise is added to the new sample to simulate real-world environmental interference, resulting in a preprocessed enhanced signal.
3. The computer system based on a quantitative pain model according to claim 1, characterized in that, The local temporal feature extraction module is specifically used for: The preprocessed enhanced signal is input into the multi-scale spatiotemporal convolution module to obtain the feature sequences output by each convolution branch, and then concatenated to obtain the concatenated features. The feature sequence is weighted and fused using the channel attention mechanism module, and the contribution of each convolutional branch is dynamically calibrated to obtain the weighted features of any convolutional branch. The spatiotemporal feature refinement module aggregates any of the weighted features into an abstract spatiotemporal representation; The feature sequence is divided into N overlapping time windows using a sliding window temporal coding module. The feature slices within each time window are individually fed into a dilated causal convolutional network for feature encoding to obtain the window feature vector; The window attention fusion module stacks a preset number of window feature vectors to form feature blocks, which serve as global temporal features related to pain.
4. The computer system based on a quantitative pain model according to claim 3, characterized in that, The preprocessed and enhanced signal is input into a multi-scale spatiotemporal convolution module to obtain the feature sequences output by each convolution branch, including: The multi-scale spatiotemporal convolution module includes three parallel temporal convolutional layers. Each branch uses convolutional kernels of different scales to capture instantaneous high-frequency fluctuations with smaller kernels and capture non-instantaneous low-frequency fluctuations with larger kernels. Preprocessing enhance signal After being decomposed into multi-scale representations by the multi-scale spatiotemporal convolution module, the representations are then concatenated; wherein, This represents the number of electrode channels. For time points; In the The operations of preprocessing the enhanced signal and the convolution kernel in each branch are represented as follows: ; in, Let be the kernel size of the i-th branch; For the first The output of each branch.
5. The computer system based on a quantitative pain model according to claim 3, characterized in that, The step of using a channel attention mechanism module to perform weighted fusion of the feature sequences, dynamically calibrating the contribution of each convolutional branch, and obtaining the weighted features of any convolutional branch includes: The channel attention mechanism module uses global average pooling to process the concatenated features. Compressed into a channel descriptor; then via two The bottleneck structure of the convolutional layer is handled to map the non-linear dependencies between features and generate attention weights. , is represented as: ; in, For the Sigmoid function, For ELU activation function; For the features after splicing Channel descriptors obtained by global average pooling; The first in the bottleneck structure Convolutional layers are used to perform channel mapping and non-linear dependency modeling on the channel descriptors; The second in the bottleneck structure Convolutional layers are used to generate attention weights for each channel.
6. The computer system based on a quantitative pain model according to claim 3, characterized in that: The dilated causal convolution operation is defined as follows: ; in, It is the expansion factor. The kernel size is [size]. x represents the current time point; x represents the input time series. For the convolution kernel in the th Filter coefficients at each position; Global time series features , is represented as: ; in, For the first Feature vectors corresponding to each time window; To be assigned to the Each time window corresponds to a feature vector Attention weights; This represents the total number of time windows.
7. The computer system based on a quantitative pain model according to claim 1, characterized in that, The cross-domain global frequency domain feature extraction module is specifically used for: Preprocessing enhance signal Frequency domain decomposition is performed using a discrete wavelet transform module to obtain the frequency band energy map; among which... This represents the number of electrode channels. For time points; The frequency band energy map is processed by a dual attention mechanism module to obtain a calibrated frequency domain feature map; The calibrated frequency domain feature map is input into the spectral-spatial multi-branch convolutional coding module to obtain a frequency domain feature sequence containing frequency domain physiological information and spatial domain function.
8. The computer system based on a quantitative pain model according to claim 1, characterized in that, The cross-domain interaction and fusion module is specifically used for: By using the multi-scale spatiotemporal convolution output temporal feature sequence in the local temporal path and concatenating it with the frequency domain feature sequence extracted from the cross-domain global path, a cross-domain hybrid feature sequence is obtained. The hybrid feature sequence is input into the Transformer encoder for processing to obtain global cross-domain features containing global cross-domain context information.
9. The computer system based on a quantitative pain model according to claim 8, characterized in that: The temporal feature sequence output by the multi-scale spatiotemporal convolution module in the local temporal domain path , and the frequency domain feature sequences extracted from the cross-domain global pathway Forming cross-domain hybrid feature sequences : ; in, The length of the time series feature. The length of the frequency domain feature. The dimension of the feature vector; The hybrid feature sequence is input into the Transformer encoder, and global average pooling is used to obtain a global cross-domain feature vector containing global cross-domain context information. The multi-head self-attention mechanism in the Transformer encoder is represented as follows: ; Where Q is the query matrix; K is the key matrix; V is the value matrix; and T represents the matrix transpose. is the dimension of the key vector.
10. The computer system based on a quantitative pain model according to claim 1, characterized in that, The feature fusion module and the classification output module are configured as follows: Global temporal characteristics of local time domain path output Global cross-domain features of cross-domain global path output The classification features are obtained by fusing them through residual connections. ; Classification features Input a fully connected classifier and output the final pain state classification probability through a Softmax function. : ; in, and These are the learnable parameters of the classifier.