ALS patient depression risk prediction model construction method and device

By applying transfer learning and feature correction techniques in ALS patients, using the depression risk prediction model of non-ALS patients, a model that can accurately predict the depression risk in ALS patients was constructed, which solved the problem of poor accuracy in the assessment of depression risk in ALS patients and provided an objective depression screening method.

CN119811666AActive Publication Date: 2025-04-11PEKING UNIVERSITY THIRD HOSPITAL (THE THIRD CLINICAL MEDICAL SCHOOL OF PEKING UNIVERSITY) +1
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202411896173.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-11
Estimated Expiration
2044-12-23

AI Technical Summary

Technical Problem

The prior art is difficult to build a model that can accurately predict the risk of depression in ALS patients. This is mainly because the EEG data of ALS patients are difficult to obtain in large quantities, resulting in poor accuracy of the trained model.

Method used

Transfer learning and feature correction are carried out through the depression risk prediction model obtained based on the sample set training of non-ALS patients with EEG data, combined with the ALS transfer learning module, adaptive feature aggregation module, multiple attention module and feature adaptation module, and transfer learning and feature correction are carried out to build a depression risk prediction model suitable for ALS patients.

Benefits of technology

A high-accurate depression risk prediction model can be constructed using only a small amount of EEG data in patients with ALS, which solves the problem of poor accuracy in the assessment of depression risk in patients with ALS, and provides an objective depression screening method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119811666A_ABST
    Figure CN119811666A_ABST
Patent Text Reader

Abstract

The invention provides an ALS patient depression risk prediction model construction method and equipment. The method comprises the following steps: training based on a non-ALS patient electroencephalogram data sample set to obtain a non-ALS patient depression risk prediction model; the method comprises the following steps: acquiring electroencephalogram data of a plurality of ALS depression patients and ALS non-depression patients, and constructing to obtain an ALS training sample set; an ALS depression risk transfer learning module is constructed between a feature extraction module and a depression risk classification module of the depression risk prediction model and is used for screening and correcting ALS electroencephalogram features to obtain feature distribution adapted to the depression risk classification module; and performing iterative training on the preliminarily constructed ALS patient depression risk prediction model by using the ALS training sample set and the loss function to obtain a convergent ALS patient depression risk prediction model. The method solves the problem that in the prior art, electroencephalogram data of the ALS patient is difficult to obtain in a large amount, a high-accuracy depression risk prediction model capable of being used for the ALS patient is difficult to train and obtain, and the accuracy of depression risk assessment of the ALS patient is poor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of clinical medicine technology, and in particular 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. The cause is currently unclear and there is no cure. Treatment mainly includes causal treatment, symptomatic treatment and various non-drug treatments, but the prognosis is poor. However, the disease does not affect the patient's consciousness, that is, the patient can clearly see the process of being "frozen". After the onset of the disease, about 50% of patients often have non-motor symptoms such as depression, anxiety, and insomnia. Depression will further affect the patient's quality of life and even affect the prognosis of disease progression. Therefore, it is particularly important to identify depression in ALS patients.

[0003] At present, depression assessment methods based on 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 disease, so conventional models cannot be used to directly predict depression risk. In addition, it is difficult to obtain a large number of EEG data samples for ALS patients, which brings great challenges to the construction of depression risk prediction models for ALS patients. Therefore, how to use a small amount of ALS EEG sample data to build a depression risk prediction model that can accurately predict the depression risk of the ALS patient group 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 is used to solve the problem in the prior art that it is difficult to obtain a large amount of EEG data of ALS patients, and it is difficult to train a high-accuracy depression risk prediction model that can be used for ALS patients, resulting in poor accuracy in depression risk assessment for ALS patients.

[0005] The purpose of the present invention is mainly achieved through the following technical solutions:

[0006] In one aspect, the present invention provides a method for constructing a depression risk prediction model for ALS patients, the method comprising:

[0007] A depression risk prediction model for non-ALS patients is obtained 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, marking 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 the 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] Further, when the ALS training sample set and the loss function are used to iteratively train the initially constructed ALS patient depression risk prediction model, 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] Among them, 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] The amplitude-corrected EEG data of the ALS patient are sliced ​​using the same time window and step size as those used in preprocessing the EEG data sample set of non-ALS patients to obtain multiple EEG data segments, which constitute the preprocessed ALS EEG data corresponding to the ALS patient.

[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 and obtain effective ALS EEG feature data;

[0024] The multi-head attention module is used to extract features from the effective ALS EEG feature data obtained by screening to obtain feature data containing the relationship between features;

[0025] The feature adaptation module is used to perform feature mapping on the feature data including the relationship between features to obtain a feature distribution adapted to the depression risk classification module.

[0026] Further, when the feature extraction module is used to extract features from the ALS EEG data of the ALS patient, a plurality of ALS EEG feature data of the same number of feature categories and the same number of time slices as those of the non-ALS patient's EEG data are obtained;

[0027] The adaptive feature aggregation module corrects the feature distribution of the EEG feature data of ALS patients by the following method:

[0028] Based on the EEG feature data corresponding to multiple patients in the EEG data sample set of non-ALS patients, the mean and standard deviation of the EEG feature data of each category are calculated on the full time slice;

[0029] The EEG feature data of the ALS patient are divided into feature groups according to feature categories, and the EEG feature data of each time slice of each EEG data segment in each feature group are subjected to feature distribution correction using the following formula:

[0030]

[0031] in, is the EEG feature of the t-th time slice after correction, Target tmis the EEG feature of ALS patients at the t-th time slice of the m-th feature before correction, SourceMean m is the mean value of the EEG feature of the mth feature in the EEG data sample set of non-ALS patients, SourceStd m The standard deviation of the mth feature in the EEG data sample set of non-ALS patients, M represents the maximum number of feature categories corresponding to each feature group, and N represents the number of time slices of each EEG data segment.

[0032] Furthermore, clustering the EEG characteristic data of the corrected ALS patients to screen out effective ALS EEG characteristic data includes:

[0033] For each feature group, the cosine similarity between the feature data of each time slice and the feature data of other time slices is calculated respectively, and an adjacency matrix is ​​constructed based on the cosine similarity;

[0034] Constructing a Laplacian matrix based on the degree matrix of the adjacency matrix and normalizing it;

[0035] Based on the normalized Laplace matrix, a feature polynomial is constructed and solved to obtain a similarity reference value between each time slice and features of the same category of other time slices;

[0036] Arrange each similarity reference value from large to small, and calculate the gap between two adjacent similarity reference values ​​to obtain the kth similarity reference value that makes the gap the largest, and use k as the number of clusters;

[0037] Based on the cluster number k, the first k similarity reference values ​​are used as cluster center values, the EEG feature data of the corrected ALS patients are clustered, and a pooling operation is performed on all the feature data in 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] The effective ALS EEG feature data is multiplied by three weight matrices respectively to perform linear transformation, and the three linear transformation results are used as Query, Key and Value; the three weight matrices are obtained by learning;

[0040] Calculate the dot product of Query and Key to get the attention score, and normalize the attention score through softmax to get the attention weight;

[0041] The Value is weighted and summed using the attention weight to obtain feature data containing the relationship between features.

[0042] Furthermore, 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 linear transformation on the input feature data, mapping the ALS EEG feature data to the non-ALS EEG feature dimension;

[0044] The activation layer is used to perform nonlinear transformation on the EEG features that have been linearly transformed by the fully connected layer, so as to learn complex feature mapping and correct the feature distribution that is suitable for the depression risk classification module.

[0045] In another aspect, a computer device is disclosed, comprising at least one processor, and at least one memory communicatively connected to the processor;

[0046] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the aforementioned method for constructing a depression risk prediction model for ALS patients.

[0047] Beneficial effects of this technical solution:

[0048] 1. The method for constructing a depression risk prediction model for ALS patients of 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 only a small amount of ALS patient EEG data is used for transfer learning training to obtain an accurate depression risk prediction model for ALS patients;

[0049] 2. The present invention establishes an ALS transfer learning module, which realizes feature correction and adaptively aggregates equivalent time slices on the basis of refining the time resolution, so as to achieve feature alignment with non-ALS EEG data; and uses a multi-head attention module to simulate the extraction of features of different disease subtypes of ALS patients through the "multi-head" mechanism of the attention model, which can take into account the complexity of ALS disease.

[0050] Other features and advantages of the present invention will be described in the following description, and part of them will become obvious from the description, or will be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings are only used for the purpose of illustrating specific embodiments and are not to be considered as limiting the present invention. In the entire drawings, the same reference symbols represent the same components;

[0052] Figure 1 is a flow chart of a method for constructing a depression risk prediction model for ALS patients according to an embodiment of the present invention; DETAILED DESCRIPTION

[0053] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the implementation cases of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0054] One embodiment of the present invention provides a method for constructing a depression risk prediction model for ALS patients, such as Figure 1 As shown, the method includes:

[0055] Step S1: obtaining a depression risk prediction model for non-ALS patients based on a sample set of EEG data of non-ALS patients; 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 electrical activity generated by the cortex. Its non-invasive collection method is highly convenient and can be applied to patients of all ages. With the development of artificial intelligence and signal processing technology, EEG signal analysis technology is also constantly improving. In the diagnosis of depression, many researchers have used EEG features as an objective basis. However, since ALS patients have unique EEG characteristics of their own disease, and the boundary between EEG characteristics and depression is not clear, mature depression models cannot be used directly to assess the depression level of ALS patients; and ALS patients' EEG data are difficult to obtain in large quantities, so it has become a technical difficulty to build a high-accuracy depression risk prediction model that can be used for ALS patients; there is currently no mature technology for identifying depression in ALS patients. The present invention uses the EEG data of non-ALS patients to pre-train a depression risk prediction model for non-ALS patients. It can also use any conventional depression risk assessment model for non-ALS patients in the prior art, that is, any depression assessment model for the general population trained using a sample set of EEG data of conventional patients. Through the method of transfer learning, only a small amount of EEG data of ALS patients is used to migrate the trained depression risk assessment model for non-ALS patients to the depression assessment of ALS patients, thereby preserving the accuracy of the original depression risk assessment model for depression and providing an objective indicator for depression screening of ALS patients. Conventional depression risk assessment models generally include a feature extraction module for performing EEG feature extraction on EEG data and a depression risk classification module for performing depression risk classification prediction. This embodiment directly uses the feature extraction module and depression risk classification module of the pre-trained or existing prediction model to perform model migration, construct a depression risk prediction model for ALS patients, and achieve accurate prediction of depression risk for ALS patients.

[0057] Step S2: obtaining EEG data of multiple ALS depressed patients and ALS non-depressed patients, marking 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;

[0058] Preferably, this embodiment uses a clinical standard EEG amplifier to collect EEG signals, with a sampling rate ranging from 200 to 1000 Hz and a channel value ranging from 16 to 32 channels.

[0059] After collecting the EEG data of ALS patients, data preprocessing is first performed, including:

[0060] Resampling, notching, removing power frequency, removing base drift, removing invalid high-frequency components and removing EEG artifacts on the collected EEG data of the ALS patient to obtain denoised EEG data;

[0061] Based on the amplitude of the EEG data in the EEG data sample set of the non-ALS patient, correcting the amplitude of the noise-reduced EEG data of the ALS patient using quartiles;

[0062] The amplitude-corrected EEG data is sliced ​​using the same time window and step size as those used in preprocessing the EEG data sample set of non-ALS patients to obtain multiple EEG data segments, which constitute the preprocessed ALS EEG data corresponding to the ALS patient.

[0063] More specifically, resampling is to remove the influence of the reference electrode position, reduce the volume conduction effect, and facilitate standardization and comparison. The EEG data needs to be re-referenced, and the reference methods include but are not limited to: average reference, ear-level reference, etc.;

[0064] To remove power frequency by notching, a notch filter (such as 50 Hz) is designed to eliminate power frequency noise interference and obtain the EEG signal after removing the base drift.

[0065] The purpose of removing the base drift is to eliminate the influence of data drift. The EEG signal is subjected to a high-pass filter to obtain the EEG signal after the base drift signal is removed. The high-pass filter frequency can be set to, for example, 1Hz.

[0066] Removing invalid high-frequency components: Most high-frequency components in EEG signals 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 an EEG signal after filtering;

[0067] Use ICA to remove eye movement artifacts, ECG artifacts, and EMG artifacts: that is, by performing a linear transformation on the original signal and using the statistical technique of ICA, the signal is decomposed into several independent components, each of which represents a different source. By observing the characteristics of these components (such as waveform, frequency, and spatial distribution), the components of electrooculography, electrocardiography, or electromyography artifacts can be identified, and these components can be removed. Through inverse transformation, the EEG data with eye movement, ECG, and EMG interference removed can be obtained.

[0068] Furthermore, by setting the EEG duration (T) and the artifact threshold of the target observation time unit, the time slices whose amplitude exceeds the threshold are recorded, the remaining time slices are marked as non-artifact time, and the EEG segments with a continuous duration greater than T in the non-artifact time are retained as a non-artifact segment set. The non-artifact segment set greater than T is divided into a step size of T. The step size can be set according to the task. The main purpose of this step is to remove large Bofu artifacts caused by human body jitter or poor contact of equipment in the EEG data. In addition, through slicing processing, the EEG acquisition time with an irregular time length is determined to an estimated length, which can ensure consistency for subsequent feature extraction and facilitate model input.

[0069] Furthermore, the EEG data sample set of non-ALS patients is used to correct the EEG data of the ALS patient EEG sample set, that is, by counting the amplitudes of the EEG data of the non-ALS patient EEG sample set and the ALS patient EEG sample set, the obtained statistics are recorded, and the ALS patient EEG data are normalized 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 equipment amplifier, the amplitude distribution of the data in the non-ALS patient EEG data sample set and the data in the ALS patient EEG data sample set will be inconsistent; and due to the different scalp thickness and skin conductivity of the subjects, the amplitude of the signal will also be affected. In order to avoid the systematic error of the subsequent feature extraction results caused by the above reasons, the EEG data of ALS patients needs to be corrected. Exemplarily, since signals in different frequency bands have different amplitude level levels, for example, the amplitude of low-frequency (1-7Hz) signals is larger than that of medium- and high-frequency (8Hz to above) signals. The signal amplitude of the EEG data of ALS patients can be corrected by frequency bands, and the signal can be decomposed into signals of several frequency bands using frequency division filtering or wavelet transform techniques. For the signal of each frequency band, the amplitude level of the signal can be corrected using the quartile normalization method, expressed as:

[0071]

[0072] Among them, 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 amplitude-corrected EEG data.

[0074] In order to use a pre-trained feature extraction module to extract the same EEG features as non-ALS EEG data from the patient's ALS EEG data, the ALS patient's EEG data after amplitude correction can also be sliced ​​using the same time window and step size as those used in preprocessing the non-ALS patient's EEG data sample set to obtain multiple EEG data segments to constitute the ALS EEG data.

[0075] Further, for each EEG data segment, feature extraction is performed through the feature extraction module of the depression risk assessment model for non-ALS patients, that is, the feature extraction method consistent with the source model is used to divide the EEG data segment into multiple time slices, each time slice is the minimum time unit for feature extraction, and then the EEG features can be obtained through signal processing or deep learning models. The extracted EEG features include: band energy features (absolute and relative band energy) and connectivity features (amplitude connectivity and phase-locking values, etc.). Exemplarily, if the signal processing method is used, the absolute and relative band energy calculated after short-time Fourier transform, 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, wherein the pipeline of all extraction processes needs to be consistent with the feature extraction method in the source model. If a method based on deep learning 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 EEG data sample set of non-ALS patients are obtained.

[0076] Step S3: constructing 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 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;

[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 perform feature distribution correction on the EEG feature data of the ALS patient based on the EEG feature data corresponding to the EEG data sample set of the non-ALS patient, and cluster the corrected EEG feature data of the ALS patient to screen and obtain effective ALS EEG feature data;

[0079] The multi-head attention module is used to extract features from the effective ALS EEG feature data obtained by screening to obtain feature data containing the relationship between features;

[0080] The feature adaptation module is used to perform feature mapping on the feature data including 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 the non-ALS patient by the following method:

[0082] Based on the EEG feature data corresponding to multiple patients in the EEG data sample set of non-ALS patients, the mean and standard deviation of the EEG feature data of each category are calculated on the full time slice; among them, the EEG feature categories include relevant feature categories such as frequency band energy and connectivity. The EEG feature of each time slice of the ALS patient to be evaluated is expressed as: Target t =(F t1 ,…,F tm …F tM ), t∈(1..N), where M represents the maximum number of feature categories in each feature group, and N represents the number of time slices of the sample. The corresponding mean of the source domain EEG feature data is expressed as SourceMean=(μ1,…,μ m …μ M ), the standard deviation is expressed as SourceStd = (σ1,…,σ m …σ M );

[0083] The EEG feature data of the ALS patient to be evaluated are divided into feature groups according to feature categories (e.g., absolute and relative band energies are both features related to band energy and are divided into one feature group, while amplitude connectivity and phase-locked values ​​are features related to connectivity and are divided into another feature group). The EEG feature data of each time slice of each EEG data segment in each feature group are subjected to feature distribution correction using the following formula:

[0084]

[0085] in, is the EEG feature of the tth time slice after correction, Target tm is the EEG feature of ALS patients at the t-th time slice of the m-th feature before correction, SourceMean m is the mean value of the EEG feature of the mth feature in the EEG data sample set of non-ALS patients, SourceStd m The standard deviation of the mth feature in the EEG data sample set of non-ALS patients, M represents the maximum number of feature categories corresponding to each feature group, and N represents the number of time slices of each EEG data segment. is the corrected EEG feature of the mth feature of the ALS patient in the tth time slice.

[0086] After feature distribution correction, the feature-corrected EEG feature data is obtained, which is expressed as:

[0087]

[0088] The rows of the matrix represent time and the columns represent feature dimensions.

[0089] This embodiment realizes feature alignment of EEG data of ALS patients through feature distribution correction, and corrects the feature distribution of ALS EEG data by calculating the distribution of non-ALS EEG features in their respective dimensions (feature categories) for subsequent adaptive feature clustering, screening and merging ALS EEG features that can match the distribution of non-ALS EEG features. For the application field of this embodiment, ALS patients include several subtypes of ALS severity, and the use of feature grouping processing can adapt to the internal relationship of features of each ALS subtype from multiple angles. For each subtype, find features with advantageous performance, and then combine them into new features. The method of this embodiment can achieve better feature recombination and reduce the problem of prediction errors caused by differences in feature distribution due to disease subtypes.

[0090] Furthermore, an adaptive feature aggregation module is established to determine the number of clusters by constructing an adjacency matrix, constructing a Laplace matrix, solving eigenvalues, finding the maximum gap, etc. 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, the cosine similarity with the feature data of the same category in other time slices is calculated, and an adjacency matrix is ​​constructed based on the cosine similarity;

[0093] The cosine similarity is expressed as:

[0094]

[0095] Among them, 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 characteristic data of the i-th time slice, is the characteristic data of the jth time slice;

[0096] The adjacency matrix is ​​represented as:

[0097] Furthermore, constructing a Laplacian matrix based on the degree matrix of the adjacency matrix and normalizing it includes:

[0098] Compute the degree matrix of the adjacency matrix, Where D is a diagonal matrix, D ii is the sum of the i-th row of the adjacency matrix A. The Laplace matrix is ​​calculated by L = D – A, and the Laplace matrix is ​​normalized using the following formula to obtain the normalized Laplace matrix L norm :

[0099]

[0100] Where I represents the identity matrix.

[0101] Furthermore, a feature polynomial is constructed based on the normalized Laplace matrix and solved to obtain a similarity reference value between each time slice and features of the same category of other time slices;

[0102] This embodiment uses L norm v=λv to solve the eigenvalue λ. The main purpose of this step is to find a set of eigenvalues ​​λ=(λ1,…,λ N ), where λ is a scalar, serving as a reference value for the similarity between each time slice and the same category features of other time slices, that is, finding a representative of the similarity between each time slice and other time slices. norm v=λv, construct characteristic polynomial:

[0103]

[0104] The solution is λ, which is the similarity reference value of each time slice with the same category features of other time slices.

[0105] Further, each similarity reference value is arranged from large to small, and the gap between two adjacent similarity reference values ​​is calculated to obtain the kth similarity reference value that makes the gap the largest, and k is used as the number of clusters;

[0106] That is, the obtained eigenvalues ​​are arranged in descending order and Δλ is used k =λ k -λ k+1 , k∈(1,…,N-1), calculate the gap between the eigenvalues ​​and obtain Δλ k The largest k is used as the final number of clusters. Through this step, the difference in the eigenvalues ​​after sorting is used to determine the representative similarity categories between different time slices.

[0107] Furthermore, based on the cluster number k, the previous k similarity reference values ​​are used as cluster center values, the EEG feature data of the corrected ALS patients are clustered, and all the feature data in the cluster after clustering are pooled and merged within the time cluster, that is, merged based on time. Before the merger, a cluster is a matrix of (N, M), N represents time, and the dimension after the merger is (1, M), and effective ALS EEG features are screened. The pooling operation can be pooling methods such as mean, maximum, and minimum.

[0108] This embodiment uses a clustering method to screen out several time clusters that are dominant under the distribution of non-ALS EEG features, and merge them within the time clusters to achieve the effect of feature screening and noise removal, so that the ALS EEG features used for classification prediction are more consistent with the distribution of non-ALS EEG features. First, the ALS EEG feature distribution is corrected, and the mean and variance of the non-ALS EEG feature distribution are used to project the corresponding ALS EEG features into the distribution of non-ALS EEG features, thereby realizing the correction of ALS EEG features based on non-ALS EEG features; then, a similarity matrix of features between time slices is constructed, and the similarity reference value is obtained by solving the matrix eigenvalues, and the number of clusters K is determined based on the maximum gap between the similarity reference values, and the features of each cluster are merged after clustering based on the number of clusters K, thereby weakening the influence of abnormal distribution of ALS EEG features.

[0109] Furthermore, a multi-head attention module is established, and the EEG feature data of each time slice after clustering is input into the multi-head attention module as query, key, and value through three linear transformations to extract the feature relationship in the target domain. It should be noted that the clustering operation of this embodiment is extracted by feature groups, and each feature group is equivalent to a "head". The linear transformation of the multi-head attention module is based on the result of each time cluster after clustering. The result of a time cluster is (1, M), and a linear transformation is performed to obtain (1, F(M)). F(m) represents the operation of linear transformation, and the results of the three linear transformations correspond to query, key, and value, respectively.

[0110] Since ALS patient EEG data has been proven to have a variety of heterogeneous (different from non-ALS) features, if the features are not transformed and directly sent to the depression risk classification module of the source depression assessment model for subsequent evaluation, the evaluation results will have a large deviation. Therefore, in order to make the extracted ALS EEG features better adapt to the classifier of the source model, this embodiment first uses a multi-head attention module as a feature relationship extraction module to learn features that are more useful for depression identification in ALS patient EEG data.

[0111] Specifically, the multi-head attention module, based on each "head", passes the clustering result data through three learnable weight matrices, where the matrix dimensions are (time cluster (i.e., number of clusters), number of feature categories), to obtain the Query, Key, and Value of the multi-head attention. The dot product of Query and Key is calculated to obtain the attention score, and the attention weight in the time cluster dimension is obtained after softmax. Based on the attention weight, the Value is weighted and summed to obtain a new feature. The new feature dimension is (time cluster, number of features), which is the same as the input dimension. That is, based on the attention mechanism, feature relationship extraction is performed through the following formula to obtain new features:

[0112]

[0113] Among them, d k is the dimension of the key (K), used to scale the dot product to prevent the gradient from vanishing or exploding.

[0114] Finally, the outputs of all the "heads" are connected and then subjected to a linear transformation to obtain the final output.

[0115] The multi-head attention mechanism is a technique that allows the model to focus on different parts of the input and different representation subspaces at the same time. It does this by running multiple attentions in parallel, where the number of "heads" represents the number of attention mechanisms that are calculated in parallel. This can be understood as the model learning the internal relationship of features from different angles, achieving better feature reorganization, reducing differences in feature distribution due to disease subtypes, and improving the accuracy of depression risk assessment for ALS patients.

[0116] Furthermore, the output of the multi-head attention module is linearly transformed through the feature adaptation module, which consists of a fully connected layer with a nonlinear activation layer, so that the features of ALS can better adapt to the depression risk classification module of the source depression model.

[0117] Since the multi-head attention mechanism mainly focuses on the relationship between features, it is not enough to fully adapt to the new data distribution. In order to compensate for the large distribution difference between non-ALS EEG features and ALS EEG features, this step constructs a feature adaptation module. Specifically, one or more fully connected layers are first constructed to perform linear transformation on the input features, where an activation layer, such as a RELU activation layer, can be introduced after each or several fully connected layers. Among them, in order 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 nonlinear transformations, enabling the model to learn more complex feature mappings and correct the feature distribution to better match the depression risk classification module of the source model.

[0119] Step S4: using the ALS training sample set and the loss function to iteratively train the initially constructed ALS patient depression risk prediction model to obtain a converged ALS patient depression risk prediction model.

[0120] Specifically, when the ALS training sample set and the loss function are used to iteratively train the preliminarily constructed ALS patient depression risk prediction model, all parameters of the feature extraction module and some parameters of the depression risk classification module are frozen;

[0121] 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.

[0122] Specifically, the depression risk classification module of this embodiment directly uses the classification part of the depression risk prediction model of non-ALS patients, or fine-tunes the latter layers of the classifier to obtain the depression risk assessment result. This embodiment uses cross entropy as the loss function for subsequent parameter optimization, and the loss function is as follows:

[0123]

[0124] Among them, y i is the one-hot encoding of the annotation label, is the prediction result of the model.

[0125] Since the feature adaptation module can make the feature space of ALS EEG data more compatible with the feature space of non-ALS patient EEG data, the classifier part of the non-ALS patient depression classification model only uses the classifier part to output the evaluation result, or only fine-tunes the last few layers of the source classifier to achieve 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 that are closer to the distribution of the annotated labels, and has a larger penalty for wrong predictions, prompting the model to learn the correct classification faster. The evaluation task of this embodiment contains only two types of labels, and the cross-entropy loss can be simplified to binary cross-entropy, expressed by the following formula:

[0126]

[0127] Among them, y i To mark the label, The prediction result of the model is the probability of being predicted as the positive class.

[0128] During model training, the ALS patient EEG data sample set was divided into a training set and a validation set, and the parameters of the first few fully connected layers of the feature extraction module and the depression risk classification module were frozen. During the training process, only the parameters of the last few layers of the multi-head attention module, feature adaptation module, and depression risk classification module were updated. The optimization goal was to minimize the cross entropy loss, and the optimal model was determined by the performance of the model in 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 the combination and distribution of features are adjusted by training the multi-head attention module and the feature adaptation module to adapt to the depression classification of ALS patients. Taking into account that the adjusted features may still differ from the distribution of 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 further discloses a computer device, comprising at least one processor, and at least one memory communicatively connected to the processor;

[0131] The memory stores instructions that can be executed by the processor, and the instructions are used to be executed by the processor to implement the aforementioned method for constructing a depression risk prediction model for ALS patients.

[0132] In summary, the embodiment of the present invention provides a method and device for constructing a depression risk prediction model for ALS patients, and proposes a method for constructing a model that migrates 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. The present invention uses a migration method to construct an adaptive feature aggregation module and a multi-head attention module to screen and correct effective EEG features, learn and extract the complex relationship of the features of ALS patients from multiple angles, and adjust the feature distribution to match the established depression risk classification module by constructing a special adaptation layer. The present invention uses only 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 depression screening of ALS patients. An objective evaluation method for assessing the depressive state of ALS patients that does not rely on subjective judgment is realized; for non-psychiatric professionals, the objective indicator can be used to judge the depressive state of ALS patients.

[0133] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0134] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field 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 depression risk prediction model for ALS patients, characterized in that: include: A depression risk prediction model for non-ALS patients was obtained based on the EEG data sample set of non-ALS patients; The depression risk prediction model includes a feature extraction module and a depression risk classification module; Obtaining EEG data of multiple ALS depressed patients and ALS non-depressed patients, marking 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; 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; The ALS training sample set and the 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.

2. The method for constructing a depression risk prediction model for ALS patients according to claim 1, characterized in that: When iteratively training the preliminarily constructed ALS patient depression risk prediction model using the ALS training sample set and the loss function, freezing all parameters of the feature extraction module and some parameters of the depression risk classification module; 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.

3. The method for constructing a depression risk prediction model for ALS patients according to claim 1, characterized in that: The cross entropy loss function is used to iteratively train the initially constructed ALS patient depression risk prediction model; The loss function is expressed as: Among them, y i To mark the label, Predict the results for the model.

4. The method for constructing a depression risk prediction model for ALS patients according to claim 1, characterized in that: The EEG data of the ALS patient are preprocessed by the following method: 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: Among them, X′ is the corrected EEG data, 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; The amplitude-corrected EEG data of the ALS patient are sliced ​​using the same time window and step size as those used in preprocessing the EEG data sample set of non-ALS patients to obtain multiple EEG data segments, which constitute the preprocessed ALS EEG data corresponding to the ALS patient.

5. The method for constructing a depression risk prediction model for ALS patients according to claim 4, characterized in that: 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 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 and obtain effective ALS EEG feature data; The multi-head attention module is used to extract features from the effective ALS EEG feature data obtained by screening to obtain feature data containing the relationship between features; The feature adaptation module is used to perform feature mapping on the feature data including the relationship 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, characterized in that: When the feature extraction module is used to extract features from the ALS EEG data of the ALS patient, a plurality of ALS EEG feature data with the same number of feature categories and the same number of time slices as those of the non-ALS patient's EEG data are obtained; The adaptive feature aggregation module corrects the feature distribution of the EEG feature data of ALS patients by the following method: Based on the EEG feature data corresponding to multiple patients in the EEG data sample set of non-ALS patients, the mean and standard deviation of the EEG feature data of each category are calculated on the full time slice; The EEG feature data of the ALS patient are divided into feature groups according to feature categories, and the EEG feature data of each time slice of each EEG data segment in each feature group are subjected to feature distribution correction using the following formula: in, is the EEG feature of the tth time slice after correction, Target tm is the EEG feature of ALS patients at the t-th time slice of the m-th feature before correction, SourceMean m is the mean value of the EEG feature of the mth feature in the EEG data sample set of non-ALS patients, SourceStd m The standard deviation of the mth feature in the EEG data sample set of non-ALS patients, M represents the maximum number of feature categories corresponding to each feature group, and N represents the number of time slices of each EEG data segment. is the corrected EEG feature of the mth feature of the ALS patient in the tth time slice.

7. The method for constructing a depression risk prediction model for ALS patients according to claim 6, characterized in that: The clustering of the corrected EEG characteristic data of the ALS patient to screen out effective ALS EEG characteristic data includes: For each feature group, the cosine similarity between the feature data of each time slice and the feature data of other time slices is calculated respectively, and an adjacency matrix is ​​constructed based on the cosine similarity; Constructing a Laplacian matrix based on the degree matrix of the adjacency matrix and normalizing it; Based on the normalized Laplace matrix, a feature polynomial is constructed and solved to obtain a similarity reference value between each time slice and features of the same category of other time slices; Arrange each similarity reference value from large to small, and calculate the gap between two adjacent similarity reference values ​​to obtain the kth similarity reference value that makes the gap the largest, and use k as the number of clusters; Based on the cluster number k, the first k similarity reference values ​​are used as cluster center values, the EEG feature data of the corrected ALS patients are clustered, and a pooling operation is performed on all the feature data in the 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 screened effective ALS EEG feature data, including: The effective ALS EEG feature data is multiplied by three weight matrices respectively to perform linear transformation, and the three linear transformation results are used as Query, Key and Value; the three weight matrices are obtained by learning; Calculate the dot product of Query and Key to get the attention score, and normalize the attention score through softmax to get the attention weight; The Value is weighted and summed using the attention weight to obtain feature data containing the relationship between features.

9. The method for constructing a depression risk prediction model for ALS patients according to claim 5, characterized in that: 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, mapping the ALS EEG feature data to the non-ALS EEG feature dimension; The activation layer is used to perform nonlinear transformation on the EEG features that have been linearly transformed by the fully connected layer, so as to learn complex feature mapping and correct the feature distribution that is suitable for the depression risk classification module.

10. A computer device, characterized in that: comprising at least one processor, and at least one memory communicatively connected to the processor; The memory stores instructions that can be executed 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 as described in any one of claims 1-9.

Citation Information

Patent Citations

  • Depression analysis method based on deep learning and resting state electroencephalogram data

    CN116386864A

  • Bearing fault diagnosis method based on iCORAL-MMD and adversarial transfer learning

    CN116793682A

  • Depression detection method based on scalp electroencephalogram signal cross-individual cross-scene difference

    CN118806297A

  • Product visual image accurate identification and processing integrated platform

    CN118982543A

  • Electroencephalogram depression recognition system and method based on knowledge distillation and meta transfer learning

    CN118986349A