A gene expression profile data classification method based on stacked autoencoder and generative adversarial network
Patent Information
- Application Number
- CN202410327196.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-21
- Publication Date
- 2026-10-13
- Estimated Expiration
- 2044-03-21
AI Technical Summary
[0006]针对基因表达谱数据高维、样本较少和不平衡的问题,本发明提出了一种基于堆叠自动编码器和生成对抗网络的基因表达谱数据分类方法
[0067]根据步骤2、3,本发明在搭建堆叠自动编码器的过程中共搭建了两层自动编码器,每一层自动编码器单独训练,并将每一层自动编码器的中间层作为下一个自动编码器的输入层且共享权重,使得模型提取了基因表达谱数据的关键信息,从而减少了数据冗余和为后面的训练降低训练时间。与普通编码器相比,堆叠自动编码器具有强大的表达能力,能够学习更加复杂的特征表示,在处理高维数据更具有优势。
Smart Images

Figure CN118262802B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of bioinformatics technology, specifically a gene expression profile data classification method based on stacked autoencoders and generative adversarial networks. Background Technology
[0002] Gene expression profiling refers to the level of gene activity in cells or tissues, specifically whether genes are transcribed into corresponding messenger RNA (mRNA) and whether related proteins are synthesized within the cell. Gene expression profiling can provide important information about how an organism responds to environmental factors, stimuli, or diseases.
[0003] However, due to various uncontrollable factors such as the difficulty of sampling and patient privacy during the actual sampling process, gene expression profile data generally suffers from imbalance between different categories of samples, small sample size, and noise in high-dimensional features, which affects the accuracy of classifier training.
[0004] A Stacked Autoencoder (SAE) is a deep learning model belonging to the category of unsupervised learning. It is a structure composed of multiple stacked autoencoder layers. The advantage of SAEs lies in their ability to better capture the hierarchical structure and features of data by learning data representation layer by layer.
[0005] Generative Adversarial Networks (GANs) are a class of deep learning models consisting of two main parts: a generator and a discriminator. These two parts compete against each other through adversarial training, enabling the generator to produce realistic data, while the discriminator effectively distinguishes between real and generated data. WGAN-GP (Wasserstein Generative Adversarial Network with Gradient Penalty) is a variant of GAN that uses the Wasserstein distance as the loss function between the generator and discriminator, and further improves training stability by introducing gradient penalties. Conditonal Wasserstein Generative Adversarial Network with Gradient Penalty (CWGAN-GP) adds labels to WGAN-GP to generate data of a specified category. Summary of the Invention
[0006] To address the issues of high dimensionality, limited sample size, and imbalance in gene expression profile data, this invention proposes a gene expression profile data classification method based on stacked autoencoders and generative adversarial networks.
[0007] The technical solution of this invention is: a gene expression profile data classification method based on stacked autoencoders and generative adversarial networks, comprising the following steps:
[0008] Step 1: Data download and data preprocessing;
[0009] Step 2: Build a stacked autoencoder;
[0010] Step 3: Train the stacked autoencoder;
[0011] Step 4: Build the generative model;
[0012] Step 5: Build the discriminant model;
[0013] Step 6: Construct the loss function for the model;
[0014] Step 7: Train the generative adversarial network;
[0015] Step 8: Generate class samples of the specified category;
[0016] Step 9: Generate samples to train the classifier.
[0017] Furthermore, step 1 includes the following steps:
[0018] Step 1.1: Use the GEOquery package in R to download gene expression profile data based on the GSE number.
[0019] Step 1.2: Normalize the data;
[0020] Step 1.3: Convert the data labels into one-hot format.
[0021] Furthermore, step 2 includes the following steps:
[0022] Step 2.1: Stacked autoencoders. Set up two hidden layers with the number of neurons h1 and h2 (h1>h2), and build an autoencoder for each hidden layer.
[0023] Step 2.2: Build the first-layer autoencoder with input and output in data_dim dimension and intermediate layer in h1 dimension, where data_dim is the dimension of the data input to the first-layer autoencoder;
[0024] Step 2.3: Build the second-layer autoencoder with h1-dimensional input and output and h2-dimensional intermediate layer;
[0025] Step 2.4: Randomly initialize the model parameters.
[0026] Furthermore, step 3 includes the following steps:
[0027] Step 3.1: Train the first layer autoencoder. Input the samples into the autoencoder. The sample size is [batch_size, data_dim], where batchsize is the minimum batch size. After 1 epoch of training, output the intermediate layer hidden vector r1.
[0028] Step 3.2: Train the second layer autoencoder. The input layer and the intermediate layer of the first layer autoencoder share weights. The hidden vector r1 of the intermediate layer of the first layer autoencoder is used as the input of the second layer autoencoder, where the input data size is [batch_size, h1]. After 1 epoch of training, the hidden vector r2 of the intermediate layer is output.
[0029] Step 3.3: Concatenate the intermediate layers of the first and second autoencoders to obtain the trained stacked autoencoder, and save the stacked autoencoder model using the save function in the torch library;
[0030] Step 3.4: Use the load function in the torch library to read the stacked autoencoder model, input the gene expression spectrum matrix into the trained stacked autoencoder model, and output the latent vector r3.
[0031] Furthermore, step 4 includes the following steps:
[0032] Step 4.1: Noise sampling. Using the Python language, import the torch library and use the normal distribution method to randomly select values to initialize the noise of size [batch_size, noise_dim]. The first parameter batch_size is also the number of noises, and the second parameter noise_dim represents the dimension of the input noise.
[0033] Step 4.2: Combine noise and one-hot format labels. Use the `cat` function from the `torch` library to concatenate the noise and labels, where the label size is [batch_size, label_size], and `label_size` is the dimension of the class label after OneHot encoding. The concatenated data is used as the input to the generative model, and its size is [batch_size, noise_dim + label_size].
[0034] Step 4.3: Build the first fully connected neural network. Import the Linear function from the torch.nn package to build the fully connected layer. The size of the input data is [batch_size, noise_dim + label_size], and the size of the output data is [batch_size, h1_G], where h1_G is the dimension of the data output by the first fully connected layer of the generator model.
[0035] Step 4.4: Build the second fully connected neural network. Import the Linear function from the torch.nn package to build the fully connected layer. The size of the input data is [batch_size, h1_G], and the size of the output data is [batch_size, h2_G], where h2_G is the dimension of the output data of the second fully connected layer of the generator model.
[0036] Step 4.5: Build the third fully connected neural network. Import the Linear function from the torch.nn package to build the fully connected layer. The size of the input data is [batch_size, h2_G], and the size of the output data is [batch_size, gene_dim], where gene_dim is the dimension of the final generated samples.
[0037] Step 4.6: Randomly initialize the parameters of the generated model.
[0038] Furthermore, step 5 includes the following steps:
[0039] Step 5.1: Combine the input samples with one-hot labels of size [batch_siz, data_dim_gan + label_size], where data_dim_gan is the dimension of the input samples;
[0040] Step 5.2: Divide the discriminant model structure into two parts, E and T;
[0041] Step 5.3: Construct model structure E. Build a three-layer fully connected neural network. Import the `Linear` function from the `torch.nn` package to construct the fully connected layers. The first fully connected neural network has an input data size of [batch_size, data_dim_gan + label_size] and an output data size of [batch_size, h1_E], where h1_E is the dimension of the first layer's output data. The second fully connected neural network has an input data size of [batch_size, h1_E] and an output data size of [batch_size, h2_E], where h2_E is the dimension of the second layer's output data. The third fully connected neural network has an input data size of [batch_size, h2_E] and an output data size of [batch_size, h3_E], where h3_E is the dimension of the output of model E, which is the same as the dimension of the noise.
[0042] Step 5.4: Build the model structure T, build a fully connected neural network, import the Linear function from the torch.nn package to build the fully connected layer. The input data size of the first fully connected neural network is [batch_size, h3_E], and the output data size is [batch_size, h1_T], where h1_T is the dimension of the output data of model T;
[0043] Step 5.5: Randomly initialize the discriminant model parameters.
[0044] Furthermore, step 6 includes the following steps:
[0045] Step 6.1: Calculate the loss of the discriminant model. Based on the loss function of the Conditional Wasserstein Generative Adversarial Network with Gradient Penalty (CWGAN-GP) discriminant model, it consists of three parts. The first part is to calculate the Wasserstein distance between the generated samples and the real samples, that is, to calculate the mean difference between the outputs of the generated samples and the real samples after passing through the discriminant model. The second part is the gradient penalty term, that is, the gradient of the mixed real samples and generated samples after passing through the discriminant model does not exceed a certain fixed value. The third part is to calculate the negative value of the Pearson correlation coefficient between the noise and the vector extracted by model E. The function pcc for calculating the Pearson correlation coefficient between variables a and b is as follows:
[0046]
[0047] Where n is the sample size, a i and b i Let represent the values of the i-th observation in the two variables respectively. and These are the sample means of the two variables. The Pearson correlation coefficient between the latent vector obtained from the generated samples through model E and the noise is calculated using the following formula:
[0048]
[0049] Where z is noise, p z This represents the noise distribution, where c is the label. Let G represent the mean, E represent the generative model, and pcc() be the function to calculate the Pearson correlation coefficient. The gradient penalty of the discriminator is calculated as follows:
[0050]
[0051] in Discrimination model right Differentiate, This represents a mixed distribution of real and generated samples. This represents a mixture of real and generated samples, as shown below:
[0052]
[0053] Where ε represents a random coefficient between 0 and 1, x represents the real sample, and y represents the generated sample;
[0054] Step 6.2: Calculate the loss of the generative model. Based on the loss function of the generative model of Conditional Wasserstein Generative Adversarial Network with Gradient Penalty (CWGAN-GP), the loss consists of two parts: one is the negative value of the mean of the generated samples after passing through the discriminator, and the other is the negative value of the Pearson correlation coefficient between the noise and the vector extracted by model E.
[0055] Furthermore, step 7 includes the following steps:
[0056] Step 7.1: Optimize the loss. Use the RMSProp optimizer to optimize the loss of the generative and discriminative models. The learning rate is set to 0.0001, and the minimum optimization method is adopted.
[0057] Step 7.2: Input noise and labels into the generative model. The latent vector r3 output in step 3.4 is used as the real sample in training. Input the real and fake samples and labels into the discriminative model and train it in batch processing. Each batch selects batch_size samples and the number of training iterations is epoch2. In each iteration, the generative model is trained once and the discriminative model is trained three times.
[0058] Step 7.3: Use the save function in the torch library to save the generated model.
[0059] Furthermore, step 8 includes the following steps:
[0060] Step 8.1: Use the load function in the torch library to read the trained generative model;
[0061] Step 8.2: Concatenate the noise and labels and input them into the trained generative model, with a size of [G5, noise_dim + label_size], where G5 is five times the largest sample size in all categories of the original gene expression profile data;
[0062] Step 8.3: Generate model output samples.
[0063] Furthermore, step 9 includes the following steps:
[0064] Step 9.1: Initialize the Random Forest (RF) classifier, the Extra Tree Classifier (ET), and the Lightweight Gradient Boosting (LGBM) algorithm;
[0065] Step 9.2: Train the classifiers. Input the generated samples into each classifier. Train each classifier ten times and take the average of the final results.
[0066] The present invention has the following technical effects:
[0067] According to steps 2 and 3, this invention constructs a two-layer autoencoder during the stacked autoencoder construction process. Each autoencoder layer is trained independently, and the intermediate layer of each autoencoder is used as the input layer of the next autoencoder, sharing weights. This allows the model to extract key information from the gene expression profile data, thereby reducing data redundancy and shortening training time for subsequent training. Compared with ordinary encoders, stacked autoencoders have powerful expressive capabilities, can learn more complex feature representations, and are more advantageous in processing high-dimensional data.
[0068] According to step 5, the present invention divides the discriminative model into an E model and a T model. The E model is built with three fully connected layers, and the T model is built with one fully connected layer. This not only retains the original structure of the CWGAN-GP discriminative model, but also has the function of extracting features of generated samples, and hardly increases the training cost.
[0069] According to step 6, the present invention adds a negative value of the Pearson correlation coefficient between noise and the vector extracted by model E to the loss function of the original CWGAN-GP generative model and discriminative model, so that the noise is correlated with the vector of the generated sample extracted by model E, thereby increasing the diversity of the generated samples, moving away from mode collapse, and thus improving the quality of the generated samples.
[0070] This demonstrates that the method improves the accuracy of disease diagnosis by extracting features from gene expression profile data and enhancing the data, thereby increasing the efficiency of diagnosis for medical personnel. Attached Figure Description
[0071] Figure 1 This is a flowchart of a gene expression profile data classification method based on stacked autoencoders and generative adversarial networks in this invention.
[0072] Figure 2 This is a structural diagram of the stacked autoencoder proposed in this invention.
[0073] Figure 3 This is a structural diagram of the discrimination model proposed in this invention.
[0074] Figure 4 This is a graph comparing the accuracy of gene expression profile data before and after the algorithm. Detailed Implementation
[0075] The specific embodiments of the present invention will now be described with reference to the accompanying drawings to enable those skilled in the art to better understand the invention. It should be particularly noted that in the following description, detailed descriptions of known functions and designs may obscure the main content of the invention, and such descriptions will be omitted here.
[0076] Gene expression profiling data can be used for early cancer detection. However, collecting sufficient gene expression profiling data from patients is difficult, and direct classification using a classifier can lead to overfitting. Therefore, this paper proposes a gene expression profiling data classification method based on stacked autoencoders and generative adversarial networks. Figure 1 As shown, the steps of this invention are as follows:
[0077] Step 1: Data download and data preprocessing.
[0078] Step 2: Build a stacked autoencoder.
[0079] Step 3: Train the stacked autoencoder.
[0080] Step 4: Build the generative model.
[0081] Step 5: Build a discriminant model.
[0082] Step 6: Construct the loss function for the model.
[0083] Step 7: Train the generative adversarial network.
[0084] Step 8: Generate class samples of the specified category.
[0085] Step 9: Generate samples to train the classifier.
[0086] The flowchart of the entire process is as follows: Figure 1 As shown.
[0087] Step 1 above includes the following steps:
[0088] Step 1.1: Use the GEOquery package in R to download gene expression profile data based on the GSE number.
[0089] Step 1.2: Normalize the data to limit the values to the range [0,1], thereby reducing the order of magnitude difference between the data in each dimension and avoiding excessive network prediction error;
[0090] Step 1.3: Convert the data labels into one-hot format. One-hot encoding can extend the values of discrete features to Euclidean space, making the distance calculation between features more reasonable.
[0091] Step 2 above includes the following steps:
[0092] Step 2.1: Set up two hidden layers for the stacked autoencoder, with the number of neurons being h1 and h2 respectively (h1>h2). Build an autoencoder for each hidden layer. The structure diagram of each stacked autoencoder layer is shown in the attached figure of the instruction manual. Figure 2 As shown;
[0093] Step 2.2: Build the first-layer autoencoder with input and output in data_dim dimension and intermediate layer in h1 dimension, where data_dim is the dimension of the data input to the first-layer autoencoder;
[0094] Step 2.3: Build the second-layer autoencoder with h1-dimensional input and output and h2-dimensional intermediate layer;
[0095] Step 2.4: Randomly initialize the model parameters.
[0096] Step 3 above includes the following steps:
[0097] Step 3.1: Train the first layer autoencoder by inputting samples into it. The sample size is [batch_size, data_dim], where batch_size is the minimum batch size. After 1 epoch of training, output the intermediate layer hidden vector r1.
[0098] Step 3.2: Train the second autoencoder. The input layer shares weights with the intermediate layers of the first autoencoder. The hidden vector r1 of the intermediate layers of the first autoencoder is used as the input to the second autoencoder, where the input data size is [batch_size, h1]. After 1 epoch of training, the hidden vector r2 of the intermediate layers is output. The loss function for each autoencoder layer is as follows:
[0099]
[0100] Where M is the number of observations in the training dataset, f i and These are the input and output of the autoencoder, respectively, and |·| denotes the vector normal form;
[0101] Step 3.3: Concatenate the intermediate layers of the first and second autoencoders to obtain the trained stacked autoencoder, and save the stacked autoencoder model using the save function in the torch library;
[0102] Step 3.4: Use the load function in the torch library to read the stacked autoencoder model, input the gene expression spectrum matrix into the trained stacked autoencoder model, and output the latent vector r3.
[0103] Step 4 above includes the following steps:
[0104] Step 4.1: Noise sampling. Using the Python language, import the torch library and use the normal distribution method to randomly select values to initialize the noise of size [batch_size, noise_dim]. The first parameter, batch_size, is the number of noise samples, and the second parameter, noise_dim, represents the dimension of the input noise.
[0105] Step 4.2: Combine noise and one-hot format labels. Use the `cat` function from the `torch` library to concatenate the noise and labels, where the label size is [batch_size, label_size], and `label_size` is the dimension of the class label after OneHot encoding. The concatenated data is used as the input to the generative model, and its size is [batch_size, noise_dim + label_size].
[0106] Step 4.3: Build the first fully connected neural network. Import the Linear function from the torch.nn package to build the fully connected layer. The size of the input data is [batch_size, noise_dim + label_size], and the size of the output data is [batch_size, h1_G], where h1_G is the dimension of the data output by the first fully connected layer of the generator model.
[0107] Step 4.4: Build the second fully connected neural network. Import the Linear function from the torch.nn package to build the fully connected layer. The size of the input data is [batch_size, h1_G], and the size of the output data is [batch_size, h2_G], where h2_G is the dimension of the output data of the second fully connected layer of the generator model.
[0108] Step 4.5: Build the third fully connected neural network. Import the Linear function from the torch.nn package to build the fully connected layer. The size of the input data is [batch_size, h2_G], and the size of the output data is [batch_size, gene_dim], where gene_dim is the dimension of the final generated samples.
[0109] Step 4.6: Randomly initialize the parameters of the generated model.
[0110] Step 5 above includes the following steps:
[0111] Step 5.1: Combine the input samples with one-hot labels of size [batch_size, data_dim_gan + label_size], where data_dim_gan is the dimension of the input samples;
[0112] Step 5.2: Divide the discriminant model structure into two parts, E and T. The discriminant model structure diagram is shown in the attached figure of the instruction manual. Figure 3 As shown;
[0113] Step 5.3: Construct model structure E. Build a three-layer fully connected neural network. Import the `Linear` function from the `torch.nn` package to construct the fully connected layers. The first fully connected neural network has an input data size of [batch_size, data_dim_gan + label_size] and an output data size of [batch_size, h1_E], where h1_E is the dimension of the first layer's output data. The second fully connected neural network has an input data size of [batch_size, h1_E] and an output data size of [batch_size, h2_E], where h2_E is the dimension of the second layer's output data. The third fully connected neural network has an input data size of [batch_size, h2_E] and an output data size of [batch_size, h3_E], where h3_E is the dimension of the output of model E, which is the same as the dimension of the noise.
[0114] Step 5.4: Build the model structure T, build a fully connected neural network, import the Linear function from the torch.nn package to build the fully connected layer. The input data size of the first fully connected neural network is [batch_size, h3_E], and the output data size is [batch_size, h1_T], where h1_T is the dimension of the output data of model T;
[0115] Step 5.5: Randomly initialize the discriminant model parameters.
[0116] Step 6 above includes the following steps:
[0117] Step 6.1: Calculate the loss of the discriminant model. Based on the loss function of the Conditional Wasserstein Generative Adversarial Network with Gradient Penalty (CWGAN-GP) discriminant model, it consists of three parts. The first part is to calculate the Wasserstein distance between the generated samples and the real samples, that is, to calculate the mean difference between the outputs of the generated samples and the real samples after passing through the discriminant model. The second part is the gradient penalty term, that is, the gradient of the mixed real samples and generated samples after passing through the discriminant model does not exceed a certain fixed value. The third part is to calculate the negative value of the Pearson correlation coefficient between the noise and the vector extracted by model E. The function pcc for calculating the Pearson correlation coefficient between variables a and b is as follows:
[0118]
[0119] Where n is the sample size, a i and b i Let represent the values of the i-th observation in the two variables respectively. and These are the sample means of the two variables. The Pearson correlation coefficient between the latent vector obtained from the generated samples through model E and the noise is calculated using the following formula:
[0120]
[0121] Where z is noise, p z This represents the noise distribution, where c is the label. Let G represent the mean, E represent the generative model, and pcc() be the function to calculate the Pearson correlation coefficient. The gradient penalty of the discriminator is calculated as follows:
[0122]
[0123] in Discrimination model right Differentiate, This represents a mixed distribution of real and generated samples. This represents a mixture of real and generated samples, as shown below:
[0124]
[0125] Where ε represents a random coefficient between 0 and 1, x represents a real sample, and y represents a generated sample; the loss function formula for the discriminant model is as follows:
[0126]
[0127] Where p y and p x Let λ1 and λ2 represent the distributions of generated samples and real samples, respectively, and let D represent the discriminant model.
[0128] Step 6.2: Calculate the loss of the generative model. Based on the loss function of the Conditional Wasserstein Generative Adversarial Network with Gradient Penalty (CWGAN-GP) generative model, this loss consists of two parts: one is the negative value of the mean of the generated samples after passing through the discriminator, and the other is the negative value of the Pearson correlation coefficient between the noise and the vector extracted by model E. The formula for the generator's loss function is as follows:
[0129]
[0130] Step 7 above includes the following steps:
[0131] Step 7.1: Optimize the loss. Use the RMSProp optimizer to optimize the loss of the generative and discriminative models. The learning rate is set to 0.0001, and the minimum optimization method is adopted.
[0132] Step 7.2: Input noise and labels into the generative model. The latent vector r3 output in step 3.4 is used as the real sample in training. Input the real and fake samples and labels into the discriminative model and train it in batch processing. Each batch selects batch_size samples and the number of training iterations is epoch2. In each iteration, the generative model is trained once and the discriminative model is trained three times.
[0133] Step 7.3: Use the save function in the torch library to save the generated model.
[0134] Step 8 above includes the following steps:
[0135] Step 8.1: Use the load function in the torch library to read the trained generative model;
[0136] Step 8.2: Concatenate the noise and labels and input them into the trained generative model, with a size of [G5, noise_dim + label_size], where G5 is five times the largest sample size in all categories of the original gene expression profile data;
[0137] Step 8.3: Generate model output samples.
[0138] Step 9 above includes the following steps:
[0139] Step 9.1: Initialize the Random Forest (RF) classifier, the Extra Tree Classifier (ET), and the Lightweight Gradient Boosting (LGBM) algorithm;
[0140] Step 9.2: Train the classifiers. Input the generated samples into each classifier. Train each classifier ten times and take the average of the final results.
[0141] Finally, to verify the feasibility of the algorithm, this invention tested the gene expression profiling data classification method based on stacked autoencoders and generative adversarial networks on breast cancer gene expression profiling data. The test results are shown in the accompanying drawings. Figure 4 As shown.
[0142] In summary, this invention proposes a gene expression profile data classification method based on stacked autoencoders and generative adversarial networks (GANs) for disease diagnosis, primarily addressing the poor classification performance caused by the imbalanced, high-dimensional, and small sample size characteristics of gene expression profile data. The method first downloads and preprocesses the gene expression profile data. Next, it constructs and trains a stacked autoencoder, then inputs samples into the trained autoencoder to obtain dimensionality-reduced data. Following this, it constructs and trains both a generative and discriminative model using a GAN. Subsequently, labels and noise are input into the generative model to generate samples of the specified categories. Finally, the generated samples are used to train the classifier. This invention improves classification efficiency and accuracy through dimensionality reduction and data augmentation.
Claims
1. A gene expression profile data classification method based on stacked autoencoders and generative adversarial networks, characterized in that, Includes the following steps: Step 1: Data download and data preprocessing; Step 2: Build a stacked autoencoder; Step 3: Train the stacked autoencoder; Step 4: Build the generative model; Step 5: Build the discriminant model; Step 6: Construct the loss function for the model; Step 7: Train the adversarial network; Step 8: Generate class samples of the specified category; Step 9: Generate samples to train the classifier; Step 1 includes the following steps: Step 1.1: Use the GEOquery package in R to download gene expression profile data based on the GSE number; Step 1.2: Normalize the data; Step 1.3: Convert the data labels into one-hot format; Step 5 includes the following steps: Step 5.1: Combine the input sample with one-hot labels of size [ , + ], in For the input sample dimensions; Step 5.2: Divide the discriminant model structure into two parts, E and T; Step 5.3: Build the model structure E, construct a three-layer fully connected neural network, import the Linear function from the torch.nn package to build the fully connected layers, and the size of the input data for the first fully connected neural network is [ , + The output data size is , ],in It is a model The dimension of the first layer's output data; the size of the input data for the second fully connected neural network is [ , The output data size is [ , ],in It is a model The dimension of the output data of the second layer; the size of the input data of the third fully connected neural network is [ , The output data size is [ , ],in It is the dimension of the output of model E, which is the same as the dimension of the noise; Step 5.4: Build the model structure T, construct a fully connected neural network layer, import the Linear function from the torch.nn package to build the fully connected layer, and the size of the input data for the first fully connected neural network layer is [ , The output data size is [ , ],in It is a model The dimension of the output data; Step 5.5: Randomly initialize the parameters of the discriminant model; Step 6 includes the following steps: Step 6.1: Calculate the loss of the discriminant model. Based on the loss function of the CWGAN-GP discriminant model, it consists of three parts. The first part is to calculate the Wasserstein distance between the generated samples and the real samples, that is, to calculate the mean difference between the outputs of the generated samples and the real samples after passing through the discriminant model. The second part is the gradient penalty term, that is, to ensure that the gradient of the mixed real samples and generated samples after passing through the discriminant model does not exceed a certain fixed value. The third part is to calculate the negative value of the Pearson correlation coefficient between the noise and the vector extracted by model E. and The function of the Pearson correlation coefficient between two variables The formula is as follows: ; in It is the sample size. and They represent the first The values of an observation in two variables, and These are the sample means of the two variables. The Pearson correlation coefficient between the latent vector obtained from the generated samples through model E and the noise is calculated using the following formula: ; in It's noise. It is the noise distribution. It's a tag. This represents the mean. Represents a generative model. Representation Model , () is the function for calculating the Pearson correlation coefficient; the gradient penalty of the discriminator is calculated as follows: ; in Discrimination model right Differentiate, This represents a mixed distribution of real and generated samples. The mixed sample representing the real sample and the generated sample is represented as follows: ; in Represents a random coefficient between 0 and 1. Represents a real sample. Indicates the generation of samples; Step 6.2: Calculate the loss of the generative model. Based on the loss function of the CWGAN-GP generative model, the loss consists of two parts: one is the negative value of the mean of the generated samples after passing through the discriminator, and the other is the negative value of the Pearson correlation coefficient between the noise and the vector extracted by model E.
2. The gene expression profile data classification method based on stacked autoencoders and generative adversarial networks according to claim 1, characterized in that, Step 2 includes the following steps: Step 2.1: Stacked autoencoder sets up two hidden layers with the following numbers of neurons: , > An autoencoder is built for each hidden layer; Step 2.2: Build the first layer of the autoencoder, with input and output as follows: Dimensions, intermediate layer is Dimension, among which It is the dimension of the data input to the first-layer autoencoder; Step 2.3: Build the second-layer autoencoder, with input and output as follows: Dimensions, intermediate layer is dimension; Step 2.4: Randomly initialize the model parameters.
3. The gene expression profile data classification method based on stacked autoencoders and generative adversarial networks according to claim 1, characterized in that, Step 3 includes the following steps: Step 3.1: Train the first layer autoencoder by inputting samples into it; the sample size is [ , ], Minimum batch size; after The training iteration outputs the intermediate layer hidden vectors. ; Step 3.2: Train the second-layer autoencoder. The input layer and the intermediate layers of the first-layer autoencoder share weights, and the hidden vectors of the intermediate layers of the first-layer autoencoder are... As the input to the second-layer autoencoder, the input data size is [ , ];go through The training iteration outputs the intermediate layer hidden vectors. ; Step 3.3: Concatenate the intermediate layers of the first and second autoencoders to obtain the trained stacked autoencoder, and save the stacked autoencoder model using the save function in the torch library; Step 3.4: Use the `load` function from the `torch` library to read the stacked autoencoder model, input the gene expression profile matrix into the trained stacked autoencoder model, and output the latent vectors. .
4. The gene expression profile data classification method based on stacked autoencoders and generative adversarial networks according to claim 1, characterized in that, Step 4 includes the following steps: Step 4.1: Noise sampling. Using the Python language, import the torch library and use a normal distribution to randomly select values of size [ , Noise initialization, where the first parameter The second parameter is also the number of noise items. The dimension representing the input noise; Step 4.2: Combine the noise and one-hot encoding using the `cat` function of the `torch` library, where the label size is [...]. , ], The dimension of the class labels after OneHot encoding is used as the input to the generative model, and its size is []. , + ]; Step 4.3: Build the first fully connected neural network layer. Import the `Linear` function from the `torch.nn` package to construct the fully connected layer. The size of the input data is [...]. , + The size of the output data is [ , ],in It is the dimension of the data output from the first fully connected layer of the generating model; Step 4.4: Build the second fully connected neural network. Import the `Linear` function from the `torch.nn` package to construct the fully connected layer. The size of the input data is [...]. , The size of the output data is [ , ],in It is the dimension of the data output from the second fully connected layer of the generating model; Step 4.5: Build the third fully connected neural network layer. Import the `Linear` function from the `torch.nn` package to construct the fully connected layer. The size of the input data is [...]. , The size of the output data is [ , ],in It is the dimension of the final generated sample; Step 4.6: Randomly initialize the parameters of the generated model.
5. The gene expression profile data classification method based on stacked autoencoders and generative adversarial networks according to claim 1, characterized in that, Step 7 includes the following steps: Step 7.1: Optimize the loss. Use the RMSProp optimizer to optimize the loss of the generative and discriminative models. The learning rate is set to 0.0001, and the minimum optimization method is adopted. Step 7.2: Input noise and labels into the generative model; output the latent vectors from step 3.
4. As real samples for training, real and fake samples and labels are input into the discrimination model, and training is performed using a batch processing method, with each batch selecting... There are samples, and the number of training iterations is . In each iteration, the generator model is trained once, and the discriminator model is trained three times. Step 7.3: Use the save function in the torch library to save the generated model.
6. The gene expression profile data classification method based on stacked autoencoders and generative adversarial networks according to claim 1, characterized in that, Step 8 includes the following steps: Step 8.1: Use the load function in the torch library to read the trained generative model; Step 8.2: Concatenate the noise and labels and input them into the trained generative model, whose size is [G5, + ], where G5 is five times the largest sample size in all categories of the original gene expression profile data; Step 8.3: Generate model output samples.
7. The gene expression profile data classification method based on stacked autoencoders and generative adversarial networks according to claim 1, characterized in that, Step 9 includes the following steps: Step 9.1: Initialize the Random Forest (RF) classifier, the Extra Tree Classifier (ET), and the Lightweight Gradient Boosting (LGBM) algorithm; Step 9.2: Train the classifiers. Input the generated samples into each classifier. Train each classifier ten times and take the average of the final results.