Training methods for single-cell annotation graph attention models, single-cell annotation methods
By constructing a single-cell annotation graph attention model, using hybrid graph and graph attention layer feature learning, and combining cell state auxiliary models and active learning, the limitations of existing single-cell annotation methods in accuracy and applicability are addressed, and high-precision classification and robust annotation of complex cell types are achieved.
Patent Information
- Application Number
- CN202411879204.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2044-12-19
AI Technical Summary
Existing single-cell annotation methods have limitations in accuracy and applicability, especially when faced with new or rare cell types, which are difficult to accurately classify. They also have limited performance on complex cell types, are sensitive to data performance from different platforms or batches, and are easily affected by batch effects.
A single-cell annotation graph attention model is constructed. Through hybrid graph construction, graph attention layer feature learning, cell state auxiliary model fusion and active learning, the degree of attention to neighbor node features is dynamically adjusted, and the samples with the largest amount of information are selected for training until the preset termination iteration conditions are met.
It improves the accuracy and robustness of single-cell annotation, enhances the understanding of the relationship between single cells and the transmission of label information, reduces the dependence on large-scale labeled data, and improves the classification accuracy and generalization ability of cell types.
Smart Images

Figure CN119864086B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a training method for a single-cell annotation graph attention model and a single-cell annotation method. Background Art
[0002] In life science research, single-cell annotation methods are crucial for understanding the diversity and heterogeneity of cells within organisms. Different cell types often have specific gene expression patterns, and accurate identification of these patterns can provide insights into cellular functions and their role in biological processes. In addition, this technology can also be applied to disease research. Accurate single-cell annotation not only helps locate specific abnormal cell types, but also provides an important basis for the diagnosis and treatment of diseases. With the rapid development of single-cell sequencing technology, the amount of data has surged, and reliable single-cell annotation methods have become the key to effectively mining this data.
[0003] Existing single-cell annotation methods mainly include marker gene-based methods, correlation analysis-based methods, and machine learning-based methods, but these methods have many limitations in accuracy and applicability.
[0004] (1) Marker gene-based methods are highly dependent on prior knowledge and usually require existing marker gene information for accurate classification. Therefore, they are difficult to use when facing new or rare cell types. In addition, such methods are highly dependent on clustering analysis. The choice of clustering parameters (such as the number of clusters) directly affects the classification results. If the parameters are not selected properly, it is easy to cause classification bias and affect the annotation quality.
[0005] (2) Correlation analysis methods typically only consider linear relationships when calculating cell similarity, ignoring high-order topological relationships between cells, which limits their performance in complex cell types. At the same time, such methods are sensitive to data performance from different platforms or batches and are easily affected by batch effects, resulting in unstable classification results.
[0006] (3) Traditional machine learning methods have high requirements for large-scale labeled data and perform poorly when labeled data is insufficient. They often focus only on gene expression characteristics and ignore the dynamic state information of cells, which limits accuracy and generalization ability when dealing with cell types with complex states.
[0007] The content of the background technology section is merely information known to the inventor personally, and does not mean that the above information has entered the public domain before the application date of this disclosure, nor does it mean that it can become the prior art of the present disclosure. Summary of the Invention
[0008] The present disclosure provides a training method for a single-cell annotation graph attention model and a single-cell annotation method to solve at least one of the above-mentioned technical problems.
[0009] In a first aspect, the present disclosure provides a method for training a single-cell annotation graph attention model, comprising:
[0010] Obtaining a training set including training samples and a test set including test samples, wherein the training samples and the test samples respectively include single-cell gene expression data;
[0011] Constructing a mixed graph including training samples and test samples, wherein the mixed graph includes nodes and edges, each node represents a sample feature of gene expression data of a single cell, and an edge connecting two nodes represents the similarity or correlation between the two nodes;
[0012] Passing the hybrid graph through a graph attention layer for feature learning to generate node embedding features;
[0013] Based on a pre-trained cell state auxiliary model, the obtained cell state data is processed to obtain intermediate embedded features, wherein the intermediate embedded features are used to characterize the cell functional state;
[0014] fusing the node embedding feature and the intermediate embedding feature based on the cell state auxiliary model to obtain a fused feature;
[0015] According to the mixed graph, the intermediate embedded features, and the fused features, the sample with the largest amount of information is selected, and the sample with the largest amount of information is used as a new training sample for the next round of training until a preset termination iteration condition is met, thereby obtaining a single-cell annotation graph attention model.
[0016] In some embodiments, constructing a mixed graph including training samples and test samples includes:
[0017] The training samples and the test samples are processed by mutual nearest neighbor algorithm and canonical correlation analysis to obtain the mixed graph containing the training samples and the test samples.
[0018] In some embodiments, the method further comprises:
[0019] The feature vectors after position encoding and linear mapping of each node in the hybrid graph are added to obtain a new feature representation of each node.
[0020] In some embodiments, the number of the graph attention layers is four, the output of the previous graph attention layer is the input of the next graph attention layer, and the input of the first graph attention layer is the mixed graph;
[0021] Among them, each graph attention layer is used to calculate the attention weights between nodes in the mixed graph, so that the single-cell annotation graph attention model captures the local and global relationships between nodes in the mixed graph.
[0022] In some embodiments, selecting the sample with the largest amount of information based on the mixed graph, the intermediate embedded features, and the fused features includes:
[0023] determining information density based on the intermediate embedded features;
[0024] determining a centrality based on the mixed graph;
[0025] Determining a prediction result based on the fusion feature, and determining information entropy based on the prediction result;
[0026] The sample with the largest amount of information is determined according to the information density, the centrality, and the information entropy.
[0027] In some embodiments, the preset termination condition includes one of: the number of training times reaches a preset training times threshold, the number of training samples reaches a preset number threshold, and the change in the prediction performance of the single-cell annotation graph attention model is less than a preset change threshold;
[0028] Among them, the preset quantity threshold is determined based on a pre-constructed training bucket, and the preset quantity threshold is the maximum number of samples stored in the training bucket; the prediction performance change is determined based on the difference in changes in the information density and the information entropy.
[0029] In a second aspect, the present disclosure provides a single-cell annotation method, comprising:
[0030] Obtain single-cell gene expression data to be annotated;
[0031] The single-cell gene expression data is input into a single-cell annotation graph attention model, and an annotation result is output, wherein the single-cell annotation graph attention model is trained based on the training method described in the first aspect.
[0032] In a third aspect, the present disclosure provides a training system for a single-cell annotation graph attention model, comprising:
[0033] a hybrid graph construction unit, configured to obtain a training set including training samples and a test set including test samples, wherein the training samples and the test samples respectively include single-cell gene expression data, and construct a hybrid graph including the training samples and the test samples, wherein the hybrid graph includes nodes and edges, each node represents a sample feature of the gene expression data of a single cell, and an edge connecting two nodes represents a similarity or correlation between the two nodes;
[0034] A graph attention mechanism unit, configured to perform feature learning on the hybrid graph through a graph attention layer to generate node embedding features;
[0035] A cell state information unit is used to process the obtained cell state data based on a pre-trained cell state auxiliary model to obtain intermediate embedded features, wherein the intermediate embedded features are used to characterize the cell functional state, and to fuse the node embedded features with the intermediate embedded features to obtain a fused feature;
[0036] An active learning unit is used to select the sample with the largest amount of information based on the mixed graph, the intermediate embedded features, and the fused features, and use the sample with the largest amount of information as a new training sample for the next round of training until a preset termination iteration condition is met, thereby obtaining a single-cell annotation graph attention model.
[0037] In some embodiments, the mixed graph construction unit is specifically configured to perform mutual nearest neighbor algorithm and canonical correlation analysis on the training samples and the test samples to obtain the mixed graph including the training samples and the test samples.
[0038] In some embodiments, the hybrid graph construction unit is further configured to perform position encoding and linear mapping on each node in the hybrid graph and add the feature vectors to obtain a new feature representation of each node.
[0039] In some embodiments, the number of the graph attention layers is four, the output of the previous graph attention layer is the input of the next graph attention layer, and the input of the first graph attention layer is the mixed graph;
[0040] Among them, each graph attention layer is used to calculate the attention weights between nodes in the mixed graph, so that the single-cell annotation graph attention model captures the local and global relationships between nodes in the mixed graph.
[0041] In some embodiments, the active learning unit is specifically used to determine the information density based on the intermediate embedded features; determine the centrality based on the mixed graph; determine the prediction result based on the fusion feature, and determine the information entropy based on the prediction result; determine the sample with the largest amount of information based on the information density, the centrality, and the information entropy.
[0042] In some embodiments, the preset termination condition for iteration includes: the number of training times reaches a preset training times threshold, the number of training samples reaches a preset number threshold, and the change in the prediction performance of the single-cell annotation graph attention model is less than a preset change threshold;
[0043] Among them, the preset quantity threshold is determined based on a pre-constructed training bucket, and the preset quantity threshold is the maximum number of samples stored in the training bucket; the prediction performance change is determined based on the difference in changes in the information density and the information entropy.
[0044] In a fourth aspect, the present disclosure provides a single-cell annotation system, comprising:
[0045] An acquisition unit, used to obtain single-cell gene expression data to be annotated;
[0046] An annotation unit is used to input the single-cell gene expression data into a single-cell annotation graph attention model and output an annotation result, wherein the single-cell annotation graph attention model is trained based on the training method described in the first aspect.
[0047] In a fifth aspect, the present disclosure provides a processor-readable storage medium, wherein the processor-readable storage medium stores a computer program, and the computer program is used to enable the processor to execute the method described in the first aspect or the second aspect above.
[0048] In a sixth aspect, the present disclosure provides a computer program product, comprising a computer program, which, when executed by a processor, implements the method described in the first or second aspect above.
[0049] The present disclosure provides a training method for a single-cell annotation graph attention model and a single-cell annotation method, wherein the training method includes: obtaining a training set including training samples and a test set including test samples, wherein the training samples and the test samples respectively include single-cell gene expression data, constructing a mixed graph including the training samples and the test samples, wherein the mixed graph includes nodes and edges, each node represents a sample feature of the gene expression data of a single cell, and the edge connecting two nodes represents the similarity or correlation between the two nodes, performing feature learning on the mixed graph through a graph attention layer to generate node embedding features, processing the obtained cell state data based on a pre-trained cell state auxiliary model to obtain intermediate embedding features, wherein the intermediate embedding features are used to characterize the functional state of the cell, fusing the node embedding features and the intermediate embedding features to obtain fused features, selecting the sample with the largest amount of information based on the mixed graph, the intermediate embedding features, and the fused features, and using the sample with the largest amount of information as the new training sample for the next round of training until the preset termination iteration condition is met, thereby obtaining a single-cell annotation graph attention model. In this embodiment, by constructing a hybrid graph, the single-cell annotation graph attention model's understanding of the relationship between single cells and the transmission of label information are enhanced; by introducing the graph attention layer, the degree of attention to the features of neighboring nodes can be dynamically adjusted, so that the single-cell annotation graph attention model can more effectively capture important features and improve the classification accuracy of cell types; by integrating cell state data and utilizing the intermediate embedded features of the cell state auxiliary model to enhance the features of the single-cell annotation graph attention model, the accuracy and robustness of cell type prediction are further improved; by selecting nodes with large amounts of information for training, the problem of insufficient sample labels is solved, and the annotation accuracy of the single-cell annotation graph attention model is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0051] Figure 1 A schematic diagram of a process for training a single-cell annotation graph attention model according to an embodiment of the present disclosure;
[0052] Figure 2 A schematic diagram illustrating the principle of a training method for a single-cell annotation graph attention model provided in an embodiment of the present disclosure;
[0053] Figure 3 A schematic diagram of the process of the single-cell annotation method provided in an embodiment of the present disclosure;
[0054] Figure 4 A schematic diagram of the structure of a training system for a single-cell annotation graph attention model provided in an embodiment of the present disclosure;
[0055] Figure 5 A schematic diagram of the structure of the single-cell annotation system provided in an embodiment of the present disclosure;
[0056] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure.
[0057] The above drawings illustrate specific embodiments of the present disclosure, which will be described in more detail below. These drawings and textual descriptions are not intended to limit the scope of the present disclosure in any way, but rather to illustrate the concepts of the present disclosure to those skilled in the art by reference to specific embodiments. DETAILED DESCRIPTION
[0058] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
[0059] It should be understood that the terms "including" and "having" and any variations thereof in the embodiments of the present disclosure are intended to cover but not exclude inclusion. For example, a product or device that includes a series of components is not necessarily limited to those components explicitly listed, but may include other components not explicitly listed or inherent to these products or devices.
[0060] In the embodiments of the present disclosure, the term "and / or" describes the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent three situations: A exists alone, A and B exist simultaneously, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0061] In the embodiments of the present disclosure, the term "plurality" refers to two or more than two, and other quantifiers are similar thereto.
[0062] The terms "first," "second," "third," and the like in this disclosure are used to distinguish between similar or similar objects or entities and are not necessarily intended to limit a particular order or precedence, unless otherwise indicated. It should be understood that the terms used in this manner are interchangeable where appropriate, e.g., capable of being implemented in an order other than that given in the illustrations or descriptions of the embodiments of this disclosure.
[0063] The term "unit / module" as used in this disclosure refers to any known or later developed hardware, software, firmware, artificial intelligence, fuzzy logic or combination of hardware and / or software code that is capable of performing the functions associated with that element.
[0064] The following will be combined with the accompanying drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the embodiments described are only part of the embodiments of the present disclosure and not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0065] According to one aspect of the present disclosure, an embodiment of the present disclosure provides a method for training a single-cell annotation graph attention model.
[0066] See also Figure 1 , Figure 1 Schematic diagram of the training method of the single cell annotation graph attention model provided in the embodiment of the present disclosure. Figure 1 As shown, the method includes:
[0067] S101: Obtain a training set including training samples and a test set including test samples, wherein the training samples and the test samples respectively include single-cell gene expression data.
[0068] For example, the training method for the single-cell annotation graph attention model provided in this embodiment (hereinafter referred to as the training method) may be executed by a training system for the single-cell annotation graph attention model (hereinafter referred to as the training system). The training system may be a server, an electronic device, or a chip, etc., which are not listed here. The training system is described elsewhere in this specification.
[0069] This embodiment does not limit the method by which the training system obtains the training set and the test set. For example, taking the training set as an example, the training system can be implemented using the following example:
[0070] In one example, the training system can be connected to the collection device and receive the training set sent by the collection device.
[0071] In another example, the training system may provide a data loading tool, and the user may transfer the training set to the training system through the data loading tool.
[0072] Among them, the tool for loading data can be an interface for connecting to an external device, such as an interface for connecting to other storage devices, through which the training set transmitted by the external device is obtained; the tool for loading data can also be a display device, such as the training system can input an interface for the loading data function on the display device, and the user can import the training set into the training system through this interface.
[0073] It is worth noting that, in this embodiment, the training system obtains the training set and the test set separately, and also performs training together with the training set and the test set.
[0074] The training set includes training samples. The number of training samples is usually multiple, which is not limited in this embodiment and can be determined based on needs, historical records, experiments, etc. A training sample can be the gene expression data of a single cell (i.e., single cell-based expression data).
[0075] Similarly, the test set includes test samples. The number of test samples is usually multiple, which is not limited in this embodiment and can be determined based on needs, historical records, experiments, etc. A test sample can be the gene expression data of a single cell (i.e., single cell-based expression data).
[0076] S102: Construct a mixed graph including training samples and test samples, wherein the mixed graph includes nodes and edges, each node represents a sample feature of gene expression data of a single cell, and an edge connecting two nodes represents the similarity or correlation between the two nodes.
[0077] For example, a hybrid graph may also be referred to as graph data (structure) or hybrid graph data (structure). A hybrid graph mainly includes nodes and edges.
[0078] For example, Figure 2 As shown in Figure 1, the training system divides the training set and test set into a grid and converts them into a matrix form. The training system constructs a hybrid graph consisting of multiple nodes and multiple edges.
[0079] A node represents a sample. For example, a node represents a single cell corresponding to a training sample, or a node represents a single cell corresponding to a test sample. A node also has a corresponding sample feature, which represents the single-cell gene expression data of the corresponding sample.
[0080] An edge connects two nodes and is used to represent the similarity or correlation between the two nodes it connects. In other words, the edge is used to represent the association relationship between the two samples it connects.
[0081] In this embodiment, by constructing a hybrid graph, the single-cell annotation graph attention model can enhance the understanding of the relationship between single cells and the transmission effect of label information.
[0082] In some embodiments, S102 may include performing Mutual Nearest Neighbors (MMN) and Canonical Correlation Analysis (CCA) processing on the training samples and the test samples to obtain a mixed graph including the training samples and the test samples.
[0083] Exemplarily, the training system determines the mutual nearest neighbors between training samples and test samples through a mutual nearest neighbor algorithm to construct their relationship; at the same time, it uses canonical correlation analysis to project the training samples and test samples into the same low-dimensional space, reducing batch effects between different data sources, so that cells with biological relevance can be closely connected in the mixed graph.
[0084] In some embodiments, after S102 , the training method may further include: performing position encoding and linear mapping on each node in the hybrid graph, and adding the feature vectors to obtain a new feature representation of each node.
[0085] Based on the above analysis, the hybrid graph includes multiple nodes, one node represents a single cell corresponding to a training sample, or one node represents a single cell corresponding to a test sample, and one node has corresponding sample features.
[0086] Accordingly, in this step, Figure 2 As shown, the training system can add the feature vectors after the position encoding and linear mapping of each node to obtain a new feature representation of each node, thereby obtaining a processed hybrid graph.
[0087] For example, the training system can generate positional encodings for nodes based on Laplace positional encoding, increasing the node's positional information and improving the model's expressiveness. Furthermore, the training system can project each node's new feature representation onto a space of the same dimension based on a linear mapping, eliminating batch effects between different data sources and ensuring data consistency.
[0088] S103: The hybrid graph is passed through the Graph Attention Layers for feature learning to generate node embedding features.
[0089] The graph attention layer may be a multi-head graph attention layer. Exemplarily, the training system performs feature learning on the mixed graph based on the multi-head graph attention layer to obtain an embedded representation of each cell node (i.e., a node embedding feature).
[0090] In this embodiment, the graph attention layer allows the training system to assign different weights to each node and its neighborhood based on the self-attention mechanism, capturing subtle relationships between different single cells and improving annotation accuracy. In other words, by introducing the graph attention layer, the degree of attention paid to neighboring node features can be dynamically adjusted, allowing the single-cell annotation graph attention model to more effectively capture important features and improve cell type classification accuracy.
[0091] In some embodiments, the number of graph attention layers is four, the output of the previous graph attention layer is the input of the next graph attention layer, and the input of the first graph attention layer is a mixed graph.
[0092] Among them, each graph attention layer is used to calculate the attention weights between nodes in the mixed graph, so that the single-cell annotation graph attention model can capture the local and global relationships between nodes in the mixed graph.
[0093] Continue reading Figure 2 The nodes in the processed hybrid graph are passed through four layers of graph attention for feature learning. Each layer of graph attention calculates the attention weights between nodes, enabling the model to more accurately capture the local and global relationships between nodes and generate node embedding features for subsequent single-cell annotation (i.e., single-cell classification).
[0094] S104: Based on the pre-trained cell state auxiliary model, the obtained cell state data is processed to obtain intermediate embedded features, wherein the intermediate embedded features are used to characterize the cell functional state.
[0095] For example, before training the single-cell annotation graph attention model, a cell state auxiliary model can be trained by a training system or other system, so that the cell state auxiliary model can extract intermediate embedding features for characterizing the cell functional state from the cell state data.
[0096] Accordingly, continue to refer to Figure 2 ,In the process of training the single-cell annotation graph attention model, the training system can input the obtained cell state data into the cell state auxiliary model to compare the cell state score predicted by the regressor with the true value (i.e., the true state label of the cell), calculate the loss and perform backpropagation to update the model parameters.
[0097] S105: Based on the cell state auxiliary model, the node embedding features and the intermediate embedding features are fused to obtain fused features.
[0098] Continue reading Figure 2 The training system can fuse the node embedding features and the intermediate embedding features to obtain a fused feature. The fusion can be performed by splicing or other operations, which is not limited in this embodiment.
[0099] In this embodiment, the training system fuses the node embedding features and the intermediate embedding features to obtain a single-cell annotation graph attention model based on the fused features, thereby enhancing the classification accuracy of the single-cell annotation graph attention model for cell types.
[0100] S106: According to the mixed graph, intermediate embedded features, and fused features, the sample with the largest amount of information is selected, and the sample with the largest amount of information is used as the new training sample for the next round of training until the preset termination iteration condition is met, thereby obtaining a single-cell annotation graph attention model.
[0101] The training samples are samples with labels, and the test samples are samples without labels.
[0102] In this embodiment, the training system can calculate the information content of each node based on the hybrid graph, intermediate embedded features, and fused features. The samples with the highest information content are used as new training samples. This can solve the problem of insufficient sample labels and enable the single-cell annotation graph attention model to prioritize samples with high information content. It can also reduce dependence on large-scale labeled data, improve annotation efficiency and generalization ability, and enhance the performance of the single-cell annotation graph attention model with sparse labeled data.
[0103] In some embodiments, S106 may include:
[0104] S1061: Determine information density based on the intermediate embedded features.
[0105] S1062: Determine the centrality based on the mixed graph.
[0106] S1063: Determine a prediction result based on the fusion features, and determine information entropy (or entropy value) based on the prediction result.
[0107] S1064: Determine the sample with the largest amount of information based on information density, centrality, and information entropy.
[0108] For example, combined Figure 2 It can be seen that the training system can calculate the information density of each node based on the intermediate embedded features; calculate the centrality of each node based on the processed hybrid graph; and calculate the information entropy of each node based on the predicted node corresponding to the fused features.
[0109] Accordingly, the training system calculates a comprehensive score for each node based on its information density, centrality, and information entropy. A node's comprehensive score represents the amount of information it contains. The training system selects the sample with the highest comprehensive score as the new training sample.
[0110] In some embodiments, the preset termination iteration conditions include: the number of training times reaches a preset training times threshold, the number of training samples reaches a preset number threshold, and the change in the prediction performance of the single-cell annotation graph attention model is less than a preset change threshold.
[0111] Among them, the preset quantity threshold is determined based on the pre-built training bucket, and the preset quantity threshold is the maximum number of samples stored in the training bucket; the change in prediction performance is determined based on the difference in changes in information density and information entropy.
[0112] Exemplarily, the preset termination conditions may include the following conditions:
[0113] Condition 1: When the number of training rounds reaches the maximum number of training rounds (i.e., the preset training round threshold), the training system stops training. Similarly, the maximum number of training rounds can be determined based on demand, historical records, experiments, etc., and this embodiment does not limit it.
[0114] Condition 2: Based on the above analysis, after each training iteration, the training system selects the test sample with the highest information content as the new training sample and places it in the training bucket. When the number of training samples in the training bucket reaches the maximum number of samples the bucket can hold, the training system stops training. Similarly, the maximum number of samples a training bucket can hold can be determined based on demand, historical records, experimentation, and other methods, and is not limited in this embodiment.
[0115] Condition 3: If the change in the prediction performance of the single-cell annotation graph attention model is less than the preset change threshold, the training system stops training. This means that the training system no longer significantly improves the annotation capabilities of the single-cell annotation graph attention model, and the training system stops training. For example, after multiple iterations, if the nodes selected by the training system (i.e., unlabeled samples) only improve the single-cell annotation graph attention model very little (i.e., the difference in information entropy and information density becomes insignificant), the training system can terminate training.
[0116] Based on the above analysis, the single-cell annotation graph attention model provided by the present disclosure is used for single-cell annotation, that is, classifying cells based on single-cell gene expression data, and combining active learning and cell state information to improve the performance of the model. Therefore, the single-cell annotation graph attention model provided by the present disclosure can be called the single-cell annotation graph attention model based on active learning and cell state (Single-Cell Active Learning and Graph Attention Model, scALGT model).
[0117] Specifically, in this embodiment, the single-cell annotation graph attention model (scALGT model) first constructs a hybrid graph between the training and test data using the CCA-MNN algorithm. It then performs eigenvalue decomposition on the Laplacian matrix to obtain positional encoding information for the nodes in the graph. The sample features and feature encodings are then projected onto a space of the same dimension using a linear projection and added together to form the new features of the sample. scALGT then begins training using the hybrid graph and the latest sample features. The scALGT classification model learns from the input samples using a graph attention mechanism layer, consisting of four graph attention layers and a classifier based on a fully connected layer. The scALGT regression model, based on cell state data as input, uses the graph attention model to perform a regression task predicting cell state scores. After the regression task is completed, the parameters of the original regression model are retained as an auxiliary model to assist the scALGT classification model. The cell type expression data undergoes another forward pass of the auxiliary model to obtain an intermediate sample embedding. This is then added to the intermediate embedding of the original classification model and fed into the classifier for classification learning. In each round of classification model training, the active learning module calculates the sample's information density score and sample uncertainty score, combines them with the centrality calculated for the graph data sample at the beginning, selects the sample with the highest comprehensive score of the three, and after obtaining a new node, puts it into the training set.
[0118] According to another aspect of the present disclosure, the present disclosure also provides a single-cell annotation method.
[0119] See also Figure 3 , Figure 3 A schematic diagram of the process of the single-cell annotation method provided in the embodiment of the present disclosure.
[0120] like Figure 3 As shown, the method includes:
[0121] S301: Obtain single-cell gene expression data to be annotated.
[0122] It can be understood that in order to avoid cumbersome descriptions, the features of this embodiment that are the same or similar to those in the above examples will not be described in detail in this embodiment.
[0123] For example, the execution subject of this embodiment may be a single cell annotation system, which may be the same system as the training system or a different system.
[0124] For another example, regarding the method of obtaining single-cell gene expression data to be annotated, please refer to the implementation principle of obtaining the training set in the above example.
[0125] S302: Input the single-cell gene expression data into the single-cell annotation graph attention model and output the annotation results, wherein the single-cell annotation graph attention model is trained based on the training method described in the above embodiment.
[0126] For example, after training the single-cell annotation graph attention model, the single-cell gene expression data can be used as the single-cell annotation graph attention model to perform annotation (i.e., cell classification) based on the single-cell annotation graph attention model to obtain and output the annotation results.
[0127] Based on the above analysis of the training method, it can be seen that in this embodiment, by using the single-cell annotation graph attention model for single-cell annotation, the accuracy and reliability of cell classification can be improved.
[0128] According to another aspect of the present disclosure, the present disclosure also provides a training system for a single-cell annotation graph attention model.
[0129] See also Figure 4 , Figure 4 Schematic diagram of the structure of the training system of the single cell annotation graph attention model provided in the embodiment of the present disclosure. Figure 4 As shown, the training system 400 of the single-cell annotation graph attention model includes:
[0130] A hybrid graph construction unit 401 is configured to obtain a training set including training samples and a test set including test samples, wherein the training samples and the test samples respectively include single-cell gene expression data, and construct a hybrid graph including the training samples and the test samples, wherein the hybrid graph includes nodes and edges, each node representing a sample feature of the gene expression data of a single cell, and an edge connecting two nodes represents a similarity or correlation between the two nodes;
[0131] A graph attention mechanism unit 402 is configured to perform feature learning on the hybrid graph through a graph attention layer to generate node embedding features;
[0132] A cell state information unit 403 is configured to process the obtained cell state data based on a pre-trained cell state auxiliary model to obtain intermediate embedded features, wherein the intermediate embedded features are used to characterize the cell functional state, and to fuse the node embedded features with the intermediate embedded features to obtain a fused feature;
[0133] The active learning unit 404 is used to select the sample with the largest amount of information based on the mixed graph, the intermediate embedded features, and the fusion features, and use the sample with the largest amount of information as a new training sample for the next round of training until the preset termination iteration condition is met, thereby obtaining a single-cell annotation graph attention model.
[0134] In some embodiments, the mixed graph construction unit 401 is specifically configured to perform mutual nearest neighbor algorithm and canonical correlation analysis on the training samples and the test samples to obtain the mixed graph including the training samples and the test samples.
[0135] In some embodiments, the hybrid graph construction unit 401 is further configured to perform position encoding and linear mapping on each node in the hybrid graph and add the feature vectors to obtain a new feature representation of each node.
[0136] In some embodiments, the number of the graph attention layers is four, the output of the previous graph attention layer is the input of the next graph attention layer, and the input of the first graph attention layer is the mixed graph;
[0137] Among them, each graph attention layer is used to calculate the attention weights between nodes in the mixed graph, so that the single-cell annotation graph attention model captures the local and global relationships between nodes in the mixed graph.
[0138] In some embodiments, the active learning unit 404 is specifically used to determine the information density based on the intermediate embedded features; determine the centrality based on the mixed graph; determine the prediction result based on the fusion feature, and determine the information entropy based on the prediction result; determine the sample with the largest amount of information based on the information density, the centrality, and the information entropy.
[0139] In some embodiments, the preset termination condition for iteration includes: the number of training times reaches a preset training times threshold, the number of training samples reaches a preset number threshold, and the change in the prediction performance of the single-cell annotation graph attention model is less than a preset change threshold;
[0140] Among them, the preset quantity threshold is determined based on a pre-constructed training bucket, and the preset quantity threshold is the maximum number of samples stored in the training bucket; the prediction performance change is determined based on the difference in changes in the information density and the information entropy.
[0141] According to another aspect of the present disclosure, the present disclosure also provides a single-cell annotation system.
[0142] See also Figure 5 , Figure 5 A schematic diagram of the structure of the single-cell annotation system provided in an embodiment of the present disclosure.
[0143] like Figure 5 As shown, the single cell annotation system 500 includes:
[0144] An acquisition unit 501 is used to obtain single-cell gene expression data to be annotated;
[0145] An annotation unit 502 is used to input the single-cell gene expression data into a single-cell annotation graph attention model and output an annotation result, wherein the single-cell annotation graph attention model is trained based on the training method described in the first aspect.
[0146] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0147] According to an embodiment of the present disclosure, the present disclosure also provides a computer program product, which includes: a computer program, the computer program is stored in a readable storage medium, at least one processor of an electronic device can read the computer program from the readable storage medium, and at least one processor executes the computer program so that the electronic device performs the above-mentioned training method or single-cell annotation method.
[0148] Figure 6 A schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0149] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the device 600 can also be stored in the RAM 603. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0150] Various components in device 600 are connected to I / O interface 605, including an input unit 606, such as a keyboard, mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, optical disk, etc.; and a communication unit 609, such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0151] The computing unit 601 can be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units for running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as training methods and single-cell annotation methods. For example, in some embodiments, the training methods and single-cell annotation methods can be implemented as computer software programs that are tangibly included in machine-readable media, such as storage unit 608. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by the computing unit 601, one or more steps of the training methods and single-cell annotation methods described above can be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to execute the training method and the single-cell annotation method in any other appropriate manner (eg, by means of firmware).
[0152] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0153] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0154] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0155] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0156] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0157] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact via a communication network. This client-server relationship is established by computer programs running on the respective computers, establishing a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosts and VPS services ("Virtual Private Servers" or simply "VPS"). The server may also be a server in a distributed system or a server integrated with blockchain.
[0158] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) containing computer-usable program code.
[0159] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present disclosure. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer-executable instructions. These computer-executable instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0160] These processor-executable instructions may also be stored in a processor-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the processor-readable memory produce an article of manufacture comprising an instruction device that implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0161] These processor-executable instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0162] Obviously, those skilled in the art may make various changes and modifications to the present disclosure without departing from the spirit and scope of the present disclosure. Thus, if these modifications and variations of the present disclosure fall within the scope of the claims of the present disclosure and their equivalents, the present disclosure is intended to include these modifications and variations.
Claims
1. A training method for a single-cell annotation graph attention model, characterized in that: The method comprises: Obtaining a training set including training samples and a test set including test samples, wherein the training samples and the test samples respectively include single-cell gene expression data; Constructing a mixed graph including training samples and test samples, wherein the mixed graph includes nodes and edges, each node represents a sample feature of gene expression data of a single cell, and an edge connecting two nodes represents the similarity or correlation between the two nodes; Passing the hybrid graph through a graph attention layer for feature learning to generate node embedding features; Based on a pre-trained cell state auxiliary model, the obtained cell state data is processed to obtain intermediate embedded features, wherein the intermediate embedded features are used to characterize the cell functional state; fusing the node embedding feature and the intermediate embedding feature based on the cell state auxiliary model to obtain a fused feature; According to the mixed graph, the intermediate embedded features, and the fused features, the sample with the largest amount of information is selected, and the sample with the largest amount of information is used as a new training sample for the next round of training until a preset termination iteration condition is met, thereby obtaining a single-cell annotation graph attention model.
2. The method according to claim 1, characterized in that The construction includes a mixed graph of training samples and test samples, including: The training samples and the test samples are processed by mutual nearest neighbor algorithm and canonical correlation analysis to obtain the mixed graph containing the training samples and the test samples.
3. The method according to claim 1, characterized in that The method further comprises: The feature vectors after position encoding and linear mapping of each node in the hybrid graph are added to obtain a new feature representation of each node.
4. The method according to claim 1, wherein The number of the graph attention layers is four, the output of the previous graph attention layer is the input of the next graph attention layer, and the input of the first graph attention layer is the mixed graph; Among them, each graph attention layer is used to calculate the attention weights between nodes in the mixed graph, so that the single-cell annotation graph attention model captures the local and global relationships between nodes in the mixed graph.
5. The method according to claim 1, wherein The selecting the sample with the largest amount of information according to the mixed graph, the intermediate embedded features, and the fused features includes: determining information density based on the intermediate embedded features; determining a centrality based on the mixed graph; Determining a prediction result based on the fusion feature, and determining information entropy based on the prediction result; The sample with the largest amount of information is determined according to the information density, the centrality, and the information entropy.
6. The method according to claim 5, characterized in that The preset termination iteration condition includes: the number of training times reaches a preset training times threshold, the number of training samples reaches a preset number threshold, and the change in the prediction performance of the single-cell annotation graph attention model is less than a preset change threshold; Among them, the preset quantity threshold is determined based on a pre-constructed training bucket, and the preset quantity threshold is the maximum number of samples stored in the training bucket; the prediction performance change is determined based on the difference in changes in the information density and the information entropy.
7. A single cell annotation method, characterized in that: The method comprises: Obtain single-cell gene expression data to be annotated; The single-cell gene expression data is input into a single-cell annotation graph attention model, and an annotation result is output, wherein the single-cell annotation graph attention model is trained based on the training method according to any one of claims 1 to 6.
8. A training system for a single-cell annotation graph attention model, characterized in that include: a hybrid graph construction unit, configured to obtain a training set including training samples and a test set including test samples, wherein the training samples and the test samples respectively include single-cell gene expression data, and construct a hybrid graph including the training samples and the test samples, wherein the hybrid graph includes nodes and edges, each node represents a sample feature of the gene expression data of a single cell, and an edge connecting two nodes represents a similarity or correlation between the two nodes; A graph attention mechanism unit, configured to perform feature learning on the hybrid graph through a graph attention layer to generate node embedding features; A cell state information unit is used to process the obtained cell state data based on a pre-trained cell state auxiliary model to obtain intermediate embedded features, wherein the intermediate embedded features are used to characterize the cell functional state, and to fuse the node embedded features with the intermediate embedded features to obtain a fused feature; An active learning unit is used to select the sample with the largest amount of information based on the mixed graph, the intermediate embedded features, and the fused features, and use the sample with the largest amount of information as a new training sample for the next round of training until a preset termination iteration condition is met, thereby obtaining a single-cell annotation graph attention model.
9. A single cell annotation system, characterized in that The system comprises: An acquisition unit, used to obtain single-cell gene expression data to be annotated; An annotation unit is used to input the single-cell gene expression data into a single-cell annotation graph attention model and output an annotation result, wherein the single-cell annotation graph attention model is trained based on the training method according to any one of claims 1 to 6.
10. A processor-readable storage medium, characterized in that: The processor-readable storage medium stores a computer program, wherein the computer program is used to cause the processor to execute the method according to any one of claims 1 to 6; or, the computer program is used to cause the processor to execute the method according to claim 7.
Citation Information
Patent Citations
Construction method and device of scRNA-Seq cell type annotation database and electronic equipment
CN115579069A
Attention-based single-cell RNA data clustering model and construction method thereof
CN118136120A