Algorithm for calculating electroencephalogram index of chronic pain

Through the multi-layer perceptron architecture, the EEG index algorithm designed with the multi-layer perceptron architecture, combined with data preprocessing and multi-scale information fusion, the problem that the existing technology cannot achieve cross-channel and cross-frequency domain EEG feature calculations is solved, and a more comprehensive and accurate assessment of chronic pain is achieved.

CN119943375APending Publication Date: 2025-05-06MACAU UNIV OF SCI & TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411908599.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

The existing EEG characteristic index calculation cannot realize EEG characteristic calculations across channels and across frequency domains, cannot reflect the correlation between brain function, and it is difficult to observe and self-monitor the psychological state of patients with chronic pain in real time.

Method used

The EEG index algorithm designed with a multi-layer perceptron architecture includes data preprocessing, model training, model evaluation and multi-scale information fusion stages. By extracting and fusing the EEG features of different frequency bands and channels, the EEG index of chronic pain is calculated.

Benefits of technology

A more comprehensive description of the association between brain neural activity and chronic pain was achieved, and hidden pain-related patterns were discovered, avoiding the limitations of single feature analysis, which helped to comprehensively evaluate chronic pain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure SMS_1
    Figure SMS_1
  • Figure SMS_2
    Figure SMS_2
  • Figure SMS_3
    Figure SMS_3
Patent Text Reader

Abstract

The invention relates to the technical field of electroencephalogram characteristic index calculation, and discloses a chronic pain electroencephalogram index calculation algorithm, which comprises a data preprocessing stage, a multi-layer perceptron architecture design, a model training stage, a model evaluation stage and a multi-scale information fusion stage. The data preprocessing stage further comprises normalization and data division; the architecture design of the multi-layer sensor comprises an input layer, a hidden layer and an output layer; the model training stage comprises a loss function and optimization algorithm, forward propagation, loss calculation, back propagation and parameter updating one-set repeated training; in the model evaluation stage, evaluation needs to be carried out on a test set, and hyper-parameters are adjusted. According to the method, the connection strength or the activity level of different regions of the brain under different threshold values is reflected, the association between the brain nerve activity and the chronic pain can be described more comprehensively by fusing the connection strength or the activity level, the pain related mode hidden in the association can be mined, the limitation of single feature analysis is avoided, and comprehensive evaluation of the chronic pain is facilitated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electroencephalogram characteristic index calculation, and in particular to an electroencephalogram index algorithm for calculating chronic pain. Background Art

[0002] Chronic pain refers to pain that lasts for more than 3 to 6 months. Unlike acute pain, chronic pain is an independent disease that lasts longer than the expected healing time. Chronic pain not only affects patients' daily eating and conversation, but also causes emotional, affective and cognitive distress. Chronic pain can easily induce sleep disorders, insomnia, anxiety, depression and other psychological diseases because it causes pain to patients over a long period of time.

[0003] When treating patients with chronic pain, it is difficult for patients to observe their own mental state in real time when implementing the psychological habit correction program, which makes it impossible to achieve self-monitoring. Therefore, it is necessary to use the calculation of EEG signal features to reflect the patient's pain state and calculate by extracting the patient's EEG features. However, the calculation of existing EEG feature indicators can generally only perform a single calculation, and cannot achieve cross-channel and cross-frequency domain EEG feature calculation, that is, it cannot reflect the problem of the correlation of brain functions. Summary of the invention

[0004] The purpose of the present invention is to provide an algorithm for calculating EEG indicators of chronic pain, which can effectively solve the problems in the background technology.

[0005] To achieve the above object, the technical solution adopted by the present invention is:

[0006] An algorithm for calculating EEG indicators of chronic pain, including a data preprocessing stage, a multi-layer perceptron architecture design, a model training stage, a model evaluation stage, and a multi-scale information fusion stage;

[0007] The data preprocessing stage also includes normalization and data partitioning;

[0008] The architecture design of the multi-layer perceptron includes an input layer, a hidden layer and an output layer;

[0009] The model training phase includes a set of repeated training including loss function and optimization algorithm, forward propagation, loss calculation, back propagation, and parameter update;

[0010] The model evaluation phase needs to be evaluated on the test set and the hyperparameters need to be adjusted;

[0011] The multi-scale information fusion includes a feature fusion stage and a fusion effect verification stage.

[0012] As a further preferred embodiment of the present invention, before the data preprocessing stage, EEG features are extracted, and the EEG data of each channel collected from chronic pain patients are preprocessed respectively using a 50 Hz notch filter and independent component analysis to remove power frequency interference, motion artifacts and eye movement noise in the EEG data, and the EEG data components of ALPHA, BETA, THETA and GAMMA frequency bands are extracted from the EEG data of each channel using a zero-phase digital bandpass filter, wherein the ALPHA frequency band represents 8 to 12 Hz, the BETA frequency band represents 13 to 30 Hz, the THETA frequency band represents 4 to 7 Hz, and the GAMMA frequency band represents 30 to 90 Hz;

[0013] The EEG features of different channels and different frequency domains are obtained by calculating the adjacency matrix for each frequency band and the adjacency matrix between two frequency bands. In the adjacency matrix, the value of the i-th row and j-th column is calculated by the Pearson product-moment correlation coefficient between the i-th channel EEG and the j-th channel EEG. The calculation formula is:

[0014]

[0015] Among them, m k,ij represents the value of the i-th row and j-th column in the adjacency matrix of the k-th frequency band, X k,i and X k,j They represent the i-th channel discrete EEG signal of the k-th frequency band and the j-th channel discrete EEG signal of the k-th frequency band respectively. When the values ​​in the adjacency matrix are subjected to feature selection, the correlation distance between the i-th channel discrete EEG signal of the k-th frequency band and the j-th channel discrete EEG signal used for subsequent feature fusion is

[0016]

[0017] Among them, m k,th Represents the threshold value of the kth frequency band used to filter channels that are too far away;

[0018] In the adjacency matrix between the qth frequency band and the pth frequency band, the value of the i-th row and j-th column is calculated by the Pearson product-moment correlation coefficient between the i-th channel EEG of the qth frequency band and the j-th channel EEG of the pth frequency band. The calculation formula is:

[0019]

[0020] Among them, m pq,ij represents the value of the i-th row and j-th column in the adjacency matrix between the q-th frequency band and the p-th frequency band, X p,i and X q,jThey represent the discrete EEG signals of the ith channel of the pth frequency band and the jth channel of the qth frequency band respectively. The correlation distance between the discrete EEG signals of the ith channel of the pth frequency band and the discrete EEG signals of the jth channel of the qth frequency band used for subsequent feature fusion is

[0021]

[0022] Among them, m pq,th Represents the threshold used to filter channels that are too far away in the adjacency matrix between the qth frequency band and the pth frequency band.

[0023] As a further preferred embodiment of the present invention, when normalizing the data, for the feature vector x=(x1, x2, ..., x n ), and normalize the minimum-maximum, the formula is:

[0024]

[0025] f k,ij and f pq,ij The features are normalized so that their value range is between [0-1];

[0026] In the data division stage, the data set is divided into a training set, a validation set, and a test set. Assuming the total number of samples is N, the number of samples in the training set is N. train =0.7N, number of samples in the validation set N υal =0.15N, number of test set samples N test =0.15N.

[0027] As a further preferred embodiment of the present invention, the number of nodes in the input layer of the multilayer perceptron architecture design stage depends on the dimension of the feature. The number of nodes in the input layer is n features, f pq,ij If there are m features, then the number of nodes in the input layer is n+m;

[0028] The input data X is a two-dimensional matrix, each row represents a sample, and each column represents a feature, that is, Where N is the number of samples;

[0029] The number of layers and nodes of the hidden layer is determined by experiment. For example, if 1-3 hidden layers are set, the number of nodes h1 of the first hidden layer can be determined according to the empirical formula Where A is a small adjustment constant, usually between 1 and 10) to initially determine the number of nodes in the subsequent hidden layers, and the number of nodes in the second hidden layer can be gradually reduced. The number of nodes in the third hidden layer

[0030] In the hidden layer, the activation function RELU function is used;

[0031] The output layer has only one node, and the activation function of the output layer selects a linear function, which can directly output the predicted chronic pain EEG index value.

[0032] As a further preferred embodiment of the present invention, the loss function adopts mean square error, assuming that y i is the true chronic pain EEG index value of the i-th sample, y i is the chronic pain EEG index value of the i-th sample predicted by the model, and the calculation formula of the mean square error is That is, the model can be trained by minimizing the mean square error, which can make the predicted value as close to the true value as possible;

[0033] The optimization algorithm can select stochastic gradient descent and its variant ADAM algorithm to optimize model parameters. The process of updating parameters in each iteration of ADAM algorithm is as follows:

[0034] Compute the gradient:

[0035] Update first-order moment estimate: m t =β1m t-1 +(1-β1)g t ,

[0036] Update the second moment estimate:

[0037] Modified first moment estimate:

[0038] Modified second moment estimate:

[0039] Update parameters:

[0040] Among them, α is the learning rate, β1 and β2 are the decay rates (usually β1 = 0.9, β2 = 0.999), and ∈ is a small number (to prevent division by zero, usually ∈ = 10 -8 ).

[0041] As a further preferred embodiment of the present invention, in the process of forward propagation, the training set data is input into the multilayer perceptron, and the predicted value is calculated in sequence through the input layer, hidden layer and output layer. i , the output of the lth hidden layer (l = 1, 2, ..., L, L is the number of hidden layers) is calculated as follows:

[0042] Input Layer:

[0043] Hidden Layer: Where σ is the activation function (such as RELU), W l is the weight matrix of the lth layer, b l is the bias vector of the lth layer.

[0044] Output layer:

[0045] Then, the loss function value is calculated based on the predicted value and the true value;

[0046] During back propagation:

[0047] For the output layer:

[0048] For the hidden layers (calculated layer by layer from the last hidden layer forward):

[0049]

[0050] Where ⊙ represents element-wise multiplication, σ′ is the derivative of the activation function;

[0051] When updating the parameters, use the optimization algorithm to update the model parameters according to the calculated gradients, and repeat the above steps until the preset number of training rounds is reached or the validation set loss no longer decreases.

[0052] As a further preferred embodiment of the present invention, when evaluating on the test set, the trained model is used to predict the test set to obtain the predicted chronic pain EEG index value, and the root mean square error is used:

[0053]

[0054] Mean absolute error:

[0055] Coefficient of determination: in is the average of the true values ​​of the test set;

[0056] According to the performance of the model on the validation set, the hyperparameters of the multilayer perceptron are adjusted. Grid search or random search methods can be used to find the optimal hyperparameter combination.

[0057] As a further preferred embodiment of the present invention, in the feature fusion principle stage, in the multi-layer perceptron training process, features f of different scales are actually fused. k,ij and f pq,ij Fusion: Through the hidden layers of the multi-layer perceptron, the input features are transformed nonlinearly layer by layer, so that the model can learn the complex relationship between different features, thereby realizing the fusion of multi-scale information;

[0058] When verifying the fusion effect, the effect of multi-scale information fusion can be verified by analyzing the weight distribution of different features of the model at different training stages.

[0059] Compared with the prior art, the present invention has the following beneficial effects:

[0060] In the present invention, the connection strength or activity level of different brain regions at different thresholds is reflected. Their fusion can more comprehensively describe the association between brain neural activity and chronic pain, and can unearth the pain-related patterns hidden therein, avoiding the limitations of single feature analysis and facilitating a comprehensive assessment of chronic pain. DETAILED DESCRIPTION

[0061] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further explained below in conjunction with specific implementation methods.

[0062] The present invention provides an algorithm for calculating the EEG index of chronic pain, including a data preprocessing stage, a multi-layer perceptron architecture design, a model training stage, a model evaluation stage, and a multi-scale information fusion stage;

[0063] The data preprocessing stage also includes normalization and data partitioning;

[0064] The architecture design of the multi-layer perceptron includes input layer, hidden layer and output layer;

[0065] The model training phase includes loss function and optimization algorithm, forward propagation, loss calculation, back propagation, parameter update and repeated training;

[0066] The model evaluation phase needs to be evaluated on the test set and the hyperparameters need to be adjusted;

[0067] Multi-scale information fusion includes the feature fusion stage and the fusion effect verification stage.

[0068] Before the data preprocessing stage, EEG features were extracted. The EEG data of each channel collected from chronic pain patients were preprocessed using a 50 Hz notch filter and independent component analysis to remove power frequency interference, motion artifacts, and eye movement noise in the EEG data. In addition, a zero-phase digital bandpass filter was used to extract the EEG data components of the ALPHA, BETA, THETA, and GAMMA frequency bands from the EEG data of each channel, where the ALPHA frequency band represents 8 to 12 Hz, the BETA frequency band represents 13 to 30 Hz, the THETA frequency band represents 4 to 7 Hz, and the GAMMA frequency band represents 30 to 90 Hz.

[0069] The EEG features of different channels and different frequency domains are obtained by calculating the adjacency matrix for each frequency band and the adjacency matrix between two frequency bands. In the adjacency matrix, the value of the i-th row and j-th column is calculated by the Pearson product-moment correlation coefficient between the i-th channel EEG and the j-th channel EEG. The calculation formula is:

[0070]

[0071] Among them, m k,ij represents the value of the i-th row and j-th column in the adjacency matrix of the k-th frequency band, X k,i and X k,j They represent the i-th channel discrete EEG signal of the k-th frequency band and the j-th channel discrete EEG signal of the k-th frequency band respectively. When the values ​​in the adjacency matrix are subjected to feature selection, the correlation distance between the i-th channel discrete EEG signal of the k-th frequency band and the j-th channel discrete EEG signal used for subsequent feature fusion is

[0072]

[0073] Among them, m k,th Represents the threshold value of the kth frequency band used to filter channels that are too far away;

[0074] In the adjacency matrix between the qth frequency band and the pth frequency band, the value of the i-th row and j-th column is calculated by the Pearson product-moment correlation coefficient between the i-th channel EEG of the qth frequency band and the j-th channel EEG of the pth frequency band. The calculation formula is:

[0075]

[0076] Among them, m pq,ij represents the value of the i-th row and j-th column in the adjacency matrix between the q-th frequency band and the p-th frequency band, X p,i and X q,j They represent the discrete EEG signals of the ith channel of the pth frequency band and the jth channel of the qth frequency band respectively. The correlation distance between the discrete EEG signals of the ith channel of the pth frequency band and the discrete EEG signals of the jth channel of the qth frequency band used for subsequent feature fusion is

[0077]

[0078] Among them, m pq,th Represents the threshold used to filter channels that are too far away in the adjacency matrix between the qth frequency band and the pth frequency band.

[0079] When normalizing the data, for the feature vector x=(x1, x2, ..., x n ), and normalize the minimum-maximum, the formula is:

[0080]

[0081] f k,ij and f pq,ij The features are normalized so that their value range is between [0-1];

[0082] In the data division stage, the data set is divided into a training set, a validation set, and a test set. Assuming the total number of samples is N, the number of samples in the training set is N. tranin =0.7N, number of samples in the validation set N υal =0.15N, number of test set samples N test =0.15N; The number of nodes in the input layer of the multilayer perceptron architecture design stage depends on the dimension of the feature. The number of nodes in the input layer is n features, f pq,ij If there are m features, then the number of nodes in the input layer is n+m;

[0083] The input data X is a two-dimensional matrix, each row represents a sample, and each column represents a feature, that is, Where N is the number of samples;

[0084] The number of hidden layers and nodes is determined experimentally. For example, if 1-3 hidden layers are set, the number of nodes in the first hidden layer h1 can be determined according to the empirical formula Where A is a small adjustment constant, usually between 1 and 10) to initially determine the number of nodes in the subsequent hidden layers, and the number of nodes in the second hidden layer can be gradually reduced. The number of nodes in the third hidden layer

[0085] In the hidden layer, the activation function RELU function is used;

[0086] The output layer has only one node, and the activation function of the output layer selects a linear function, which can directly output the predicted chronic pain EEG index value; the loss function uses the mean square error, assuming y i is the true chronic pain EEG index value of the i-th sample, y i is the chronic pain EEG index value of the i-th sample predicted by the model, and the calculation formula of the mean square error is That is, the model can be trained by minimizing the mean square error, which can make the predicted value as close to the true value as possible;

[0087] The optimization algorithm can choose stochastic gradient descent and its variant ADAM algorithm to optimize model parameters. The process of ADAM algorithm updating parameters in each iteration is as follows:

[0088] Compute the gradient:

[0089] Update first-order moment estimate: m t =β1mt-1 +(1-β1)g t ,

[0090] Update the second moment estimate:

[0091] Modified first moment estimate:

[0092] Modified second moment estimate:

[0093] Update parameters:

[0094] Among them, α is the learning rate, β1 and β2 are the decay rates (usually β1 = 0.9, β2 = 0.999), and ∈ is a small number (to prevent division by zero, usually ∈ = 10 -8 ); In the process of forward propagation, the training set data is input into the multilayer perceptron, and the predicted value is calculated in sequence through the input layer, hidden layer and output layer. For the input sample x i , the output of the lth hidden layer (l = 1, 2, ..., L, L is the number of hidden layers) is calculated as follows:

[0095] Input Layer:

[0096] Hidden Layer: Where σ is the activation function (such as RELU), W l is the weight matrix of the lth layer, b l is the bias vector of the lth layer.

[0097] Output layer:

[0098] Then, the loss function value is calculated based on the predicted value and the true value;

[0099] During back propagation:

[0100] For the output layer:

[0101] For the hidden layers (calculated layer by layer from the last hidden layer forward):

[0102]

[0103] Where ⊙ represents element-wise multiplication, σ′ is the derivative of the activation function;

[0104] When updating the parameters, the optimization algorithm is used to update the model parameters according to the calculated gradients, and the above steps are repeated until the preset number of training rounds is reached or the validation set loss no longer decreases; when evaluating on the test set, the trained model is used to predict the test set to obtain the predicted chronic pain EEG index value, using the root mean square error:

[0105]

[0106] Mean absolute error:

[0107] Coefficient of determination: in is the average of the true values ​​of the test set;

[0108] According to the performance of the model on the validation set, the hyperparameters of the multilayer perceptron are adjusted. The grid search or random search method can be used to find the optimal hyperparameter combination. In the feature fusion principle stage, during the training process of the multilayer perceptron, the features of different scales f are actually being fused. k,ij and f pq,ij Fusion: Through the hidden layers of the multi-layer perceptron, the input features are transformed nonlinearly layer by layer, so that the model can learn the complex relationship between different features, thereby realizing the fusion of multi-scale information;

[0109] When verifying the fusion effect, the effect of multi-scale information fusion can be verified by analyzing the weight distribution of different features of the model at different training stages.

[0110] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.

Claims

1. An algorithm for calculating EEG indicators of chronic pain, characterized by: It includes data preprocessing stage, multi-layer perceptron architecture design, model training stage, model evaluation stage, and multi-scale information fusion stage; The data preprocessing stage also includes normalization and data partitioning; The architecture design of the multi-layer perceptron includes an input layer, a hidden layer and an output layer; The model training phase includes a set of repeated training including loss function and optimization algorithm, forward propagation, loss calculation, back propagation, and parameter update; The model evaluation phase needs to be evaluated on the test set and the hyperparameters need to be adjusted; The multi-scale information fusion includes a feature fusion stage and a fusion effect verification stage.

2. The algorithm for calculating the EEG index of chronic pain according to claim 1, characterized in that: Before the data preprocessing stage, EEG features were extracted. The EEG data of each channel collected from chronic pain patients were preprocessed using a 50 Hz notch filter and independent component analysis to remove power frequency interference, motion artifacts, and eye movement noise in the EEG data. In addition, a zero-phase digital bandpass filter was used to extract the EEG data components of the alpha, beta, theta, and gamma frequency bands from the EEG data of each channel, where the alpha frequency band represents 8 to 12 Hz, the beta frequency band represents 13 to 30 Hz, the theta frequency band represents 4 to 7 Hz, and the gamma frequency band represents 30 to 90 Hz. The EEG features of different channels and different frequency domains are obtained by calculating the adjacency matrix for each frequency band and the adjacency matrix between two frequency bands. In the adjacency matrix, the value of the i-th row and j-th column is calculated by the Pearson product-moment correlation coefficient between the i-th channel EEG and the j-th channel EEG. The calculation formula is: Among them, m k,ij represents the value of the i-th row and j-th column in the adjacency matrix of the k-th frequency band, X k,i and X k,j They represent the i-th channel discrete EEG signal of the k-th frequency band and the j-th channel discrete EEG signal of the k-th frequency band respectively. When the values ​​in the adjacency matrix are subjected to feature selection, the correlation distance between the i-th channel discrete EEG signal of the k-th frequency band and the j-th channel discrete EEG signal used for subsequent feature fusion is Among them, m k,th Represents the threshold value of the kth frequency band used to filter channels that are too far away; In the adjacency matrix between the qth frequency band and the pth frequency band, the value of the i-th row and j-th column is calculated by the Pearson product-moment correlation coefficient between the i-th channel EEG of the qth frequency band and the j-th channel EEG of the pth frequency band. The calculation formula is: Among them, m pq,ij represents the value of the i-th row and j-th column in the adjacency matrix between the q-th frequency band and the p-th frequency band, X p,i and X q,j They represent the discrete EEG signals of the ith channel of the pth frequency band and the jth channel of the qth frequency band respectively. The correlation distance between the discrete EEG signals of the ith channel of the pth frequency band and the discrete EEG signals of the jth channel of the qth frequency band used for subsequent feature fusion is Among them, m pq,th Represents the threshold used to filter channels that are too far away in the adjacency matrix between the qth frequency band and the pth frequency band.

3. The algorithm for calculating the EEG index of chronic pain according to claim 1, characterized in that: When normalizing the data, for the feature vector x=(x1, x2, ..., x n ), and normalize the minimum-maximum, the formula is: f k,ij and f pq,ij The features are normalized so that their value range is between [0-1]; In the data division stage, the data set is divided into a training set, a validation set, and a test set. Assuming the total number of samples is N, the number of samples in the training set is N. train =0.7N, number of samples in the validation set N val =0.15N, number of test set samples N test =0.15N.

4. The algorithm for calculating the EEG index of chronic pain according to claim 1, characterized in that: The number of nodes in the input layer of the multilayer perceptron architecture design stage depends on the dimension of the feature. The number of nodes in the input layer is n features, f pq,ij If there are m features, then the number of nodes in the input layer is n+m; The input data X is a two-dimensional matrix, each row represents a sample, and each column represents a feature, that is, Where N is the number of samples; The number of layers and nodes of the hidden layer is determined by experiment. For example, if 1-3 hidden layers are set, the number of nodes h1 of the first hidden layer can be determined according to the empirical formula Where a is a small adjustment constant, usually between 1 and 10) to initially determine the number of nodes in the subsequent hidden layers, and the number of nodes in the second hidden layer can be gradually reduced. The number of nodes in the third hidden layer In the hidden layer, the activation function RELU function is used; The output layer has only one node, and the activation function of the output layer selects a linear function, which can directly output the predicted chronic pain EEG index value.

5. The algorithm for calculating the EEG index of chronic pain according to claim 1, characterized in that: The loss function adopts mean square error, assuming y i is the true chronic pain EEG index value of the i-th sample, y i is the chronic pain EEG index value of the i-th sample predicted by the model, and the calculation formula of the mean square error is That is, the model can be trained by minimizing the mean square error, which can make the predicted value as close to the true value as possible; The optimization algorithm can select stochastic gradient descent and its variant adam algorithm to optimize model parameters. The process of adam algorithm updating parameters in each iteration is as follows: Compute the gradient: Update first-order moment estimate: m t =β1m t-1 +(1-β1)g t , Update the second moment estimate: Modified first moment estimate: Modified second moment estimate: Update parameters: Among them, α is the learning rate, β1 and β2 are the decay rates (usually β1 = 0.9, β2 = 0.999), and ∈ is a small number (to prevent division by zero, usually ∈ = 10 -8 ).

6. The algorithm for calculating the EEG index of chronic pain according to claim 1, characterized in that: In the process of forward propagation, the training set data is input into the multi-layer perceptron, and the predicted value is calculated in sequence through the input layer, hidden layer and output layer. i , the output of the lth hidden layer (l = 1, 2, ..., L, L is the number of hidden layers) is calculated as follows: Input Layer: Hidden Layer: Where σ is the activation function (such as RELU), W l is the weight matrix of the lth layer, b l is the bias vector of the lth layer. Output layer: Then, the loss function value is calculated based on the predicted value and the true value; During back propagation: For the output layer: For the hidden layers (calculated layer by layer from the last hidden layer forward): Where ⊙ represents element-wise multiplication, σ′ is the derivative of the activation function; When updating the parameters, use the optimization algorithm to update the model parameters according to the calculated gradients, and repeat the above steps until the preset number of training rounds is reached or the validation set loss no longer decreases.

7. The algorithm for calculating the EEG index of chronic pain according to claim 1, characterized in that: When evaluating on the test set, the trained model is used to predict the test set to obtain the predicted chronic pain EEG index value, using the root mean square error: Mean absolute error: Coefficient of determination: in is the average of the true values ​​of the test set; According to the performance of the model on the validation set, the hyperparameters of the multilayer perceptron are adjusted. Grid search or random search methods can be used to find the optimal hyperparameter combination.

8. The algorithm for calculating the EEG index of chronic pain according to claim 1, characterized in that: In the feature fusion principle stage, during the training process of the multi-layer perceptron, features of different scales are actually being fused. k,ij and f pq,ij Fusion: Through the hidden layers of the multi-layer perceptron, the input features are transformed nonlinearly layer by layer, so that the model can learn the complex relationship between different features, thereby realizing the fusion of multi-scale information; When verifying the fusion effect, the effect of multi-scale information fusion can be verified by analyzing the weight distribution of different features of the model at different training stages.

Citation Information

Cited By

  • Multi-mode postoperative child pain identification method

    CN120661081A