A method and device for constructing a prediction model of depression risk in ALS patients
Through transfer learning and feature correction methods, a depression risk prediction model suitable for ALS patients was constructed, which solved the problem that the existing model could not be directly applied to ALS patients and achieved a high-accurate depression risk assessment.
Patent Information
- Application Number
- CN202411896173.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2044-12-23
AI Technical Summary
The existing depression risk prediction model cannot be directly applied to ALS patients, and the EEG data of ALS patients are difficult to obtain in large quantities, resulting in poor accuracy in the assessment of depression risk in ALS patients.
Through the transfer learning method, the EEG data sample set of non-ALS patients trained the feature extraction module and the depression risk classification module, combined with adaptive feature aggregation, multiple attention module and feature adaptive module, the EEG data of ALS patients were characterized and screened to construct a depression risk prediction model for ALS patients.
It is realized that an accurate depression risk prediction model is constructed under a small amount of EEG data of patients with ALS to adapt to the disease characteristics of patients with ALS, and the accuracy of depression risk assessment is improved.
Smart Images

Figure CN119811666B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of clinical medicine, and particularly relates to a method and device for constructing a depression risk prediction model for ALS patients. Background Art
[0002] Amyotrophic lateral sclerosis (ALS) is a neurodegenerative disease, also known as Lou Gehrig's disease. Currently, the cause is unknown and there is no cure. Treatments mainly include etiological treatment, symptomatic treatment, and various non-drug treatments, but the prognosis is poor. However, this disease does not affect the patient's consciousness, that is, the patient can clearly see the process of being "frozen". After the onset, about 50% of the patients often suffer from non-motor symptoms such as depression, anxiety, and insomnia. Depression will further affect the patient's quality of life and even the prognosis of the disease progression. Therefore, the identification of depression in ALS patients is particularly important.
[0003] Currently, depression assessment methods based on electroencephalogram (EEG) features and neural network models have achieved good results. However, the existing depression risk prediction models are all constructed based on the general population, and ALS patients have unique EEG features related to their own diseases, so the conventional models cannot be directly used for depression risk prediction in ALS patients. Moreover, it is difficult to obtain a large number of EEG data samples for ALS patients, which brings great challenges to the construction of a depression risk prediction model for ALS patients. Therefore, how to use a small amount of ALS EEG sample data to construct a depression risk prediction model that can accurately predict the depression risk of ALS patients has become an urgent problem to be solved. Summary of the Invention
[0004] In view of the above analysis, the present invention aims to provide a method and device for constructing a depression risk prediction model for ALS patients, which are used to solve the problems in the prior art that it is difficult to obtain a large amount of EEG data for ALS patients, and it is difficult to train a depression risk prediction model with high accuracy for ALS patients, resulting in poor accuracy of depression risk assessment for ALS patients.
[0005] The object of the present invention is mainly achieved by the following technical solutions:
[0006] On the one hand, the present invention provides a method for constructing a depression risk prediction model for ALS patients, and the method includes:
[0007] Training a depression risk prediction model for non-ALS patients based on a non-ALS patient EEG data sample set; the depression risk prediction model includes a feature extraction module and a depression risk classification module;
[0008] Obtaining EEG data of multiple ALS depressed patients and ALS non-depressed patients, labeling corresponding depression or non-depression labels, and performing data preprocessing on the EEG data based on the non-ALS patient EEG data sample set to construct an ALS training sample set;
[0009] An ALS depression risk transfer learning module is constructed between the feature extraction module and the depression risk classification module to obtain a preliminarily constructed ALS patient depression risk prediction model; the ALS depression risk transfer learning module is used to screen and correct the ALS EEG features corresponding to the EEG data of the ALS patient extracted by the feature extraction module based on the EEG features corresponding to the EEG data sample set of the non-ALS patient, so as to obtain a feature distribution suitable for the depression risk classification module;
[0010] The ALS training sample set and loss function are used to iteratively train the initially constructed ALS patient depression risk prediction model to obtain a converged ALS patient depression risk prediction model.
[0011] Furthermore, when iteratively training the preliminarily constructed ALS patient depression risk prediction model using the ALS training sample set and the loss function, all parameters of the feature extraction module and some parameters of the depression risk classification module are frozen;
[0012] The feature extraction module is used to extract features from the data in the ALS training sample set, and the unfrozen parameters of the ALS depression risk transfer learning module and the depression risk classification module are iteratively optimized to obtain a converged ALS patient depression risk prediction model.
[0013] Furthermore, the cross-entropy loss function is used to iteratively train the initially constructed ALS patient depression risk prediction model;
[0014] The loss function is expressed as:
[0015]
[0016] Among them, y i To mark the label, Predict the results for the model.
[0017] Furthermore, the EEG data of the ALS patient is preprocessed by the following method:
[0018] Based on the amplitude of the EEG data in the EEG data sample set of non-ALS patients, the amplitude of the EEG data of ALS patients is corrected using quartiles, which is expressed as:
[0019]
[0020] Wherein, X represents the EEG data of ALS patients, Y represents the EEG data in the EEG data sample set of non-ALS patients, and Q is the quantile statistic;
[0021] Slice the EEG data of the ALS patients after amplitude correction using the same time window and step length as those in the preprocessing of the EEG data sample set of non-ALS patients to obtain multiple EEG data segments, constituting the preprocessed ALS EEG data corresponding to the ALS patients.
[0022] Furthermore, the ALS transfer learning module includes an adaptive feature aggregation module, a multi-head attention module, and a feature adaptation module;
[0023] The adaptive feature aggregation module is used to perform feature distribution correction on the EEG feature data of ALS patients based on the EEG feature data corresponding to the EEG data sample set of non-ALS patients, and cluster the corrected EEG feature data of ALS patients to screen out effective ALS EEG feature data;
[0024] The multi-head attention module is used to extract features from the screened effective ALS EEG feature data to obtain feature data containing the relationships between features;
[0025] The feature adaptation module is used to perform feature mapping on the feature data containing the relationships between features to obtain a feature distribution adapted to the depression risk classification module.
[0026] Furthermore, when using the feature extraction module to extract features from the ALS EEG data of ALS patients, multiple ALS EEG feature data with the same number of feature categories and the same number of time slices corresponding to the EEG data of non-ALS patients are obtained;
[0027] The adaptive feature aggregation module performs feature distribution correction on the EEG feature data of ALS patients through the following method:
[0028] Based on the EEG feature data corresponding to multiple patients in the EEG data sample set of non-ALS patients, calculate the mean and standard deviation of the EEG feature data of each category on the full-time slices;
[0029] Divide the EEG feature data of the ALS patients into feature groups according to the feature categories, and perform feature distribution correction on the EEG feature data of each time slice of each EEG data segment in each feature group through the following formula:
[0030]
[0031] Wherein, is the EEG feature of the t-th time slice after correction, Target tmThe EEG feature of the m-th feature of the ALS patient at the t-th time slice before correction, SourceMean m The mean value of the EEG features of the m-th feature in the EEG data sample set of non-ALS patients, SourceStd m The standard deviation of the m-th feature in the EEG data sample set of non-ALS patients. M represents the maximum number of corresponding feature categories in each feature group, and N represents the number of time slices in each EEG data segment.
[0032] Furthermore, clustering the corrected EEG feature data of ALS patients and screening to obtain effective ALS EEG feature data includes:
[0033] For each feature group, calculate the cosine similarity between the feature data of each time slice and the feature data of other time slices, and construct an adjacency matrix based on the cosine similarity;
[0034] Construct a Laplacian matrix based on the degree matrix of the adjacency matrix and normalize it;
[0035] Construct a characteristic polynomial based on the normalized Laplacian matrix and solve it to obtain the similarity reference value of the same category features of each time slice and other time slices;
[0036] Arrange each similarity reference value from largest to smallest, calculate the gap between adjacent two similarity reference values, obtain the k-th similarity reference value that makes the gap the largest, and use k as the number of clustering clusters;
[0037] Based on the number of clustering clusters k, use the first k similarity reference values as the clustering center values, cluster the corrected EEG feature data of ALS patients, and perform a pooling operation on all the feature data within the cluster after clustering to screen out effective ALS EEG features.
[0038] Furthermore, the multi-head attention module is used to extract features from the screened effective ALS EEG feature data, including:
[0039] Multiply the effective ALS EEG feature data by three weight matrices respectively for linear transformation, and use the results of the three linear transformations as Query, Key, and Value; the three weight matrices are obtained through learning;
[0040] Calculate the dot product of Query and Key to obtain the attention score, and normalize the attention score through softmax to obtain the attention weight;
[0041] Use the attention weight to perform weighted summation on Value to obtain the feature data containing the relationship between features.
[0042] Further, the feature adaptation module includes a plurality of fully connected layers arranged in sequence and an activation layer arranged after each fully connected layer;
[0043] The fully connected layer is used to perform a linear transformation on the input feature data and map the ALS EEG feature data to the non-ALS EEG feature dimension;
[0044] The activation layer is used to perform a non-linear transformation on the EEG features after the linear transformation by the fully connected layer, so as to learn a complex feature mapping and correct to obtain a feature distribution adapted to the depression risk classification module.
[0045] On the other hand, a computer device is also disclosed, including at least one processor and at least one memory communicatively connected to the processor;
[0046] The memory stores instructions executable by the processor, and the instructions are used to be executed by the processor to implement the foregoing method for constructing a depression risk prediction model for ALS patients.
[0047] Beneficial effects of the technical solution of the present invention:
[0048] 1. The method for constructing a depression risk prediction model for ALS patients according to the present invention is based on a conventional depression risk prediction model and constructs a depression risk prediction model for ALS patients through a feature transfer learning method, which can utilize the feature extraction advantages and classification accuracy of the original depression assessment model; by adjusting the feature distribution, the learning ability of the conventional non-ALS patient depression assessment model is transferred to the depression evaluation of ALS patients, and an accurate depression risk prediction model for ALS patients can be obtained by only using a small amount of ALS patient EEG data for transfer learning training;
[0049] 2. The present invention establishes an ALS transfer learning module, which realizes feature correction on the basis of refining the time resolution, adaptively aggregates equivalent time slices, and realizes feature alignment with non-ALS EEG data; and uses a multi-head attention module, through the "multi-head" mechanism of the attention model, to simulate and extract the features of different disease subtypes of ALS patients, which can take into account the complexity of ALS diseases.
[0050] Other features and advantages of the present invention will be described in the following description, and some of them will become obvious from the description or be understood by implementing the present invention. The objectives and other advantages of the present invention can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. Description of the Drawings
[0051] The drawings are only for the purpose of showing specific embodiments and are not considered as limiting the present invention. Throughout the drawings, the same reference numerals represent the same components;
[0052] Figure 1 It is a flowchart of a method for constructing a depression risk prediction model for ALS patients according to an embodiment of the present invention; Detailed implementation manners
[0053] The preferred embodiments of the present invention will be specifically described below with reference to the accompanying drawings. The accompanying drawings form a part of this application and are used together with the embodiments of the present invention to explain the principles of the present invention, and are not used to limit the scope of the present invention.
[0054] An embodiment of the present invention provides a method for constructing a depression risk prediction model for ALS patients, as Figure 1 shown, the method includes:
[0055] Step S1: Training a depression risk prediction model for non-ALS patients based on a non-ALS patient electroencephalogram data sample set; the depression risk prediction model includes a feature extraction module and a depression risk classification module;
[0056] Specifically, electroencephalogram (EEG) is a commonly used measurement method for recording the electrical activities generated by the cerebral cortex. Its non-invasive acquisition method has high convenience and can be applied to patients of all ages. With the development of artificial intelligence and signal processing technologies, EEG signal analysis technologies are also constantly improving. In the diagnosis of depressive mood, many researchers have used EEG features as objective evidence. However, due to the unique EEG characteristics of ALS patients' own diseases and the unclear boundary with the EEG characteristics of depression, the mature depression model cannot be directly used to evaluate the depression level of ALS patients; and it is difficult to obtain a large amount of EEG data of ALS patients. Therefore, constructing a high-accuracy depression risk prediction model for ALS patients has become a technical difficulty; there is no mature technology in the method for identifying depression in ALS patients. The present invention pre-trains a depression risk prediction model for non-ALS patients using non-ALS patients' EEG data, or any conventional non-ALS patient depression risk assessment model in the prior art, that is, any depression assessment model for the general population trained with the EEG data sample set of conventional patients. By means of transfer learning, only a small amount of ALS patients' EEG data is used to transfer the trained non-ALS patient depression risk assessment model to the depression assessment of ALS patients, preserving the accuracy of the original depression risk assessment model for depression, and providing an objective index for the depression screening of ALS patients. Conventional depression risk assessment models generally include a feature extraction module for extracting EEG features from EEG data and a depression risk classification module for performing depression risk classification prediction. In this embodiment, the feature extraction module and the depression risk classification module of the pre-trained or existing prediction model are directly used for model transfer to construct a depression risk prediction model for ALS patients, so as to accurately predict the depression risk of ALS patients.
[0057] Step S2: Obtain the EEG data of multiple ALS patients with depression and ALS patients without depression, label the corresponding depression or non-depression labels, and perform data preprocessing on the EEG data based on the non-ALS patient EEG data sample set to construct an ALS training sample set;
[0058] Preferably, in this embodiment, a clinical standard EEG amplifier is used to collect EEG signals, and the sampling rate ranges from 200 to 1000 Hz, and the number of channels ranges from 16 to 32 leads.
[0059] After collecting the EEG data of ALS patients, data preprocessing is first performed, specifically including:
[0060] Resample, notch filter the power frequency, remove the baseline drift, remove the invalid high-frequency components, and remove the EEG artifacts from the collected EEG data of the ALS patients to obtain the denoised EEG data;
[0061] Based on the amplitude of the EEG data in the non-ALS patient EEG data sample set, use quartiles to correct the amplitude of the denoised EEG data of the ALS patients;
[0062] Slice the EEG data after amplitude correction using the same time window and step length as in the preprocessing of the non-ALS patient EEG data sample set to obtain multiple EEG data segments, which constitute the preprocessed ALS EEG data corresponding to the ALS patients.
[0063] More specifically, resampling is to remove the influence of the reference electrode position, reduce the volume conduction effect, and facilitate standardization and comparison. It is necessary to perform rereferencing on the EEG data. The reference methods include but are not limited to: average reference, ear-level reference, etc.;
[0064] Notch filtering to remove power frequency: Design a notch filter (such as 50 Hz) to eliminate power frequency noise interference and obtain the EEG signal after removing the baseline drift;
[0065] Removing the baseline drift is to eliminate the influence caused by data drift. Perform high-pass filtering on the EEG signal to obtain the EEG signal after removing the baseline drift signal. The high-pass filtering frequency can be set to, for example, 1 Hz;
[0066] Removing invalid high-frequency components: Most of the high-frequency components in the EEG signal are noise and do not contain physiological or pathological significance. In this embodiment, a low-pass filter (such as 40 Hz) is designed to remove higher-frequency components to obtain the filtered EEG signal;
[0067] Use ICA to remove eye movement artifacts, electrocardiogram artifacts, and electromyogram artifacts: That is, by performing a linear transformation on the original signal and using the statistical techniques of ICA, the signal is decomposed into several independent components. Each component represents a different source. By observing the characteristics of these components (such as waveform, frequency, and spatial distribution), the components of electrooculogram, electrocardiogram, or electromyogram artifacts can be identified, these components are removed, and the EEG data after removing eye movement, electrocardiogram, and electromyogram interference is obtained through inverse transformation.
[0068] Furthermore, by setting the EEG duration (T) of the target observation time unit and the artifact threshold, record the time slices with amplitudes exceeding the threshold, mark the remaining time slices as non-artifact time, and retain the EEG segments with continuous durations greater than T in the non-artifact time as the non-artifact segment set. The non-artifact segment set with a duration greater than T is sliced with a step length of T. The step length can be set according to the task. The main purpose of this step is to remove large-amplitude artifacts in the EEG data caused by reasons such as human body jitter or poor equipment contact. And through slicing processing, the EEG acquisition time with an unfixed length is determined to an estimated length, which can ensure consistency for subsequent feature extraction and facilitate model input.
[0069] Further, the EEG data of ALS patients is corrected using the EEG data sample set of non-ALS patients, that is, by statistically analyzing the amplitudes of the EEG data in the EEG data sample set of non-ALS patients and the EEG data sample set of ALS patients, recording the obtained statistics, and normalizing the EEG data of ALS patients using quartiles.
[0070] Specifically, since the non-ALS EEG data sample set used to establish the non-ALS patient depression assessment model and the EEG data of ALS patients collected in this embodiment may come from different acquisition devices, affected by the design of the device amplifier, the amplitude distributions of the data in the non-ALS EEG data sample set and the data in the ALS EEG data sample set will be inconsistent; and due to the different scalp thicknesses and skin conductivities of the subjects, the signal amplitude will also be affected. To avoid systematic errors in the subsequent feature extraction results caused by the above reasons, it is necessary to correct the EEG data of ALS patients. Exemplarily, since signals in different frequency bands have different amplitude level grades, for example, the amplitude of low-frequency (1-7 Hz) signals is larger than that of medium-high frequency (8 Hz and above) signals. The signal amplitude of the EEG data of ALS patients can be corrected by frequency band, using techniques such as frequency division filtering or wavelet transform to decompose the signal into signals of several frequency bands. For the signals of each frequency band, the amplitude level of the signal can be corrected using the quartile normalization method, expressed as:
[0071]
[0072] where X represents the EEG data of ALS patients, Y represents the EEG data in the EEG data sample set of non-ALS patients, and Q represents the quantile statistic;
[0073] After correction, the original frequency band level is restored using the superposition method to obtain the EEG data with corrected amplitude.
[0074] In order to extract the same EEG features from the ALS EEG data of patients as those of non-ALS EEG data using the pre-trained feature extraction module, the corrected ALS EEG data can also be sliced using the same time window and step size as those used in the preprocessing of the non-ALS patient EEG data sample set to obtain multiple EEG data segments, constituting the ALS EEG data.
[0075] Further, for each EEG data segment, feature extraction is performed through the feature extraction module of the non-ALS patient depression risk assessment model, that is, the same feature extraction method as the source model is used to divide the EEG data segment into multiple time slices. Each time slice is the smallest time unit for feature extraction. Then, EEG features can be obtained through signal processing or a deep learning model. The extracted EEG features include: band energy features (absolute and relative band energy) and connectivity features (amplitude connectivity, phase-locking value, etc.). Exemplarily, if the signal processing method is used, the absolute and relative band energy calculated after short-time Fourier transform, etc., the amplitude connectivity can be obtained by calculating the correlation coefficient of the EEG data, and the phase-locking value can be obtained by calculating the phase of the signal. Among them, the pipeline of all extraction processes needs to be consistent with the feature extraction method in the source model. If the deep learning-based method is used, the feature extraction module in the source model is directly used to extract features from multiple EEG data segments corresponding to ALS patients, and multiple EEG feature data with the same number of feature categories and the same number of time slices corresponding to each EEG data segment in the non-ALS patient EEG data sample set are obtained.
[0076] Step S3: Construct an ALS depression risk transfer learning module between the feature extraction module and the depression risk classification module to obtain a preliminarily constructed ALS patient depression risk prediction model; the ALS depression risk transfer learning module is used to screen and correct the ALS EEG features corresponding to the ALS patient's EEG data extracted by the feature extraction module based on the EEG features corresponding to the non-ALS patient EEG data sample set, so as to obtain a feature distribution adapted to the depression risk classification module.
[0077] Specifically, the ALS transfer learning module includes an adaptive feature aggregation module, a multi-head attention module, and a feature adaptation module.
[0078] The adaptive feature aggregation module is used to correct the feature distribution of the ALS patient's EEG feature data based on the EEG feature data corresponding to the non-ALS patient EEG data sample set, and cluster the corrected ALS patient's EEG feature data to screen out effective ALS EEG feature data.
[0079] The multi-head attention module is used to extract features from the screened effective ALS EEG feature data to obtain feature data containing the relationship between features.
[0080] The feature adaptation module is used to perform feature mapping on the feature data containing the relationship between features to obtain a feature distribution adapted to the depression risk classification module.
[0081] Specifically, the adaptive feature aggregation module corrects the feature distribution of the EEG feature data of the ALS patient based on the EEG feature data corresponding to the EEG data sample set of non-ALS patients through the following method:
[0082] Based on the EEG feature data corresponding to multiple patients in the non-ALS patient EEG data sample set, calculate the mean and standard deviation of the EEG feature data of each category on the full-time slice; among them, the EEG feature categories include feature categories related to band energy, connectivity, etc., and the EEG feature of each time slice of the ALS patient to be evaluated is represented as: Target t =(F t1 ,…,F tm …F tM ), t∈(1..N), where M represents the maximum number of feature categories corresponding to each feature group, N represents the number of time slices of the sample, then the mean of the corresponding source domain EEG feature data is represented as SourceMean=(μ1,…,μ m …μ M ), and the standard deviation is represented as SourceStd=(σ1,…,σ m …σ M );
[0083] Divide the EEG feature data of the ALS patient to be evaluated into feature groups according to the feature category (for example, absolute and relative band energy are both feature categories related to band energy, divided into one feature group, amplitude connectivity and phase-locking value, etc. are feature categories related to connectivity, divided into another feature group), and correct the feature distribution of the EEG feature data of each time slice of each EEG data segment in each feature group through the following formula:
[0084]
[0085] Among them, is the EEG feature of the corrected t-th time slice, Target tm is the EEG feature of the ALS patient of the m-th feature at the t-th time slice before correction, SourceMean m is the mean of the EEG feature of the m-th feature in the non-ALS patient EEG data sample set, SourceStd m is the standard deviation of the m-th feature in the non-ALS patient EEG data sample set, M represents the maximum number of feature categories corresponding to each feature group, N represents the number of time slices of each EEG data segment, is the EEG feature of the ALS patient of the m-th feature at the t-th time slice after correction.
[0086] After performing feature distribution correction, the corrected EEG feature data is obtained, represented as:
[0087]
[0088] Among them, the rows of the matrix represent time, and the columns represent feature dimensions.
[0089] In this embodiment, feature alignment of EEG data of ALS patients is achieved through feature distribution correction. By calculating the distribution of non-ALS EEG features in their respective dimensions (each feature category), the feature distribution of ALS EEG data is corrected for subsequent adaptive feature clustering, screening, and merging of ALS EEG features that can match the non-ALS EEG feature distribution. For the application field of this embodiment, ALS patients include several subtypes of amyotrophic lateral sclerosis degrees, and using feature grouping processing can adapt to the internal relationships of features of each ALS subtype from multiple angles. For each subtype, features with dominant performance are found, and then combined into new features. The method of this embodiment can achieve better feature recombination, reducing the problem of prediction errors caused by differences in feature distribution due to disease subtypes.
[0090] Furthermore, an adaptive feature aggregation module is established. By constructing an adjacency matrix, constructing a Laplacian matrix, solving eigenvalues, finding the largest gap, etc., the number of clusters for clustering is determined. After clustering, for each cluster, a pooling operation is used to merge the features of the subsets in the cluster.
[0091] The purpose of this step is to determine the dominant time clusters in the ALS EEG data and merge the time subsets of each cluster into representative features. The specific steps are as follows:
[0092] After correcting the EEG data, for the feature data of each time slice in each feature group, calculate the cosine similarity with the feature data of the same category of other time slices respectively. Based on the cosine similarity, an adjacency matrix is constructed;
[0093] The cosine similarity is expressed as:
[0094]
[0095] where A ij is the cosine similarity between the feature data of the i-th time slice and the feature data of the j-th time slice; is the feature data of the i-th time slice, is the feature data of the j-th time slice;
[0096] The adjacency matrix is expressed as:
[0097] Furthermore, based on the degree matrix of the adjacency matrix, a Laplacian matrix is constructed and normalized, including:
[0098] Calculate the degree matrix of the adjacency matrix, where D is a diagonal matrix, and D ii is the sum of the i-th row of the adjacency matrix A. Calculate the Laplacian matrix through L = D – A, and normalize the Laplacian matrix using the following formula to obtain the normalized Laplacian matrix L norm :
[0099]
[0100] where I represents the identity matrix.
[0101] Furthermore, construct and solve the characteristic polynomial based on the normalized Laplacian matrix to obtain the similarity reference value of the same-category features between each time slice and other time slices;
[0102] In this embodiment, use L norm v = λv to solve for the eigenvalue λ. The main purpose of this step is to find a set of eigenvalues λ = (λ1,…,λ N ), where λ is a scalar, as the similarity reference value of the same-category features between each time slice and other time slices, that is, to find the representative of the similarity degree between each time slice and other time slices. That is, based on L norm v = λv, construct the characteristic polynomial:
[0103]
[0104] Solve to obtain λ, which is the similarity reference value of the same-category features between each time slice and other time slices.
[0105] Furthermore, arrange each similarity reference value from largest to smallest, and calculate the gap between adjacent two similarity reference values to obtain the k-th similarity reference value that makes the gap the largest, and use k as the number of clustering clusters;
[0106] That is, arrange the obtained eigenvalues from largest to smallest in sequence, and use Δλ k = λ k - λ k+1 , k ∈ (1,…,N - 1), to calculate the gap between eigenvalues, and obtain the k that makes Δλ k the largest as the final number of clustering clusters. Through this step, use the difference of the sorted eigenvalues to determine the representative similarity degree types between different time slices.
[0107] Further, based on the number of clustering clusters k, using the first k similarity reference values as the clustering center values, cluster the EEG feature data of the corrected ALS patients, and perform a pooling operation on all the feature data within the cluster after clustering. Merge within the time cluster, that is, merge based on time. Before merging, a cluster is a matrix of (N, M), where N represents time, and after merging, the dimension is (1, M). Screen out the effective ALS EEG features; the pooling operation can be pooling methods such as mean, maximum, minimum, etc.
[0108] In this embodiment, through the clustering method, several time clusters that are dominant under the non-ALS EEG feature distribution are screened out, and merged within the time cluster to achieve the effects of feature screening and noise removal, making the ALS EEG features used for classification prediction more in line with the distribution of non-ALS EEG features. First, correct the ALS EEG feature distribution, use the mean and variance of the non-ALS EEG feature distribution, and project the corresponding ALS EEG features into the distribution of non-ALS EEG features, realizing the correction of ALS EEG features based on non-ALS EEG features; then construct a similarity matrix of features between time slices, and solve through the matrix eigenvalues to obtain the similarity reference values. Based on the maximum gap between the similarity reference values, determine the number of clustering clusters K, and merge the features of each cluster after clustering based on the number of clusters K, weakening the influence of the abnormal distribution of ALS EEG features.
[0109] Further, establish a multi-head attention module, and respectively pass the EEG feature data of each time slice after clustering through three linear transformations as the query (Query), key (Key), and value (Value) and input them into the multi-head attention module to extract the feature relationships within the target domain. It should be noted that the clustering operation in this embodiment is extracted by feature group, and each feature group is equivalent to a "head". The linear transformation of the multi-head attention module is based on the results of each time cluster after clustering. The result of a time cluster is (1, M), and after linear transformation, it becomes (1, F(M)), where F(m) represents the operation of linear transformation. The results of the three linear transformations respectively correspond to the query (Query), key (Key), and value (Value).
[0110] Since it has been confirmed that there are multiple heterogeneous (different from non-ALS) features in the EEG data of ALS patients, if the features are not transformed and directly sent to the depression risk classification module of the source depression assessment model for subsequent evaluation, there will be a large deviation in the evaluation results. Therefore, in order to make the extracted ALS EEG features better adapt to the classifier of the source model, this embodiment first uses the multi-head attention module as a feature relationship extraction module to learn the features that are more useful for depression discrimination in the EEG data of ALS patients.
[0111] Specifically, on the basis of each "head", the multi-head attention module passes the clustering result data through three learnable weight matrices respectively, where the matrix dimension is (time clusters (i.e., the number of clustering clusters), the number of feature categories), to obtain the Query, Key, and Value of the multi-head attention. Calculate the dot product of Query and Key to obtain the attention score. After passing through softmax, obtain the attention weights in the time cluster dimension. Based on the attention weights, perform weighted summation on Value to obtain new features. The dimension of the new features is (time clusters, the number of features), which is the same as the input dimension. That is, based on the attention mechanism, perform feature relationship extraction through the following formula to obtain new features:
[0112]
[0113] where d k is the dimension of the key (K), which is used to scale the dot product to prevent gradient disappearance or explosion.
[0114] Finally, connect the outputs of all "heads", and then perform a linear transformation to obtain the final output.
[0115] The multi-head attention mechanism is a technique that allows the model to simultaneously focus on different parts of the input and different representation subspaces. It achieves this by running multiple attentions in parallel, where the number of "heads" represents the number of attention mechanisms for parallel computing. It can be understood that the model learns the internal relationships of features from different perspectives, realizes better feature recombination, reduces the differences in feature distributions caused by disease subtypes, and improves the accuracy of depression risk assessment for ALS patients.
[0116] Furthermore, through the feature adaptation module, a linear transformation is performed on the output of the multi-head attention module. This module consists of a fully connected layer with a non-linear activation layer, enabling the features of ALS to better adapt to the depression risk classification module of the source depression model.
[0117] Since the multi-head attention mechanism mainly focuses on the relationships between features, but it is not sufficient to fully adapt to the new data distribution. To make up for the possible large distribution differences between non-ALS EEG features and ALS EEG features, this step constructs a feature adaptation module. Specifically, first construct one or more fully connected layers to perform a linear transformation on the input features, and an activation layer, such as a RELU activation layer, can be introduced after each or several fully connected layers. Among them, to stabilize the distribution of features, a normalization layer can be added at the end of this module.
[0118] The feature adaptation module provides additional non-linear transformations, enabling the model to learn more complex feature mappings and correcting the feature distribution to better match the depression risk classification module of the source model.
[0119] Step S4: Iteratively train the preliminarily constructed ALS patient depression risk prediction model using the ALS training sample set and the loss function to obtain a converged ALS patient depression risk prediction model.
[0120] Specifically, when iteratively training the preliminarily constructed ALS patient depression risk prediction model using the ALS training sample set and the loss function, all parameters of the feature extraction module and some parameters of the depression risk classification module are frozen.
[0121] Use the feature extraction module to extract features from the data in the ALS training sample set, and iteratively optimize the unfrozen parameters of the ALS depression risk transfer learning module and the depression risk classification module to obtain a converged ALS patient depression risk prediction model.
[0122] Specifically, the depression risk classification module in this embodiment directly uses the classification part of the non-ALS patient depression risk prediction model or fine-tunes the last few layers of the classifier to obtain the depression risk assessment result. In this embodiment, cross-entropy is used as the loss function for subsequent parameter optimization, and the loss function is as follows:
[0123]
[0124] where y i is the one-hot encoding of the labeled label, is the prediction result of the model.
[0125] Since the feature adaptation module can make the feature space of ALS EEG data more matched with the feature space of non-ALS patient EEG data, only the classification part output of the non-ALS patient depression classification model is used in the classifier part for the evaluation result, or only the last few layers of the source classifier are fine-tuned to achieve the depression evaluation of ALS patients. The present invention uses cross-entropy loss to achieve the optimization goal of model parameters, which can encourage the model to output predictions closer to the distribution of the labeled labels, has a large penalty for incorrect predictions, and prompts the model to learn correct classification faster. The evaluation task in this embodiment only contains two types of labels, and this cross-entropy loss can be simplified to binary cross-entropy, which is represented by the following formula:
[0126]
[0127] where y i is the labeled label, is the model prediction result, that is, the probability of being predicted as the positive class.
[0128] During model training, the EEG data sample set of ALS patients is divided into a training set and a validation set. The parameters of the first few fully connected layers of the feature extraction module and the depression risk classification module are frozen, and only the parameters of the multi-head attention module, the feature adaptation module, and the last few layers of the depression risk classification module are updated during the training process. The optimization objective is to minimize the cross-entropy loss, and the optimal model is determined by the performance of the model on the validation set.
[0129] In this embodiment, only ALS EEG data is used for model training. The modules whose parameters need to be updated include: the multi-head attention module, the feature adaptation module, and the parameters of the last few layers of the depression risk classification module. The rest of the model is frozen. The feature extraction module is frozen because this part has been fully trained in the source model and has certain feature extraction advantages. Therefore, only by training the multi-head attention module and the feature adaptation module can the combination and distribution of features be adjusted to adapt to the depression classification of ALS patients. Considering that the adjusted features may still have differences in distribution from non-ALS features, in the classifier part of the model, the parameter optimization of the last few layers of the depression risk classification module is opened to adapt to the new depression classification task.
[0130] Another embodiment of the present invention also discloses a computer device, including at least one processor and at least one memory communicatively connected to the processor;
[0131] The memory stores instructions executable by the processor, and the instructions are used to be executed by the processor to implement the foregoing method for constructing a depression risk prediction model for ALS patients.
[0132] In summary, the method and device for constructing a depression risk prediction model for ALS patients provided by the embodiments of the present invention propose a method for migrating a mature depression assessment model to ALS patients. While maintaining the original model's ability to extract depression features, the features are not affected by ALS symptoms and can be applied to the depression assessment of ALS patients. Through the migration method, the present invention constructs an adaptive feature aggregation module and a multi-head attention module to screen and correct effective EEG features, learns and extracts the complex relationships of ALS patients' features from multiple angles, and adjusts the feature distribution to match the established depression risk classification module by constructing a special adaptation layer. The present invention only uses a small amount of ALS patient data to migrate the trained depression model to the depression assessment of ALS patients, preserves the accuracy of the original depression assessment model for depression risk assessment, and provides an objective indicator for the depression screening of ALS patients. It realizes an objective evaluation method for assessing the depression state of ALS patients without relying on subjective judgment; for non-psychiatric professionals, the objective indicator can be used to judge the depression state of ALS patients.
[0133] Those skilled in the art can understand that all or part of the processes for implementing the methods of the above embodiments can be completed by instructing relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium. Among them, the computer-readable storage medium is a disk, an optical disc, a read-only memory or a random access memory, etc.
[0134] As mentioned above, the above are only the preferred specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A method for constructing a prediction model for the risk of depression in ALS patients, characterized in that, Including: A depression risk prediction model for non-ALS patients trained based on a non-ALS patient EEG data sample set; The depression risk prediction model includes a feature extraction module and a depression risk classification module; Obtain the EEG data of multiple ALS patients with depression and ALS patients without depression, label the corresponding depression or non-depression labels, and perform data preprocessing on the EEG data based on the non-ALS patient EEG data sample set to construct an ALS training sample set; Construct an ALS depression risk transfer learning module between the feature extraction module and the depression risk classification module to obtain a preliminarily constructed ALS patient depression risk prediction model; the ALS depression risk transfer learning module is used to screen and correct the ALS EEG features corresponding to the EEG data of ALS patients extracted by the feature extraction module based on the EEG features corresponding to the non-ALS patient EEG data sample set, so as to obtain a feature distribution adapted to the depression risk classification module; Use the ALS training sample set and the loss function to iteratively train the preliminarily constructed ALS patient depression risk prediction model to obtain a converged ALS patient depression risk prediction model.
2. The method for constructing a depression risk prediction model for ALS patients according to claim 1, wherein When using the ALS training sample set and the loss function to iteratively train the preliminarily constructed ALS patient depression risk prediction model, freeze all the parameters of the feature extraction module and some of the parameters of the depression risk classification module; Use the feature extraction module to extract features from the data in the ALS training sample set, and iteratively optimize the unfrozen parameters of the ALS depression risk transfer learning module and the depression risk classification module to obtain a converged ALS patient depression risk prediction model.
3. The method for constructing a depression risk prediction model for ALS patients according to claim 1, wherein Use the cross-entropy loss function to iteratively train the preliminarily constructed ALS patient depression risk prediction model; The loss function is expressed as: Among them, y i is the annotation label, and is the model prediction result.
4. The method for constructing a depression risk prediction model for ALS patients according to claim 1, wherein Perform data preprocessing on the EEG data of the ALS patient by the following method: Based on the amplitude of the EEG data in the non-ALS patient EEG data sample set, use the quartile to correct the amplitude of the EEG data of the ALS patient, expressed as: Where X′ is the corrected EEG data, X represents the EEG data of the ALS patient, Y represents the EEG data in the non-ALS patient EEG data sample set, and Q is the quantile statistic; Slice the EEG data of the ALS patient after amplitude correction with the same time window and step length as those used in the preprocessing of the non-ALS patient EEG data sample set to obtain multiple EEG data segments, constituting the preprocessed ALS EEG data corresponding to the ALS patient.
5. The method for constructing a prediction model for the risk of depression in ALS patients according to claim 4, wherein The ALS transfer learning module includes an adaptive feature aggregation module, a multi-head attention module, and a feature adaptation module; The adaptive feature aggregation module is used to correct the feature distribution of the EEG feature data of the ALS patient based on the EEG feature data corresponding to the non-ALS patient EEG data sample set, and cluster the corrected EEG feature data of the ALS patient to screen out effective ALS EEG feature data; The multi-head attention module is used to extract features from the selected effective ALS EEG feature data to obtain feature data containing the relationships between features; The feature adaptation module is used to perform feature mapping on the feature data containing the relationships between features to obtain a feature distribution adapted to the depression risk classification module.
6. The method for constructing a depression risk prediction model for ALS patients according to claim 5, wherein When using the feature extraction module to extract features from the ALS EEG data of ALS patients, multiple ALS EEG feature data with the same number of feature categories and the same number of time slices corresponding to the EEG data of non-ALS patients are obtained; The adaptive feature aggregation module corrects the feature distribution of the ALS patient's EEG feature data through the following method: Based on the EEG feature data corresponding to multiple patients in the non-ALS patient EEG data sample set, calculate the mean and standard deviation of the EEG feature data of each category on the full-time slices; Divide the EEG feature data of the ALS patient into feature groups according to the feature category, and correct the feature distribution of the EEG feature data of each time slice of each EEG data segment in each feature group through the following formula: Among them, is the EEG feature of the t-th time slice after correction, Target tm is the EEG feature of the ALS patient at the t-th time slice of the m-th feature before correction, SourceMean m is the mean value of the EEG features of the m-th feature in the non-ALS patient EEG data sample set, SourceStd m is the standard deviation of the m-th feature in the non-ALS patient EEG data sample set. M represents the maximum number of corresponding feature categories in each feature group, and N represents the number of time slices of each EEG data segment. is the EEG feature of the ALS patient at the t-th time slice and the m-th feature after correction.
7. The method for constructing a depression risk prediction model for ALS patients according to claim 6, wherein Clustering the corrected ALS patient's EEG feature data, and screening to obtain effective ALS EEG feature data, including: For each feature group, calculate the cosine similarity between the feature data of each time slice and the feature data of other time slices respectively, and construct an adjacency matrix based on the cosine similarity; Construct a Laplacian matrix based on the degree matrix of the adjacency matrix and normalize it; Construct a characteristic polynomial based on the normalized Laplacian matrix and solve it to obtain a similarity reference value of the same category features of each time slice and other time slices; Arrange each similarity reference value from largest to smallest, calculate the gap between adjacent two similarity reference values, obtain the kth similarity reference value that makes the gap the largest, and use k as the number of clustering clusters; Based on the number of clustering clusters k, use the first k similarity reference values as the clustering center values, cluster the corrected ALS patient's EEG feature data, and perform a pooling operation on all the feature data in each cluster after clustering to screen out effective ALS EEG features.
8. The method for constructing a depression risk prediction model for ALS patients according to claim 5, characterized in that, The multi-head attention module is used to extract features from the selected effective ALS EEG feature data, including: Multiply the effective ALS EEG feature data by three weight matrices respectively for linear transformation, and use the three linear transformation results as Query, Key, and Value; the three weight matrices are obtained through learning; Calculate the dot product of Query and Key to obtain an attention score, and normalize the attention score through softmax to obtain an attention weight; Use the attention weight to perform weighted summation on Value to obtain feature data containing the relationships between features.
9. The method for constructing a depression risk prediction model for ALS patients according to claim 5, characterized in that, [[ID=!!!]]The feature adaptation module includes a plurality of fully connected layers arranged in sequence and an activation layer arranged after each fully connected layer; The fully connected layer is used to perform linear transformation on the input feature data and map the ALS EEG feature data to the non-ALS EEG feature dimension; The activation layer is used to perform a non-linear transformation on the EEG features after linear transformation by the fully connected layer, so as to learn complex feature mappings and correct the feature distribution adapted to the depression risk classification module.
10. A computer device, characterized in that, It includes at least one processor and at least one memory communicatively connected to the processor; The memory stores instructions executable by the processor, and the instructions are used to be executed by the processor to implement the method for constructing an ALS patient depression risk prediction model according to any one of claims 1-9.
Citation Information
Patent Citations
Depression analysis method based on deep learning and resting state electroencephalogram data
CN116386864A
Electroencephalogram depression recognition system and method based on knowledge distillation and meta transfer learning
CN118986349A