Method for annotating cell types based on tumor single cell transcriptome sequencing data
By using the ResNet-34 deep learning model in tumor single-cell transcriptome sequencing data and combining it with transfer learning and model fine-tuning, the problem of low annotation accuracy was solved, and efficient and accurate annotation of tumor single-cell types was achieved, which improved annotation accuracy and reduced time costs.
Patent Information
- Application Number
- CN202510754359.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-06
- Publication Date
- 2025-09-19
AI Technical Summary
The annotation accuracy of tumor single-cell transcriptome sequencing data in existing technologies is low. Affected by high data noise, extremely high dimensionality and significant batch effects, the annotation accuracy is only 50-60%, and it cannot be effectively improved by adjusting model parameters to avoid overfitting.
The deep learning model ResNet-34 is used for training, and a combination of transfer learning and model fine-tuning is used. By freezing the parameters except the fully connected layer, the annotation model is trained using a public dataset, and the fully connected layer is fine-tuned on its own dataset to solve the data distribution offset problem.
The accuracy of single-cell annotation of tumors has been significantly improved by more than 15% compared to existing automatic annotation software, and annotation time has been saved.
Smart Images

Figure CN120673840A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of single-cell transcriptome sequencing, and in particular to a method for annotating cell types based on tumor single-cell transcriptome sequencing data. Background Art
[0002] Single-cell transcriptome sequencing (scRNA-seq) of tumors captures single-cell transcriptional abundance data in tumors and their microenvironment through high-throughput. It can deeply analyze the heterogeneity of tumor cells, the composition of the immune microenvironment, specific gene markers and functional differences, and provide important molecular map support for the study of tumor occurrence, development and treatment.
[0003] Existing technologies typically utilize public datasets and machine learning models to develop algorithms for automatic annotation of single-cell tumor types. However, in practical applications, due to the influence of sequencing technology, tumor tissue source, and processing pipeline, single-cell tumor data generally face the following challenges: high data noise, extremely high dimensionality, and significant batch effects, which lead to the emergence of a large number of low-expressed genes and increase the difficulty of data analysis. As a result, when technicians in this field use public datasets to train deep learning models and then transfer the models to their own datasets for automatic annotation, they often fail to obtain ideal annotation results, with the average annotation accuracy being only 50-60%, which is a low accuracy rate. Moreover, this problem cannot be effectively solved even by adjusting model parameters to avoid overfitting. Insufficient annotation accuracy limits further exploration of tumor heterogeneity characteristics and hinders the effectiveness of feature selection and subsequent analysis. Summary of the Invention
[0004] In order to solve the problem of low annotation accuracy of tumor single-cell transcriptome sequencing data in the prior art, the present invention provides a method for annotating cell types based on tumor single-cell transcriptome sequencing data.
[0005] The first object of the present invention is to provide a method for annotating cell types based on tumor single-cell transcriptome sequencing data.
[0006] The second object of the present invention is to provide application of the method in tumor single-cell transcriptome sequencing data analysis.
[0007] A third object of the present invention is to provide a computer device.
[0008] A fourth object of the present invention is to provide a computer-readable storage medium.
[0009] In order to achieve the above object, the present invention is implemented through the following scheme: The present invention discovered that the annotation accuracy of tumor single-cell transcriptome sequencing data is low due to the significant data distribution shifts that often exist between different datasets. By introducing a deep learning model as an algorithm for single-cell tumor classification, which is commonly used in the field of computer vision, the present invention constructs a set of methods for processing single-cell data, enabling it to serve as input for deep learning models. In addition, to address the data distribution shift issue, the present invention provides a new combined training method, namely transfer learning combined with model fine-tuning, to improve the annotation accuracy of the trained model on its own dataset.
[0010] A method for annotating cell types based on tumor single-cell transcriptome sequencing data, comprising the following steps: Using dataset 1 as input and the cell types of samples in dataset 1 as prediction targets, the annotation model is trained in combination with the ResNet model to obtain the annotation model; freezing all trainable parameters of the annotation model except the fully connected layer parameters, and then using the annotation model and dataset 2 for transfer learning to fine-tune the fully connected layer parameters; Dataset 1 is the single-cell transcriptome sequencing data of sample group 1; Dataset 2 is the tumor single-cell transcriptome sequencing data of sample group 2. There are no duplicate samples between sample groups 1 and 2. In the present invention, Dataset 1 is a public dataset, and Dataset 2 is a proprietary dataset.
[0011] Preferably, the number of samples in sample group 1 is not less than 400; the number of samples in sample group 2 is not less than 20; and the number of samples in sample group 1 is at least 4 times the number of samples in sample group 2.
[0012] More preferably, the number of samples in the sample group 1 is 20 to 60 times the number of samples in the sample group 2.
[0013] Preferably, the ResNet model is a ResNet-34 model.
[0014] Preferably, before training, the learning rate of the ResNet model is 0.001; before transfer learning, the learning rate of the annotation model is changed to 0.000001.
[0015] Preferably, before training, the formats of the data in the dataset 1 and the dataset 2 are adjusted to a format suitable for inputting the ResNet model.
[0016] More preferably, the adjusting to a format suitable for inputting a ResNet model comprises the following steps: adjusting the format of the data in the dataset 1 and the dataset 2 to a matrix format, and then expanding it to obtain a four-dimensional tensor format.
[0017] Further preferably, the adjustment to a format suitable for the input ResNet model includes the following steps: adjusting the format of the data in the dataset 1 and the dataset 2 to a matrix format, expanding it to obtain a three-dimensional tensor format, and then expanding it to obtain a four-dimensional tensor format.
[0018] Further preferably, the conversion into a format suitable for inputting the ResNet model includes the following steps: the data in the dataset 1 is converted into matrix A, and the data in the dataset 2 is converted into matrix B; the rows of matrix A and matrix B are all samples, the columns are all genes, and the elements are all gene expression levels; the elements of matrix A are obtained by analyzing the single-cell transcriptome sequencing data of the dataset 1; the elements of matrix B are obtained by analyzing the tumor single-cell transcriptome sequencing data of the dataset 2 combined with matrix A, wherein when the gene in matrix B is the same as that in matrix A but the expression level of the gene is missing, 0 is used as the expression level of the gene.
[0019] More preferably, dimension reduction is performed on the matrix A and the matrix B, and the dimension reduction method includes standardizing and logarithmically transforming the expression levels of the genes.
[0020] Specifically, the dimensionality reduction method includes the following steps: 1) For genes expressed in less than 10 samples, remove their corresponding columns in matrix A and matrix B to reduce the impact of low-expression genes; 2) Using the Scanpy tool based on Python, the total number of gene expression levels was normalized to scale the transcript counts of each cell to a uniform level, eliminating the quantitative deviation between samples and obtaining standardized expression levels; 3) Perform logarithmic transformation on the normalized expression levels to stabilize the variance and make the data tend to Gaussian distribution, reduce the bias of highly expressed genes, and obtain normalized expression levels; 4) Based on the normalized expression level, the variance is calculated. The top 1,000 genes with the greatest expression differences are retained based on the variance and recorded as signature genes. These 1,000 signature genes are subsequently used for cell annotation to focus on analyzing key variables that may affect the identification of single-cell tumor types.
[0021] After the input data enters the ResNet-34 model, it passes through the input layer, convolution layer, and pooling layer to reach the output layer. Each sample corresponds to a vector of length N, where N represents the number of cell types. The elements in the vector are the confidence levels of the various cell types corresponding to the sample. The cell type with the highest confidence level is extracted as the annotation result of the cell type of the sample and output.
[0022] Preferably, the output layer of the annotation model converts the confidence of the cell type corresponding to each sample into a probability, and outputs the cell type with the highest probability as the cell type corresponding to the sample.
[0023] More preferably, the output layer of the ResNet model is provided with a softmax function for converting the confidence of the cell type corresponding to each sample into a probability.
[0024] Further preferably, the formula of the softmax function is formula (1): ;in, x is the confidence level; e xi is the exponential value of the confidence of the i-th cell type, softmax(x) is the probability of the i-th cell type, softmax(x)∈[0,1], i∈[1,N], N is the total number of cell types.
[0025] Preferably, the learning rate scheduling strategy of the ResNet model is warm-up.
[0026] More preferably, the learning rate scheduling strategy of the ResNet model is nonlinear warm-up.
[0027] More preferably, the loss function of the ResNet model is a cross entropy loss function, which is used to measure the difference between the cell type output by the annotation model and the actual cell type of each sample.
[0028] Further preferably, the formula of the cross entropy loss function is formula (2): ;in, y i is the i-th true cell type of each sample; pi is the predicted probability, that is, the calculated value softmax(x) of formula (1), 0< p i ≤1, p i The sum is 1, p The larger the value, the more likely the model is to be the first i The greater the confidence in the cell type; for p i The logarithm of the value is negative; the minus sign “-” is used to ensure L is a positive value, L The larger the value, the greater the gap between the ResNet-34 model prediction and the actual cell type.
[0029] Further preferably, L2 regularization is used to optimize the cross entropy loss function.
[0030] More preferably, the cross entropy loss function after L2 regularization optimization is used. L becomes L l2 , the corresponding optimized formula is formula (3): ;in, L That is, in formula (2) L , is the data loss of the ResNet-34 model, the loss calculated by the cross entropy loss function; λ is the regularization parameter, which is used to control the strength of regularization; w is the weight vector, which is the parameter learned by the convolution kernel of the convolution layer, the weight of the fully connected layer, the bias term, etc. is the weight vector w of L The square of the 2-norm, expressed as the sum of the squares of the parameters in the weight vector.
[0031] Furthermore, preferably, during the training process, starting from the first epoch, the ResNet-34 model of the current epoch is recorded after each epoch. L l2 Value, and the ResNet-34 model of the current epoch L l2 Values and past epochs L l2 Compare the values and keep L l2 The model parameters of the ResNet-34 model with the smallest value (i.e., the weight vector in formula (3) w ) as the model parameters for subsequent transfer learning.
[0032] Furthermore, starting from the first epoch, the number of samples whose cell types output by the ResNet-34 model are consistent with the actual cell types (denoted as m) is recorded at each epoch, and the accuracy of that epoch is calculated (denoted as AC, AC = m / M, where M is the number of samples). To avoid overfitting, if the accuracy in the validation set decreases for 10 consecutive epochs, it is considered that overfitting has occurred. At this time, training is stopped and the ResNet-34 model of the current epoch is saved to obtain the annotation model.
[0033] Application of any of the above methods in analysis of tumor single-cell transcriptome sequencing data.
[0034] A computer device comprises a memory and a processor, wherein the memory stores a computer program executable on the processor; when the computer program is executed by the processor, the operation of any of the methods described above is implemented.
[0035] A computer-readable storage medium stores a computer program executable by a processor, wherein when the computer program is executed by the processor, the operation of any of the methods described above is implemented.
[0036] Compared with the prior art, the present invention has the following beneficial effects: This paper uses a combined learning technology of transfer learning and model fine-tuning to solve the problem of data distribution deviation in the annotation process of tumor single-cell transcriptome sequencing data, improve the accuracy of tumor single-cell type annotation, and increase the average annotation accuracy by more than 15% compared with the most advanced existing automatic annotation software, while saving annotation time. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A schematic flow chart of a method for annotating cell types based on tumor single-cell transcriptome sequencing data provided by the present invention.
[0038] Figure 2 Schematic diagram of the process of building the ResNet-34 model.
[0039] Figure 3 The accuracy of the training set and test set changes with epoch under different methods in Application Example 1; a is model training; b is transfer learning + model fine-tuning; c is without transfer learning and model fine-tuning.
[0040] Figure 4 The accuracy of the training set and test set changes with epoch under different methods in Application Example 2; a is model training; b is transfer learning + model fine-tuning; c is without transfer learning and model fine-tuning. DETAILED DESCRIPTION
[0041] The present invention is further described in detail below with reference to the accompanying drawings and specific examples. The examples are intended only to illustrate the present invention and are not intended to limit the scope of the present invention. The experimental methods used in the following examples are conventional methods unless otherwise specified; the materials and reagents used are commercially available unless otherwise specified.
[0042] Example 1 Based on the combined learning strategy of transfer learning and model fine-tuning, this paper provides a method for annotating cell types based on tumor single-cell transcriptome sequencing data to solve the problem of data distribution deviation in the annotation process. The process is as follows Figure 1 As shown, it mainly includes: data collection, data processing, model construction and training, transfer learning and model evaluation.
[0043] 1. Data Collection (1) Public datasets Single-cell transcriptome sequencing data of more than 400 samples were collected from the data disclosed in the existing technology. The data information included cell type, gene and gene expression level, and was recorded as a public dataset.
[0044] (2) Own dataset Single-cell transcriptome sequencing was performed on more than 20 tumor samples to obtain raw sequencing data. After quality control and format conversion, the Rdata file containing gene expression levels was obtained after processing by cellranger and Seurat as our own dataset.
[0045] 2. Data processing (1) Data preparation The single-cell transcriptome sequencing data of the public dataset is converted into a two-dimensional matrix, where each row of the matrix represents a sample, each column of the matrix represents a gene, and the elements are the gene expression levels, which is recorded as matrix A; the cell type corresponding to each sample is separated from the matrix A and saved as an independent vector matrix A.
[0046] According to the method of constructing matrix A, the data of the own dataset is also converted into a two-dimensional matrix to obtain matrix B and vector matrix B. The genes corresponding to the columns of matrix B and matrix A are the same. When the expression value of the corresponding gene in matrix B in matrix A is missing, it is filled with 0, that is, 0 is used as the expression value of the gene to avoid affecting the subsequent analysis due to the missing expression value of some genes.
[0047] (2) Data dimensionality reduction In order to reduce the data dimensions of the public dataset and the proprietary dataset, the following processing is performed on the matrix A and the matrix B: 1) For genes expressed in less than 10 samples, remove their corresponding columns in matrix A and matrix B to reduce the impact of low-expression genes; 2) Using the Scanpy tool based on Python, the total number of gene expression levels was normalized to scale the transcript counts of each cell to a uniform level, eliminating the quantitative deviation between samples and obtaining standardized expression levels; 3) Perform logarithmic transformation on the normalized expression levels to stabilize the variance and make the data tend to Gaussian distribution, reduce the bias of highly expressed genes, and obtain normalized expression levels; 4) Based on the normalized expression level, the variance is calculated. The top 1,000 genes with the greatest expression differences are retained based on the variance and recorded as signature genes. These 1,000 signature genes are subsequently used for cell annotation to focus on analyzing key variables that may affect the identification of single-cell tumor types.
[0048] (3) Data division The public dataset after data dimensionality reduction contains M samples and N cell types. The samples are divided into a training set (for model training) and a validation set (for verifying model fitting results) in a ratio of 8:2, and the ratio of each type of cell in the training set and validation set is ensured to be 8:2.
[0049] After dimensionality reduction, the original dataset, containing M' samples and N' cell types, was used as the test set (for testing the model training results). The test set was also divided into a fine-tuning training set (for transfer learning and fine-tuning the trained model) and a fine-tuning test set (for testing the results of model transfer learning and fine-tuning) in a 2:8 ratio, ensuring that each cell type was present in an 8:2 ratio in the fine-tuning training set and fine-tuning test set.
[0050] (4) Data conversion Convolutional neural network models like ResNet are generally used for image processing. The input data is in the shape of [sample number, channel, length, width]. Channel represents the number of channels in the image, and color images have three channels by default. To make the training, validation, and test data compatible with the ResNet model, the data must first be converted.
[0051] Before the transformation, the shape of the data is [sample number, 1000], which means each row is a sample and each column is a 1000 gene matrix. The eigenvalue of each sample is a 1×1000 vector.
[0052] For each sample, data transformation is performed as follows: 1) Convert the data into a 20×50 matrix, which is a three-dimensional tensor format with shape=[s,20,50], where "s" represents the sth sample. Each sample gets a 20×50 matrix, and each column in each matrix corresponds to the same gene. 2) Use the tensor.unsqueeze method to expand the dimension. In this case, it is a four-dimensional tensor format, that is, shape = s, 1, 20, 50]; 3) Use tensor.from to convert the data format to tensor format.
[0053] After the above steps, the data types of the training set, validation set, and test set are finally obtained as tensor([s,1,20,50]), which can be directly input into the ResNet model.
[0054] 3. Model construction and training (1) Model construction Use the Pytorch framework to build the ResNet-34 model. The process is as follows Figure 2 As shown in FIG, compared with the model structure of the ResNet-34 model for image processing, the present invention mainly modifies the structural setting of the model as follows: 1) The convolution mode used for image processing uses two-dimensional convolution by default: conv2d, and the present invention uses one-dimensional convolution: conv1d; 2) The convolution mode used for image processing uses a two-dimensional pooling layer by default: MaxPool2d. The present invention uses a one-dimensional pooling layer: MaxPool1d.
[0055] (2) Model training The training used an Nvidia-A4000 GPU. The ResNet-34 model was trained using the training set data as input, with the cell types corresponding to the samples as output. Prior to training, the hyperparameter settings for the ResNet-34 model were shown in "Model Training" in Table 1. The learning rate was adjusted using a nonlinear warm-up strategy. Initially, a small learning rate (approximately 0.000001) was used to improve model stability, and then gradually adjusted to the predetermined value (0.001).
[0056] Table 1 Model hyperparameter settings
[0057] After the input data enters the ResNet-34 model, it passes through the input layer, convolution layer, and pooling layer to reach the output layer. Each sample corresponds to a vector of length N, where N represents the number of cell types. The elements in the vector are the confidence levels of the various cell types corresponding to the sample. The cell type with the highest confidence level is extracted as the annotation result of the cell type of the sample and output.
[0058] To better interpret the cell type annotation results, the present invention converts the vector from a confidence distribution to a probability distribution, extracts the cell type with the highest probability as the final cell type corresponding to the sample, and outputs it. The specific method is as follows: First, the confidence of each sample (denoted as x ) is converted to exponential form to obtain e xi , the output layer of the ResNet-34 model is equipped with a softmax function as shown in formula (1), and the probability that the sample corresponds to N cell types is calculated. i The probability of a cell type is denoted as e xi (e xi ∈[0,1]), the sum of the probabilities of N cell types is 100%.
[0059] Formula (1): ; in,x is the confidence level; e xi is the exponential value of the confidence of the i-th cell type, softmax(x) is the probability of the i-th cell type, softmax(x)∈[0,1], i∈[1,N], N is the total number of cell types.
[0060] The output layer of the ResNet-34 model also has a cross-entropy loss function (Cross-Entropy Loss) as shown in formula (2), which is used to measure the difference between the cell type output by the ResNet-34 model and its actual cell type for each sample.
[0061] Formula (2): ; in, y i is the i-th true cell type of each sample; pi is the predicted probability, that is, the calculated value softmax(x) of formula (1), 0< p i ≤1, p i The sum is 1, p The larger the value, the more likely the model is to be the first i The greater the confidence in the cell type; for p i The logarithm of the value is negative; the minus sign “-” is used to ensure L is a positive value, L The larger the value, the greater the gap between the ResNet-34 model prediction and the actual cell type.
[0062] In order to avoid overfitting that may lead to poor robustness of the trained ResNet-34 model, the cross entropy loss function is optimized using L2 regularization, and the optimized cross entropy loss function is obtained as formula (3).
[0063] Formula (3): ; in, L That is, in formula (2) L , is the data loss of the ResNet-34 model, the loss calculated by the cross entropy loss function; λ is the regularization parameter, which is used to control the strength of regularization; w is the weight vector, which is the parameter learned by the convolution kernel of the convolution layer, the weight of the fully connected layer, the bias term, etc. is the weight vector w of L The square of the 2-norm, expressed as the sum of the squares of the parameters in the weight vector.
[0064] The cross entropy loss function adds an L2 norm penalty term, which is the square root of the sum of the squares of all parameters. This will greatly reduce the value of each element in the parameter vector, while taking into account data loss and regularization terms. This will reduce the model generalization error while maintaining the ability to fit the training data, that is, to prevent the model from overfitting the training data, minimize the size of the model parameters, reduce the model complexity, and thus improve the generalization ability of the model.
[0065] During training, starting from the first epoch, the number of samples whose cell types output by the ResNet-34 model matched the actual cell types (denoted as m) is recorded at each epoch, and the accuracy of that epoch is calculated (denoted as AC, where AC = m / M). To avoid overfitting, if the accuracy of the validation set decreases for 10 consecutive epochs, it is considered overfitting. At this time, training is stopped and the ResNet-34 model of the current epoch is saved to obtain the annotation model.
[0066] In addition, during the training process, starting from the first epoch, the ResNet-34 model of the current epoch is recorded after each epoch. L l2 The value is obtained by formula (3), and the ResNet-34 model of the current epoch is L l2 Values and past epochs L l2 Compare the values and keep L l2 The model parameters of the ResNet-34 model with the smallest value (i.e., the weight vector in formula (3) w ) as the model parameters for subsequent transfer learning.
[0067] 4. Transfer learning and model fine-tuning (1) Parameter freezing For the annotation model obtained in the previous step, set the weight freeze setting, that is, freeze all trainable parameters except the fully connected layer parameters, and set the learning rate in the hyperparameters to 0.000001, as shown in "Model Fine-tuning" in Table 1. This ensures that the annotation model is only fine-tuned in the future and is not overtrained.
[0068] (2) Model fine-tuning The fine-tuned training set is input into the annotation model with frozen parameters for training, and the cell type annotation results of each sample are output. The accuracy of the annotation model is tested using the fine-tuned test set.
[0069] Application Example 1 1. Data Collection (1) Public datasets According to the method of Example 1, human single-cell transcriptome sequencing data was collected from the data disclosed in the prior art "scDeepSort: a pre-trained cell-type annotation method for single-cell transcriptomics using deep learning with aweighted graph neural network" (DOI: 10.1093 / nar / gkab775) to obtain a public dataset.
[0070] (2) Own dataset According to the method of Example 1, human tumor single-cell transcriptome sequencing data were collected from the original database obtained by Jiangxi Hypros Medical Testing Laboratory Co., Ltd. from single-cell transcriptome sequencing of human tumor samples to obtain a proprietary dataset.
[0071] The information on the number of samples, genes, cell types, and tissue types contained in the above public datasets and proprietary datasets is shown in Table 2.
[0072] Table 2 Information of human tumor single-cell transcriptome sequencing data
[0073] 2. Data processing The data of this application example is processed according to the method of Example 1, and the results of data division are shown in Table 3.
[0074] Table 3 Data partition results
[0075] 3. Model construction and training (1) Model construction The ResNet-34 model was constructed according to the method in Example 1.
[0076] (2) Model training According to the method of Example 1, the ResNet-34 model constructed by training the training set of this application example is trained, and the training results of the model are tested using the test set to observe how the accuracy of the test set changes with epoch.
[0077] like Figure 3As shown in a and Table 4, in the first 20 epochs, the model fits both the training and test datasets well, achieving an annotation accuracy of approximately 62% in the test set. After 20 epochs, the model begins to overfit the training set. However, since the model has already avoided overfitting by adding L2 regularization and momentum parameters, the decline in model performance is not due to overfitting. After 70 epochs, the accuracy of the model in the training set continues to rise, while the accuracy in the test set gradually stabilizes, showing no further overfitting of the training set. This indicates that the distribution of public datasets collected from existing technologies is inconsistent with that of the proprietary data to be annotated, with significant heterogeneity and the presence of data distribution shift.
[0078] The ResNet-34 model with the highest accuracy on the test set (at the 24th epoch) is used as the annotation model, and the weight parameters of the model at this time are saved for subsequent transfer learning and model fine-tuning.
[0079] 4. Transfer learning and model fine-tuning According to the method of Example 1, transfer learning and model fine-tuning are performed using the test set of this application example.
[0080] like Figure 3 As shown in Figure 2b and Table 4, we can see that with prior knowledge, even though all parameters except the fully connected layer are frozen, the model can quickly find the optimization direction and gradually stabilizes after 80 epochs of training, indicating that the model has been fully fitted. This shows that the transfer learning method provided by the present invention can successfully solve the problem of data distribution shift. Only fine-tuning the model parameters of the last fully connected layer is required to successfully fit the annotation model trained on the public dataset to the proprietary dataset, significantly improving annotation accuracy.
[0081] In order to compare the effectiveness of transfer learning + fine-tuning, we use the fine-tuned model dataset in Table 3 of this application example and directly train the model without loading the transfer learning model parameters (i.e., compare the fine-tuned model). The results are as follows: Figure 3 As shown in c and Table 4, even after 100 epochs of training, the accuracy of the model without transfer learning parameters is only 1.6%. This further proves that using transfer learning plus model fine-tuning is effective in addressing the data distribution shift problem in tumor single-cell annotation.
[0082] Table 4 Training results of human tumor single-cell transcriptome sequencing data (final model stability results)
[0083] 5. Cross-validation To comprehensively evaluate the stability of the model obtained through transfer learning and fine-tuning, we performed five 50-fold cross-validation runs using the application's own dataset. This involves evenly dividing all data into five parts, randomly selecting four of these parts as validation sets each time to verify the accuracy of the model fine-tuning. This was repeated five times to ensure that all data underwent cross-validation. The accuracy of each cross-validation run was recorded, as shown in Table 5. The mean and standard deviation were calculated based on these results, resulting in an average accuracy of 71.29 ± 2.33% across the five cross-validations.
[0084] Table 5 Cross-validation results of human tumor single-cell transcriptome sequencing data
[0085] 6. Comparison with existing automatic annotation methods Method provided by the invention is compared with existing automatic annotation method, equally with the own data set of this application example as test set, result is as shown in Table 6, it can be seen that in the existing automatic annotation model, the automatic annotation method with the best annotation performance is Celltypist, and the average annotation accuracy of each model reaches 69.50%, and variance is only 1.29%, which shows that this method is also more stable when annotation accuracy is higher.Yet the method that contrasts the present invention proposes still has about 2% backwardness.The accuracy of other automatic annotation methods is lower, and variance is larger, shows that annotation accuracy is poor and unstable.
[0086] Table 6 Accuracy of existing automatic annotation methods for annotating human tumor single-cell transcriptome sequencing data
[0087] Application Example 2 1. Data Collection (1) Public datasets According to the method of Example 1, single-cell transcriptome sequencing data of mice were collected from the data disclosed in the prior art "scDeepSort: a pre-trained cell-type annotation method for single-cell transcriptomics using deep learning with aweighted graph neural network" (DOI: 10.1093 / nar / gkab775) to obtain a public dataset.
[0088] (2) Own dataset According to the method of Example 1, the single-cell transcriptome sequencing data of mouse tumors were collected from the original database obtained by Jiangxi Hypros Medical Testing Laboratory Co., Ltd. through single-cell transcriptome sequencing of human tumor samples to obtain a proprietary dataset.
[0089] The information on the number of samples, genes, cell types, and tissue types contained in the above public datasets and proprietary datasets is shown in Table 7.
[0090] Table 7 Information of mouse tumor single-cell transcriptome sequencing data
[0091] 2. Data processing The data of this application example is processed according to the method of Example 1, and the results of data division are shown in Table 8.
[0092] Table 8 Data partition results
[0093] 3. Model construction and training (1) Model construction The ResNet-34 model was constructed according to the method in Example 1.
[0094] (2) Model training According to the method of Example 1, the ResNet-34 model constructed by training the training set of this application example is trained, and the training results of the model are tested using the test set to observe how the accuracy of the test set changes with epoch.
[0095] like Figure 4 As shown in a and Table 9, it can be seen that in the first 20 epochs, the loss on the test set has almost no change, but the accuracy on the training set is getting higher and higher, which shows that although the model can fit the public dataset well at this time, it fits the proprietary dataset very poorly; after 40 epochs, the accuracy reaches 14.12%; however, as the epochs increase, the accuracy of the test set gradually stabilizes and slowly decreases, indicating that the annotation model is overfitting on the training set at this time. It also shows that there is a large heterogeneity between the public dataset and the proprietary dataset, and there is a data distribution shift.
[0096] The ResNet-34 model with the highest accuracy on the test set (at the 40th epoch) is used as the annotation model, and the weight parameters of the model at this time are saved for subsequent transfer learning and model fine-tuning.
[0097] 4. Transfer learning and model fine-tuning According to the method of Example 1, transfer learning and model fine-tuning are performed using the test set of this application example.
[0098] like Figure 4 As shown in b and Table 9, similar to the situation in Application Example 1, the model can quickly find the optimization direction and gradually stabilizes after 80 epochs of training, indicating that the model has been fully fitted. This also shows that the transfer learning method provided by the present invention can successfully solve the problem of data distribution offset. Only the model parameters of the annotation model trained with the public dataset need to be fine-tuned to successfully fit the proprietary dataset, significantly improving the annotation accuracy.
[0099] In order to compare the effectiveness of transfer learning + fine-tuning, we use the model fine-tuning dataset in Table 8 of this application example and directly train the model without loading the model parameters of transfer learning (i.e., compare the fine-tuning model). The results are as follows: Figure 4 As shown in c and Table 9, we can see that even after training for 100 epochs, its accuracy is only 4%.
[0100] Table 9 Training results of mouse tumor single-cell transcriptome sequencing data (final model stability results)
[0101] 5. Cross-validation The same cross-validation method as in Application Example 1 was used to perform cross-validation, and the accuracy of each cross-validation was recorded. The results are shown in Table 10. Based on this, the mean and standard deviation were calculated, and the average accuracy of the five cross-validations was 66.65±0.43% for mouse data.
[0102] Table 10 Cross-validation results of mouse tumor single-cell transcriptome sequencing data
[0103] 6. Comparison with existing automatic annotation models The method provided by the present invention was compared with existing automatic annotation models, using the data set of this application example as the test set. The results are shown in Table 11. The average accuracy of SingleR was 22.7%, with a standard deviation of 8.3%. The average annotation accuracy of Celltypist was 39.67%. Although the accuracy of some models of Celltypist was higher than that of the method of the present invention, the standard deviation was 23.55%, indicating that the automatic annotation method was unstable. Table 11 Accuracy of existing automatic annotation methods for annotating mouse tumor single-cell transcriptome sequencing data
[0104] Note: CelliD v1.14.0, scCATCH v3.2.2, Garnett v0.1.23, Azimuth v0.5.0, scMayoMap v0.2.0, and scType do not have mouse databases and therefore were not compared.
[0105] Finally, it should be noted that the above embodiments are intended only to illustrate the technical solutions of the present invention and are not intended to limit the scope of protection of the present invention. Those skilled in the art will readily appreciate that other variations or modifications may be made based on the above descriptions and concepts. It is not necessary and impossible to provide an exhaustive list of all possible implementations. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the claims of the present invention.
Claims
1. A method for annotating cell types based on tumor single-cell transcriptome sequencing data, characterized in that: The following steps are involved: Using dataset 1 as input and the cell types of samples in dataset 1 as prediction targets, the annotation model is trained in combination with the ResNet model to obtain the annotation model; freezing all trainable parameters of the annotation model except the fully connected layer parameters, and then using the annotation model and dataset 2 for transfer learning to fine-tune the fully connected layer parameters; The dataset 1 is the single-cell transcriptome sequencing data of sample group 1; The dataset 2 is the tumor single-cell transcriptome sequencing data of sample group 2; there are no repeated samples between the sample group 1 and the sample group 2.
2. The method according to claim 1, characterized in that The output layer of the annotation model converts the confidence of the cell type corresponding to each sample into a probability, and outputs the cell type with the highest probability as the cell type corresponding to the sample.
3. The method according to claim 2, characterized in that The loss function of the ResNet model is the cross entropy loss function.
4. The method according to claim 3, characterized in that The cross entropy loss function is optimized using L2 regularization.
5. The method according to claim 1, wherein Before training, the formats of the data in the dataset 1 and the dataset 2 are adjusted to a format suitable for inputting the ResNet model.
6. The method according to claim 5, characterized in that The adjustment to the format adapted to the input ResNet model includes the following steps: The formats of the data in the dataset 1 and the dataset 2 are adjusted to a matrix format, and then expanded to obtain a four-dimensional tensor format.
7. The method according to claim 1, characterized in that The ResNet model is a ResNet-34 model.
8. Use of the method according to any one of claims 1 to 7 in analysis of tumor single-cell transcriptome sequencing data.
9. A computer device comprising a memory and a processor, characterized in that: The memory stores a computer program executable on the processor; when the computer program is executed by the processor, the operation of the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program executable by a processor, characterized in that: When the computer program is executed by a processor, the operation of the method according to any one of claims 1 to 7 is implemented.