Surface electromyography neural network discrimination method and system for chronic leg pain based on muscle compensation mechanism modeling
By modeling based on muscle compensation mechanisms, and using structured grouped convolution and shared convolution kernels to extract temporal asymmetric dynamic features, combined with short-time Fourier transform and channel attention mechanisms, the anatomical relationship neglect and data imbalance problems in the existing technology for chronic leg pain recognition are solved, achieving high-precision and stable chronic leg pain recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGDONG UNIV OF TECH
- Filing Date
- 2026-01-27
- Publication Date
- 2026-06-19
Smart Images

Figure CN122241298A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of biomedical signal processing technology, and in particular to a method and system for discriminating chronic leg pain based on surface electromyography neural networks modeled on muscle compensation mechanisms. Background Technology
[0002] Chronic leg pain is a common problem in sports injuries, lower limb strain, and chronic pain syndromes, often accompanied by changes in the activation patterns of calf muscles (such as the peroneus longus and gastrocnemius). Surface electromyography (sEMG), as a non-invasive, real-time, and convenient monitoring method, can record bioelectrical changes during neuromuscular system activity and has become a key tool for identifying differences in muscle group activation patterns, recognizing chronic pain states, and assessing functional changes.
[0003] Currently, sEMG-based pain recognition methods are mainly divided into two categories: The first category is based on traditional feature engineering methods. These methods typically extract time-domain statistical features (such as root mean square value, waveform length, etc.), frequency-domain features (such as average frequency, median frequency, etc.), or time-frequency features (such as wavelet energy) from sEMG signals. Then, they utilize classifiers such as Support Vector Machines (SVM), Linear Discriminant Analysis (LDA), or Random Forests for pain discrimination. However, these methods heavily rely on manually designed fixed features and empirical parameters, making it difficult to adapt to the complex and highly individualized muscle dynamic changes produced by chronic pain patients under different motor tasks, resulting in weak generalization ability.
[0004] The second category is based on deep learning methods. In recent years, models such as Convolutional Neural Networks (CNNs), Recurrent Neural Networks (RNNs), and Transformers have been widely applied to sEMG analysis, aiming to automatically learn latent temporal patterns in signals in an end-to-end manner. While these methods have improved recognition accuracy to some extent, existing deep learning models still have significant limitations when processing lower limb electromyography (sEMG) signals: First, there is a lack of explicit modeling of anatomical structures and muscle compensation mechanisms. Medical research shows that muscle compensation is a common neural adaptation strategy in patients with chronic pain. When the function of a muscle declines due to pain, the nervous system enhances the activation of adjacent muscles or the corresponding muscles on the opposite side to maintain motor performance, thus exhibiting a significant "left-right asymmetry" pattern. Most existing deep learning models treat sEMG as general multi-channel time-series data, ignoring the structural correspondence between the corresponding muscles on the left and right sides (such as the left and right gastrocnemius muscles), and cannot effectively capture the local activation inhibition and inverse compensation features induced by pain. Directly inputting raw signals often causes this subtle dynamic imbalance to be masked by overall signal fluctuations.
[0005] Secondly, the use of time-frequency domain information is insufficient and lacks specificity. Some existing methods focus only on single time-domain or frequency-domain information, ignoring the complementarity between the two in pain recognition. Even when time-frequency combined methods are used, they are often simple feature splicing, lacking attention mechanisms for specific frequency bands (pain-related energy attenuation or migration), making the model sensitive to noise and difficult to extract key pathological features.
[0006] Finally, the problems of sample imbalance and hard sample learning are particularly prominent in the EMG pain recognition task. In real-world medical data collection scenarios, chronic pain samples are usually a significant minority in the overall data distribution, exhibiting a significant class asymmetry with healthy samples. Simultaneously, individuals with chronic pain gradually develop differentiated muscle compensation strategies under long-term pain stimulation, resulting in significant heterogeneity in muscle recruitment order, activation intensity, and muscle group coordination patterns among individuals. This leads to local overlap of EMG signals in the feature space, with some samples shifting to the transition region between healthy and painful states, forming hard samples that significantly influence the discrimination boundary. These samples are usually accompanied by high prediction uncertainty, manifested as low model output confidence. The traditional cross-entropy loss function, with its optimization objective of minimizing overall error, easily leads to the training process being dominated by the majority of easily classifiable healthy samples under imbalanced data distribution conditions. This weakens the model's effective attention to and learning ability for the minority class of chronic pain hard samples, ultimately resulting in a high false negative rate for chronic pain samples and limiting the model's generalization performance.
[0007] In summary, designing a deep learning model that can explicitly characterize the anatomical relationship between the left and right muscle groups, effectively capture the asymmetric dynamic features caused by muscle compensation, and integrate complementary information in the time and frequency domains is a technical challenge that urgently needs to be solved in the field of intelligent sEMG discrimination of chronic leg pain. Summary of the Invention
[0008] Based on this, it is necessary to provide a surface electromyography (EMG) discrimination method and system for chronic leg pain that can explicitly characterize the anatomical relationship between the left and right muscle groups and effectively capture the asymmetric dynamic characteristics caused by muscle compensation, and that can make full use of time-frequency domain information for complementarity.
[0009] To achieve the above-mentioned objectives of this invention, the technical solution adopted is as follows: A surface electromyography (EMG) neural network-based method for discriminating chronic leg pain based on muscle compensation mechanisms includes the following steps: Electromyography (EMG) signals from the subject's two legs were collected and preprocessed to obtain discrete sample sequences. The signal is preprocessed to extract the effective segment of the action, resulting in a discrete sample sequence. Grouping the left and right leg muscle groups to extract intra-group co-activation features; calculating the second-order difference sequences of the left and right corresponding muscles, and extracting asymmetric dynamic features representing the muscle compensation mechanism by sharing convolution kernels; and weighting and fusing the two features by learnable weight parameters to obtain a temporal fusion feature vector. Frequency domain feature vectors of discrete sample sequences are extracted using short-time Fourier transform. The time-domain fused feature vector is concatenated with the frequency-domain feature vector, and the discrimination result of chronic leg pain is output through a fully connected network.
[0010] A surface electromyography (EMG) neural network discriminant system for chronic leg pain based on muscle compensation mechanism modeling includes: The data acquisition and preprocessing module is used to acquire surface electromyography signals from the subject's two legs and preprocess them to obtain discrete sample sequences. The temporal feature extraction module is configured to receive discrete sample sequences and perform temporal feature extraction using a parallel structured grouping convolutional sub-path and a temporal left-right muscle differential convolutional feature extraction sub-path. The structured grouping convolutional sub-path is used to group the muscles by left and right leg groups to extract intra-group co-activation features. The temporal left-right muscle differential convolutional feature extraction sub-path is used to calculate the second-order difference sequences of the left and right corresponding muscles and extract asymmetric dynamic features representing the muscle compensation mechanism. The temporal feature extraction module also includes a fusion unit, which is used to fuse the outputs of the above two sub-paths through learnable weight parameters to obtain a temporal fusion feature vector. The frequency domain feature extraction module is configured to extract frequency domain feature vectors of discrete sample sequences through short-time Fourier transform; The fusion classification module is used to concatenate the time-domain fusion feature vector with the frequency-domain feature vector and output the discrimination result of chronic leg pain through a fully connected network. The fully connected network in the fusion classification module adopts the Focal Loss loss function during training to enhance the learning ability of difficult-to-classify samples and minority class chronic pain samples, and optimizes the training process by combining cosine annealing learning rate scheduling, thereby improving the stability and generalization performance of the model under imbalanced data conditions.
[0011] Preferably, the surface electromyography signals include the left gastrocnemius channel, the left peroneus longus channel, the right gastrocnemius channel, and the right peroneus longus channel.
[0012] Furthermore, the temporal feature extraction module includes a temporal left and right muscle difference convolution feature extraction sub-path: a difference calculation unit, used to perform second-order difference operations on the left and right corresponding channels of the gastrocnemius and peroneus longus muscles respectively, and calculate the difference between the left and right second-order differences to obtain a difference sequence; and a feature extraction unit, configured to perform convolution operations on the difference sequence using convolution kernels with shared weights, so as to extract the compensatory dynamic patterns of different muscle pairs in the same parameter space.
[0013] Furthermore, the frequency domain feature extraction module obtains a spectrogram by performing a short-time Fourier transform on the multi-channel signal, and rearranges the spectrogram into multiple local spectral segments in the time dimension; a channel attention mechanism is applied to each local spectral segment to generate weighting coefficients for different muscle channels to enhance the expression of pain-sensitive frequency bands; the weighted spectral segments are input into a depthwise separable convolutional layer to extract spatial features, and then input into a bidirectional LSTM network to extract temporal dependency features.
[0014] Furthermore, temporal feature extraction is performed using a parallel structured grouping convolution sub-path and a temporal left and right muscle difference convolution feature extraction sub-path. The specific steps are as follows: The four-channel input is divided into two groups based on the left and right sides: left group: CH0 and CH1, right group: CH2 and CH3. Independent temporal convolutional kernels are applied to each group to extract intra-group co-activation patterns, resulting in two sub-tensors based on the left and right sides.
[0015]
[0016] in, i For channel indexing, n For time indexing, N The number of sample points for a single action; Apply a two-dimensional temporal convolution to each group, with a kernel size of C×T, where C is the channel dimension and T is the time window length. The stride s and zero-padding p are set according to design requirements to obtain the left-right co-activation map:
[0017] Where * denotes a two-dimensional convolution between the channel and time. For learnable kernel weights, For bias, F is the number of output channels, and N′ is the time length after convolution; and The data is concatenated along the channel dimension, then fused via convolution, followed by batch normalization, nonlinear activation, and pooling to finally obtain a structured temporal feature vector. .
[0018] Furthermore, the second-order difference sequences of the corresponding muscles on the left and right sides are calculated, specifically including: The discrete sample sequences were regrouped according to the muscle name to obtain the gastrocnemius muscle group sEMG: sEMG of the peroneus longus muscle group: ,in The values L and R represent the left leg and right leg, respectively.
[0019]
[0020] For any electromyography signal channel The result after smoothing filtering is defined as:
[0021] in: , representing the signal channel; n: the index of the current time point, i.e., the center position of the sliding window; t: the time series index within the neighborhood range, used to traverse the sampling points within the window range; W: the sliding window size, representing the number of time steps used for filtering; Apply sliding mean filtering to the gastrocnemius and peroneus longus muscles respectively:
[0022]
[0023] After smoothing the left and right corresponding channels to suppress local noise, the second-order difference is calculated to explicitly amplify and characterize the asymmetric dynamics between the left and right corresponding muscles:
[0024]
[0025] Then, take the difference between the second-order differences of the left and right channels to obtain the difference sequence: Gastrocnemius muscle differential sequence:
[0026] Difference sequence of peroneus longus muscle:
[0027] The above difference sequences are arranged into a multi-channel matrix according to muscle pairs. The matrix has the following form:
[0028] The input is fed into a weight-shared temporal convolutional unit (shared convolutional kernel) for dynamic feature extraction, thereby abstracting the compensatory dynamic patterns of different muscle pairs within the same parameter space and outputting the feature vector of the difference path. .
[0029] Furthermore, the temporal fusion feature vector is obtained by fusing the outputs of the two sub-paths using learnable weight parameters. The specific calculation formula is as follows:
[0030] in, and The weights are normalized and are calculated as follows:
[0031]
[0032]
[0033] in, and These are the original weight parameters that can be learned during network training.
[0034] Furthermore, the fully connected classification network in the fusion classification module employs the Focal Loss loss function during training:
[0035]
[0036] in, These are the class weight coefficients, used to balance positive and negative samples; This represents the model's predicted probability of the true class. is the focus factor, used to adjust the model's attention to samples of varying difficulty; p is the model's predicted probability that a sample will be classified as positive. It is the true category label of the sample.
[0037] Furthermore, during the training of the fully connected classification network, the Adam optimizer is used to update the model parameters, and cosine annealing learning rate scheduling is employed to obtain a smooth learning rate decay strategy.
[0038] The beneficial effects of this invention are as follows: This invention proposes a temporal structured grouping convolution method designed for the structural features of the left and right calf muscle groups. It divides surface electromyography (EMG) signals into left and right sides, extracts them separately in the temporal domain through convolution, and then fuses them across muscle groups using channel-mixed convolution. This effectively models the synergistic and differential activation patterns of bilateral muscles under pain conditions, improving the structural consistency of feature expression. It provides a surface EMG discrimination system and method for chronic leg pain that can explicitly characterize the anatomical relationship between the left and right muscle groups and effectively capture asymmetric dynamic features caused by muscle compensation. Furthermore, this invention constructs a three-class information fusion framework: temporal structural features, temporal asymmetric difference features, and frequency-domain temporal features. Cross-domain information integration is achieved through linear concatenation and a deep discriminant network, fully utilizing complementary time-frequency domain information to achieve high-precision identification of chronic leg pain, muscle compensation behavior, and muscle dynamic imbalance features. This effectively improves generalization ability, especially showing significant advantages in cross-subject validation. Attached Figure Description
[0039] Figure 1 This is a schematic diagram of the surface electromyography neural network discrimination system for chronic leg pain based on muscle compensation mechanism modeling of the present invention in one embodiment; Figure 2 This is a schematic diagram of the original signal in one embodiment; Figure 3 This is a schematic diagram of signals during operation in one embodiment; Figure 4 This is a schematic diagram of the surface electromyography neural network discrimination process for chronic leg pain based on muscle compensation mechanism modeling in one embodiment of the present invention. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0041] Example 1 like Figure 1 As shown, a surface electromyography (EMG) neural network discrimination system for chronic leg pain based on muscle compensation mechanism modeling includes: The data acquisition and preprocessing module is used to acquire surface electromyography signals from the subject's two legs and preprocess them to obtain discrete sample sequences. The temporal feature extraction module is configured to receive discrete sample sequences and perform temporal feature extraction using a parallel structured grouping convolutional sub-path and a temporal left-right muscle differential convolutional feature extraction sub-path. The structured grouping convolutional sub-path is used to group the muscles by left and right leg groups to extract intra-group co-activation features. The temporal left-right muscle differential convolutional feature extraction sub-path is used to calculate the second-order difference sequences of the left and right corresponding muscles and extract asymmetric dynamic features representing the muscle compensation mechanism. The temporal feature extraction module also includes a fusion unit, which is used to fuse the outputs of the above two sub-paths through learnable weight parameters to obtain a temporal fusion feature vector. The frequency domain feature extraction module is configured to extract frequency domain feature vectors of discrete sample sequences through short-time Fourier transform; The fusion classification module is used to concatenate the time-domain fusion feature vector with the frequency-domain feature vector and output the discrimination result of chronic leg pain through a fully connected network. The fully connected network in the fusion classification module adopts the Focal Loss loss function during training to enhance the learning ability of difficult-to-classify samples and minority class chronic pain samples, and optimizes the training process by combining cosine annealing learning rate scheduling, thereby improving the stability and generalization performance of the model under imbalanced data conditions.
[0042] In one specific embodiment, the surface electromyography signal includes the left gastrocnemius channel, the left peroneus longus channel, the right gastrocnemius channel, and the right peroneus longus channel.
[0043] In this embodiment, the original signal is as follows: Figure 2 As shown, the surface electrode patches of the 4-channel electromyography (EMG) acquisition device were attached to the gastrocnemius and peroneus longus muscles of the subject's legs. The channels were numbered as follows: CH0—left gastrocnemius sEMG channel, CH1—left peroneus longus sEMG channel, CH2—right gastrocnemius sEMG channel, CH3—right peroneus longus sEMG channel. The subject completed the task continuously under pre-recorded audio prompts. Each leg raise has a cycle of approximately 6 seconds.
[0044] In this embodiment, the preprocessed signal is as follows: Figure 3 As shown, the acquired raw sEMG is denormalized and bandpass filtered. After preprocessing such as artifact removal, the effective segments are truncated based on the action start marker to obtain a discrete sample sequence:
[0045] In one specific embodiment, the temporal feature extraction module includes a temporal left and right muscle difference convolution feature extraction sub-path, which comprises: a difference calculation unit, used to perform second-order difference operations on the left and right corresponding channels of the gastrocnemius and peroneus longus muscles respectively, and calculate the difference between the left and right second-order differences to obtain a difference sequence; and a feature extraction unit, configured to perform convolution operations on the difference sequence using convolution kernels with shared weights, so as to extract the compensatory dynamic patterns of different muscle pairs in the same parameter space.
[0046] In one specific embodiment, the frequency domain feature extraction module obtains a spectrogram by performing a short-time Fourier transform on the multi-channel signal, and rearranges the spectrogram into multiple local spectral segments in the time dimension; a channel attention mechanism is applied to each local spectral segment to generate weighting coefficients for different muscle channels to enhance the expression of pain-sensitive frequency bands; the weighted spectral segments are input into a depthwise separable convolutional layer to extract spatial features, and then input into a bidirectional LSTM network to extract temporal dependency features.
[0047] In one specific embodiment, temporal feature extraction is performed using a parallel structured grouping convolution sub-path and a temporal left and right muscle difference convolution feature extraction sub-path. The specific steps are as follows: The four-channel input is divided into two groups based on the left and right sides: left group: CH0 and CH1, right group: CH2 and CH3. Independent temporal convolutional kernels are applied to each group to extract intra-group co-activation patterns, resulting in two sub-tensors based on the left and right sides.
[0048]
[0049] in, i For channel indexing, n For time indexing, N The number of sample points for a single action; Apply a two-dimensional temporal convolution to each group, with a kernel size of C×T, where C is the channel dimension and T is the time window length. The stride s and zero-padding p are set according to design requirements to obtain the left-right co-activation map:
[0050] Where * denotes a two-dimensional convolution between the channel and time. For learnable kernel weights, For bias, F is the number of output channels, and N′ is the time length after convolution; and The data is concatenated along the channel dimension, then fused via convolution, followed by batch normalization, nonlinear activation, and pooling to finally obtain a structured temporal feature vector. .
[0051] In one specific embodiment, calculating the second-order difference sequence of the left and right corresponding muscles specifically includes: The discrete sample sequences were regrouped according to the muscle name to obtain the gastrocnemius muscle group sEMG: sEMG of the peroneus longus muscle group: ,in The values L and R represent the left leg and right leg, respectively.
[0052]
[0053] For any electromyography signal channel The result after smoothing filtering is defined as:
[0054] in: , represents the signal channel; n: the index of the current time point, i.e., the center position of the sliding window; t: the time series index within the neighborhood range, used to traverse the sampling points within the window range; W: the sliding window size, representing the number of time steps used for filtering.
[0055] Apply sliding mean filtering to the gastrocnemius and peroneus longus muscles respectively:
[0056]
[0057] After smoothing the left and right corresponding channels to suppress local noise, the second-order difference is calculated to explicitly amplify and characterize the asymmetric dynamics between the left and right corresponding muscles:
[0058]
[0059] Then, take the difference between the second-order differences of the left and right channels to obtain the difference sequence: Gastrocnemius muscle differential sequence:
[0060] Difference sequence of peroneus longus muscle:
[0061] The above difference sequences are arranged into a multi-channel matrix according to muscle pairs. The matrix has the following form:
[0062] The input is fed into a weight-shared temporal convolutional unit (shared convolutional kernel) for dynamic feature extraction, thereby abstracting the compensatory dynamic patterns of different muscle pairs within the same parameter space and outputting the feature vector of the difference path. .
[0063] In one specific embodiment, the temporal fusion feature vector is obtained by fusing the outputs of the two sub-paths using learnable weight parameters. The specific calculation formula is as follows:
[0064] in, and The weights are normalized and are calculated as follows:
[0065]
[0066]
[0067] in, and These are the original weight parameters that can be learned during network training.
[0068] In one specific embodiment, the fully connected classification network in the fusion classification module uses the Focal Loss loss function during training:
[0069]
[0070] in, These are the class weight coefficients, used to balance positive and negative samples; This represents the model's predicted probability of the true class. is the focus factor, used to adjust the model's attention to samples of varying difficulty; p is the model's predicted probability that a sample will be classified as positive. It is the true category label of the sample.
[0071] In one specific embodiment, during the training process of the fully connected classification network, the Adam optimizer is also used to update the model parameters, and cosine annealing learning rate scheduling is used to obtain a smooth learning rate decay strategy.
[0072] In this embodiment, the present invention introduces structured grouped convolution in the temporal domain, dividing the four-channel calf electromyography signals into two groups according to the left and right limbs, and constructing convolutional pathways within each group to extract the co-activation patterns of muscles within the group. This structured modeling approach fully utilizes the anatomical priors of the left and right calf muscle groups, enabling the network to identify activation changes related to specific anatomical regions, improving the interpretability and specificity of the model, and compensating for the lack of structural priors in existing deep learning methods. The present invention introduces smoothed second-order differences into the differential modeling of left and right corresponding muscles, and performs unified pattern abstraction on the difference sequences through shared-temporal convolution, which can stably extract the dynamic features of "activation inhibition-contralateral compensation" caused by pain. Second-order differences have the advantages of enhancing changes, suppressing common trends, and reducing baseline drift, which can significantly improve the signal-to-noise ratio of left-right asymmetric information, thereby effectively characterizing the muscle compensation mechanism. Compared with traditional amplitude features or ordinary convolution directly processing the original signal, the present invention is more sensitive to compensation patterns and has stronger discriminative ability. The structured path and differential path focus on intragroup co-activation and cross-side differential dynamics, respectively. This invention adaptively controls the contribution ratio of the two types of features in different samples through trainable soft fusion weights, which can adaptively adjust the feature emphasis across subjects and different behavioral states, improving the applicability and generalization ability of the model. Compared with simple splicing and fusion with a fixed ratio, the learnable fusion strategy of this invention can achieve better temporal information scheduling. In the frequency domain branch, this invention uses short-time Fourier transform (STFT) to obtain time-frequency representation, and selectively emphasizes the contribution of different muscles in specific frequency bands through local spectral patch construction and channel attention mechanism. Subsequently, the temporal dependency relationship between spectral patches is modeled through depthwise separable convolution and bidirectional LSTM. This design can highlight the characteristics such as decreased muscle excitability and high-frequency energy decay in pain states, making the frequency domain representation more targeted. Compared with traditional full-spectrum convolution or methods without attention mechanism, this invention has significant advantages in frequency domain discrimination accuracy and feature interpretability. This invention splices temporal fusion features and frequency domain attention features in the feature dimension, and performs discrimination learning through a multi-layer fully connected network. In chronic pain, left-right asymmetric changes caused by muscle compensation and spectral energy transfer often coexist. The time-frequency joint strategy of this invention can simultaneously capture these two complementary signals, improving the performance of the discriminative model in scenarios with weak features and multimodal features. This invention enhances the learning efficiency for difficult-to-classify and minority class samples through Focal Loss, avoiding the model being dominated by a large number of easily classified healthy samples; it employs cosine annealing learning rate scheduling to ensure smooth convergence during training, reducing oscillations and improving the overall stability and generalization performance of the model. This combined training strategy can effectively address practical problems such as imbalanced self-collected pain data and large differences in compensation patterns. This invention uses lightweight structures such as structured convolution, shared convolution, and depthwise separable convolution, with significantly lower parameter count and computational cost than traditional large-scale convolutional networks, making it suitable for deployment in embedded devices, wearable systems, or edge computing units.Furthermore, this invention also provides implementations of the method, system, and storage medium, allowing the discrimination process to be executed via a processor, facilitating engineering implementation. Because this invention combines anatomical structures, compensatory mechanisms, time-frequency joint features, and hard sample learning strategies, it exhibits stronger generalization ability across subjects, different pain levels, and different acquisition conditions. This effectively improves the reliability and stability of surface electromyography (EMG) discrimination for chronic leg pain, contributing to the application of clinical assessment and home-based rehabilitation monitoring systems.
[0073] Example 2 In this embodiment, the surface electromyography neural network discriminant system for chronic leg pain based on muscle compensation mechanism modeling was used for discrimination. The specific steps are as follows: Thirty-eight healthy volunteers aged 22-30 years and 20 patients aged 30-60 years diagnosed with nonspecific lower limb muscle pain at Guangdong Provincial People's Hospital were selected. Diagnoses included myofascial pain syndrome, fibromyalgia syndrome, and knee osteoarthritis. The electromyography (EMG) signal acquisition device was set to a sampling frequency of 2000Hz, and surface electrode patches were placed on the gastrocnemius and peroneus longus muscles of both legs. Under pre-recorded voice guidance, participants performed 35 consecutive leg raises, each repetition lasting approximately 3 seconds. Baseline noise and high-frequency components were removed using a Butterworth high-pass filter, and sEMG signals from 10Hz to 160Hz were extracted. Filtered EMG signals from healthy and pain subjects were plotted. Non-action-induced EMG potentials were manually removed, while action-induced EMG potentials were retained. A fixed length of 3 seconds (6000 sampling points) was used as one sEMG sample. sEMG samples from healthy volunteers and pain patients were labeled as "non-painful / painful," respectively. Data was stratified by subject and 10-fold cross-validation was used to ensure the robustness of the assessment and its generalization ability across subjects. Data augmentation strategies (such as signal time slicing, mild noise perturbation, and amplitude scaling) can be used to improve the diversity of training samples, but these are not mandatory steps.
[0074] In one embodiment for verifying the effectiveness of the present invention, the training parameters of the neural network model can be set as follows: the Adam optimization algorithm is used for parameter updates, and the initial learning rate is set to 0.001; a dynamic learning rate adjustment strategy is introduced during training, preferably using cosine annealing for learning rate scheduling, with the minimum learning rate eta_min set to 1×10. -5 The loss function used is Focal Loss, where the class weight coefficients are... The focus factor γ was set to 1.3, the batch size for model training was set to 8, and the number of training epochs was set to 100. During model training, the discrimination accuracy and loss value were calculated on the validation dataset for each training epoch, and the optimal model parameters were saved based on the validation results. Simultaneously, k=10-fold cross-validation was used to statistically summarize the model performance to evaluate the stability and generalization ability of the method in the chronic leg pain discrimination task. It should be noted that the above parameter settings are only used to illustrate the feasibility of the technical solution of this invention in practical applications and do not constitute a limitation on the scope of protection of this invention.
[0075] In this embodiment, commonly used evaluation metrics in the field of model classification performance assessment are employed to evaluate the performance of the chronic leg pain discrimination model. These metrics include accuracy (ACC) and macro-average F1 score (MF1). Accuracy reflects the overall correctness of the model in distinguishing between chronic leg pain samples and non-chronic leg pain samples. The macro-average F1 score, by calculating the precision and recall for each category and then comprehensively evaluating them, can more comprehensively reflect the model's classification performance even in cases of imbalanced sample distribution.
[0076] The chronic leg pain discrimination model based on muscle compensation mechanism proposed in this invention was experimentally verified on the aforementioned constructed dataset. The above evaluation indicators were used to comprehensively evaluate the discrimination accuracy, stability and generalization performance of the model in practical application scenarios.
[0077] To verify the effectiveness of the method of this invention, two existing deep learning models with dual-branch structures were selected as comparison methods. The HMMFD model employs a dual-branch convolutional neural network architecture, with one branch introducing a self-attention mechanism to extract the temporal features of surface electromyography (EMG) signals, and the other branch extracting the corresponding frequency domain features. The DeepLap model is a multi-task deep learning method based on a heterogeneous dual-stream structure, processing the temporal and frequency domain features of EMG signals separately, and fusing the correlation information between symmetrical muscle group signals through a cross-layer convolutional network to improve the accuracy of symptom muscle identification. It should be noted that although the above comparison models introduce muscle group correlation or compensation information at the feature level, they do not explicitly model the muscle compensation mechanism in chronic leg pain scenarios. Their network structures do not reflect feature constraints or discrimination logic based on the compensation mechanism, which is fundamentally different from the chronic leg pain discrimination method based on muscle compensation mechanism modeling proposed in this invention.
[0078] In this embodiment, Table 1 presents a comparison of the experimental results of the method of the present invention and the comparative method on the dataset.
[0079] Table 1
[0080] In this embodiment, to further analyze the impact of each functional module of the present invention on the performance of chronic leg pain discrimination, the following ablation experiments were designed and conducted: In one comparison setting, the model did not enable the feature extraction sub-path based on left and right muscle differential convolution in the temporal branch; in another comparison setting, the model did not enable the feature extraction sub-path based on structured group convolution in the temporal branch; under the above comparison settings, the model retained the remaining network structure unchanged. In addition, model structures with the temporal branch removed and the frequency branch removed were respectively set, as well as a comparison model in which the original FocalLoss loss function applicable to class imbalance scenarios was replaced with the ordinary cross-entropy loss function.
[0081] The results of the ablation experiments are shown in Table 2. Comparing the experimental results of the complete model with those of the ablation models mentioned above, it can be seen that the failure to introduce any sub-path based on muscle compensation mechanism modeling in the time-domain branch, or the use of only a single time-domain or frequency-domain feature extraction module, will lead to varying degrees of decline in the model's discrimination performance. This indicates that the multi-branch modeling method based on muscle compensation mechanism proposed in this invention plays an important role in the chronic leg pain discrimination task.
[0082] Table 2
[0083] In this embodiment, the present invention proposes a temporal structured grouping convolution method designed for the structural features of the left and right calf muscle groups. The four-channel surface electromyography (EMG) signals are divided into left and right groups according to anatomical location, and convolution is performed separately in the temporal domain for extraction. Then, cross-muscle group fusion is performed through channel-mixed convolution, effectively modeling the synergistic and differential activation patterns of bilateral muscles under pain conditions, improving the structural consistency of feature expression. The present invention innovatively performs second-order difference operations on the corresponding muscle channels of the left and right sides, constructing difference pairs as new feature inputs. Second-order difference enhances the weak asymmetric activation differences of the left and right muscles under pain conditions, while suppressing the influence of absolute amplitude and low-frequency drift, making the compensatory correlation pattern more significant and improving the accuracy and stability of asymmetry detection. Based on the second-order difference features, the present invention uses a shared-temporal convolution kernel to extract temporal difference patterns, and adaptively weights and fuses them with the temporal features output by the structured grouping convolution path through learnable parameters. This achieves dynamic weight matching of "left-right symmetrical structural features" and "compensatory asymmetric features," obtaining a temporal comprehensive representation automatically optimized for different samples. This invention introduces patch-channel attention into frequency domain feature extraction for the first time. By modeling the channel sensitivity of the spectrum generated by STFT on a time-segment basis, independent channel weights are generated for each spectrum segment, thereby highlighting pain-related local energy changes and suppressing noise, improving the responsiveness of frequency domain features to muscle fatigue, compensation, and abnormal activity. This invention employs depthwise-separable convolution for local spatial feature extraction of the spectrum to reduce the number of parameters and maintain channel independence. Subsequently, bidirectional LSTM is used to capture the dynamic trends of frequency domain spectrum segments over time, providing a high-order semantic feature representation that combines time and frequency, reflecting pain-related dynamic muscle behavior better than traditional frequency domain CNNs. This invention constructs a three-class information fusion framework consisting of temporal structural features, temporal asymmetric difference features, and frequency domain temporal features. Cross-domain information integration is achieved through linear concatenation and a deep discriminative network, enabling high-precision identification of chronic leg pain, muscle compensation behavior, and muscle dynamic imbalance features. This fusion framework effectively improves generalization ability, especially showing significant advantages in cross-subject validation.
[0084] Example 3 like Figure 4 As shown, a surface electromyography (EMG) neural network-based method for discriminating chronic leg pain based on muscle compensation mechanisms includes the following steps: Electromyography (EMG) signals from the subject's two legs were collected and preprocessed to obtain discrete sample sequences. The signal is preprocessed to extract the effective segment of the action, resulting in a discrete sample sequence. Grouping the left and right leg muscle groups to extract intra-group co-activation features; calculating the second-order difference sequences of the left and right corresponding muscles, and extracting asymmetric dynamic features representing the muscle compensation mechanism by sharing convolution kernels; and weighting and fusing the two features by learnable weight parameters to obtain a temporal fusion feature vector. Frequency domain feature vectors of discrete sample sequences are extracted using short-time Fourier transform. The time-domain fused feature vector is concatenated with the frequency-domain feature vector, and the discrimination result of chronic leg pain is output through a fully connected network.
Claims
1. A surface electromyography (EMG) neural network-based discriminant method for chronic leg pain based on muscle compensation mechanism modeling, characterized in that, Includes the following steps: Electromyography (EMG) signals from the subject's two legs were collected and preprocessed to obtain discrete sample sequences. The signal is preprocessed to extract the effective segment of the action, resulting in a discrete sample sequence. Grouping by left and right leg muscle groups to extract intra-group co-activation features; Calculate the second-order difference sequences of the left and right corresponding muscles, and extract asymmetric dynamic features representing the muscle compensation mechanism by sharing convolution kernels; The two features are weighted and fused using learnable weight parameters to obtain a temporal fusion feature vector; Frequency domain feature vectors of discrete sample sequences are extracted using short-time Fourier transform. The time-domain fused feature vector is concatenated with the frequency-domain feature vector, and the discrimination result of chronic leg pain is output through a fully connected network.
2. A surface electromyography neural network discriminant system for chronic leg pain based on muscle compensation mechanism modeling, characterized in that, include: The data acquisition and preprocessing module is used to acquire surface electromyography signals from the subject's two legs and preprocess them to obtain discrete sample sequences. The temporal feature extraction module is configured to receive discrete sample sequences and perform temporal feature extraction using a parallel structured grouping convolutional sub-path and a temporal left-right muscle differential convolutional feature extraction sub-path. The structured grouping convolutional sub-path is used to group the muscles by left and right leg groups to extract intra-group co-activation features. The temporal left-right muscle differential convolutional feature extraction sub-path is used to calculate the second-order difference sequences of the left and right corresponding muscles and extract asymmetric dynamic features representing the muscle compensation mechanism. The temporal feature extraction module also includes a fusion unit, which is used to fuse the outputs of the above two sub-paths through learnable weight parameters to obtain a temporal fusion feature vector. The frequency domain feature extraction module is configured to extract frequency domain feature vectors of discrete sample sequences through short-time Fourier transform; The fusion classification module is used to concatenate the time-domain fusion feature vector with the frequency-domain feature vector, and output the discrimination result of chronic leg pain through a fully connected network; The fully connected network in the fusion classification module employs the Focal Loss loss function during training to enhance its learning ability for difficult-to-classify samples and minority class chronic pain samples. It also combines cosine annealing learning rate scheduling to optimize the training process, thereby improving the model's stability and generalization performance under imbalanced data conditions.
3. The system according to claim 2, characterized in that, The surface electromyography signals include the left gastrocnemius channel, the left peroneus longus channel, the right gastrocnemius channel, and the right peroneus longus channel.
4. The system according to claim 2, characterized in that, The temporal feature extraction module includes a temporal left and right muscle difference convolution feature extraction sub-path, which is used to perform second-order difference operations on the left and right corresponding channels of the gastrocnemius and peroneus longus muscles respectively, and calculate the difference between the left and right second-order differences to obtain a difference sequence; and a feature extraction unit configured to perform convolution operation on the difference sequence using a convolution kernel with shared weights, so as to extract the compensatory dynamic patterns of different muscle pairs in the same parameter space.
5. The system according to claim 2, characterized in that, The frequency domain feature extraction module obtains a spectrum by performing a short-time Fourier transform on the multi-channel signal, and rearranges the spectrum into multiple local spectral segments in the time dimension; a channel attention mechanism is applied to each local spectral segment to generate weighting coefficients for different muscle channels to enhance the expression of pain-sensitive frequency bands; the weighted spectral segments are input into a depthwise separable convolutional layer to extract spatial features, and then input into a bidirectional LSTM network to extract temporal dependency features.
6. The system according to claim 2, characterized in that, Temporal feature extraction is performed using a parallel structured grouping convolution sub-path and a temporal left and right muscle difference convolution feature extraction sub-path. The specific steps are as follows: The four-channel input is divided into two groups based on the left and right sides: left group: CH0 and CH1, right group: CH2 and CH3. Independent temporal convolutional kernels are applied to each group to extract intra-group co-activation patterns, resulting in two sub-tensors based on the left and right sides. in, i For channel index, n For time indexing, N The number of sample points for a single action; Apply a two-dimensional temporal convolution to each group, with a kernel size of C×T, where C is the channel dimension and T is the time window length. The stride s and zero-padding p are set according to design requirements to obtain the left-right co-activation map: Where * denotes a two-dimensional convolution between the channel and time. For learnable kernel weights, For bias, F is the number of output channels, and N′ is the time length after convolution; and The data is concatenated along the channel dimension, then fused via convolution, followed by batch normalization, nonlinear activation, and pooling to finally obtain a structured temporal feature vector. .
7. The system according to claim 2, characterized in that, The discrete sample sequences were regrouped according to the muscle name to obtain the gastrocnemius muscle group sEMG: sEMG of the peroneus longus muscle group: ,in The values L and R represent the left leg and right leg, respectively. For any electromyography signal channel The result after smoothing filtering is defined as: in: , representing the signal channel; n: the index of the current time point, i.e., the center position of the sliding window; t: the time series index within the neighborhood range, used to traverse the sampling points within the window range; W: the sliding window size, representing the number of time steps used for filtering; Apply sliding mean filtering to the gastrocnemius and peroneus longus muscles respectively: After smoothing the left and right corresponding channels to suppress local noise, the second-order difference is calculated to explicitly amplify and characterize the asymmetric dynamics between the left and right corresponding muscles: Then, take the difference between the second-order differences of the left and right channels to obtain the difference sequence: Gastrocnemius muscle differential sequence: Difference sequence of peroneus longus muscle: The above difference sequences are arranged into a multi-channel matrix according to muscle pairs. The matrix has the following form: The input is fed into a weight-shared temporal convolutional unit (shared convolutional kernel) for dynamic feature extraction, thereby abstracting the compensatory dynamic patterns of different muscle pairs within the same parameter space and outputting the feature vector of the difference path. .
8. The system according to claim 6, characterized in that, The temporal fusion feature vector is obtained by fusing the outputs of the two sub-paths using learnable weight parameters. The specific calculation formula is as follows: in, and The weights are normalized and are calculated as follows: in, and These are the original weight parameters that can be learned during network training.
9. The system according to claim 2, characterized in that, The fully connected classification network in the fusion classification module uses the Focal Loss loss function during training. in, This represents the model's predicted probability of the true class. These are the class weight coefficients, used to balance positive and negative samples; This is a focus factor used to adjust the model's attention to samples classified as easy or difficult. It's a real label.
10. The system according to claim 9, characterized in that, During the training of the fully connected classification network, the Adam optimizer is used to update the model parameters, and cosine annealing learning rate scheduling is used to obtain a smooth learning rate decay strategy.