Model training method, and multiple sclerosis formation risk prediction method and device

By preprocessing and extracting features from high-density electroencephalogram (EEG) data and training a Transformer model, the problems of small sample size and limited feature analysis in the diagnosis of multiple sclerosis were solved, enabling early risk prediction and improved accuracy.

CN120974331APending Publication Date: 2025-11-18XUANWU HOSPITAL OF CAPITAL UNIV OF MEDICAL SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511002288.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-21
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

Existing diagnostic methods for multiple sclerosis based on high-density electroencephalography (EEG) suffer from problems such as small sample size, single-center design, and limited feature analysis. They also lack interpretable and clinically validated biomarkers, making it difficult to meet actual clinical needs.

Method used

By preprocessing high-density electroencephalogram (EEG) data, power spectral density feature vectors and functional connectivity feature vectors are extracted. The Transformer model is then trained, and the model parameters and hyperparameters are adjusted to obtain the target Transformer model, which is used to predict the risk of developing multiple sclerosis.

Benefits of technology

It improves the accuracy of multiple sclerosis prediction, enabling early prediction of disease risk, assisting clinical decision-making, and enhancing the effectiveness of early intervention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120974331A_ABST
    Figure CN120974331A_ABST
Patent Text Reader

Abstract

The invention provides a model training method, a multiple sclerosis risk prediction method and a multiple sclerosis risk prediction device, belongs to the technical field of deep learning, and aims to solve the problems of lack of markers for early diagnosis of multiple sclerosis at present and insufficient accuracy of an existing method. According to the method, the power spectral density feature and the functional connection feature of the high-density electroencephalogram of the target patient are extracted, training is carried out in combination with the Transform model, the target Transform model is obtained, and finally the formation risk of the multiple sclerosis of the target patient is predicted through the target Transform model, so that high-precision risk prediction of the multiple sclerosis is realized, clinical decision can be effectively assisted, and the risk prediction efficiency of the multiple sclerosis is improved. The early intervention effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of deep learning, and in particular to a model training method, a multiple sclerosis risk prediction method and device. BACKGROUND

[0002] Multiple sclerosis (MS) is a chronic immune-mediated disease of the central nervous system, which often occurs in young adults. Early detection of neural damage is crucial for timely intervention and improvement of long-term prognosis. Current diagnostic methods for multiple sclerosis mainly include MRI and cerebrospinal fluid analysis, but these methods have limitations in identifying early non-radiological brain changes. High-density electroencephalogram (hd-EEG) shows potential in identifying early neural damage due to its high temporal resolution and advanced source localization capabilities, but its reliable clinical practical biomarkers have not been fully explored.

[0003] In related technologies and research, the multiple sclerosis research based on electroencephalogram has problems such as small sample size, single-center design, and limited feature analysis, lacks biomarkers with strong interpretability and clinical verification, and is difficult to meet the actual clinical needs. Therefore, there is an urgent need for a multiple sclerosis risk prediction method based on high-density electroencephalogram and deep learning to improve diagnostic accuracy and risk assessment capabilities. SUMMARY

[0004] In view of the above problems, the embodiments of the present application provide a model training method, a multiple sclerosis risk prediction method, a device, an electronic device and a readable storage medium, so as to overcome the above problems or at least partially solve the above problems.

[0005] In a first aspect, the embodiments of the present application provide a model training method, which comprises:

[0006] performing data preprocessing on original high-density electroencephalogram data to obtain first sample electroencephalogram signals after source analysis;

[0007] extracting a sample power spectral density feature vector and a sample functional connectivity feature vector from the first sample electroencephalogram signals;

[0008] inputting the sample power spectral density feature vector and the sample functional connectivity feature vector into a first Transformer model to obtain a risk prediction value output by the first Transformer model;

[0009] calculating a model loss value of the first Transformer model based on the risk prediction value and first label information corresponding to the first sample electroencephalogram signals;

[0010] Based on the model loss value, the model parameters and the hyperparameters of the first Transformer model are adjusted to obtain a target Transformer model; the target Transformer model is used to determine the risk of multiple sclerosis formation of a target patient according to target high-density electroencephalogram data of the target patient.

[0011] Optionally, the method further comprises:

[0012] The resting-state electroencephalogram data of the sample patient is collected using a 256-channel electroencephalogram system at a sampling rate of 1000 Hz to obtain the original high-density electroencephalogram data.

[0013] Optionally, the calculating the loss value of the first Transformer model based on the risk prediction value and the first label information corresponding to the first sample electroencephalogram signal comprises:

[0014] Based on the risk prediction value and the first label information corresponding to the first sample electroencephalogram signal, a cross-entropy loss value of the first Transformer model is calculated.

[0015] A regularization loss value of the first Transformer model is calculated.

[0016] Based on the cross-entropy loss value and the regularization loss value, a model loss value of the first Transformer model is determined.

[0017] Optionally, the determining the model loss value of the first Transformer model based on the cross-entropy loss value and the regularization loss value comprises:

[0018] A balance coefficient of the regularization loss value is determined.

[0019] Based on the balance coefficient, the cross-entropy loss value and the regularization loss value, the model loss value of the first Transformer model is determined.

[0020] Optionally, the inputting the sample power spectral density feature vector and the sample functional connectivity feature vector into the first Transformer model to obtain a risk prediction value output by the first Transformer model comprises:

[0021] The sample power spectral density feature vector and the sample functional connectivity feature vector are respectively spliced with sample clinical data of the sample patient to obtain a first sample splicing vector and a second sample splicing vector; the clinical data includes demographic information, neuropsychological assessment results, cerebrospinal fluid indicators and blood indicators of the patient.

[0022] input the first sample splicing vector and the second sample splicing vector into a first Transformer model to obtain a risk prediction value output by the first Transformer model.

[0023] Optionally, the model parameters and the hyperparameters of the first Transformer model are adjusted based on the model loss value to obtain a target Transformer model, including:

[0024] The model parameters and the hyperparameters of the first Transformer model are adjusted once based on the model loss value to obtain an updated first Transformer model.

[0025] The step of inputting the sample power spectrum density feature vector and the sample functional connectivity feature vector into the first Transformer model to obtain the risk prediction value output by the first Transformer model is re-executed.

[0026] In a case where the model loss value meets a preset convergence condition or a training number of the first Transformer model reaches a preset number, the model parameters and the hyperparameters of the first Transformer model are stopped from being adjusted to obtain a target Transformer model.

[0027] In a second aspect, an embodiment of the present application provides a multiple sclerosis formation risk prediction method, and the method includes:

[0028] Target high-density electroencephalogram data of a target patient is obtained.

[0029] The target high-density electroencephalogram data is subjected to data preprocessing and feature extraction to obtain power spectrum density features and functional connectivity features.

[0030] The power spectrum density features and the functional connectivity features are input into a target Transformer model to obtain a risk prediction value output by the target Transformer model; and the target Transformer model is obtained based on the model training method according to any one of the preceding embodiments.

[0031] Based on the risk prediction value, a multiple sclerosis formation risk of the target patient is determined.

[0032] In a third aspect, an embodiment of the present application provides a model training device, and the device includes:

[0033] A data preprocessing module is configured to perform data preprocessing on original high-density electroencephalogram data to obtain first sample electroencephalogram signals subjected to source analysis.

[0034] The feature extraction module is used to extract the sample power spectral density feature vector and the sample functional connectivity feature vector from the first sample EEG signal;

[0035] The input / output module is used to input the sample power spectral density feature vector and the sample function concatenation feature vector into the first Transformer model to obtain the risk prediction value output by the first Transformer model.

[0036] The calculation module is used to calculate the model loss value of the first Transformer model based on the risk prediction value and the first annotation information corresponding to the first sample EEG signal.

[0037] An adjustment module is used to adjust the model parameters and hyperparameters of the first Transformer model based on the model loss value to obtain a target Transformer model; the target Transformer model is used to determine the risk of multiple sclerosis in the target patient based on the target high-density EEG data of the target patient.

[0038] Optionally, the device further includes:

[0039] The acquisition module is used to acquire resting-state EEG data of sample patients using a 256-channel EEG system at a sampling rate of 1000Hz, thereby obtaining the raw high-density EEG data.

[0040] Optionally, the computing module includes:

[0041] The first calculation submodule is used to calculate the cross-entropy loss value of the first Transformer model based on the risk prediction value and the first annotation information corresponding to the first sample EEG signal.

[0042] The second calculation submodule is used to calculate the regularization loss value of the first Transformer model;

[0043] The first determining submodule is used to determine the model loss value of the first Transformer model based on the cross-entropy loss value and the regularization loss value.

[0044] Optionally, the first determining submodule includes:

[0045] The first determining unit is used to determine the balance coefficient of the regularization loss value;

[0046] The second determining unit is used to determine the model loss value of the first Transformer model based on the balance coefficient, the cross-entropy loss value, and the regularization loss value.

[0047] Optionally, the input / output module includes:

[0048] The splicing submodule is used to splice the sample power spectral density feature vector and the sample functional connectivity feature vector with the sample clinical data of the sample patient, respectively, to obtain a first sample splicing vector and a second sample splicing vector; the clinical data includes the patient's demographic information, neuropsychological assessment results, cerebrospinal fluid indicators, and blood indicators.

[0049] The input / output submodule is used to input the first sample concatenation vector and the second sample concatenation vector into the first Transformer model to obtain the risk prediction value output by the first Transformer model.

[0050] Optionally, the adjustment module includes:

[0051] The adjustment submodule is used to adjust the model parameters and hyperparameters of the first Transformer model once based on the model loss value, so as to obtain the updated first Transformer model.

[0052] The execution submodule is used to re-execute the step of inputting the sample power spectral density feature vector and the sample function concatenation feature vector into the first Transformer model to obtain the risk prediction value output by the first Transformer model;

[0053] The Stop Adjustment submodule is used to stop adjusting the model parameters and hyperparameters of the first Transformer model when the model loss value meets the preset convergence condition or the training times of the first Transformer model reach the preset number, so as to obtain the target Transformer model.

[0054] Fourthly, embodiments of this application provide a device for predicting the risk of developing multiple sclerosis, the device comprising:

[0055] The data acquisition module is used to acquire the target high-density electroencephalogram (EEG) data of the target patient;

[0056] The feature extraction module is used to extract features from the target high-density electroencephalogram data to obtain power spectral density features and functional connectivity features;

[0057] The input / output module is used to input the power spectral density features and the functional connectivity features into the target Transformer model to obtain the risk prediction value output by the target Transformer model; the target Transformer model is obtained based on any of the model training methods described above.

[0058] A determination module is used to determine the risk of multiple sclerosis development in the target patient based on the risk prediction value.

[0059] Fifthly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the model training method as described above, or the multiple sclerosis risk prediction method.

[0060] Sixthly, embodiments of this application provide a readable storage medium storing a program or instructions, which, when executed by a processor, implement the model training method described above, or the multiple sclerosis risk prediction method.

[0061] The specific beneficial effects are as follows:

[0062] This application embodiment preprocesses the raw high-density EEG data to obtain the first sample EEG signal after source analysis. It extracts the sample power spectral density feature vector and sample functional connectivity feature vector from the first sample EEG signal. These feature vectors are then input into a first Transformer model to obtain the risk prediction value output by the first Transformer model. Based on the risk prediction value and the first annotation information corresponding to the first sample EEG signal, the model loss value of the first Transformer model is calculated. Based on the model loss value, the model parameters and hyperparameters of the first Transformer model are adjusted to obtain the target Transformer model. The target Transformer model is used to determine the risk of multiple sclerosis formation in the target patient based on the target high-density EEG data. The first Transformer model can be adjusted using the sample power spectral density feature vector and sample functional connectivity feature vector extracted from the first sample EEG signal. The former model is used to train the target Transformer model, which can then be used to predict the risk of developing multiple sclerosis in target patients. This allows for early prediction of the risk of developing multiple sclerosis, improving the accuracy of multiple sclerosis prediction and effectively assisting clinical decision-making, thereby enhancing the effectiveness of early intervention. Attached Figure Description

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

[0064] Figure 1 This is a schematic flowchart of a model training method provided in an embodiment of this application;

[0065] Figure 2 A flowchart illustrating another model training method provided in an embodiment of this application;

[0066] Figure 3 A flowchart illustrating a method for predicting the risk of multiple sclerosis development provided in this application embodiment;

[0067] Figure 4 This is a logic block diagram of a model training device provided in an embodiment of this application;

[0068] Figure 5 This is a logic block diagram of a multiple sclerosis risk prediction device provided in an embodiment of this application;

[0069] Figure 6 This is a schematic diagram of an electronic device provided in an embodiment of this application. Detailed Implementation

[0070] Exemplary embodiments of this application will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a more thorough understanding of this application and to fully convey the scope of this application to those skilled in the art.

[0071] Reference Figure 1 , Figure 1 This is a flowchart illustrating a model training method provided in an embodiment of this application. The method may include:

[0072] Step 101: Perform data preprocessing on the original high-density EEG data to obtain the first sample EEG signal after source analysis.

[0073] In the embodiments of this application, high-density electroencephalography (HD-EEG) is a special electroencephalography recording technique that captures the brain's electrical activity using more electrodes than traditional EEG. These electrodes are densely arranged on the scalp to provide more detailed and comprehensive information on brain electrical activity. Compared to traditional EEG, HD-EEG has higher spatial resolution and can more accurately locate sources of electrical activity in the brain. This is of great significance for studying brain function, diagnosing neurological diseases, and monitoring treatment effects. HD-EEG typically uses hundreds or even thousands of electrodes to record the brain's electrical activity, which can be arranged in a specific pattern to cover the entire scalp. Through this technique, doctors and researchers can observe minute electrical changes in the brain, thereby gaining a more accurate understanding of the brain's functional state and potential pathological changes. However, while increasing the number of sampling electrodes, it inevitably leads to increased noise in the acquired signals. Therefore, for model training, it is necessary to preprocess the acquired raw HD-EEG data to obtain more accurate signals as the first sample EEG signals for model training. The raw brain density EEG data contains low-frequency and high-frequency noise, which can be filtered out using a 0.1-100Hz bandpass filter. Next, spherical spline interpolation is used to process bad channels, and the values ​​corresponding to the bad channels are regenerated using the average value as a reference. Then, independent component analysis (ICA) is applied to remove eye movement, muscle, and cardiac artifacts. The data is then segmented into 2-second epochs, and segments with amplitudes greater than 100 microvolts (μV) or drastic voltage fluctuations are excluded to remove fluctuation noise. Finally, a linearly constrained minimum variance (LCMV) beamformer is used to project the data onto the source space to obtain the preprocessed signal. After these data preprocessing steps, the resulting first sample EEG signal is formed based on the functional state of the brain and potential pathological changes, thus completing the source analysis of the EEG data.

[0074] Step 102: Extract the sample power spectral density feature vector and the sample functional connectivity feature vector from the first sample EEG signal.

[0075] In the embodiments of this application, a normalized sample power spectral density feature vector can be calculated based on the signal space of the first sample EEG signal. Then, a functional connectivity feature vector can be calculated between any two sample power spectral density feature vectors (e.g., by feature alignment) to obtain the connectivity matrix for each frequency band. The sample power spectral density feature vectors correspond to one of nine classic EEG frequency bands: Delta (1-4Hz), Theta (4-8Hz), Alpha1 (8-11.5Hz), Alpha2 (11.5-13Hz), Beta1 (13-17Hz), Beta2 (17-21Hz), Beta3 (21-28Hz), Gamma1 (31-47Hz), and Gamma2 (53-97Hz). That is, the number of sample power spectral density feature vectors under one training dataset is 9, and the number of functional connectivity feature vectors is 36.

[0076] Step 103: Input the sample power spectral density feature vector and the sample function concatenation feature vector into the first Transformer model to obtain the risk prediction value output by the first Transformer model.

[0077] In embodiments of this application, the sample power spectral density feature vector and the sample function concatenation feature vector can be input into a first Transformer model to obtain the risk prediction value output by the first Transformer model. The Transformer model may include a multi-head self-attention mechanism module and a feedforward neural network module to extract temporal features and global dependencies, and finally output the risk prediction value.

[0078] Step 104: Calculate the model loss value of the first Transformer model based on the risk prediction value and the first annotation information corresponding to the first sample EEG signal.

[0079] In the embodiments of this application, the model loss value of the first Transformer model can be calculated based on the risk prediction value and the first annotation information corresponding to the first sample EEG signal. Since the first annotation information is the classification information of multiple sclerosis (having and not having), the model loss value can be a binary cross-entropy loss value or a variant thereof.

[0080] Step 105: Based on the model loss value, adjust the model parameters and hyperparameters of the first Transformer model to obtain the target Transformer model; wherein, the target Transformer model is used to determine the risk of multiple sclerosis formation in the target patient based on the target high-density EEG data of the target patient.

[0081] In the embodiments of this application, the model parameters and hyperparameters of the first Transformer model can be adjusted based on the model loss value to obtain the target Transformer model. The parameter adjustment of the first Transformer model can be repeated multiple times. After each parameter adjustment, training data can be re-inputted to obtain a new model loss value. After completing a specified number of epochs, the adjustment of the model parameters and hyperparameters of the first Transformer model can be stopped, thus obtaining the target Transformer model.

[0082] In the embodiments of this application, the original high-density EEG data is preprocessed to obtain the first sample EEG signal after source analysis. Sample power spectral density feature vector and sample functional connectivity feature vector are extracted from the first sample EEG signal. These feature vectors are input into a first Transformer model to obtain the risk prediction value output by the first Transformer model. Based on the risk prediction value and the first annotation information corresponding to the first sample EEG signal, the model loss value of the first Transformer model is calculated. Based on the model loss value, the model parameters and hyperparameters of the first Transformer model are adjusted to obtain the target Transformer model. The target Transformer model is used to determine the risk of multiple sclerosis formation in the target patient based on the target high-density EEG data. It can be trained on the first Transformer model using the sample power spectral density feature vector and sample functional connectivity feature vector extracted from the first sample EEG signal to obtain the target Transformer model. The ORMER model predicts the risk of developing multiple sclerosis in target patients, enabling early prediction of the risk of developing multiple sclerosis, improving the accuracy of multiple sclerosis prediction, effectively assisting clinical decision-making, and enhancing the effectiveness of early intervention.

[0083] Reference Figure 2 , Figure 2 This is a flowchart illustrating another model training method provided in an embodiment of this application. The method may include:

[0084] Step 201: Using a 256-channel EEG system, at a sampling rate of 1000Hz, collect resting-state EEG data from the sample patients to obtain raw high-density EEG data.

[0085] In the embodiments of this application, a 256-channel EEG system can be used to acquire resting-state EEG data from sample patients at a sampling rate of 1000Hz, thereby obtaining raw high-density EEG data. Through the above steps, highly accurate raw high-density EEG data can be obtained.

[0086] Step 202: Perform data preprocessing on the original high-density EEG data to obtain the first sample EEG signal after source analysis.

[0087] In the embodiments of this application, the implementation of this step can be referred to the embodiment of step 101, and will not be repeated here.

[0088] Step 203: Extract the sample power spectral density feature vector and the sample functional connectivity feature vector from the first sample EEG signal.

[0089] In the embodiments of this application, the implementation of this step can be referred to the embodiment of step 102, and will not be repeated here.

[0090] Step 204: Input the sample power spectral density feature vector and the sample function concatenation feature vector into the first Transformer model to obtain the risk prediction value output by the first Transformer model.

[0091] In the embodiments of this application, the implementation of this step can be referred to the embodiment of step 103, and will not be repeated here.

[0092] Optionally, step 204 may include the following sub-steps:

[0093] Sub-step 2041 involves concatenating the sample power spectral density feature vector and the sample functional connectivity feature vector with the sample clinical data of the sample patient to obtain a first sample concatenation vector and a second sample concatenation vector; the clinical data includes the patient's demographic information, neuropsychological assessment results, cerebrospinal fluid indicators, and blood indicators.

[0094] In the embodiments of this application, the sample power spectral density feature vector and the sample functional connectivity feature vector can be concatenated with the sample clinical data of the sample patient, respectively, so as to add features to the sample power spectral density feature vector and the sample functional connectivity feature vector using the sample clinical data of the sample patient, to obtain a first sample concatenation vector and a second sample concatenation vector, wherein the clinical data includes the patient's demographic information, neuropsychological assessment results, cerebrospinal fluid indicators and blood indicators.

[0095] Sub-step 2042: Input the first sample concatenation vector and the second sample concatenation vector into the first Transformer model to obtain the risk prediction value output by the first Transformer model.

[0096] In the embodiments of this application, the first sample splicing vector and the second sample splicing vector obtained by splicing can be input into the first Transformer model to obtain the risk prediction value output by the first Transformer model.

[0097] In the embodiments of this application, a first sample concatenation vector and a second sample concatenation vector are obtained by concatenating the sample power spectral density feature vector and the sample functional connectivity feature vector with the sample clinical data of the sample patient, respectively. The clinical data includes the patient's demographic information, neuropsychological assessment results, cerebrospinal fluid indicators, and blood indicators. The first sample concatenation vector and the second sample concatenation vector are input into the first Transformer model to obtain the risk prediction value output by the first Transformer model. This can increase the information richness of the input data, improve the model training effect, and improve the prediction accuracy of the target Transformer model.

[0098] Step 205: Calculate the model loss value of the first Transformer model based on the risk prediction value and the first annotation information corresponding to the first sample EEG signal.

[0099] In the embodiments of this application, the implementation of this step can be referred to the embodiment of step 104, and will not be repeated here.

[0100] Optionally, step 205 may include the following sub-steps:

[0101] Sub-step 2051: Based on the risk prediction value and the first annotation information corresponding to the first sample EEG signal, calculate the cross-entropy loss value of the first Transformer model.

[0102] In the embodiments of this application, the model loss value can be composed of a cross-entropy loss value and a regularization loss value. Firstly, the cross-entropy loss value of the first Transformer model can be calculated based on the risk prediction value and the first annotation information corresponding to the first sample EEG signal. The calculation method is shown in Equation 1 below:

[0103]

[0104] In Equation 1 above, L CE Let y be the cross-entropy loss value. i Let be the risk prediction value corresponding to the i-th EEG signal of the first sample. This is the first annotation information for the i-th first sample EEG signal. This indicates that the patient has multiple sclerosis. This indicates that the individual does not have multiple sclerosis. N represents the total number of EEG signals in the first sample.

[0105] Sub-step 2052: Calculate the regularization loss value of the first Transformer model.

[0106] In the embodiments of this application, the regularization loss is a loss value used in machine learning and deep learning to prevent model overfitting. It is achieved by adding an extra term to the loss function, which is typically a penalty applied to the model parameters. The regularization loss value of the first Transformer model can be calculated based on the risk prediction value and the first annotation information corresponding to the first sample EEG signal, as shown in Equation 2 below:

[0107]

[0108] In equation 2 above, L R1 ω represents the regularization loss value, where M is the number of model parameters and hyperparameters in the first Transformer model. i This represents the i-th model parameter or hyperparameter.

[0109] Sub-step 2053: Based on the cross-entropy loss value and the regularization loss value, determine the model loss value of the first Transformer model.

[0110] In the embodiments of this application, the model loss value of the first Transformer model can be calculated by direct summation or weighted summation based on the cross-entropy loss value and the regularization loss value.

[0111] Optionally, sub-step 2053 may include the following sub-steps:

[0112] Sub-step A1: Determine the balance coefficient of the regularization loss value.

[0113] In the embodiments of this application, the regularization loss value, as a penalty term in the model loss value, typically requires a balancing coefficient to control the penalty intensity. Therefore, the balancing coefficient of the regularization loss value set for the first Transformer model can be determined. This balancing coefficient is manually set and can be called at any time.

[0114] Sub-step A2: Based on the balance coefficient, the cross-entropy loss value, and the regularization loss value, determine the model loss value of the first Transformer model.

[0115] In the embodiments of this application, the model loss value of the first Transformer model can be calculated based on the balance coefficient, cross-entropy loss value, and regularization loss value, as shown in Equation 3 below:

[0116] L = L CE +λL R1 (Equation 3)

[0117] In Equation 3 above, L is the model loss value, L CE Let L be the cross-entropy loss value, λ be the balance coefficient, and L be the cross-entropy loss value. R1 This represents the regularization loss value.

[0118] In the embodiments of this application, by determining the balance coefficient of the regularization loss value, and based on the balance coefficient, the cross-entropy loss value, and the regularization loss value, the model loss value of the first Transformer model is determined. The proportion of the cross-entropy loss value and the regularization loss value in the model loss value can be adjusted according to the needs, which can improve the accuracy and reliability of the model loss value to a certain extent.

[0119] In the embodiments of this application, the cross-entropy loss value of the first Transformer model is calculated based on the risk prediction value and the first annotation information corresponding to the first sample EEG signal. The regularization loss value of the first Transformer model is also calculated. Based on the cross-entropy loss value and the regularization loss value, the model loss value of the first Transformer model is determined. The model loss value can be constructed using the cross-entropy loss value and the regularization loss value, which can improve the richness of the types of model loss values ​​and improve the training performance of the model.

[0120] Step 206: Based on the model loss value, adjust the model parameters and hyperparameters of the first Transformer model once to obtain the updated first Transformer model.

[0121] In the embodiments of this application, the model parameters and hyperparameters of the Transformer model can be adjusted once based on the model loss value, thereby obtaining an updated first Transformer model.

[0122] Step 207: Re-execute the step of inputting the sample power spectral density feature vector and the sample function concatenation feature vector into the first Transformer model to obtain the risk prediction value output by the first Transformer model.

[0123] In the embodiments of this application, after obtaining the updated first Transformer model, the step of "inputting the sample power spectral density feature vector and the sample function concatenation feature vector into the first Transformer model to obtain the risk prediction value output by the first Transformer model" can be re-executed to start the next model training.

[0124] Step 208: When the model loss value meets the preset convergence condition, or when the training times of the first Transformer model reach the preset number of times, stop adjusting the model parameters and hyperparameters of the first Transformer model to obtain the target Transformer model.

[0125] In the embodiments of this application, when the model loss value meets a preset convergence condition, or when the training iterations of the first Transformer model reach a preset number, the adjustment of the model parameters and hyperparameters of the first Transformer model is stopped, and the target Transformer model is obtained. The preset convergence condition may be that the number of consecutive occurrences of the model loss value being less than a preset threshold is greater than or equal to a preset number.

[0126] In the embodiments of this application, the model parameters and hyperparameters of the first Transformer model are adjusted once based on the model loss value to obtain an updated first Transformer model. The step of inputting the sample power spectral density feature vector and the sample function concatenation feature vector into the first Transformer model again to obtain the risk prediction value output by the first Transformer model is then executed. When the model loss value meets the preset convergence condition or the training times of the first Transformer model reach the preset number, the adjustment of the model parameters and hyperparameters of the first Transformer model is stopped, and the target Transformer model is obtained. The first Transformer model can be trained multiple times, and the target Transformer model can be obtained when the model converges, which can improve the prediction accuracy and reliability of the target Transformer model.

[0127] Reference Figure 3 , Figure 3 A flowchart illustrating a method for predicting the risk of multiple sclerosis development, provided in this application embodiment, includes:

[0128] Step 301: Obtain the target high-density electroencephalogram (EEG) data of the target patient.

[0129] In the embodiments of this application, target high-density electroencephalogram (EEG) data of the target patient can be acquired. The acquisition method can be found in the embodiment of step 201, and will not be repeated here.

[0130] Step 302: Perform data preprocessing and feature extraction on the target high-density EEG data to obtain power spectral density features and functional connectivity features.

[0131] In the embodiments of this application, the target high-density EEG data can be preprocessed to obtain a signal with less noise, and then feature extraction can be performed to obtain power spectral density features and functional connectivity features. The implementation details of data preprocessing can be found in the embodiment of step 101, and the implementation details of feature extraction can be found in the embodiment of step 102, which will not be repeated here.

[0132] Step 303: Input the power spectral density feature and the functional connectivity feature into the target Transformer model to obtain the risk prediction value output by the target Transformer model; wherein, the target Transformer model is obtained based on any of the model training methods described above.

[0133] In embodiments of this application, power spectral density features and functional connectivity features can be input into the target Transformer model to obtain the risk prediction value output by the target Transformer model. The target Transformer model can be obtained based on any of the model training methods described above.

[0134] Step 304: Based on the risk prediction value, determine the risk of multiple sclerosis development in the target patient.

[0135] In the embodiments of this application, the risk of developing multiple sclerosis in a target patient can be determined based on a risk prediction value. The risk prediction value directly represents the risk of developing multiple sclerosis. For example, if the risk prediction value is 86%, it means that the target patient has an 86% probability of developing multiple sclerosis.

[0136] In the embodiments of this application, target high-density electroencephalogram (EEG) data of the target patient is acquired, and the target EEG data is preprocessed and feature extracted to obtain power spectral density features and functional connectivity features. The power spectral density features and functional connectivity features are then input into the target Transformer model to obtain the risk prediction value output by the target Transformer model. The target Transformer model is obtained based on any of the model training methods described above. Based on the risk prediction value, the risk of multiple sclerosis formation in the target patient is determined. The target Transformer model can be used to predict the risk of multiple sclerosis formation in the target patient, which can improve the accuracy of risk prediction to a certain extent.

[0137] The embodiments of this application use the following method to verify the effectiveness of the target Transformer model:

[0138] 1. Feature Selection

[0139] Feature selection employed a dual-standard approach based on statistical significance and model-driven importance. For each spatial location in the EEG channel, an independent two-sample t-test was performed to assess inter-group differences and derive the corresponding p-value. Simultaneously, the Least Absolute Contraction and Selection Operator (LASSO) regression was applied to estimate regression coefficients at the same spatial locations. The p-values ​​of the t-tests were converted to a statistical importance score using the negative base-10 logarithm (-lg(p)), while the absolute values ​​of the LASSO coefficients served as a model-based importance measure. These two scores were then combined through a weighted sum to calculate a composite importance score for each feature. Within each EEG channel, the top k spatial locations with the highest composite scores were retained as model inputs.

[0140] 2. Select an AI model for testing.

[0141] Support Vector Machines (SVMs) are trained using radial basis function (RBF) kernels to capture nonlinear relationships in the feature space. Random Forest models use ensemble decision trees trained on bootstrap samples and random feature selection to enhance robustness and reduce overfitting. XGBoost employs gradient boosting trees with L1 and L2 regularization to optimize predictive performance and model sparsity. Transformer encoders integrate multi-head self-attention mechanisms and position-wise feedforward layers to model complex dependencies between features.

[0142] Model performance was evaluated using four key metrics: accuracy (overall classification correctness), sensitivity (true positive rate), specificity (true negative rate), and the area under the receiver operating characteristic (AUC) curve—used to quantify discriminative ability. The final model selection was based on the combined performance of these metrics on the retained test set. Receiver operating characteristic (AUC) curves were plotted for each model to visually compare classification performance.

[0143] We developed artificial intelligence models (SVM, Random Forest, XGBoost, and Transformer) using the training set of this queue, and then tested the models on the reserved test set. The test results are shown in Table 1 below:

[0144] Table 1

[0145]

[0146] According to the results in Table 1, the Transformer model outperformed the other three models in all five prediction items.

[0147] refer to Figure 4 , Figure 4 This application provides a logic block diagram of a model training apparatus 400, which may include:

[0148] The data preprocessing module 401 is used to preprocess the raw high-density EEG data to obtain the first sample EEG signal after source analysis.

[0149] Feature extraction module 402 is used to extract sample power spectral density feature vector and sample functional connectivity feature vector from the first sample EEG signal;

[0150] The input / output module 403 is used to input the sample power spectral density feature vector and the sample function concatenation feature vector into the first Transformer model to obtain the risk prediction value output by the first Transformer model.

[0151] The calculation module 404 is used to calculate the model loss value of the first Transformer model based on the risk prediction value and the first annotation information corresponding to the first sample EEG signal.

[0152] The adjustment module 405 is used to adjust the model parameters and hyperparameters of the first Transformer model based on the model loss value to obtain a target Transformer model; the target Transformer model is used to determine the risk of multiple sclerosis formation in the target patient based on the target high-density electroencephalogram data of the target patient.

[0153] Optionally, the device 400 further includes:

[0154] The acquisition module is used to acquire resting-state EEG data of sample patients using a 256-channel EEG system at a sampling rate of 1000Hz, thereby obtaining the raw high-density EEG data.

[0155] Optionally, the computing module 404 includes:

[0156] The first calculation submodule is used to calculate the cross-entropy loss value of the first Transformer model based on the risk prediction value and the first annotation information corresponding to the first sample EEG signal.

[0157] The second calculation submodule is used to calculate the regularization loss value of the first Transformer model;

[0158] The first determining submodule is used to determine the model loss value of the first Transformer model based on the cross-entropy loss value and the regularization loss value.

[0159] Optionally, the first determining submodule includes:

[0160] The first determining unit is used to determine the balance coefficient of the regularization loss value;

[0161] The second determining unit is used to determine the model loss value of the first Transformer model based on the balance coefficient, the cross-entropy loss value, and the regularization loss value.

[0162] Optionally, the input / output module 403 includes:

[0163] The splicing submodule is used to splice the sample power spectral density feature vector and the sample functional connectivity feature vector with the sample clinical data of the sample patient, respectively, to obtain a first sample splicing vector and a second sample splicing vector; the clinical data includes the patient's demographic information, neuropsychological assessment results, cerebrospinal fluid indicators, and blood indicators.

[0164] The input / output submodule is used to input the first sample concatenation vector and the second sample concatenation vector into the first Transformer model to obtain the risk prediction value output by the first Transformer model.

[0165] Optionally, the adjustment module 405 includes:

[0166] The adjustment submodule is used to adjust the model parameters and hyperparameters of the first Transformer model once based on the model loss value, so as to obtain the updated first Transformer model.

[0167] The execution submodule is used to re-execute the step of inputting the sample power spectral density feature vector and the sample function concatenation feature vector into the first Transformer model to obtain the risk prediction value output by the first Transformer model;

[0168] The Stop Adjustment submodule is used to stop adjusting the model parameters and hyperparameters of the first Transformer model when the model loss value meets the preset convergence condition or the training times of the first Transformer model reach the preset number, so as to obtain the target Transformer model.

[0169] The model training device in this application embodiment can be integrated into an electronic device, or a component in an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices besides a terminal. For example, the electronic device can be a GPU box, mobile phone, tablet computer, laptop computer, handheld computer, robot, ultra-mobile personal computer (UMPC), or personal digital assistant (PDA), etc., and can also be a server, personal computer (PC), etc. This application embodiment does not specifically limit the specific implementation.

[0170] The model training device in this application embodiment can be a device with an operating system. This operating system can be Android, Linux, Windows, or other possible operating systems; this application embodiment does not specifically limit it.

[0171] The model training device provided in this application embodiment can achieve... Figure 1 and Figure 2 The various processes implemented in the method embodiments will not be described again here to avoid repetition.

[0172] Reference Figure 5 , Figure 5 This application provides a logic block diagram of a multiple sclerosis risk prediction device, wherein the device 500 may include:

[0173] Data acquisition module 501 is used to acquire target high-density electroencephalogram (EEG) data of the target patient;

[0174] Feature extraction module 502 is used to extract features from the target high-density electroencephalogram data to obtain power spectral density features and functional connectivity features;

[0175] The input / output module 503 is used to input the power spectral density feature and the functional connectivity feature into the target Transformer model to obtain the risk prediction value output by the target Transformer model; the target Transformer model is obtained based on any of the model training methods described above.

[0176] The determination module 504 is used to determine the risk of multiple sclerosis formation in the target patient based on the risk prediction value.

[0177] The multiple sclerosis risk prediction device in this embodiment can be integrated into an electronic device or a component of an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a GPU box, mobile phone, tablet computer, laptop computer, PDA, robot, ultra-mobile personal computer (UMPC), or personal digital assistant (PDA), etc., and can also be a server, personal computer (PC), etc. This embodiment does not specifically limit the device.

[0178] The multiple sclerosis risk prediction device in this application embodiment can be a device with an operating system. This operating system can be Android, Linux, Windows, or other possible operating systems; this application embodiment does not specifically limit it.

[0179] The multiple sclerosis formation risk prediction device provided in this application embodiment can achieve... Figure 3 The various processes implemented in the method implementation examples will not be described again here to avoid repetition.

[0180] This application provides an electronic device, see [link to relevant documentation] Figure 6 The electronic device 60 includes: a processor 601, a memory 602, and a computer program 6021 stored in the memory 602 and executable on the processor 601. When the processor 601 executes the program, it implements the model training method of the foregoing embodiments, or the multiple sclerosis risk prediction method.

[0181] This application also provides a computer-readable storage medium storing a computer program / instructions thereon, which, when executed by a processor, implements the steps in the model training method or the multiple sclerosis risk prediction method disclosed in this application.

[0182] This application also provides a computer program product that, when run on an electronic device, enables a processor to execute steps in the model training method or the multiple sclerosis risk prediction method disclosed in this application.

[0183] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0184] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, electronic devices, and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0185] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0186] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0187] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0188] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0189] The above provides a detailed description of the model training method, multiple sclerosis risk prediction method, and apparatus provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A model training method, characterized in that, The method includes: Data preprocessing was performed on the raw high-density EEG data to obtain the first sample EEG signal after source analysis; Extract the sample power spectral density feature vector and the sample functional connectivity feature vector from the first sample EEG signal; The sample power spectral density feature vector and the sample function concatenation feature vector are input into the first Transformer model to obtain the risk prediction value output by the first Transformer model. Based on the risk prediction value and the first annotation information corresponding to the first sample EEG signal, the model loss value of the first Transformer model is calculated. Based on the model loss value, the model parameters and hyperparameters of the first Transformer model are adjusted to obtain the target Transformer model; the target Transformer model is used to determine the risk of multiple sclerosis in the target patient based on the target high-density EEG data of the target patient.

2. The method according to claim 1, characterized in that, The method further includes: Using a 256-channel EEG system at a sampling rate of 1000Hz, resting-state EEG data of the sample patients were acquired to obtain the raw high-density EEG data.

3. The method according to claim 1, characterized in that, The step of calculating the loss value of the first Transformer model based on the risk prediction value and the first annotation information corresponding to the first sample EEG signal includes: Based on the risk prediction value and the first annotation information corresponding to the first sample EEG signal, calculate the cross-entropy loss value of the first Transformer model; Calculate the regularization loss value of the first Transformer model; Based on the cross-entropy loss value and the regularization loss value, the model loss value of the first Transformer model is determined.

4. The method according to claim 3, characterized in that, Determining the model loss value of the first Transformer model based on the cross-entropy loss value and the regularization loss value includes: Determine the balance coefficient of the regularization loss value; The model loss value of the first Transformer model is determined based on the balance coefficient, the cross-entropy loss value, and the regularization loss value.

5. The method according to claim 2, characterized in that, The step of inputting the sample power spectral density feature vector and the sample function concatenation feature vector into the first Transformer model to obtain the risk prediction value output by the first Transformer model includes: The sample power spectral density feature vector and the sample functional connectivity feature vector are respectively concatenated with the sample clinical data of the sample patient to obtain a first sample concatenation vector and a second sample concatenation vector; the clinical data includes the patient's demographic information, neuropsychological assessment results, cerebrospinal fluid indicators, and blood indicators; Input the first sample concatenation vector and the second sample concatenation vector into the first Transformer model to obtain the risk prediction value output by the first Transformer model.

6. The method according to claim 1, characterized in that, The step of adjusting the model parameters and hyperparameters of the first Transformer model based on the model loss value to obtain the target Transformer model includes: Based on the model loss value, the model parameters and hyperparameters of the first Transformer model are adjusted once to obtain the updated first Transformer model; Re-execute the step of inputting the sample power spectral density feature vector and the sample function concatenation feature vector into the first Transformer model to obtain the risk prediction value output by the first Transformer model; When the model loss value meets the preset convergence condition, or when the training times of the first Transformer model reach the preset number, the adjustment of the model parameters and hyperparameters of the first Transformer model is stopped, and the target Transformer model is obtained.

7. A method for predicting the risk of developing multiple sclerosis, characterized in that, The method includes: Acquire target high-density electroencephalogram (EEG) data from the target patient; Data preprocessing and feature extraction are performed on the target high-density EEG data to obtain power spectral density features and functional connectivity features; The power spectral density features and the functional connectivity features are input into the target Transformer model to obtain the risk prediction value output by the target Transformer model; wherein, the target Transformer model is obtained based on the model training method according to any one of claims 1 to 6; Based on the risk prediction value, the risk of developing multiple sclerosis in the target patient is determined.

8. A model training device, characterized in that, The device includes: The data preprocessing module is used to preprocess the raw high-density EEG data to obtain the first sample EEG signal after source analysis. The feature extraction module is used to extract the sample power spectral density feature vector and the sample functional connectivity feature vector from the first sample EEG signal; The input / output module is used to input the sample power spectral density feature vector and the sample function concatenation feature vector into the first Transformer model to obtain the risk prediction value output by the first Transformer model. The calculation module is used to calculate the model loss value of the first Transformer model based on the risk prediction value and the first annotation information corresponding to the first sample EEG signal. An adjustment module is used to adjust the model parameters and hyperparameters of the first Transformer model based on the model loss value to obtain a target Transformer model; the target Transformer model is used to determine the risk of multiple sclerosis in the target patient based on the target high-density EEG data of the target patient.

9. A device for predicting the risk of multiple sclerosis, characterized in that, The device includes: The data acquisition module is used to acquire the target high-density electroencephalogram (EEG) data of the target patient; The feature extraction module is used to extract features from the target high-density electroencephalogram data to obtain power spectral density features and functional connectivity features; An input / output module is used to input the power spectral density features and the functional connectivity features into a target Transformer model to obtain the risk prediction value output by the target Transformer model; wherein, the target Transformer model is obtained based on the model training method according to any one of claims 1 to 6; A determination module is used to determine the risk of multiple sclerosis development in the target patient based on the risk prediction value.