Training method of pain model and pain degree analysis method

By combining independent feature extraction branches from EEG signals and multivariate natural language description corpora of pain, the pain model is optimized, solving the problem of bias in pain prediction results in existing technologies and achieving more accurate pain intensity analysis.

CN122241112APending Publication Date: 2026-06-19BEIJING ZHUOZHI MEDICAL TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING ZHUOZHI MEDICAL TECHNOLOGY CO LTD
Filing Date
2026-03-26
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing pain intensity prediction technologies based on electroencephalogram (EEG) signals rely on fuzzy numerical labels, which leads to biased prediction results and fails to accurately reflect the actual pain intensity and characteristics of patients.

Method used

By combining multivariate natural language description corpus of pain with EEG signals, feature vectors are extracted through independent EEG feature extraction branches and language feature extraction branches. The pain model is then optimized through feature correlation to avoid relying on numerical levels based on subjective judgment.

Benefits of technology

It improves the accuracy of pain-related judgments, solves the problem of model prediction bias caused by fuzzy label training, and realizes a pain model that is more in line with the actual manifestation of pain.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122241112A_ABST
    Figure CN122241112A_ABST
Patent Text Reader

Abstract

This application relates to the field of computer technology and discloses a method for training a pain model and a method for analyzing pain intensity. The method includes: acquiring a training dataset; the training dataset includes electroencephalogram (EEG) signals and natural language description corpus of pain, wherein the natural language description corpus of pain includes at least one of the following: pain complaint description information, original question-and-answer information from a pain scale, and pain feature keyword combination description information; based on the training dataset, constructing mutually independent EEG feature extraction branches and language feature extraction branches; extracting EEG signals from the training dataset through the EEG feature extraction branches to obtain EEG signal feature vectors; extracting features from the natural language description corpus of pain in the training dataset through the language feature extraction branches to obtain natural language description feature vectors; and optimizing the EEG feature extraction branches and language feature extraction branches based on the EEG signal feature vectors and natural language description feature vectors to determine the pain model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a method for training a pain model and a method for analyzing pain intensity. Background Technology

[0002] Pain intensity prediction technology based on EEG signals mainly employs supervised learning methods such as machine learning / deep learning, and uses regression or classification patterns to predict the quantitative level of pain.

[0003] Specifically, the patient's electroencephalogram (EEG) signals are collected as input features for the model, and manually labeled numerical pain levels are used as ground truth values. The parameters of the neural network, classifier, or regression model are optimized by calculating the loss value between the model output and the ground truth values, ultimately achieving the prediction of pain levels.

[0004] However, forcibly mapping the degree of pain to a fixed numerical level as the true value, and since this numerical label mainly comes from the scores of the patient's subjective completion of the scale or the subjective judgment of the doctor's manual consultation, it cannot accurately reflect the patient's actual pain degree, pain characteristics and other information, forming a fuzzy single numerical label. The prediction results of the model trained based on this fuzzy label will inevitably be biased. Summary of the Invention

[0005] In view of this, this application provides a training method for a pain model and a pain intensity analysis method to solve the problem of bias in the output results of the model trained based on the fuzzy label.

[0006] Firstly, this application provides a method for training a pain model. The method includes: acquiring a training dataset; wherein the training dataset includes electroencephalogram (EEG) signals of pain patients and corresponding natural language descriptions of pain based on their EEG signals, the natural language descriptions of pain including at least one of the following: pain complaint descriptions, original question-and-answer information from a pain scale, and descriptions of pain feature keyword combinations; based on the training dataset, constructing independent EEG feature extraction branches and language feature extraction branches; extracting EEG signals from the training dataset using the EEG feature extraction branches to obtain EEG signal feature vectors; extracting features from the natural language descriptions of pain in the training dataset using the language feature extraction branches to obtain natural language description feature vectors; and optimizing the EEG feature extraction branches and language feature extraction branches based on the EEG signal feature vectors and natural language description feature vectors to determine a pain model.

[0007] This application provides a training method for a pain model. The method acquires a training dataset containing electroencephalogram (EEG) signals from pain patients and multi-dimensional natural language descriptions of pain. The dataset covers multiple dimensions, including subjective complaints, original information from scale-based question-and-answer sessions, and descriptions using combinations of pain characteristic keywords, reflecting the patient's actual pain level and other details. Simultaneously, independent EEG feature extraction and language feature extraction branches are constructed, extracting corresponding feature vectors respectively. The pain model is then obtained by determining the correlation between the two types of feature vectors. This method learns based on the correlation between EEG signals and multi-dimensional pain language description features, rather than relying on subjective numerical levels. It restores the multi-dimensional characteristics of pain itself and the patient's real pain experience, avoiding the information loss and subjective bias of single numerical labels. Furthermore, the learned feature correlations better reflect the actual representation of pain, improving the model's accuracy in pain-related judgments and solving the problem of model prediction bias caused by training based on fuzzy numerical labels.

[0008] In one optional implementation, based on EEG signal feature vectors and natural language description feature vectors, the EEG feature extraction branch and the language feature extraction branch are optimized to determine the pain model. This includes: determining the matching degree between the EEG signal feature vectors and natural language description feature vectors corresponding to a set of sample data; constructing a loss function based on the matching degree; and jointly optimizing the network parameters of the EEG feature extraction branch and the language feature extraction branch to maximize the similarity between matching EEG signal feature vectors and language feature vectors in the training dataset, and minimize the similarity between non-matching EEG signal feature vectors and language feature vectors.

[0009] In one optional implementation, determining the matching degree between the EEG signal feature vector and the natural language description feature vector corresponding to a set of sample data includes:

[0010] The feature vector of the electroencephalogram (EEG) signal. The feature vector is described in natural language. Let S be the coefficient and S be the matching degree.

[0011] Secondly, this application provides a method for pain intensity analysis, which includes: acquiring the electroencephalogram (EEG) signal of the patient to be predicted, and determining the EEG signal feature vector of the patient to be predicted based on the target EEG feature extraction branch and the EEG signal of the patient to be predicted; and determining the patient's pain intensity based on the EEG signal feature vector of the patient to be predicted and a standard pain language feature library.

[0012] In one possible implementation, all preset standard language feature vectors are retrieved from the standard pain language feature library. The similarity between the EEG signal feature vector of the patient to be predicted and each standard language feature vector in the standard pain language feature library is calculated to obtain a set of similarity values. The similarity values ​​are sorted from high to low to obtain the sorting results corresponding to the similarity values. Based on the sorting results, the patient's pain level is determined.

[0013] In one possible implementation, the patient's pain level is determined based on the ranking results, including: selecting the standard language feature vector with the highest similarity from the ranking results; and determining the patient's pain level based on the standard language feature vector with the highest similarity and a preset mapping relationship; wherein the preset mapping relationship is the mapping relationship between the standard language feature vector and the pain level.

[0014] In one possible implementation, determining the patient's pain level based on the ranking results includes: selecting a preset number of standard language feature vectors from the ranking results; determining the relative similarity distance between the preset number of standard language feature vectors; determining the proportion of the relative similarity distance corresponding to the preset number of standard language feature vectors based on the relative similarity distance; and determining the patient's pain level based on the proportion of the relative similarity distance.

[0015] Thirdly, this application provides a training device for a pain model, comprising: an acquisition module for acquiring a training dataset; wherein the training dataset includes EEG signals of pain patients and corresponding natural language description corpus of pain, the natural language description corpus of pain including at least one of pain complaint description information, original question-and-answer information of a pain scale, and pain feature keyword combination description information; a construction module for constructing mutually independent EEG feature extraction branches and language feature extraction branches based on the training dataset; a first extraction module for extracting EEG signals from the training dataset through the EEG feature extraction branches to obtain EEG signal feature vectors; a second extraction module for extracting features from the natural language description corpus of pain in the training dataset through the language feature extraction branches to obtain natural language description feature vectors; and a pain model determination module for optimizing the EEG feature extraction branches and language feature extraction branches based on the EEG signal feature vectors and natural language description feature vectors to determine the pain model.

[0016] Fourthly, this application provides a computer device, including: a memory and a processor, which are communicatively connected to each other. The memory stores computer instructions, and the processor executes the computer instructions to perform the methods described in the first aspect or the second aspect or any corresponding embodiment thereof.

[0017] Fifthly, this application provides a computer-readable storage medium storing computer instructions for causing a computer to perform the methods described in the first aspect or the second aspect or any corresponding embodiment thereof.

[0018] In a sixth aspect, this application provides a computer program product, including computer instructions for causing a computer to perform the methods described in the first aspect or the second aspect or any corresponding embodiment thereof. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating a training method for a pain model according to an embodiment of this application;

[0021] Figure 2 This is a flowchart illustrating the pain level analysis method according to an embodiment of this application;

[0022] Figure 3 This is a flowchart illustrating another pain level analysis method according to an embodiment of this application;

[0023] Figure 4 This is a flowchart illustrating another pain level analysis method according to an embodiment of this application;

[0024] Figure 5 This is a schematic diagram of a model training framework according to an embodiment of this application;

[0025] Figure 6 This is a schematic diagram of another model training framework according to an embodiment of this application;

[0026] Figure 7 This is a schematic diagram of the structure of the EEG branch network according to an embodiment of this application;

[0027] Figure 8 This is a structural block diagram of a training device for a pain model according to an embodiment of this application;

[0028] Figure 9 This is a schematic diagram of the hardware structure of a computer device according to an embodiment of this application. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0030] Based on relevant technologies, current methods for identifying or predicting pain levels based on electroencephalogram (EEG) signals primarily utilize machine learning / deep learning techniques, especially supervised learning, to predict the quantitative level of pain through regression or classification. Supervised learning requires input with corresponding ground truth values ​​to calculate the loss, thereby optimizing the neural network or traditional classifier or regression model. However, the ground truth values ​​for pain largely come from the patient's subjective judgment. Obtaining labels through answering questions on scales or by doctors directly inquiring about pain levels is highly subjective, leading to ambiguous ground truth values.

[0031] Secondly, some patients experience fluctuating pain levels rather than a fixed intensity, meaning their pain may not remain constant throughout the data collection period. This often necessitates additional sensor equipment and close cooperation with the patient to obtain precise timestamps. While additional data can improve tag accuracy and enable more sophisticated signal analysis, collecting this type of data is more complex and inefficient in many scenarios.

[0032] Furthermore, pain caused by different diseases has different pathologies and nerve sensitivities. When mapping information to pain levels, a lot of information is lost. Recording information in a precise, structured way, such as the pain level of disease A, the pain level of disease B, or the pain level of mixed diseases, makes it difficult to obtain a clearly defined and complete structure, and at the same time, it will make the data too fragmented.

[0033] Based on this, this application provides a training method for a pain model. This method acquires a training dataset containing EEG signals from pain patients and multi-dimensional natural language descriptions of pain. The dataset covers multiple dimensions of information, including subjective complaints, original information from scale questions and answers, and descriptions of pain feature keyword combinations, reflecting details such as the actual degree and characteristics of the patient's pain. Simultaneously, independent EEG feature extraction and language feature extraction branches are constructed, extracting corresponding feature vectors respectively. The pain model is then obtained by determining the correlation between the two types of feature vectors. This method learns based on the correlation between EEG signals and multi-dimensional pain language description features, rather than relying on subjective numerical levels. This not only restores the multi-dimensional characteristics of pain itself and the patient's real pain experience, avoiding the information loss and subjective bias of single numerical labels, but also improves the accuracy of the model's pain-related judgments by using learned feature correlations that better reflect the actual representation of pain. This solves the problem of model prediction bias caused by training based on fuzzy numerical labels.

[0034] According to an embodiment of this application, a method for training a pain model is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0035] This embodiment provides a method for training a pain model, which can be used in computer devices such as computers and servers. Figure 1 This is a flowchart of a pain model training method according to an embodiment of this application, such as... Figure 1 As shown, the process includes the following steps:

[0036] Step S101: Obtain the training dataset; wherein, the training dataset includes the EEG signals of pain patients and the corresponding natural language description corpus of pain patients, and the natural language description corpus of pain includes at least one of the following: pain complaint description information, original question and answer information of pain scale, and pain feature keyword combination description information.

[0037] The training dataset can be a set of sample data pairs that correspond one-to-one between "EEG signals and pain natural language description corpus" for model training. Specifically, the training dataset includes EEG signals from pain patients and corresponding pain natural language description corpus. The pain natural language description corpus includes at least one of the following: pain complaint description information, original question-and-answer information from pain scales, and pain feature keyword combination description information.

[0038] Among them, electroencephalogram (EEG) signals can indicate the electrical activity signals of the human brain collected by EEG acquisition equipment. Specifically, they can be single-channel or multi-channel signals, used to reflect pain status.

[0039] The natural language description corpus for pain can indicate non-single numerical textual descriptions of pain-related information matched with the EEG signal acquisition time period. Specifically, it can include three categories: chief complaint description information, raw question-and-answer information from pain scales, and description information based on combinations of pain characteristic keywords. The specific content of these three categories of description information is as follows:

[0040] Chief complaint description information: The doctor's professional description of the patient's pain status or the patient's own description of the pain, such as "the patient has persistent abdominal distension and pain after surgery, with moderate pain" or "I have intermittent stabbing pain on the left side of my head, and I can't open my eyes when it hurts".

[0041] Original information from the questions and answers of the pain scale: The original questions and answers when the patient filled out the pain scale, including not only the information from the rating scale, but also the non-rating questions, such as the scale question "Does the pain affect my sleep?", the answer is "Occasionally it does, it takes more than 30 minutes to fall asleep"; the scale question "Does the pain spread?", the answer is "Only in the shoulder and neck area, it has not spread".

[0042] Pain feature keyword combination description information: Extract keyword combinations of core pain features, such as "migraine and paroxysmal and mild to moderate and unilateral", "lower back pain and persistent and severe and aggravated by bending over".

[0043] In a feasible example, a multi-channel EEG acquisition device is used to collect EEG signals from gastric cancer patients 24 hours after surgery (in 5-minute segments). Simultaneously, the doctor records the patient's pain complaint description at each EEG segment, such as "2 hours after surgery, persistent stabbing pain in the abdominal incision, pain level 4, aggravated by pressure". The "5-minute EEG signal and the complaint description" are used as a sample pair. A total of 100 postoperative patients are collected to form a basic training dataset.

[0044] In one possible implementation, the training dataset could also be expanded to include EEG signals and corresponding state descriptions from people with pain-free diseases and healthy individuals.

[0045] Step S102: Based on the training dataset, construct independent branches for EEG feature extraction and language feature extraction.

[0046] The EEG feature extraction branch can be designated as an independent feature extraction network adapted to the modal features of EEG signals. It includes modules such as signal windowing, preprocessing, manual feature extraction according to preset rules, such as frequency domain transformation to obtain frequency domain power values, or automatic feature extraction through feature extraction neural networks, which are used to extract feature vectors of EEG signals.

[0047] The language feature extraction branch can be designated as an independent feature extraction network adapted to the modal features of natural language description corpora. It is built based on language models such as BERT / TransformerEncoder and is used to extract semantic feature vectors from pain natural language description corpora.

[0048] Mutual independence indicates that the network structure, input modality, and feature extraction logic of the two branches are completely separated. Specifically, the processing of the EEG feature extraction branch and the language feature extraction branch can be relatively independent.

[0049] Specifically, the feature extraction for model training is divided into two steps. First, based on the training dataset, an independent dual-branch network is built to adapt to the modal features of EEG signals and natural language corpora (the EEG branch adapts to the time or frequency domain features of physiological signals, and the language branch adapts to the semantic features of text).

[0050] Step S103: Extract the EEG signals from the training dataset through the EEG feature extraction branch to obtain the EEG signal feature vector.

[0051] The EEG signal feature vector can be indicated as a high-dimensional numerical vector that represents the core features of the EEG signal after processing it through corresponding branches.

[0052] Specifically, EEG signals are extracted from the training dataset based on the EEG feature extraction branch to obtain EEG signal feature vectors.

[0053] Step S104: Extract features from the natural language description corpus of pain in the training dataset through the language feature extraction branch to obtain the natural language description feature vector.

[0054] Natural language description feature vectors can be indicated as high-dimensional numerical vectors that represent the core features of pain natural language description corpora after processing them through corresponding branches.

[0055] Specifically, pain natural language description corpus is extracted from the training dataset based on the language feature extraction branch to obtain natural language description feature vectors.

[0056] In one possible implementation example, the EEG feature extraction branch consists of a structure consisting of a signal preprocessing module, a 3s window with 50% overlap, a short-time Fourier transform frequency domain conversion module, a 1D convolutional ResNet-block, and a small fully connected network. The EEG signals from the training dataset are input into this branch, which sequentially performs denoising, windowing, and frequency domain conversion. After extracting time-domain / frequency-domain features, the network outputs a normalized EEG signal feature vector (with a dimension of 256).

[0057] Language feature extraction branch: The basic BERT structure (12-layer attention head, 768-dimensional hidden dimension) is built as the core network. The pain natural language description corpus of the training dataset is processed by text segmentation and encoding and then input into this branch to extract semantic features and output normalized natural language description corpus feature vector (the dimension is set to 256, which is consistent with the dimension of EEG signal feature vector).

[0058] Step S105: Based on the EEG signal feature vector and the natural language description feature vector, optimize the EEG feature extraction branch and the language feature extraction branch to determine the pain model.

[0059] More specifically, after determining the EEG signal feature vector and the natural language description feature vector, the feature correlation between the EEG signal feature vector and the natural language description feature vector can be further determined. By constraining the feature correlation between the EEG signal feature vector and the natural language description corpus feature vector, the EEG feature extraction branch and the language feature extraction branch can be optimized to determine the pain model.

[0060] Feature correlation can indicate the implicit mapping relationship between the feature vectors of EEG signals and the feature vectors of the corresponding natural language description corpus. That is, through similarity calculation, the similarity of feature vectors of matching samples in the training dataset is maximized and the similarity of feature vectors of non-matching samples is minimized, forming an implicit correlation of "the language features of specific semantic descriptions corresponding to EEG signals of specific pain states".

[0061] Optimizing the EEG feature extraction branch and the language feature extraction branch can be understood as completing the training of the EEG feature extraction branch and the language feature extraction branch through feature correlation optimization. The network parameters have been optimized through the loss function and can accurately extract feature vectors representing pain states.

[0062] The extracted normalized EEG signal feature vectors and natural language description corpus feature vectors are used as the matching benchmark with sample pairs in the training dataset. The matching degree of the feature vectors is measured by cosine similarity calculation. Then, a cross-entropy loss function is constructed to jointly optimize the network parameters of the two branches. Finally, the two branches establish the feature correlation between EEG signals and pain natural language description corpus to complete the model training and obtain the EEG feature extraction branch and language feature extraction branch that can be used for prediction to determine the pain model.

[0063] The pain model training method provided in this application acquires a training dataset containing EEG signals from pain patients and multi-dimensional natural language descriptions of pain. The dataset covers multiple dimensions, including subjective complaints, original information from scale questions and answers, and descriptions of pain feature keywords, reflecting the patient's actual pain level and pain characteristics. Simultaneously, it constructs independent EEG feature extraction branches and language feature extraction branches, extracting corresponding feature vectors respectively. The pain model is then obtained by determining the correlation between the two types of feature vectors. This method learns based on the correlation between EEG signals and multi-dimensional pain language description features, rather than relying on subjective numerical levels. It restores the multi-dimensional characteristics of pain itself and the patient's real pain experience, avoiding the information loss and subjective bias of single numerical labels. Furthermore, the learned feature correlations better reflect the actual representation of pain, improving the model's accuracy in pain-related judgments and solving the problem of model prediction bias caused by training based on fuzzy numerical labels.

[0064] This embodiment provides a method for training a pain model, which can be used in computer devices such as computers and servers. Figure 2 This is a flowchart of a pain model training method according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps:

[0065] Step S201: Obtain the training dataset; wherein, the training dataset includes the electroencephalogram (EEG) signals of pain patients and the corresponding natural language description corpus of pain based on their EEG signals. The natural language description corpus of pain includes at least one of the following: descriptions of pain complaints, original question-and-answer information from pain scales, and descriptions based on combinations of pain feature keywords. For details, please refer to [link to relevant documentation]. Figure 1 Step S101 of the illustrated embodiment will not be described again here.

[0066] Step S202: Based on the training dataset, construct independent branches for EEG feature extraction and language feature extraction. For details, please refer to [link to relevant documentation]. Figure 1 Step S102 of the illustrated embodiment will not be described again here.

[0067] Step S203: The EEG signals in the training dataset are extracted using the EEG feature extraction branch to obtain EEG signal feature vectors. For details, please refer to [link to relevant documentation]. Figure 1 Step S103 of the illustrated embodiment will not be described again here.

[0068] Step S204: The pain natural language description corpus in the training dataset is used for feature extraction via the language feature extraction branch to obtain the natural language description feature vector. For details, please refer to [link to details]. Figure 1 Step S104 of the illustrated embodiment will not be described again here.

[0069] Step S205: Based on the EEG signal feature vector and the natural language description feature vector, optimize the EEG feature extraction branch and the language feature extraction branch to determine the pain model.

[0070] Specifically, step S205 includes:

[0071] Step S2051: Determine the matching degree between the EEG signal feature vector and the natural language description feature vector corresponding to a set of sample data.

[0072] The sample data pairs can indicate a one-to-one correspondence between "EEG signals - pain natural language description corpus".

[0073] Specifically, for each pair of sample data in the training dataset, the cosine similarity value of the sample data pair is calculated based on its corresponding normalized EEG signal feature vector and normalized language feature vector, thereby quantifying the matching degree of the two feature vectors; at the same time, for all samples in the training batch, the similarity between matching sample pairs (EEG and language feature vectors of the same data pair) and non-matching sample pairs (EEG and language feature vectors of different data pairs) also needs to be calculated.

[0074] As an example, cosine similarity can be used to determine the degree of matching between two feature vectors of the same sample data pair.

[0075] As an example, the matching degree can be determined as follows:

[0076] The feature vector of the electroencephalogram (EEG) signal. The feature vector is described in natural language. Let S be the coefficient and S be the matching degree.

[0077] Step S2052: Based on the matching degree, construct a loss function and jointly optimize the network parameters of the EEG feature extraction branch and the language feature extraction branch to maximize the similarity between the matching EEG signal feature vectors and the natural language description feature vectors in the training dataset, and minimize the similarity between the non-matching EEG signal feature vectors and the natural language description feature vectors.

[0078] Network parameters can be indicated as the trainable parameters within the network for EEG feature extraction and language feature extraction branches, such as the kernel parameters of 1D convolutions in the EEG branch, the weights / biases of fully connected networks, the attention weights of TransformerEncoder in the language branch, and the embedding layer parameters of BERT.

[0079] Specifically, the following formula can be used when constructing the loss function:

[0080] ; The cosine similarity between the i-th EEG feature and the i-th language feature. The cosine similarity between the i-th EEG feature and the j-th language feature. The EEG-side cross-entropy loss is represented by N, where N is the number of samples.

[0081] ; The indicator is the cosine similarity between the j-th language feature and the j-th EEG feature. The indicator is the cosine similarity between the j-th language feature and the i-th EEG feature. For language-side cross-entropy loss;

[0082] ;in, This is the loss function.

[0083] In this step, based on the similarity values ​​of all sample pairs in the training batch obtained in step S2031, the cross-entropy loss formulas of the EEG side and the language side are substituted to calculate the total batch loss L. The core objective is to "maximize the cosine similarity of the matching sample pairs (Si,i / Sj,j) and minimize the similarity of the non-matching sample pairs (Si,j / Sj,i)," which is essentially to make the total loss function L continuously decrease and converge.

[0084] A gradient descent-type optimization algorithm is used to calculate the gradient of the total loss L with respect to all network parameters of the EEG and language branches. The network parameters of the two branches are adjusted synchronously according to the gradient direction to reduce the loss value.

[0085] The training dataset is trained iteratively in batches. When the total loss function L converges to a stable value (no significant decrease over multiple consecutive epochs) and the similarity of matched / unmatched sample pairs reaches the expected effect, training is stopped. At this point, the EEG feature extraction branch and the language feature extraction branch are the target EEG feature extraction branch and the language feature extraction branch.

[0086] In one possible implementation scenario, step S2031 has obtained the similarity matrix of 32 sample batches, N=32, and calculated that the batch's Leeg=0.85, Ltxt=0.82, and the total loss L=21(0.85+0.82)=0.835; the stochastic gradient descent method is adopted, and the learning rate is set to 0.01 (parameter adjustment step size); the gradient of the total loss L with respect to all network parameters of the EEG branch and the language branch is calculated, and the convolution kernel, weights, biases and other parameters of the two branches are adjusted synchronously according to the gradient direction to complete one parameter update; all batches of the training dataset are iteratively trained for 50 epochs in the above manner, and the validation set loss is calculated after each epoch. When the total loss converges to 0.05 (stable value) in the 50th epoch, the mean similarity of matched sample pairs reaches 0.94, and the mean similarity of unmatched sample pairs reaches 0.12; training is stopped, and the EEG feature extraction branch and the language feature extraction branch at this time are the target branches.

[0087] The pain model training method provided in this application accurately quantifies the matching degree between EEG signal feature vectors and language feature vectors in the same sample data pair through cosine similarity, providing an objective and quantifiable core basis for dual-branch joint optimization and avoiding training bias caused by subjective labels. At the same time, by constructing a loss function that combines EEG-side and language-side cross-entropy loss, the network parameters of the EEG feature extraction branch and the language feature extraction branch are jointly optimized. This ensures the synergy of feature extraction in the two branches and can specifically achieve the goal of maximizing the similarity of matching feature vectors and minimizing the similarity of non-matching feature vectors. It effectively establishes the implicit mapping relationship between EEG signals and natural language descriptions of pain. The final target dual-branch can accurately extract feature vectors representing pain states, which not only improves the accuracy and stability of model training, but also does not rely on any numerical pain labels. This fundamentally solves the problems of vague labels, low data utilization, and weak model generalization ability in existing technologies. Moreover, the design of independent dual-branch optimization does not require the concatenation of multimodal features into a large language model, reducing computational complexity and adapting to the needs of various clinical pain prediction scenarios.

[0088] This embodiment provides a pain level analysis method that can be used in computer devices, such as computers and servers. Figure 3 This is a flowchart of a pain intensity analysis method according to an embodiment of this application, such as... Figure 3 As shown, the process includes the following steps:

[0089] Step S301: Obtain the electroencephalogram (EEG) signal of the patient to be predicted.

[0090] The EEG signals of the patient to be predicted can indicate whether the patient needs to have their pain level assessed. These signals are acquired using the same type of EEG acquisition equipment as used in the training phase (single / multi-channel is acceptable, acquisition rules are consistent with the training set to ensure feature consistency). Specifically, the EEG signals of the patient to be predicted can be acquired using specific equipment.

[0091] Step S302: Based on the target EEG feature extraction branch, determine the EEG signal feature vector of the patient to be predicted according to the EEG signal of the patient to be predicted.

[0092] The EEG signal feature vector of the patient to be predicted can be indicated as the normalized EEG signal feature vector obtained by inputting the EEG signal of the patient to be predicted into the target EEG feature extraction branch and then through the standardized feature extraction process of the target EEG feature extraction branch (which is completely consistent with the training phase).

[0093] Specifically, the EEG signals of the patient to be predicted are collected and input into the target EEG feature extraction branch obtained in step S103. Through standardized processes such as signal preprocessing, windowing, frequency domain conversion, and deep feature extraction of the branch, the EEG signal feature vector of the patient to be predicted is directly output without additional optimization, in order to prepare for subsequent matching of pain natural language description corpus.

[0094] Step S303: Determine the patient's pain level based on the EEG signal feature vector of the patient to be predicted and the standard pain language feature library.

[0095] A standard pain language feature library can indicate a set containing different levels of pain and their corresponding standard language feature vectors and one-to-one mapping relationships.

[0096] Pain level can indicate the patient's pain status based on the target pain natural language description corpus. It can be directly matched as a quantitative level of 0-10, or it can be quantified into a subdivided pain level value (such as 4.8 level) based on the similarity distance between adjacent levels.

[0097] Specifically, the cosine similarity between the EEG signal feature vector of the patient to be predicted and all standard language feature vectors in the standard pain language feature library is calculated. Based on the similarity results, the standard language feature vector with the highest similarity is determined to determine the patient's pain level. Alternatively, a fixed quantification level can be directly matched, or the relative distance ratio between two adjacent highest similarity levels can be quantified into a subdivided pain level value to achieve accurate prediction of pain level.

[0098] In one possible implementation scenario, a standard pain language feature library is pre-defined: natural language description texts for pain levels 0-10 are pre-defined, such as "Level 0: No pain sensation", "Level 3: Mild pain, does not affect daily activities", and "Level 7: Severe pain, affects eating and sleeping". The corresponding standard language feature vectors are extracted, and a mapping relationship is established to form the standard pain language feature library. The cosine similarity of the EEG signal feature vector (256 dimensions) of the patient to be predicted with all 11 standard language feature vectors in the standard pain language feature library is calculated, and the similarity results are obtained as follows: Level 0 (0.12), Level 3 (0.95), Level 7 (0.36)...Level 10 (0.08), among which Level 3 has the highest similarity (0.95). According to the mapping relationship, the description text corresponding to Level 3 with the highest similarity is "mild pain, does not affect daily activities", so the patient's pain level is determined to be Level 3 (mild pain).

[0099] In one possible implementation scenario, a standard pain language feature library is pre-set with natural language description text for pain levels 0-10. At the same time, natural language description text for non-integer pain levels can also be pre-set, such as "Level 4 or 5, mild to moderate pain, occasionally affecting sleep". The level is mapped to 4.5. Specifically, depending on the output requirements of different scenarios, non-integer levels can be output, or "Level 4 or 5" can be output, or "mild to moderate pain" can be output.

[0100] The pain intensity analysis method provided in this application constructs a training dataset by using natural language descriptions of pain as corresponding labels for electroencephalogram (EEG) signals. This method abandons the single, numerical, and ambiguous pain label, fundamentally solving the problem of subjective ambiguity in labels that cannot reflect the true pain state.

[0101] Based on this training dataset, we built and used independent EEG and language feature extraction branches to extract corresponding feature vectors. By determining the feature correlation between the two through the feature vectors, we obtained the target branch after training. The whole process is free from dependence on numerical fuzzy labels, which solves the problem of low accuracy caused by fuzzy labels in model training.

[0102] Finally, the EEG signal feature vector of the patient to be predicted is obtained by the target EEG feature extraction branch after training. Combined with the standard pain language feature library, the pain level is determined. The actual state of pain can be accurately reflected by natural language description corpus, which solves the problems of not being able to accurately reflect the subdivided state of pain and inaccurate prediction results.

[0103] This embodiment provides a pain level analysis method that can be used in computer devices, such as computers and servers. Figure 4 This is a flowchart of a pain intensity analysis method according to an embodiment of this application, such as... Figure 4 As shown, the process includes the following steps:

[0104] Step S401: Acquire the electroencephalogram (EEG) signals of the patient to be predicted. For details, please refer to [link to relevant documentation]. Figure 3 Step S301 of the illustrated embodiment will not be described again here.

[0105] Step S402: Based on the target EEG feature extraction branch, determine the EEG signal feature vector of the patient to be predicted according to the EEG signal of the patient to be predicted. For details, please refer to [link to details]. Figure 3 Step S302 of the illustrated embodiment will not be described again here.

[0106] Step S403: Determine the patient's pain level based on the EEG signal feature vector of the patient to be predicted and the standard pain language feature library.

[0107] Specifically, step S403 includes:

[0108] Step S4031: Retrieve all preset standard language feature vectors from the standard pain language feature library, calculate the similarity between the EEG signal feature vector of the patient to be predicted and each standard language feature vector in the standard pain language feature library, and obtain a set of similarity values.

[0109] Specifically, all standard language feature vectors in the standard pain language feature library are extracted. The cosine similarity is calculated between the EEG signal feature vector of the patient to be predicted and each standard language feature vector. This results in a set of similarity values, representing the degree of match between the patient's EEG and a specific pain description.

[0110] In one example, a standard pain language feature library is used, ranging from 0 to 10. This library contains 11 standard descriptions: 0 - no pain, 1 - very mild, 2 - mild... 10 - severe pain. Each description corresponds to a standard language feature vector. The EEG signal feature vector of the patient to be predicted is compared with these 11 vectors using cosine similarity calculations, resulting in 11 similarity values, for example: 0: 0.15, 1: 0.05, 2: 0.03, 3: 0.82, ..., 10: 0.02.

[0111] In one example, a standard pain language feature library with detailed descriptions is used. This library includes terms such as "mild dull pain," "mild to moderate throbbing pain," "moderate stabbing pain," and "moderate to severe colic." The similarity between the patient's EEG and each description is calculated, resulting in a set of similarity scores.

[0112] In one example, a keyword combination-based standard pain language feature library is used. This library consists of keyword combinations such as: "postoperative, mild and stable", "postoperative, moderate and paroxysmal", and "chronic, severe and persistent". Cosine similarity is calculated for each combination to obtain a set of similarity values.

[0113] Step S4032: Sort the similarity values ​​from high to low to obtain the sorting results corresponding to the similarity values.

[0114] Sort the similarity scores from highest to lowest to obtain the sorted results. For example, if similarity score A is greater than similarity score B, and similarity score B is greater than similarity score C, then the sorted result could be A—B—C.

[0115] Step S4033: Based on the sorting results, determine the patient's pain level.

[0116] After determining the sorting results, the patient's pain level can be determined based on the sorting results.

[0117] As an example, the standard language feature vector with the highest similarity value is selected from the ranking results, and the pain level is determined based on the standard language feature vector with the highest similarity value.

[0118] Specifically, step S4033 above includes:

[0119] Step a1: Select the standard language feature vector with the highest similarity from the sorting results.

[0120] After determining the ranking results, the standard language feature vectors with the highest similarity can be selected from the ranking results.

[0121] Step a2: Determine the patient's pain level based on the standard language feature vector with the highest similarity and the preset mapping relationship; wherein, the preset mapping relationship is the mapping relationship between the standard language feature vector and the pain level.

[0122] The preset mapping relationship is between standard language feature vectors and pain levels. Specifically, after determining the standard language feature vector with the highest similarity, the pain level can be directly determined through the preset mapping relationship.

[0123] Specifically, step S4033 above also includes:

[0124] Step b1: Select a preset number of standard language feature vectors from the sorting results.

[0125] Step b2: Determine the relative similarity distance between a preset number of standard language feature vectors.

[0126] Step b3: Based on the relative similarity distance, determine the proportion of the relative similarity distance corresponding to a preset number of standard language feature vectors.

[0127] The relative distance of similarity can be represented by a weighted average calculated based on multiple highest similarity scores, used to subdivide intermediate pain levels among multiple candidate pain levels. Specifically, when two or more standard language feature vectors are selected, the relative distance between the similarity values ​​of these standard language feature vectors is calculated, i.e., the difference in their similarity values, to determine which level of pain the patient leans towards.

[0128] Step b4: Determine the patient's pain level based on the proportion of similarity relative distance.

[0129] After determining the relative similarity distances between standard language feature vectors, the proportion of the relative similarity distances corresponding to each of the multiple standard language feature vectors is further determined, and the degree of pain is determined based on the proportion. Specifically, if the proportion of the distance corresponding to mild pain is higher, it indicates a stronger correlation between the EEG feature to be predicted and mild pain, ultimately determining the patient's pain level as mild to moderate. Conversely, if the proportion of the distance corresponding to moderate pain is higher, it indicates a stronger correlation between the EEG feature to be predicted and moderate pain, ultimately determining the patient's pain level as mild to moderate.

[0130] In one possible implementation, the calculation can be performed using a distance-normalized weighted average, where the top K distances are d. k (k=1,2,3,…,K), where the preset mapping level for each standard language feature vector is y. k Calculate the weights:

[0131] Ultimate pain level ;in, For weights.

[0132] The pain level analysis method provided in this application has two aspects. First, it selects the standard language feature vector with the highest similarity from the ranking results and directly determines the corresponding pain level based on the vector and the preset mapping relationship. Second, it can select a preset number of leading standard language feature vectors, calculate their relative similarity distance and corresponding proportion, and subdivide adjacent levels according to the proportion weight to obtain a more accurate intermediate pain level. This method relies on natural language description to build a standard feature library, without relying on subjective and vague pain labels. It can not only use the semantic features implicit in the language model to achieve accurate matching of pain levels, but also solve the problems of pain fluctuation and coarse level division through weighted calculation of multiple candidate vectors. While retaining complete pain description information, it significantly improves the precision and accuracy of pain level prediction.

[0133] Please refer to Figure 5 , Figure 5 This is a schematic diagram of a model training framework according to an embodiment of this application. (Combined with...) Figure 5As shown, in one possible implementation, the above method also provides a pain level analysis method, which may include the following steps:

[0134] Pain intensity prediction is achieved through a pre-training fine-tuning approach. Specifically, the trained EEG feature extraction branch obtained from the dual-branch construction training step is used as a separate pre-training model. Logistic regression, classification, or regression models are then connected to the end of the deep feature extraction network of this pre-training model, and existing pain level labels are used for secondary fine-tuning. After fine-tuning, the EEG signal of the patient to be predicted is directly input into the pre-training model, which extracts EEG features and outputs the pain quantification level or subdivided pain intensity value. Because the pre-training model establishes an implicit mapping relationship between EEG signals and natural language descriptions of pain based on an association training set, it can solve the problem of fuzzy pain level labels during the secondary fine-tuning process.

[0135] Please refer to Figure 6 , Figure 6 This is a schematic diagram of another model training framework according to an embodiment of this application. (Combined with...) Figure 5 It is known that the EEG branch includes preprocessing steps such as signal preprocessing, signal windowing, and frequency domain transformation. After signal preprocessing, the EEG signal is denoised. After windowing and Fourier transform, a time-domain signal sequence with a certain window length and the corresponding frequency-domain information are obtained. Then, the signal (or artificially set high-dimensional statistical values ​​in the signal, such as signal amplitude and spectral power) is fed into the neural network. The last layer of the network can be regarded as the features of the EEG signal.

[0136] Specifically, the neural network structure here can be a fully connected network, a convolutional neural network (such as a network composed of 1D convolutions for a signal), an LSTM, or a Transformer, etc.

[0137] In the language branch, descriptive information such as the chief complaint / scale and EEG signals are paired and processed through a neural network to obtain language features. The outputs of the last layer of both branches are used to calculate the loss and optimize the neural network.

[0138] In particular, the neural network parameters for the language branch can be locked without optimization, or additional structural optimization can be performed using techniques such as LoRA, or fine-tuned using the full dataset.

[0139] When deploying and using this system, different levels of pain description are fixed, such as a fixed pain description from 0 to 10. The corresponding language features are calculated separately. After the patient's EEG signal is input, the similarity between the patient's EEG signal and the language features of different pain levels is compared. The closest similarity is selected as the patient's pain level. For example, if the distance to the language feature of pain quantification level 5 is close, the patient's pain level is considered to be 5. Alternatively, it can be quantified into a more detailed level based on the distance. For example, based on the distance to the language features of pain quantification levels 4 and 5, the patient's pain level is ultimately considered to be 4.8.

[0140] Please refer to Figure 7 , Figure 7 This is a schematic diagram of the structure of an electroencephalogram (EEG) branch network according to an embodiment of this application. (Combined with...) Figure 7 As shown, in one possible implementation, this application also provides a specific implementation of the above-mentioned pain level analysis method, the specific implementation process of which is as follows:

[0141] Taking the prediction of pain quantification levels from 0 to 10 as an example, where 0 represents no pain sensation and 10 represents unbearable pain, a prediction model is established. Preprocessing of the EEG signal branches includes a 0.1Hz high-pass filter, a 50Hz power frequency notch filter, and baseline offset removal. Then, independent component analysis (ICA) is used to eliminate eye movement and muscle movement interference, obtaining a denoised signal. The denoised signal is windowed with a 3s window length and 50% overlap, and a short-time Fourier transform is used to obtain the frequency domain signal. The power of specific bands, such as delta (0.5-4Hz), theta (4-8Hz), alpha (8-13Hz), beta (13-30Hz), and gamma (30Hz), is statistically obtained. The denoised signal and the corresponding frequency domain power signal are concatenated to form the signal under the current window; a single EEG signal can yield a sequence of multiple window signals. A two-layer ResNet-block-like structure is used to process the time-domain signal, replacing the convolutional layers with 1D convolutions to adapt to the EEG signal, thus obtaining the embedding representation of the time-domain signal. The frequency domain power is processed through a small fully connected network to obtain the spectral embedding representation. These two representations are then concatenated to obtain the embedding representation of the current window. The resulting embedding sequence is then fed into a sequence model, using a 2-layer BiLSTM structure (a Transformer self-attention structure or other sequence model structures can also be used). The output at the last time step is used as the EEG branch feature output. In the language branch, a network using a BERT structure or a Transformer Encoder structure is constructed to obtain language features. A 12-layer attention head with a hidden dimension of 768 and an encoder layer of 12 is used. The encoder output is used as the language branch feature.

[0142] This embodiment also provides a pain level analysis device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0143] This embodiment provides a training device for a pain model, such as... Figure 8 As shown, the system includes: an acquisition module 801 for acquiring a training dataset; wherein the training dataset includes EEG signals from pain patients and corresponding natural language descriptions of pain from the EEG signals, the natural language descriptions of pain including at least one of the following: pain complaint description information, original question-and-answer information from a pain scale, and pain feature keyword combination description information; a construction module 802 for constructing independent EEG feature extraction branches and language feature extraction branches based on the training dataset; a first extraction module 803 for extracting EEG signals from the training dataset through the EEG feature extraction branches to obtain EEG signal feature vectors; a second extraction module 804 for extracting features from the natural language descriptions of pain from the training dataset through the language feature extraction branches to obtain natural language description feature vectors; and a pain model determination module 805 for optimizing the EEG feature extraction branches and language feature extraction branches based on the EEG signal feature vectors and natural language description feature vectors to determine the pain model.

[0144] In one possible implementation, the pain model determination module 805 includes: a first determination unit for determining the matching degree between the EEG signal feature vector and the natural language description feature vector corresponding to a set of sample data; and a second determination unit for constructing a loss function based on the matching degree and jointly optimizing the network parameters of the EEG feature extraction branch and the language feature extraction branch to maximize the similarity between the matching EEG signal feature vector and the natural language description feature vector in the training dataset, and minimize the similarity between the non-matching EEG signal feature vector and the natural language description feature vector.

[0145] In one possible implementation, the first determining unit is also used for... The degree of matching between two feature vectors:

[0146] The feature vector of the electroencephalogram (EEG) signal. The feature vector is described in natural language. Let S be the coefficient and S be the matching degree.

[0147] This embodiment provides a pain intensity analysis device, which includes: an electroencephalogram (EEG) signal acquisition module for acquiring the EEG signal of a patient to be predicted; a feature vector determination module for determining the EEG signal feature vector of the patient to be predicted based on the EEG feature extraction branch; and a pain intensity determination module for determining the target pain natural language description corpus corresponding to the EEG signal feature vector and a standard pain language feature library, and determining the patient's pain intensity based on the target pain natural language description corpus.

[0148] Further functional descriptions of the above modules and units are the same as those in the corresponding embodiments described above, and will not be repeated here.

[0149] In this embodiment, the pain model training device and / or pain level analysis device are presented in the form of functional units. Here, a unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.

[0150] This application also provides a computer device having the above-described features. Figure 8 The training device for the pain model shown.

[0151] Please see Figure 9 , Figure 9 This is a schematic diagram of the structure of a computer device provided in an optional embodiment of this application, such as... Figure 9 As shown, the computer device includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise installed as needed. The processors can process instructions executed within the computer device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interfaces). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple computer devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 9 Take a processor 10 as an example.

[0152] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.

[0153] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.

[0154] The memory 20 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the computer device. Furthermore, the memory 20 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some alternative embodiments, the memory 20 may optionally include memory remotely located relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0155] The memory 20 may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as flash memory, hard disk or solid-state drive; the memory 20 may also include a combination of the above types of memory.

[0156] The computer device also includes an input device 30 and an output device 40. The processor 10, memory 20, input device 30, and output device 40 can be connected via a bus or other means. Figure 9 Taking the example of a connection between China and Israel via a bus.

[0157] Input device 30 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the computer device, such as a touchscreen, keypad, mouse, trackpad, touchpad, joystick, one or more mouse buttons, trackball, joystick, etc. Output device 40 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The aforementioned display devices include, but are not limited to, liquid crystal displays, light-emitting diodes, displays, and plasma displays. In some alternative embodiments, the display device may be a touchscreen.

[0158] The computer device also includes a communication interface for communicating with other devices or communication networks.

[0159] This application also provides a computer-readable storage medium. The methods described in this application can be implemented in hardware or firmware, or implemented as recordable on a storage medium, or implemented as computer code downloaded over a network and originally stored on a remote storage medium or a non-transitory machine-readable storage medium and subsequently stored on a local storage medium. Thus, the methods described herein can be processed by software stored on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. The storage medium can be a magnetic disk, optical disk, read-only memory, random access memory, flash memory, hard disk, or solid-state drive, etc.; further, the storage medium can also include combinations of the above types of memory. It is understood that computers, processors, microprocessor controllers, or programmable hardware include storage components capable of storing or receiving software or computer code. When the software or computer code is accessed and executed by the computer, processor, or hardware, the methods shown in the above embodiments are implemented.

[0160] A portion of this application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide the methods and / or technical solutions according to this application through the operation of the computer. Those skilled in the art will understand that the forms in which computer program instructions exist in a computer-readable medium include, but are not limited to, source files, executable files, installation package files, etc. Correspondingly, the ways in which computer program instructions are executed by a computer include, but are not limited to: the computer directly executing the instructions, or the computer compiling the instructions and then executing the corresponding compiled program, or the computer reading and executing the instructions, or the computer reading and installing the instructions and then executing the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to a computer.

[0161] Although embodiments of this application have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of this application, and all such modifications and variations fall within the scope defined by the appended claims.

Claims

1. A method of training a pain model, characterized by, The method includes: Obtain a training dataset; wherein the training dataset includes EEG signals of pain patients and pain natural language description corpus corresponding to the EEG signals of pain patients, and the pain natural language description corpus includes at least one of the following: pain complaint description information, original question and answer information of pain scale, and pain feature keyword combination description information; Based on the training dataset, independent branches for EEG feature extraction and language feature extraction are constructed. The EEG signals in the training dataset are extracted through the EEG feature extraction branch to obtain the EEG signal feature vector; The pain natural language description corpus in the training dataset is extracted using the language feature extraction branch to obtain a natural language description feature vector. Based on the EEG signal feature vector and the natural language description feature vector, the EEG feature extraction branch and the language feature extraction branch are optimized to determine the pain model.

2. The training method of a pain model according to claim 1, wherein, The step of optimizing the EEG feature extraction branch and the language feature extraction branch based on the EEG signal feature vector and the natural language description feature vector to determine the pain model includes: Determine the matching degree between the EEG signal feature vector and the natural language description feature vector corresponding to a set of sample data; Based on the matching degree, a loss function is constructed to jointly optimize the network parameters of the EEG feature extraction branch and the language feature extraction branch, so as to maximize the similarity between the matching EEG signal feature vectors and the natural language description feature vectors in the training dataset, and minimize the similarity between the non-matching EEG signal feature vectors and the natural language description feature vectors.

3. The training method of a pain model according to claim 2, wherein, Determining the matching degree between the EEG signal feature vector and the natural language description feature vector corresponding to a set of sample data includes: is a feature vector of the brain electrical signal, is a feature vector of the natural language description, is a coefficient, and S is a matching degree.

4. A method of pain intensity analysis, characterized by, The method includes: Acquire the electroencephalogram (EEG) signals of the patient to be predicted; Based on the target EEG feature extraction branch, the EEG signal feature vector of the patient to be predicted is determined according to the EEG signal of the patient to be predicted; wherein, the target EEG feature extraction branch is obtained based on the training method of the pain model as described in any one of claims 1-3; The degree of pain in the patient is determined based on the EEG signal feature vector and the standard pain language feature library of the patient to be predicted.

5. The pain intensity analysis method according to claim 4, characterized in that, Based on the EEG signal feature vector of the patient to be predicted and the standard pain language feature library, the patient's pain level is determined, including: Retrieve all preset standard language feature vectors from the standard pain language feature library, calculate the similarity between the EEG signal feature vector of the patient to be predicted and each standard language feature vector in the standard pain language feature library, and obtain a set of similarity values. Sort the similarity scores from highest to lowest to obtain the sorting results corresponding to the similarity scores; Based on the ranking results, the patient's pain level is determined.

6. The pain intensity analysis method according to claim 5, characterized in that, Based on the ranking results, the patient's pain level is determined, including: Select the standard language feature vector with the highest similarity from the sorting results; The patient's pain level is determined based on the standard language feature vector with the highest similarity and a preset mapping relationship; wherein, the preset mapping relationship is the mapping relationship between the standard language feature vector and the pain level.

7. The pain intensity analysis method according to claim 5, characterized in that, Based on the ranking results, the patient's pain level is determined, including: Select a predetermined number of standard language feature vectors from the sorting results; Determine the relative similarity distances between a predetermined number of standard language feature vectors; Based on the relative similarity distance, determine the proportion of relative similarity distances corresponding to a preset number of standard language feature vectors; The degree of pain of the patient is determined based on the ratio of the relative distances of the similarities.

8. A training device for a pain model, characterized in that, The device includes: The acquisition module is used to acquire a training dataset; wherein, the training dataset includes the electroencephalogram (EEG) signals of pain patients and the corresponding natural language description corpus of pain, and the natural language description corpus of pain includes at least one of the following: pain complaint description information, original question and answer information of pain scale, and pain feature keyword combination description information; A module is built to construct independent EEG feature extraction branches and language feature extraction branches based on the training dataset. The first extraction module is used to extract the electroencephalogram (EEG) signals from the training dataset through the EEG feature extraction branch to obtain an EEG signal feature vector; The second extraction module is used to extract features from the natural language description corpus of pain in the training dataset through the language feature extraction branch to obtain a natural language description feature vector; The pain model determination module is used to optimize the EEG feature extraction branch and the language feature extraction branch based on the EEG signal feature vector and the natural language description feature vector to determine the pain model.

9. A non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform a training method for a pain model according to any one of claims 1-3 and / or a pain intensity analysis method according to any one of claims 4-7.

10. A computer program product comprising a computer program that, when executed by a processor, implements the steps of a training method for a pain model according to any one of claims 1-3 and / or a pain intensity analysis method according to any one of claims 4-7.