Rare disease detection method based on generative adversarial network

By combining the semi-supervised learning framework of generative adversarial networks and long and short-term memory networks, falsified data similar to the distribution of real data is solved, and the problem of scarcity and category imbalance in rare disease detection is significantly improved. The accuracy of rare disease detection is significantly improved .

CN119207776APending Publication Date: 2024-12-27EAST CHINA NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411337482.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-25
Publication Date
2024-12-27

AI Technical Summary

Technical Problem

Existing medical diagnostic methods have problems of misdiagnosis or misdiagnosis in rare disease detection, especially when data is scarce and categories are unbalanced, traditional machine learning methods are difficult to effectively process high-dimensional medical records and long-term series data.

Method used

Using a semi-supervised learning framework based on the combination of generative adversarial networks (GANs) and long and short-term memory networks (LSTMs), we can generate fake data similar to the distribution of real data, and improve the accuracy of rare disease detection sex.

Benefits of technology

It significantly improves the accuracy of rare disease detection, especially in the case of scarcity of data and imbalance of categories, and can effectively utilize unlabeled data to improve detection performance, especially suitable for extracting and processing complex time series data from electronic health records.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119207776A_ABST
    Figure CN119207776A_ABST
Patent Text Reader

Abstract

The invention discloses a rare disease detection method based on a generative adversarial network. The method is characterized by comprising the following steps: 1) collecting medical records of a patient; 2) data preprocessing; 3) coding the medical record events; 4) embedding a medical event sequence; 5) coding and representing the sequence data; 6) designing and training a generative adversarial network; 7) performing semi-supervised learning; 8) disease prediction, result output and the like. Compared with the prior art, the method has the advantages that early discovery of rare diseases is helped in medical application, diagnosis accuracy is improved, remarkable effects can be achieved particularly under the conditions of data scarcity and category imbalance, the method is particularly suitable for extracting and processing complex time sequence data from electronic health records, detection precision is improved, and the method is simple, convenient and easy to implement. The effect is obvious, and the application prospect and the commercial development value are good.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of deep learning models, and in particular to a rare disease detection method based on generative adversarial networks (GANs). Background Art

[0002] Rare diseases have long faced huge challenges in medical diagnosis due to their low incidence and complex pathological characteristics. Existing medical diagnostic methods usually rely on doctors' experience and existing medical knowledge, but the number of rare disease cases is small, and clinicians often lack sufficient knowledge, leading to misdiagnosis or missed diagnosis. For patients with rare diseases, diagnosis often requires multiple visits to the doctor, and long diagnostic delays.

[0003] With the increase of medical data, machine learning technology has gradually been applied to the field of disease detection. Some classic machine learning methods, such as logistic regression, random forest and support vector machine, have performed well in dealing with the diagnosis of common diseases. However, these methods have shown certain limitations when dealing with high-dimensional medical records, especially long time series data. First, these traditional methods usually rely on manual feature extraction, and this feature engineering is inefficient when faced with complex clinical data of rare diseases. Second, there is a significant class imbalance in rare disease data, which leads to the lack of generalization ability of traditional models when dealing with small sample data.

[0004] In recent years, deep learning models, especially those based on long short-term memory networks (LSTM) and generative adversarial networks (GANs), have shown potential in processing time series data and generating samples. LSTM models can effectively capture dependencies in time series, while GANs have significant advantages in generating fake data similar to real data in a scarce data environment. Especially in semi-supervised learning, GANs can improve the detection accuracy of the model under the condition of a small amount of labeled data by utilizing a large amount of unlabeled data. Although GANs have made significant progress in the fields of image generation and natural language processing, its application in medical data is still in the exploratory stage.

[0005] In view of the above problems, the present invention proposes a rare disease detection method based on generative adversarial networks and long short-term memory networks (LSTM), which performs sequence modeling on the patient's medical records and uses GANs to generate samples with similar distribution to the real data to improve the detection performance of the model under the conditions of a small amount of labeled data and a large amount of unlabeled data. The semi-supervised learning framework of the present invention can make full use of unlabeled data, overcome the problems of data scarcity and class imbalance, and significantly improve the accuracy of rare disease detection. Summary of the invention

[0006] The purpose of the present invention is to design a rare disease detection method based on generative adversarial networks (GANs) to address the deficiencies of the prior art. The method adopts generative adversarial networks and sequence modeling methods in deep learning, utilizes patient medical data in electronic health records (EHR), and combines generative adversarial networks to generate simulated medical event sequences. Through deep learning models, efficient and accurate rare disease detection can be achieved, especially in the case of data scarcity and category imbalance. Remarkable results can be achieved, and it is particularly suitable for extracting and processing complex time series data from electronic health records (EHR) to improve the accuracy of detection. The method is simple, the effect is remarkable, and it has good application prospects and commercial development value.

[0007] The purpose of the present invention is to achieve this: a rare disease detection method based on generative adversarial networks (GANs) and sequence modeling, which is characterized by using long short-term memory networks (LSTMs) for sequence modeling and combining generative adversarial networks to generate simulated medical event sequences to achieve efficient and accurate rare disease detection, specifically comprising the following steps:

[0008] Step 1: Collection of patient medical records

[0009] Access long-term patient medical records, including historical data on diagnoses (Dx), prescriptions (Rx), and medical procedures (Px), from electronic health record systems (EHR) and medical claims databases, covering all medical events of the patient from the first visit to the current one.

[0010] Step 2: Data preprocessing

[0011] The collected medical records are preprocessed, including removing redundant or duplicate data, filling in missing values ​​and standardizing medical event coding; using a standard coding system (such as ICD codes) to uniformly encode information such as diagnosis, prescriptions and medical operations to ensure data consistency and comparability.

[0012] Arrange the medical records in chronological order to generate the patient's medical event sequence v i It is defined by the following formula (a):

[0013] v i = {v ij ,j=1,...,N} (a).

[0014] Among them, v ij Represents the medical events of the patient at the jth time point.

[0015] Step 3: Coding of medical record events

[0016] One-hot encoding is performed on each medical event, converting each diagnosis, prescription, or operation event into a high-dimensional sparse vector to ensure that the data can be processed by the neural network. The dimension of each event encoding is equal to the total number of categories of medical events.

[0017] Step 4: Embedding of Medical Event Sequence

[0018] In order to capture the semantic relationship between medical events, the one-hot encoded event sequence is input into the embedding layer for dimensionality reduction. Through word embedding methods, such as skip-gram with negative sampling, each medical event is mapped into a low-dimensional dense vector, and the dimension of the embedding vector is set to 300.

[0019] Step 5: Encoding and Representation of Sequence Data

[0020] The patient's medical event sequence is input into a long short-term memory network (LSTM) to capture the temporal dependencies in the sequence. The LSTM network consists of one hidden layer, and the hidden layer size is set to 256. A hidden state vector is generated for each time step, and these hidden state vectors are subjected to a time pooling (max pooling) operation to generate a fixed-length sequence representation vector.

[0021] Step 6: Design of Generative Adversarial Network

[0022] A generative adversarial network (GAN) including a generator G and a discriminator D is constructed. The generator G receives a random noise vector as input to generate a simulated patient medical sequence. The generator G consists of 5 fully connected layers, each layer uses the ReLU activation function, and the last layer uses the tanh activation function to limit the output value to [-1, 1]. The discriminator D is responsible for distinguishing between real data and generated data, and determining whether the patient suffers from a rare disease. The discriminator D consists of 5 fully connected layers, and the last layer uses the softmax activation function to output three labels, namely real data, generated data, and unlabeled data.

[0023] Step 7: Generate adversarial network training

[0024] Discriminator loss: includes labeled data loss, unlabeled data loss, and generated data loss. The goal of the discriminator is to optimize the model by maximizing the accuracy of distinguishing true and false data. The total loss function of the discriminator is L D It is defined by the following formula (b):

[0025] L D =L L +L U +LG (b).

[0026] The labeled data loss L L is defined by the following formula (c) as:

[0027] L L = -E x,y~L [log p D (y|x, y < K + 1)] (c).

[0028] Where L L is the loss term of the labeled data, L U is the loss term of the unlabeled data, L G is the loss term of the generated data, E x,y~L is the mathematical expectation of samples x and y from the labeled data distribution L, log p D (y∣x, y < K + 1) is the log probability that the discriminator D predicts class y given the samples x and x, y < K + 1.

[0029] The unlabeled data loss L U is defined by the following formula (d) as:

[0030] L U = -E x~U [log p D (y ≤ K|x) (d).

[0031] Where L U is the loss term of the unlabeled data, E x~U is the mathematical expectation of samples x from the unlabeled data distribution U, log p D (y ≤ K∣x) is the log probability that the discriminator D predicts class y ≤ K given the sample x.

[0032] The generated data loss L G is defined by the following formula (e) as:

[0033] L G = -E x~G [log p D (y = K + 1|x)] (e)

[0034] Where L G is the loss term of the data from the generator G, E x~G is the mathematical expectation of samples x from the distribution of the generator G, log p D (y = K + 1∣x) is the log probability that the discriminator D predicts class y = K + 1 given the sample x.

[0035] Generator loss: The goal of the generator is to generate fake data that is similar to the real sequence distribution. The loss function of the generator is composed of the feature matching loss L FM and pull-apart (PT) loss L PT The feature matching loss LFM is defined by the following formula (f):

[0036]

[0037] Among them, L FM is the loss term of feature matching; E x~G is the mathematical expectation of sample x from the distribution of generator G, f(x) is the feature extracted by discriminator D on sample x, E x~U is the mathematical expectation of samples x from the unlabeled data distribution U.

[0038] The pull-off loss L PT It is used to improve the diversity of generated samples and is defined as follows:

[0039]

[0040] Among them, L PT is the loss function; N is the total number of samples, i and j are the indexes of the samples, f(x i ) and f(x j ) are samples x i and x j The feature vector after the feature extraction function f.

[0041] Step 8: Semi-supervised learning

[0042] Through semi-supervised learning, training is performed by combining partially labeled data of patients with rare diseases and a large amount of unlabeled data of common patients. Labeled data is used for supervised learning, while unlabeled data is used for unsupervised learning. The generator G in the generative adversarial network continuously generates fake data to deceive the discriminator D, and the discriminator D improves the classification accuracy by learning to distinguish between generated data and real data.

[0043] Step 9: Disease prediction and result output

[0044] The medical record sequence of a new patient is input into the trained generative adversarial network model. The discriminator D outputs the prediction result of whether the patient has a rare disease based on the input medical record sequence. The output results include classification results and classification probabilities. The evaluation standard of the model is PR-AUC (Precision-Recall Area Under Curve). Experimental results show that the use of this model can significantly improve the accuracy of detection.

[0045] Compared with the prior art, the present invention utilizes unlabeled data, solves the problems of data scarcity and class imbalance, and realizes effective detection of rare diseases by combining generative adversarial networks and sequence modeling technology. Experimental results show that this method has a significant improvement in the PR-AUC indicator compared with traditional models, and can help detect rare diseases early and improve the accuracy of diagnosis in medical applications. In particular, it can achieve significant results in cases of data scarcity and class imbalance, and is particularly suitable for extracting and processing complex time series data from electronic health records (EHR) to improve the accuracy of detection. The method is simple, the effect is significant, and it has good application prospects and commercial development value. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is a flow chart of the present invention;

[0047] Figure 2 This is a simplified example of a patient medical record sequence;

[0048] Figure 3 Schematic diagram of the generative adversarial network (GANs) structure. DETAILED DESCRIPTION

[0049] See also Figure 1 The present invention uses long short-term memory network for sequence modeling and combines generative adversarial network to generate simulated medical event sequences. The detection of rare diseases includes the following specific steps:

[0050] Step S110: Obtaining the patient's medical records, the medical records including: diagnosis, prescription and historical data of medical operations;

[0051] Step S120: preprocessing the collected medical records to remove redundant data and fill missing values, and using standardized medical events for hot coding to generate a patient medical event sequence;

[0052] Step S130: Using word embedding technology to perform dimensionality reduction processing on the hot-coded medical event sequence to generate a dense vector;

[0053] Step S140: inputting the embedded medical event sequence vector into the long short-term memory network to generate a hidden state vector for each time step, and obtaining a fixed-length sequence feature representation;

[0054] Step S150: using the generator G in the generative adversarial network to generate a simulated patient medical event sequence, and using the discriminator D in the generative adversarial network to distinguish between real patient data and generated forged data;

[0055] Step S160: using semi-supervised learning to optimize the generative adversarial network and using unlabeled data to improve the accuracy of rare disease detection;

[0056] Step S170: Use the Adam optimizer to perform gradient updates based on historical data, improve the performance of the model (generative adversarial network model) and output rare disease prediction results.

[0057] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0058] It should be mentioned before discussing the exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0059] Example 1

[0060] The present invention is implemented in the following environment for detecting rare diseases based on electronic health record (EHR) data. The environment includes a deep learning platform running on a server. The platform can process medical record data from different hospitals. The data includes patient diagnosis records, prescription records, and medical operation records. The implementation steps and applications of the invention are described in detail below:

[0061] Step 1: Data Collection

[0062] In actual applications, electronic health record data of patients from multiple hospitals and medical institutions are integrated into a unified database. The database contains multi-dimensional medical data, including: 1) basic information of patients (such as age, gender, date of birth); 2) diagnosis data, using the International Classification of Diseases (ICD-10); 3) prescription data, including the name of prescription drugs, dosage and medication time; 4) medical operation data, recording the patient's surgery and other medical operations.

[0063] See also Figure 2 , a simplified example of a patient medical record sequence. Dx stands for diagnosis, Rx stands for prescription, Px stands for medical procedure, and the subscripts represent different codes in each category. All of this data has been anonymized to protect patient privacy.

[0064] Step 2: Data preprocessing

[0065] There are a certain amount of missing values ​​and redundant data in medical data. At this time, the data preprocessing process includes:

[0066] 1) Missing value filling: For partially missing medical record data, the k-nearest neighbor algorithm (KNN) can be used to fill in the missing data. For example, when the prescription information of a patient at a specific time point is missing, the data of similar cases of the patient can be used to fill in the missing information.

[0067] 2) Standardization: All medical records are classified and labeled using the standard ICD-10 coding system. For operation information without ICD codes, manual review and mapping can be used to convert them into corresponding standard codes.

[0068] Step 3: Serialized representation of medical events

[0069] In this embodiment, the patient's diagnosis, prescription and operation records are arranged in chronological order. Specifically, each medical event is serialized and processed as follows:

[0070] 1) Use the one-hot encoding method to encode medical events into sparse vectors, and the vector dimension depends on the total number of medical event categories (for example, if there are 1,000 diagnostic event categories, the encoded vector is 1,000-dimensional).

[0071] 2) Word embedding models (such as the skip-gram model of Word2Vec) are used to reduce the dimensionality of high-dimensional sparse vectors to dense vectors. The embedded medical events are represented as 300-dimensional dense vectors.

[0072] Step 4: Use of Long Short-Term Memory Network (LSTM) Model

[0073] The processed medical event sequence was input into the LSTM network to capture the temporal dependency in the data. The LSTM model was configured as follows: 1) the hidden layer size was 256; 2) the network contained one LSTM layer, followed by a maximum pooling layer for feature compression of the entire sequence; 3) the output was a fixed-length sequence feature representation.

[0074] Step 5: Generate adversarial network training

[0075] See also Figure 3 , the model structure of the generative adversarial network of the present invention is adopted. Wherein, z is the random noise input to the generator G of the generative adversarial network (GAN). In the training process of the generative adversarial network (GANs), the input of the generator G is the random noise z vector, and the discriminator D inputs the real medical sequence or the forged sequence generated by the generator. The specific implementation steps are as follows:

[0076] 1) Generator architecture: The generator adopts a fully connected layer design. Each layer includes a ReLU activation function. The last layer uses a tanh activation function to map the output to the range of [-1,1]. The purpose of the generator is to generate fake data that is similar to the distribution of real medical event sequences.

[0077] 2) Architecture of the discriminator D: The discriminator D receives the sequence generated by the generator or the real sequence, uses the softmax function for classification, and outputs three categories: real data, forged data, and unlabeled data. The discriminator D improves the model's ability to distinguish between real data and forged data through adversarial learning.

[0078] Step 6: Semi-supervised learning optimization

[0079] In practical applications, labeled data (data of patients with rare diseases) is very scarce, so a semi-supervised learning method is used for model optimization as follows:

[0080] 1) Use a small amount of labeled data of patients with rare diseases (positive samples) and a large amount of unlabeled data of common patients (negative samples) to train the discriminator D.

[0081] 2) The generation ability of the generator G is enhanced through feature matching loss and pull-off loss, so that the data generated by the generator G is as close as possible to the real data in the feature space, while ensuring the diversity of the generated data.

[0082] Step 7: Disease detection result output

[0083] After the generative adversarial network is trained, new patient medical data is input into the model. The discriminator D determines whether the patient may have a rare disease based on the output of the generative adversarial network. The final output results include:

[0084] 1) Binary classification results of whether the patient has a rare disease;

[0085] 2) The confidence score of the classification result (such as probability between 0 and 1).

[0086] In practical applications, the PR-AUC (Precision-Recall Area Under Curve) evaluation index is used to measure the detection performance of the model. Experimental results show that the PR-AUC index of the present invention is significantly better than the traditional machine learning method on the data sets of multiple medical institutions.

[0087] The generative adversarial network in the present invention can be structurally optimized according to specific application scenarios. The following is a specific implementation of the optimization:

[0088] 1) The number of network layers of the generator G is expanded from 5 to 7, and the generator's ability to generate complex data is improved by increasing the depth of the hidden layer. The discriminator D is also adjusted in depth to improve the model's ability to classify complex medical sequence data. The number of neurons in each layer is adjusted in proportion to the sequence length to adapt to the time span of different medical records.

[0089] 2) In certain cases, a batch normalization layer can be added to the discriminator D to improve the convergence speed of the model and avoid overfitting. This optimization makes the generative adversarial network more stable when processing complex medical data sets and improves the accuracy of rare disease detection.

[0090] The above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A rare disease detection method based on generative adversarial networks, characterized in that: Long short-term memory networks are used for sequence modeling, combined with generative adversarial networks to generate simulated medical event sequences. Rare disease detection specifically includes the following steps: Step 1: Collection of patient medical records obtaining a patient's medical records, the medical records including: diagnosis, prescriptions, and historical data of medical procedures; Step 2: Data Preprocessing The collected medical records are used to remove redundant or duplicate data, fill in missing values, and standardize medical event codes. The medical records are arranged in chronological order, and the medical event sequence v is generated by the following formula (a): v = {v, j = 1, ..., N} (a); Among them, v represents the medical event of the patient at the jth time point; Step 3: Coding of medical record events Perform one-hot encoding on each medical event, converting each diagnosis, prescription or operation event into a high-dimensional sparse vector, wherein the dimension of each medical event encoding is equal to the total number of categories of the medical event; Step 4: Embedding of Medical Event Sequences The one-hot encoded medical event sequence v is input into the embedding layer for dimensionality reduction. The word embedding method is used to map each medical event into a low-dimensional dense vector, and the dimension of the embedding vector is set to 300. Step 5: Encoding and Representation of Sequence Data The medical event sequence v is input into the long short-term memory network to generate a hidden state vector for each time step, which is then subjected to a time pooling operation to generate a fixed-length sequence representation vector; Step 6: Design of Generative Adversarial Network Construct a generative adversarial network including a generator G and a discriminator D, wherein the generator G receives a random noise vector as input to generate a simulated patient medical sequence; the discriminator D consists of 5 fully connected layers, each layer uses a ReLU activation function, and the last layer uses a tanh activation function to limit the output value to [-1, 1]; Step 7: Training the Generative Adversarial Network The discriminator D optimizes the generative adversarial network model by maximizing the accuracy of distinguishing true and false data. The discriminator loss function includes: labeled data loss function L, unlabeled data loss function L and generated data loss function L. The total discriminator loss function L is defined by the following formula (b): L = L + L + L (b); The label data loss function L is defined by the following formula (c): L=-E , ~ [logp(y∣x,y <K+1)] (c); where E ,~ is the mathematical expectation of samples x and y from the labeled data distribution L; logp(y∣x,y<K+1) is the log probability that discriminator D predicts class y given samples x and x,y<K+1; The unlabeled data loss function L is defined by the following formula (d): L=-E ~ [log p(y≤K∣x) (d); Among them, E ~ is the mathematical expectation of sample x from the unlabeled data distribution U; logp(y≤K|x) is the logarithmic probability of the discriminator D predicting category y≤K under the condition of a given sample x; The generated data loss function L is defined by the following formula (e): L=-E ~ [log p(y=K+1∣x)] (e); Where L is the loss term of the data from the generator G; E ~ is the mathematical expectation of sample x from the distribution of generator G; logp(y=K+1|x) is the logarithmic probability of discriminator D predicting category y=K+1 under the condition of given sample x; The generator G generates fake data that is similar to the real sequence distribution, and the generator loss function is composed of the feature matching loss function L )* And pull the loss function L +, The feature matching loss function L )* It is defined by the following formula (f): Among them, E ~ is the mathematical expectation of sample x from the distribution of generator G; f(x) is the feature extracted by discriminator D on sample x; E ~ is the mathematical expectation of sample x from the unlabeled data distribution U; The pull loss function L +, It is defined by the following formula (g): Where N is the total number of samples; i and j are the sample indexes; f(x) and f:x are the feature vectors of samples x and x after feature extraction function f, respectively; Step 8: Semi-supervised learning Semi-supervised learning is used to train the generative adversarial network model by combining partially labeled data of patients with rare diseases and a large amount of unlabeled data of common patients. The labeled data is used for supervised learning, while the unlabeled data is used for unsupervised learning. Step 9: Disease prediction and result output The medical record sequence of a new patient is input into the trained generative adversarial network model, and the discriminator D outputs a prediction result of whether the patient suffers from a rare disease based on the input medical record sequence. The prediction result includes a classification result and a classification probability.

2. The rare disease detection method based on generative adversarial network according to claim 1, characterized in that: The standardized medical events use the International Classification of Diseases to uniformly code diagnosis, prescription and medical operation data.

3. The rare disease detection method based on generative adversarial network according to claim 1, characterized in that: The LSTM network consists of a hidden layer, the hidden layer size is set to 256, the sequence length is 300, and the hidden state of the entire sequence is extracted through the time pooling operation to obtain a fixed-length sequence feature representation.

4. The rare disease detection method based on generative adversarial network according to claim 1, characterized in that: The discriminator D consists of 5 fully connected layers, the last layer uses a softmax activation function, and outputs three labeled data: real data, generated data, and unlabeled data.

5. The rare disease detection method based on generative adversarial network according to claim 1, characterized in that: The generative adversarial network is trained through semi-supervised learning. The generator G generates a patient sequence similar to the real data distribution by minimizing the loss. The discriminator D determines whether the patient suffers from a rare disease by distinguishing between the real patient data and the generated data, and unsupervised learning is performed using unlabeled data.

6. The rare disease detection method based on generative adversarial network according to claim 1 or claim 9, characterized in that: The generative adversarial network model uses PR-AUC to evaluate the classification performance of the model in rare disease detection.