COPD patient re-admission prediction method and system based on multi-modal sparse attention mechanism
Through the prediction method of multimodal sparse attention mechanism, combined with the long short-term memory model, TextCNN and improved Transformer model, the data fusion and feature extraction problems in the prediction of COPD patient readmission were solved, achieving efficient and accurate prediction results.
Patent Information
- Application Number
- CN202510852964.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-24
- Publication Date
- 2025-10-03
AI Technical Summary
In existing technologies, the COPD patient readmission prediction model relies on single medical data and does not integrate environmental factors, resulting in one-sided prediction results. The model is highly complex and has difficulty processing long sequence data. In addition, data imbalance leads to overfitting, and feature redundancy makes it difficult to extract key features.
A prediction method based on a multimodal sparse attention mechanism is adopted. The long short-term memory model is used to extract temporal features, the TextCNN model is used to extract the semantic features of clinical diagnosis codes, the improved Transformer model is used to extract the doctor's text features, and multimodal fusion is performed through the self-attention mechanism, and attention weights are dynamically allocated for prediction.
It achieves efficient and accurate prediction of COPD patients' readmission, reduces redundant information interference, and improves the prediction efficiency and accuracy of the model.
Smart Images

Figure CN120748751A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of medical data analysis and artificial intelligence technology, and specifically relates to a COPD patient readmission prediction method and system based on a multimodal sparse attention mechanism. Background Art
[0002] Chronic obstructive pulmonary disease (COPD) is a chronic disease with high morbidity and mortality worldwide. The high rate of readmissions among patients places a huge burden on medical resources. Traditional technologies rely primarily on single medical data (such as electronic medical records or clinical indicators), which present the following problems: Data limitations: Environmental factors (such as air pollution and meteorological data) are not integrated, resulting in one-sided prediction results; High model complexity: The computational complexity of the traditional self-attention mechanism is O(T 2 D) It is difficult to process long series of data; data imbalance: normal samples in medical data far outnumber readmission samples, making the model prone to overfitting; feature redundancy: information redundancy exists when fusing multimodal data, making it difficult to extract key features. Existing methods such as the LACE index and LASSO regression have not effectively addressed these issues.
[0003] For example, the Chinese invention patent with publication number CN119480124A discloses a lung infectious disease prediction system based on multimodal data fusion, including a data acquisition module, a feature extraction module, a dynamic fusion module and a prediction modeling module; the data acquisition module obtains the patient's clinical, digital medical imaging and environmental factor data; the feature extraction module extracts the feature vectors of each data source; the dynamic fusion module adaptively assigns weights to the multimodal features and fuses them into a multimodal feature representation; the prediction modeling module dynamically models the multimodal feature representation through time series analysis based on the neural network model to generate a probability prediction value of the patient suffering from a lung infectious disease and a disease trend prediction result; the neural network model includes a time feature extraction part , dynamic context modeling, and outcome prediction. The temporal feature extraction section includes a time window adaptive adjustment unit. The dynamic context modeling section consists of an autoregressive module with a cross-attention mechanism. The outcome prediction section includes a multi-task output unit. For vital sign data (such as body temperature, pulse, blood pressure, and blood oxygen saturation), the module extracts statistical features through time series analysis. Symptom description data is processed using natural language processing (NLP) technology, first converting unstructured text data into structured semantic vectors. Then, combined with sentiment analysis and context modeling techniques (such as Transformer-based language models), key semantic features related to pulmonary infectious diseases, such as cough frequency and chest pain severity, are extracted. Although the above scheme can be used to predict pulmonary infectious diseases, the computational complexity of the self-attention mechanism is too high, making it difficult to process long sequence data. In addition, normal samples in medical data far outnumber readmission samples, making the model prone to overfitting. Feature redundancy: Information redundancy exists when multimodal data is fused, making it difficult to extract key features. Therefore, an efficient and accurate multimodal fusion prediction model is urgently needed. Summary of the Invention
[0004] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art, improve the accuracy and efficiency of the disease prediction model, realize the readmission prediction of chronic obstructive pulmonary disease (COPD), and provide a COPD patient readmission prediction method and system based on a multimodal sparse attention mechanism.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] A COPD patient readmission prediction method based on a multimodal sparse attention mechanism includes the following steps:
[0007] S1: Obtaining patient sample data and preprocessing the sample data, the sample data includes electronic medical records and clinical observation data within a set observation time T, patient statistical characteristics and meteorological environment data; the electronic medical records include clinical diagnosis data and doctor text data;
[0008] S2: A long short-term memory model based on the attention mechanism is used to extract time series features from the pre-processed clinical observation data, patient statistical characteristics, and meteorological environment data to obtain the time series feature vector H;
[0009] S3: Use the text classification model based on sparse self-attention mechanism to extract text features from the preprocessed clinical diagnosis data and obtain the latent representation vector of the clinical diagnosis data
[0010] S4: Use the improved Transformer model to extract features from the preprocessed doctor text data and obtain the latent representation vector of the doctor text data The decoder layer of the improved Transformer model includes a sparse multi-head self-attention layer, a normalization layer, a naive multi-head cross attention layer, and a feedforward neural network layer;
[0011] S5: Based on the self-attention mechanism, the latent representation vector of the time series feature vector H and the clinical diagnosis data and the latent representation vector of the doctor text data Assign attention weights to obtain the multimodal fusion feature vector, input the multimodal fusion feature vector into the fully connected layer for output prediction, and obtain the final prediction result.
[0012] Preferably, the electronic medical record in step S1 includes clinical diagnosis data and doctor text data, the clinical diagnosis data includes disease diagnosis data and surgical operation data, and the doctor text data is the diagnosis information text of the patient's admission and discharge.
[0013] Preferably, the preprocessing of the electronic medical records in step S1 includes: oversampling the electronic medical records of readmitted patients using the SMOTE sampling algorithm, generating ICD codes corresponding to the disease diagnosis data and the surgical operation data based on the ICD coding rules, wherein the ICD codes for the disease diagnosis data are disease diagnosis codes obtained based on the ICD-10 coding rules and include chapters, sections, categories, sub-sections, details, and extended codes; and the ICD codes for the surgical operation data are surgical operation codes obtained based on the ICD-9 coding rules and include sections, categories, sub-sections, details, and extended codes.
[0014] The disease diagnosis code and surgical operation code are converted into word vectors using the Word2Vec or GloVe model to obtain the clinical diagnosis code d. The doctor text data is converted into word vectors using the Word2Vec or GloVe model to obtain the doctor text vector v. n .
[0015] Preferably, the preprocessing of the clinical observation data, patient statistical characteristics and meteorological environment data in step S1 includes: discretizing and normalizing the clinical observation data with the median as the standard, and filling missing values, and then adding the binary indicator features of the clinical observation data, patient statistical characteristics, and meteorological environment data to obtain the clinical time series data x t .
[0016] Preferably, in step S2, a long short-term memory model based on an attention mechanism is used to extract time series features from the pre-processed clinical observation data, patient statistical characteristics, and meteorological environment data to obtain a time series feature vector H. The specific steps are:
[0017] The clinical time series data x t Input the long short-term memory model to get the hidden state of each time step,
[0018]
[0019] Among them, m is the feature dimension size of the time series feature vector H, is the hidden state of the mth dimension at the tth moment, is the hidden state of the mth dimension at the t-1th moment, and LSTM() is the long short-term memory network layer;
[0020] Based on the attention mechanism, different attention values are learned for the hidden state at each moment in the long short-term memory model, and the output time series feature vector H is obtained by weighted summation of the hidden states at all moments. The expression is:
[0021]
[0022] in, is the attention parameter; Represents the hidden state at the m-th moment The learned weights.
[0023] Preferably, the text classification model based on the sparse self-attention mechanism is used in step S3 to extract text features from the pre-processed clinical diagnosis data to obtain the latent representation vector of the clinical diagnosis data. The specific steps are:
[0024] The TextCNN text classification model is used to extract text features of the clinical diagnosis code d. Specifically, the TextCNN text classification model includes a convolutional layer and a maximum pooling layer. The convolutional layer is used to extract the local features of the clinical diagnosis code d. The vector d i represents the i-th word in the clinical diagnosis code d, then a clinical diagnosis sequence of length n is expressed as:
[0025]
[0026] in, It is a concatenation operator that uses the filter w to perform a convolution operation on the clinical diagnosis sequence to generate a new feature c i , and get the feature map Specifically:
[0027]
[0028]
[0029] Among them, b represents the bias, f is the nonlinear function Relu; max() is the global maximum pooling, and k is the kernel width of the filter w;
[0030] The convolution layer is equipped with R filters, each of which is convolved, and the feature maps are connected to obtain the pooled feature vector Z1;
[0031] The feature vector Z1 is input into the sparse self-attention layer for linear transformation to obtain the latent representation vector of the disease diagnosis data Its expression is:
[0032]
[0033]
[0034] Among them, W Q ,W K ,W V These are all parameters of the sparse self-attention layer, and ProbSparse() is the sparse self-attention layer.
[0035] The TextCNN text classification model of the present invention efficiently captures the local semantics of clinical diagnosis code text through local convolution and pooling, improving the feature extraction efficiency of short text clinical diagnosis codes; at the same time, it adopts a sparse self-attention layer to reduce the redundancy of attention calculation, thereby improving efficiency and model performance.
[0036] Preferably, the improved Transformer model used in step S4 includes N encoder layers and M decoder layers, and the output of the Mth decoder layer is the latent representation vector of the doctor text data
[0037] The first encoder layer takes the target template feature Z2 with spatial position encoding as input information, where the target template feature is the doctor text vector v n The word embedding vector of the second and subsequent encoder layers takes the output of the previous encoder layer as input, and its expression is:
[0038]
[0039] Among them, P enc Represents spatial position encoding, represents the j-th encoder layer, represents the output of the (j-1)th encoder layer;
[0040] Each decoder layer not only inputs the search area features with spatial position encoding or the output of its previous decoder layer, but also inputs the encoded target template features output by the encoder, which is expressed as:
[0041]
[0042] Among them, X represents the search area characteristics, represents the encoded target template features output by the Nth encoder layer, represents the rth decoder layer, represents the output of the (r-1)th decoder layer.
[0043] Preferably, the specific method for decoding at each decoder layer is:
[0044] First, sparse multi-head self-attention is used to calculate the self-attention of the search region feature X or the output of the previous decoder layer, and then naive multi-head cross attention is used to calculate the encoded target template feature and the self-attention of the search region feature X Cross-attention When 2≤r≤M, each decoder layer Expressed as:
[0045]
[0046] Among them, SMSA is sparse multi-head self-attention, MCA is naive multi-head cross attention, is the self-attention of the search region feature X, Norm is layer normalization, and FFN is the feedforward neural network; is the output of the rth decoder layer.
[0047] The improved Transformer model of the present invention adopts a sparse multi-head self-attention layer to efficiently generate the target sequence, and adopts a naive multi-head cross-attention layer to fully fuse the source information input to the decoder layer, thereby improving the decoding calculation efficiency.
[0048] Preferably, the calculation expression of the multimodal fusion feature vector in step S5 is:
[0049] Let the input feature vector but
[0050] W F =[W H ,W Z1 ,W Z2 ];
[0051]
[0052]
[0053] Among them, W F is the weight matrix of the input feature vector F, W H 、W Z1 and W Z2 They are respectively the time series feature vector H and the latent representation vector of clinical diagnosis data and the latent representation vector of the doctor text data The corresponding weight matrix, α fuse is the attention weight vector, is the multimodal fusion feature vector;
[0054] The expression of the final prediction result y is:
[0055]
[0056] Among them, sigmoid is the activation function, W f is the output weight, b f is the output bias.
[0057] A COPD patient readmission prediction system based on a multimodal sparse attention mechanism, used to implement the COPD patient readmission prediction method based on a multimodal sparse attention mechanism, comprising:
[0058] The data acquisition and preprocessing module is used to obtain and preprocess the patient's sample data. The sample data includes electronic medical records, clinical observation data within a set observation time, patient statistical characteristics, and meteorological environment data;
[0059] The time series feature extraction module is used to extract time series features from pre-processed clinical observation data, patient statistical characteristics, and meteorological environment data using a long short-term memory model based on an attention mechanism to obtain a time series feature vector;
[0060] A text feature extraction module is used to extract text features from preprocessed clinical diagnosis data using a text classification model based on a sparse self-attention mechanism to obtain a latent representation vector of the clinical diagnosis data, and to extract features from preprocessed doctor text data using an improved Transformer model to obtain a latent representation vector of the doctor text data, wherein the decoder layer of the improved Transformer model includes a sparse multi-head self-attention layer, a normalization layer, a naive multi-head cross-attention layer, and a feedforward neural network layer;
[0061] The multimodal feature fusion module is used to assign attention weights to the time series feature vector, the latent representation vector of clinical diagnosis data, and the latent representation vector of doctor text data based on the self-attention mechanism to obtain a multimodal fusion feature vector, which is then input into the fully connected layer for output prediction to obtain the final prediction result.
[0062] The present invention obtains patient sample data, uses the long short-term memory model (LSTM) to extract the temporal features of data such as clinical observation data within the patient's observation time, uses the TextCNN model to extract the semantic features of clinical diagnosis codes, and uses the improved Transformer model to extract semantic features of doctor text vectors. Finally, the temporal features and semantic features are input into the attention layer, and the weights are dynamically assigned. The multimodal fusion feature vector is obtained by linear fusion feature, and the multimodal fusion feature vector is input into the fully connected layer for output prediction to obtain the probability of readmission.
[0063] The present invention realizes the prediction of hospital readmission for patients with chronic obstructive pulmonary disease (COPD). By obtaining multiple different types of sample data of COPD patients, combining attention mechanism, time series analysis and semantic analysis to perform correlation analysis, and performing feature fusion of multimodal data, the predicted probability of hospital readmission of COPD patients is obtained. At the same time, the self-attention mechanism can extract more critical features, which is more comprehensive, accurate and efficient. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] The present invention is described in further detail below with reference to the accompanying drawings:
[0065] Figure 1 It is a block diagram of the method of the present invention. DETAILED DESCRIPTION
[0066] like Figure 1 As shown, the present invention provides a COPD patient readmission prediction method based on a multimodal sparse attention mechanism, comprising the following steps: S1: obtaining the patient's sample data and preprocessing the sample data, the sample data including electronic medical records and clinical observation data within a set observation time T, patient statistical characteristics and meteorological environment data.
[0067] In this embodiment, the electronic medical record includes clinical diagnosis data and doctor's text data. The clinical diagnosis data includes disease diagnosis data and surgical operation data, and the doctor's text data is the patient's admission and discharge diagnosis information text.
[0068] In this embodiment, preprocessing of electronic medical records includes: using the SMOTE sampling algorithm to oversample the electronic medical records of readmitted patients, generating ICD codes corresponding to disease diagnosis data and surgical operation data based on ICD coding rules. The ICD codes for disease diagnosis data are disease diagnosis codes obtained based on ICD-10 coding rules, including chapter, section, category, sub-category, detail, and extended codes, such as: the ICD code for open patellar fracture is S82.010; the ICD codes for surgical operation data are surgical operation codes obtained based on ICD-9 coding rules, including section, category, sub-category, detail, and extended codes, such as: the ICD code for sigmoidoscopy is 45.24001. In this embodiment, the clinical diagnosis data in the electronic medical record is converted using ICD coding to expand the sample data.
[0069] The disease diagnosis code and surgical operation code are converted into word vectors using the Word2Vec or GloVe model to obtain the clinical diagnosis code d. The doctor text data is converted into word vectors using the Word2Vec or GloVe model to obtain the doctor text vector v. n Since disease diagnosis data and surgical operation data are discrete and have certain correlations, the present invention uses the distributed representation method Word2Vec or GloVe to capture the implicit correlation between discrete medical concepts and represents the embedded representation of medical concepts with a low-dimensional, dense real number vector.
[0070] In this embodiment, the observation time T is set to 48 hours. Clinical observation data include systolic / diastolic blood pressure, pulse, oxygen partial pressure (PaO2), carbon dioxide partial pressure (PaCO2), pH, white blood cell count (WBC), procalcitonin (PCT), C-reactive protein (CRP), serum tumor necrosis factor-α (TNF-α), interleukin-10 (IL-10), coagulation factors (plasma D-dimer, plasma viscosity, whole blood viscosity), forced respiratory volume in one second (FEV1 value) and forced respiratory volume in one second / maximal vital capacity (FEV1 / FVC ratio, FEV1%), a total of 17 dimensions; meteorological environment data include CO2, PM 2.5 、PM 10 , SO2, CO, NO2 and O3, a total of seven dimensions of data; the patient's statistical characteristics include the patient's gender, age, ethnicity, occupation, marital status, history of drug allergy, blood type, admission route and admission department, a total of 9 dimensions.
[0071] In this embodiment, the preprocessing of clinical observation data, patient statistical characteristics and meteorological environment data includes: discretizing and normalizing the clinical observation data with the median as the standard, and filling the missing values, and then adding the 17-dimensional binary indicator features of the clinical observation data, the 9-dimensional patient statistical characteristics, and the 7-dimensional meteorological environment data to obtain the clinical time series data x t , a total of 50 dimensions.
[0072] S2: Using the long short-term memory model based on the attention mechanism to analyze the clinical time series data x t Perform time series feature extraction to obtain the time series feature vector H; the specific method is:
[0073] The clinical time series data x t Input the long short-term memory model (LSTM) to get the hidden state of each time step,
[0074]
[0075] Wherein, m is the feature dimension size of the time series feature vector H. In this embodiment, m is 1,…,50; LSTM() is the long short-term memory network layer. is the hidden state of the mth dimension at the tth moment, is the hidden state of the m-th dimension at time t-1; T is 48, in hours.
[0076] Based on the attention mechanism, different attention values are learned for the hidden state at each moment in the LSTM model, and the output time series feature vector H is obtained by weighted summation of the hidden states at all moments. The expression is:
[0077]
[0078] in, is the attention parameter, which is initialized using the Xavier initialization method; Represents the hidden state at the m-th moment The learned weights.
[0079] S3: A text classification model based on sparse self-attention mechanism is used to extract text features of clinical diagnosis code d to obtain the latent representation vector of clinical diagnosis data The specific steps are:
[0080] The TextCNN text classification model is used to extract text features of the clinical diagnosis code d. Specifically, the TextCNN text classification model includes a convolutional layer and a maximum pooling layer. The convolutional layer is used to extract the local features of the clinical diagnosis code d. The vector d irepresents the i-th word in the clinical diagnosis code d, then a clinical diagnosis sequence of length n is expressed as:
[0081]
[0082] in, It is a concatenation operator that uses the filter w to perform a convolution operation on the clinical diagnosis sequence to generate a new feature c i , and obtain the feature map, specifically:
[0083]
[0084] b represents the bias, f is the nonlinear function Relu, and k is the kernel width of the filter w.
[0085] For indices exceeding the sequence boundary, zero padding is used and the filter is applied to each possible window to produce a feature map.
[0086]
[0087] Among them, max() is the global maximum pooling;
[0088] The convolution layer is equipped with R filters, each of which is convolved, and the feature maps are connected to obtain the pooled feature vector Z1;
[0089] The feature vector Z1 is input into the sparse self-attention layer for linear transformation to obtain the latent representation vector of the disease diagnosis data Its expression is:
[0090]
[0091] Among them, W Q ,W K ,W V These are all parameters of the sparse self-attention layer, and ProbSparse() is the sparse self-attention layer.
[0092] In this embodiment, the TextCNN text classification model efficiently captures the local semantics of clinical diagnosis code text through local convolution and pooling, improving the feature extraction efficiency of short text clinical diagnosis codes; at the same time, a sparse self-attention layer is used to reduce the redundancy of attention calculation, thereby improving efficiency and model performance.
[0093] S4: Use the improved Transformer model to transform the doctor text vector v n Perform feature extraction to obtain the latent representation vector of the doctor text data The improved Transformer model consists of N encoder layers and M decoder layers. The output of the Mth decoder layer is the latent representation vector of the doctor text data.
[0094] In this embodiment, the first encoder layer takes the target template feature Z2 with spatial position encoding as input information, where the target template feature is the doctor text vector v n The word embedding vector of the second and subsequent encoder layers takes the output of the previous encoder layer as input, and its expression is:
[0095]
[0096] Among them, P enc Represents spatial position encoding, represents the j-th encoder layer, represents the output of the (j-1)th encoder layer.
[0097] In this embodiment, each decoder layer not only inputs the search area features with spatial position encoding or the output of its previous decoder layer, but also inputs the encoded target template features output by the encoder, which is expressed as:
[0098]
[0099] Among them, X represents the search area characteristics, represents the encoded target template features output by the Nth encoder layer, represents the rth decoder layer, represents the output of the (r-1)th decoder layer.
[0100] In this embodiment, each decoder layer includes a sparse multi-head self-attention layer SMSA, a normalization layer Norm, a naive multi-head cross attention layer MCA and a feedforward neural network layer FFN.
[0101] In this embodiment, in each decoder layer, sparse multi-head self-attention is first used to calculate the self-attention of the search region feature X or the output of the previous decoder layer, and then naive multi-head cross attention is used to calculate the encoded target template feature and the self-attention of the search region feature X Cross-attention When 2≤r≤M, each decoder layer Expressed as:
[0102]
[0103] Among them, SMSA is sparse multi-head self-attention, MCA is naive multi-head cross attention, is the self-attention of the search region feature X, Norm is layer normalization, and FFN is the feedforward neural network; is the output of the rth decoder layer.
[0104] In this embodiment, the use of a sparse multi-head self-attention layer in the improved Transformer model can efficiently generate the target sequence, and the use of a naive multi-head cross-attention layer can fully fuse the source information input to the decoder layer, thereby improving the decoding calculation efficiency.
[0105] S5: Based on the self-attention mechanism, the latent representation vector of the time series feature vector H and the clinical diagnosis data and the latent representation vector of the doctor text data Assign attention weights to obtain the multimodal fusion feature vector, input the multimodal fusion feature vector into the fully connected layer for output prediction, and obtain the final prediction result.
[0106] In this embodiment, the calculation expression of the multimodal fusion feature vector in step S5 is:
[0107] Let the input feature vector but
[0108] W F =[W H ,W Z1 ,W Z2 ];
[0109] α fuse =softmax(W F T ·(tanh(W F ·F));
[0110]
[0111] Among them, W F is the weight matrix of the input feature vector F, W H 、W Z1 and W Z2 They are respectively the time series feature vector H and the latent representation vector of clinical diagnosis data and the latent representation vector of the doctor text data The corresponding weight matrix, α fuse is the attention weight vector, is the multimodal fusion feature vector.
[0112] The expression of the final prediction result y is:
[0113]
[0114] Among them, sigmoid is the activation function, Wf is the output weight, b f is the output bias.
[0115] The present invention's multimodal data analysis method based on a sparse self-attention mechanism reduces the generation and interference of redundant information from unimportant modalities. This fusion approach automatically adjusts the weights during training based on the decrease in the loss function, allowing the latent representation information of more important modalities to take full advantage.
[0116] In this example, because readmission prediction is a binary classification problem, the present invention uses a cross-entropy loss function to calculate the deviation between the target value and the predicted value. With the goal of minimizing this loss function, various parameters such as the random seed, batch size, and epoch are initialized for training, and weights are dynamically assigned. The Adam algorithm is used for optimization, and an L2 regularization term and dropout are added to prevent overfitting.
[0117] The present invention obtains patient sample data, uses an LSTM model to extract the temporal features of data such as the patient's clinical observation data within 48 hours, uses a TextCNN model to extract the semantic features of clinical diagnosis codes, and uses an improved Transformer model to extract semantic features from doctor text vectors. Finally, the temporal features and semantic features are input into the attention layer, and weights are dynamically assigned. A multimodal fusion feature vector is obtained through linear feature fusion, and the multimodal fusion feature vector is input into the fully connected layer for output prediction to obtain the probability of readmission.
[0118] The present invention realizes the prediction of hospital readmission for patients with chronic obstructive pulmonary disease (COPD). By obtaining multiple different types of sample data of COPD patients, combining attention mechanism, time series analysis and semantic analysis to perform correlation analysis, and performing feature fusion of multimodal data, the predicted probability of hospital readmission of COPD patients is obtained. At the same time, the self-attention mechanism can extract more critical features, which is more comprehensive, accurate and efficient.
[0119] The present invention also provides a COPD patient readmission prediction system based on a multimodal sparse attention mechanism, which is used to implement the above-mentioned COPD patient readmission prediction method based on a multimodal sparse attention mechanism, comprising:
[0120] The data acquisition and preprocessing module is used to obtain and preprocess the patient's sample data. The sample data includes electronic medical records, clinical observation data within a set observation time, patient statistical characteristics, and meteorological environment data;
[0121] The time series feature extraction module is used to extract time series features from pre-processed clinical observation data, patient statistical characteristics, and meteorological environment data using a long short-term memory model based on an attention mechanism to obtain a time series feature vector;
[0122] A text feature extraction module is used to extract text features from preprocessed clinical diagnosis data using a text classification model based on a sparse self-attention mechanism to obtain a latent representation vector of the clinical diagnosis data, and to extract features from preprocessed doctor text data using an improved Transformer model to obtain a latent representation vector of the doctor text data, wherein the decoder layer of the improved Transformer model includes a sparse multi-head self-attention layer, a normalization layer, a naive multi-head cross-attention layer, and a feedforward neural network layer;
[0123] The multimodal feature fusion module is used to assign attention weights to the time series feature vector, the latent representation vector of clinical diagnosis data, and the latent representation vector of doctor text data based on the self-attention mechanism to obtain a multimodal fusion feature vector, which is then input into the fully connected layer for output prediction to obtain the final prediction result.
[0124] The above are merely preferred embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection defined by the claims.
Claims
1. A COPD patient readmission prediction method based on a multimodal sparse attention mechanism, characterized by: The following steps are involved: S1: Obtaining patient sample data and preprocessing the sample data, the sample data includes electronic medical records and clinical observation data within a set observation time T, patient statistical characteristics and meteorological environment data; the electronic medical records include clinical diagnosis data and doctor text data; S2: A long short-term memory model based on the attention mechanism is used to extract time series features from the pre-processed clinical observation data, patient statistical characteristics, and meteorological environment data to obtain the time series feature vector H; S3: Use the text classification model based on sparse self-attention mechanism to extract text features from the preprocessed clinical diagnosis data and obtain the latent representation vector of the clinical diagnosis data S4: Use the improved Transformer model to extract features from the preprocessed doctor text data and obtain the latent representation vector of the doctor text data The decoder layer of the improved Transformer model includes a sparse multi-head self-attention layer, a normalization layer, a naive multi-head cross attention layer, and a feedforward neural network layer; S5: Based on the self-attention mechanism, the latent representation vector of the time series feature vector H and the clinical diagnosis data and the latent representation vector of the doctor text data Assign attention weights to obtain the multimodal fusion feature vector, input the multimodal fusion feature vector into the fully connected layer for output prediction, and obtain the final prediction result.
2. The COPD patient readmission prediction method based on multimodal sparse attention mechanism according to claim 1, characterized in that: The electronic medical record in step S1 includes clinical diagnosis data and doctor text data, the clinical diagnosis data includes disease diagnosis data and surgical operation data, and the doctor text data is the diagnosis information text of the patient's admission and discharge.
3. The COPD patient readmission prediction method based on multimodal sparse attention mechanism according to claim 2, characterized in that: The preprocessing of the electronic medical records in step S1 includes: oversampling the electronic medical records of readmitted patients using the SMOTE sampling algorithm, generating ICD codes corresponding to the disease diagnosis data and the surgical operation data based on the ICD coding rules, wherein the ICD codes for the disease diagnosis data are disease diagnosis codes obtained based on the ICD-10 coding rules and include chapter, section, category, sub-category, detail, and extended codes; and the ICD codes for the surgical operation data are surgical operation codes obtained based on the ICD-9 coding rules and include section, category, sub-category, detail, and extended codes. The disease diagnosis code and surgical operation code are converted into word vectors using the Word2Vec or GloVe model to obtain the clinical diagnosis code d, and the doctor text data is converted into word vectors using the Word2Vec or GloVe model to obtain the doctor text vector v n .
4. The COPD patient readmission prediction method based on multimodal sparse attention mechanism according to claim 1, characterized in that: The preprocessing of the clinical observation data, patient statistical characteristics and meteorological environment data in step S1 includes: discretizing and normalizing the clinical observation data with the median as the standard, and filling missing values, and then adding the binary indicator features of the clinical observation data, patient statistical characteristics, and meteorological environment data to obtain the clinical time series data x t .
5. The COPD patient readmission prediction method based on multimodal sparse attention mechanism according to claim 1, characterized in that: In step S2, a long short-term memory model based on an attention mechanism is used to extract time series features from the pre-processed clinical observation data, patient statistical characteristics, and meteorological environment data to obtain a time series feature vector H. The specific steps are as follows: The clinical time series data x t Input the long short-term memory model to get the hidden state of each time step, Among them, m is the feature dimension size of the time series feature vector H, is the hidden state of the mth dimension at the tth moment, is the hidden state of the mth dimension at the t-1th moment, and LSTM() is the long short-term memory network layer; Based on the attention mechanism, different attention values are learned for the hidden state at each moment in the long short-term memory model, and the output time series feature vector H is obtained by weighted summation of the hidden states at all moments. The expression is: in, is the attention parameter; Represents the hidden state at the m-th moment The learned weights.
6. The COPD patient readmission prediction method based on multimodal sparse attention mechanism according to claim 3, characterized in that: In step S3, a text classification model based on a sparse self-attention mechanism is used to extract text features from the pre-processed clinical diagnosis data to obtain a latent representation vector of the clinical diagnosis data. The specific steps are: The TextCNN text classification model is used to extract text features of the clinical diagnosis code d. Specifically, the TextCNN text classification model includes a convolutional layer and a maximum pooling layer. The convolutional layer is used to extract the local features of the input clinical diagnosis code d. The vector d i represents the i-th word in the clinical diagnosis code d, then a clinical diagnosis sequence of length n is expressed as: d 1,n =d1⊕d2⊕…⊕d n Where ⊕ is a concatenation operator that uses filter w to perform convolution operation on the clinical diagnosis sequence to generate a new feature c i , and get the feature map Specifically: Among them, b represents the bias, f is the nonlinear function Relu; max() is the global maximum pooling, and k is the kernel width of the filter w; The convolution layer is equipped with R filters, each of which is convolved, and the feature maps are connected to obtain the pooled feature vector Z1; The feature vector Z1 is input into the sparse self-attention layer for linear transformation to obtain the latent representation vector of the disease diagnosis data Its expression is: Among them, W Q ,W K ,W V These are all parameters of the sparse self-attention layer, and ProbSparse() is the sparse self-attention layer.
7. The COPD patient readmission prediction method based on multimodal sparse attention mechanism according to claim 1, characterized in that: The improved Transformer model used in step S4 includes N encoder layers and M decoder layers, and the output of the Mth decoder layer is the latent representation vector of the doctor text data The first encoder layer takes the target template feature Z2 with spatial position encoding as input information, where the target template feature is the doctor text vector v n The word embedding vector of the second and subsequent encoder layers takes the output of the previous encoder layer as input, and its expression is: Among them, P enc Represents spatial position encoding, represents the j-th encoder layer, represents the output of the (j-1)th encoder layer; Each decoder layer not only inputs the search area features with spatial position encoding or the output of its previous decoder layer, but also inputs the encoded target template features output by the encoder, which is expressed as: Among them, X represents the search area characteristics, represents the encoded target template features output by the Nth encoder layer, represents the rth decoder layer, represents the output of the (r-1)th decoder layer.
8. The COPD patient readmission prediction method based on multimodal sparse attention mechanism according to claim 7, characterized in that: The specific method for decoding at each decoder layer is: First, sparse multi-head self-attention is used to calculate the self-attention of the search region feature X or the output of the previous decoder layer, and then naive multi-head cross attention is used to calculate the encoded target template feature and the self-attention of the search region feature X Cross-attention When 2≤r≤M, each decoder layer Expressed as: Among them, SMSA is sparse multi-head self-attention, MCA is naive multi-head cross attention, is the self-attention of the search region feature X, Norm is layer normalization, and FFN is the feedforward neural network; is the output of the rth decoder layer.
9. The COPD patient readmission prediction method based on multimodal sparse attention mechanism according to claim 1, characterized in that: The calculation expression of the multimodal fusion feature vector in step S5 is: Let the input feature vector but IN F =[W H ,IN Z1 ,IN Z2 ]; α fuse =softmax(W F T ·(tanh(W F ·F)); Among them, W F is the weight matrix of the input feature vector F, W H 、W Z1 and W Z2 They are respectively the time series feature vector H and the latent representation vector of clinical diagnosis data and the latent representation vector of the doctor text data The corresponding weight matrix, α fuse is the attention weight vector, is the multimodal fusion feature vector; The expression of the final prediction result y is: Among them, sigmoid is the activation function, W f is the output weight, b f is the output bias.
10. A COPD patient readmission prediction system based on a multimodal sparse attention mechanism, characterized by: The method for predicting readmission of COPD patients based on a multimodal sparse attention mechanism according to any one of claims 1 to 9 comprises: The data acquisition and preprocessing module is used to obtain and preprocess the patient's sample data. The sample data includes electronic medical records, clinical observation data within a set observation time, patient statistical characteristics, and meteorological environment data; The time series feature extraction module is used to extract time series features from pre-processed clinical observation data, patient statistical characteristics, and meteorological environment data using a long short-term memory model based on an attention mechanism to obtain a time series feature vector; A text feature extraction module is used to extract text features from preprocessed clinical diagnosis data using a text classification model based on a sparse self-attention mechanism to obtain a latent representation vector of the clinical diagnosis data, and to extract features from preprocessed doctor text data using an improved Transformer model to obtain a latent representation vector of the doctor text data, wherein the decoder layer of the improved Transformer model includes a sparse multi-head self-attention layer, a normalization layer, a naive multi-head cross-attention layer, and a feedforward neural network layer; The multimodal feature fusion module is used to assign attention weights to the time series feature vector, the latent representation vector of clinical diagnosis data, and the latent representation vector of doctor text data based on the self-attention mechanism to obtain a multimodal fusion feature vector, which is then input into the fully connected layer for output prediction to obtain the final prediction result.
Citation Information
Patent Citations
Lung infectious disease prediction system based on multi-modal data fusion
CN119480124A
Cited By
Dead cause chain automatic generation and root cause judgment support method and device fused with multi-model intelligent reasoning
CN122158094A
Method and device for automatic generation of cause-of-death chain and determination of underlying cause of death based on intelligent inference of fusion multi-model
CN122158094B