Multi-space self-supervised contrastive learning method for spatial transcriptome data spatial domain identification
By employing a multi-spatial self-supervised contrastive learning method, and utilizing graph neural networks and contrastive learning loss, the problem of inaccurate clustering in spatial transcriptome data analysis is solved, achieving more efficient spatial domain identification and annotation.
Patent Information
- Application Number
- CN202511493764.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2045-10-20
AI Technical Summary
Existing spatial transcriptome data analysis methods are insufficient in fully utilizing spatial information and processing technical noise, leading to inaccurate clustering and sparse expression profiles that affect the quality of expression features.
A multi-spatial self-supervised contrastive learning method is adopted. The encoder and decoder are constructed through graph neural networks. By combining data augmentation and contrastive learning loss, multiple rich graph feature representations are generated. The Adam optimizer is used to update the network parameters to complete spatial domain recognition.
It improves clustering performance and spatial domain annotation accuracy, enhances the robustness of spatial information extraction and clustering accuracy, and can better capture global and local spatial information.
Smart Images

Figure CN120954500B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of spatial transcriptome data analysis, in particular to a spatial transcriptome data spatial domain identification method based on multi-space self-supervised contrast learning. BACKGROUND
[0002] Spatial transcriptomics (ST) has become a valuable tool in recent years, providing researchers with effective assistance in dissecting the complex relationship between tissue structure and function at the cellular or even subcellular level. This technology measures gene expression levels in the context of spatial location information, with resolutions ranging from single-cell level to local aggregates of multiple cells at a certain spatial location (commonly referred to as "spot"), providing a new perspective for the study of key biological processes such as nervous system development, organ development, and tumor microenvironment.
[0003] In the field of spatial transcriptome data analysis, a fundamental and important task is spatial domain identification, which aims to divide spatial sites with consistent gene expression and histological structure in tissue samples into meaningful clusters, similar to spatial clustering. Therefore, in recent years, using clustering methods to study spatial transcriptome data has become a hot topic in this field.
[0004] Currently, methods for identifying spatial domains can be broadly divided into two categories: non-spatial clustering methods and spatial clustering methods. Traditional non-spatial methods, such as classic k-means and Leiden, only consider gene expression information and ignore spatial dependence, so they are prone to clustering discontinuous tissue structures. Since graph neural network (GNN)-based methods can smooth gene expression within spatially adjacent regions, effectively reducing the impact of technical noise, such methods are often used as an alternative solution for spatial clustering tasks. Recently, the self-supervised contrast learning strategy commonly used in the field of image processing has been gradually introduced into the study of spatial transcriptomics as an effective strategy.
[0005] Although these graph neural network clustering methods based on contrast learning strategies have brought valuable insights, there are still many challenges in fully utilizing ST data to achieve accurate clustering of tissue structures. First, previous contrast learning strategies are often performed in a single space, and the data scale obtained cannot fully capture more comprehensive data distribution to assist downstream tasks. Second, due to the existence of technical noise and biological noise, these objective factors often cause the ST expression matrix to be sparse, which in turn affects the quality of expression features. SUMMARY
[0006] The application provides a multi-space self-supervised contrast learning spatial transcriptome data spatial domain identification method which helps to improve clustering performance and realize more accurate spatial domain annotation.
[0007] To solve the above technical problems, the application adopts the following technical solutions:
[0008] The multi-space self-supervised contrast learning spatial transcriptome data spatial domain identification method comprises the following steps:
[0009] S1, gene expression and spatial position of spatial transcriptome data are taken as input, data standardization is performed, spatial information of the spatial transcriptome data is modeled based on the spatial information, a spatial neighborhood graph is generated, gene expression data after data standardization is taken as node features, data enhancement is performed on the spatial neighborhood graph by keeping the graph structure unchanged and scrambling the node features, and the enhanced graph is taken as an enhanced graph;
[0010] S2, an encoder is constructed based on a graph neural network, spatial transcriptome data fused with spatial information and gene information are extracted to obtain latent embedding, and the latent embedding is sent to a multi-space generator to generate multiple sets of rich graph feature representations;
[0011] S3, the graph feature representations obtained by S2 are fused with the latent embedding to obtain refined representations, and the refined representations are reconstructed into a gene expression matrix through a decoder, and in the decoding reconstruction process, a contrast learning loss and a reconstruction loss are added together as a total objective function;
[0012] S4, according to the total objective function obtained by S3, an Adam optimizer is used to update network parameters to complete spatial transcriptome spatial domain identification.
[0013] Further, in S1, the data standardization processing is performed on the original gene expression matrix as follows: first, 3000 high-variation genes are selected from the original gene expression matrix to obtain a screened gene expression matrix, then the screened gene expression matrix is normalized, the values in the matrix are added by 1, and log transformation is performed, finally, each gene expression feature is standardized to obtain a final data-standardized gene expression matrix.
[0014] Further, in S1, the construction of the spatial neighborhood graph is obtained by using the spatial position information in the spatial transcriptome data and based on a near neighbor algorithm , a pre-defined neighbor number of an undirected neighborhood graph , the expression is:
[0015] ;
[0016] wherein, denotes a set of spots, the number of spots is , denotes a set of edges connecting spots, , is defined as the adjacency matrix of, if j e V is a neighbor of i e V, then a ij is 1, otherwise 0, wherein i and j both represent nodes, a ij denotes an element in the adjacency matrix, reflecting the link between node i and node j.
[0017] Further, in the S1, the operation of data enhancement is to create an enhanced graph by randomly shuffling the gene expression vectors between spots while keeping the topology of the original graph unchanged, given a neighborhood graph and a normalized gene expression matrix .
[0018] wherein, , M represents the gene feature dimension;
[0019] Let denote the enhanced graph, then denotes the shuffled gene expression matrix.
[0020] Further, in the S2 and the S3, a graph neural network is used to construct an encoder to extract the latent embedding of the spatial transcriptome data, further referring to introducing a graph convolutional autoencoder, so as to more comprehensively fuse the gene expression information and the spatial position information, and learn a compact latent representation for the spatial transcriptome data;
[0021] The fusion of the graph feature representation E and the latent embedding refers to the concatenation operation of the low-dimensional embedding representation Z and the graph feature representation E in the feature dimension, to obtain the fused representation .
[0022] wherein, the encoder and the decoder are both composed of a single-layer graph convolutional network GCN, the input includes the normalized gene expression matrix X and the adjacency matrix A generated by the spatial coordinates, under this framework, the encoder maps the input to a low-dimensional embedding representation Z, and the decoder will reconstruct the gene expression matrix H according to the low-dimensional embedding representation Z and the fusion result , formally, Z and H are expressed as:
[0023]
[0024]
[0025] wherein, denotes a normalized adjacency matrix, , is an identity matrix, is a diagonal matrix with diagonal elements denotes a nonlinear activation function, denote trainable weight matrices in the encoder and decoder, respectively;
[0026] To fully exploit the gene expression matrix X, the model is trained by minimizing the reconstruction loss of gene expression, which is denoted as:
[0027]
[0028] where L recon denotes the reconstruction loss, i denotes the expression vector of the ith node in the gene expression matrix X, h
[0029] Further, in S2, the multi-space generator adopts a multi-space contrast learning strategy to ensure that the model captures rich global spatial context information of the spatial points. Further, the original graph node embedding features and the enhanced graph node embedding features
[0030] are input into the multi-space generator MSG, respectively, to obtain multiple sets of graph embedding, i.e., global embedding.
[0031]
[0032] wherein, is the number of spaces to be compared, is the node embedding of the ith space, is the node feature dimension, and l denotes the lth space.
[0033] When the input is the enhanced graph node embedding feature encoded by the space generator MSG, the process is also denoted as:
[0034]
[0035] wherein, is the node embedding of the ith space.
[0036] Further, in the S3, the contrastive learning loss refers to using intra-space and inter-space contrastive losses to learn diverse and informative representations, thereby capturing important global information of the graph;
[0037] For the intra-space contrastive loss, it seeks to maximize the mutual information MI between two view representations in each group, so that the representation of each individual group becomes more informative, and the paired representations are The intra-space contrastive loss is then formulated as:
[0038]
[0039] wherein, and are the parameters of the encoder in the original graph and the augmented graph, respectively, and k represents the kth space.
[0040] For the inter-space contrastive loss, the pair-wise relationship between different groups in the same view is constrained to enhance the diversity between spaces. Further, the inter-space contrastive loss based on mutual information minimization is used to encourage any two representations in the same view to capture different features of the given graph. The inter-space contrastive loss focuses on each pair of representations between different groups in the view , that is, The inter-space contrastive loss is then formulated as:
[0041]
[0042] Combining the intra-space contrastive loss and the inter-space contrastive loss, the final contrastive loss function is:
[0043]
[0044] wherein, represents the contrastive loss, and λ is a parameter balancing the influence of the intra-space contrastive loss and the inter-space contrastive loss.
[0045] Further, in the S3, the total loss function L recon is calculated by combining the reconstruction loss L total obtained in the autoencoder part and the contrastive loss L obtained in the self-supervised contrastive learning part, and the expression is:
[0046] ;
[0047] wherein, α and β are both weight parameters.
[0048] By minimizing the total loss function L total , a more optimal gene expression reconstruction result H is obtained.
[0049] Further, for the intra-space contrastive loss, since when and When the distribution of the two views is unknown, the mutual information becomes difficult to handle, so the mutual information is replaced by maximizing the lower bound of the mutual information based on the sampling sample, and the Jensen-Shannon mutual information estimation is used, and the calculation formula is:
[0050]
[0051] Wherein, is a discriminator, which takes the representation of the two views as input and scores the consistency between them, and the discriminator is simply instantiated as the dot product between the two representations, that is, , SP(·) is an activation function, is the expectation of the joint distribution of the two views in the same space k, is the product of the expectation of the independent distribution of the two views in the same space k;
[0052] For the inter-space contrast loss, the upper bound of the mutual information is introduced to replace the minimum mutual information, that is, the formula of the Jensen-Shannon mutual information estimation is taken as the opposite;
[0053] The final contrast loss function is determined as:
[0054] ;
[0055] Wherein, represents the expectation of the joint distribution expectation of the two views in the k group, represents the expectation of the product of the independent distribution expectation of the two views in the k group, represents the expectation of the joint distribution expectation of the two views in the k group and the l group, respectively.
[0056] Further, in the S4, the spatial transcriptome spatial domain identification further comprises: taking the gene expression matrix H reconstructed by the S3 as input, assigning a spatial region pseudo label to each spatial site through the Mclust clustering algorithm, the pseudo label is an integer value, the value range is [0, D], wherein D is the number of pre-specified spatial domain region; Then calculate the clustering accuracy related evaluation index with the manually annotated label, the commonly used evaluation index includes adjusted rand index ARI and normalized mutual information NMI, wherein the value range of ARI is [-1, 1], the value range of NMI is [0, 1], the higher the value, the better the evaluation index, on the contrary, the lower the value, the worse the evaluation index.
[0057] The beneficial effects of the present application are:
[0058] The application designs a clustering method suitable for spatial transcriptome representation extraction, which is of great significance for further improving clustering performance and realizing more accurate spatial domain annotation. BRIEF DESCRIPTION OF DRAWINGS
[0059] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application.
[0060] Figure 1 is a whole process schematic diagram of the spatial transcriptome data spatial domain recognition method of the embodiment of the application.
[0061] Figure 2 is a whole block diagram of the spatial transcriptome data spatial domain recognition method of the embodiment of the application.
[0062] Figure 3 is a data preprocessing part of the spatial transcriptome data spatial domain recognition method of the embodiment of the application. Figure 2
[0063] Figure 4 is an enlarged schematic diagram of the domain feature extraction part in the spatial transcriptome data spatial domain recognition method of the embodiment of the application. Figure 2
[0064] Figure 5 is an enlarged schematic diagram of the downstream task part in the spatial transcriptome data spatial domain recognition method of the embodiment of the application. Figure 2
[0065] Figure 6 is an enlarged schematic diagram of the MSG internal details in the spatial transcriptome data spatial domain recognition method of the embodiment of the application. Figure 2
[0066] Figure 7 is an ARI measurement clustering structure schematic diagram of all methods in the embodiment of the application in the dorsolateral prefrontal cortex DLPFC data set.
[0067] Figure 8 is an NMI measurement clustering structure schematic diagram of all methods in the embodiment of the application in the dorsolateral prefrontal cortex DLPFC data set.
[0068] Figure 9 FIG. 17 is a visualization result schematic diagram of the present application in the dorsolateral prefrontal cortex DLPFC dataset embodiment, on slice 151672.
[0069] Figure 10 FIG. 18 is a visualization result schematic diagram of the present application in the dorsolateral prefrontal cortex DLPFC dataset embodiment, on slice 151672.
[0070] Figure 11 FIG. 19 is a visualization result schematic diagram of the present application in the dorsolateral prefrontal cortex DLPFC dataset embodiment, on slice 151672.
[0071] Figure 12 FIG. 20 is a visualization result schematic diagram of the present application in the mouse hypothalamus MERFISH dataset embodiment, clustering results of ARI indicators of six methods.
[0072] Figure 13 FIG. 21 is a visualization result schematic diagram of the present application in the mouse hypothalamus MERFISH dataset embodiment, clustering results of NMI indicators of six methods.
[0073] Figure 14 FIG. 22 is a visualization result schematic diagram of the present application in the mouse hypothalamus MERFISH dataset embodiment, on m0.04 slice.
[0074] Figure 15 FIG. 23 is a visualization result schematic diagram of the present application in the mouse hypothalamus MERFISH dataset embodiment, on m0.09 slice.
[0075] Figure 16 FIG. 24 is a visualization result schematic diagram of the present application in the mouse hypothalamus MERFISH dataset embodiment, on m0.14 slice.
[0076] Figure 17 FIG. 25 is a structural block diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0077] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all embodiments. The embodiments in the present application and the features in the embodiments can be combined with each other without conflict. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor are within the scope of protection of the present application.
[0078] It should be noted that the meaning of "and / or" appearing in the whole text includes three parallel schemes, for example, "A and / or B" includes A scheme, or B scheme, or A and B scheme. In addition, "multiple" means more than two. In addition, the technical solutions of various embodiments can be combined with each other, but it must be based on the realization of ordinary skilled in the art, when the combination of technical solutions appears contradictory or cannot be realized, it should be considered that the combination of technical solutions does not exist, nor within the protection scope required by the present application.
[0079] Reference Figure 1 The embodiment of the present application provides a multi-space self-supervised contrast learning spatial transcriptome data spatial domain identification method, comprising the following steps:
[0080] S1, gene expression and spatial position of spatial transcriptome data are taken as input, data standardization is carried out, then spatial information of spatial transcriptome data is modeled, spatial neighborhood graph is generated, gene expression data after data standardization is taken as node feature, data enhancement is carried out by keeping the graph structure unchanged and disturbing the node feature for the spatial neighborhood graph, and the enhanced graph is taken as the enhanced graph;
[0081] S2, an encoder is constructed based on a graph neural network, spatial transcriptome data fused with spatial information and gene information are extracted to obtain latent embedding, and the latent embedding is sent into a multi-space generator to generate multiple groups of rich graph feature representations;
[0082] S3, the graph feature representation obtained by S2 is fused with the latent embedding to obtain a refined representation, and the refined representation is reconstructed into a gene expression matrix through a decoder, and in the decoding reconstruction process, the contrast learning loss and the reconstruction loss are added together as a total objective function;
[0083] S4, according to the total objective function obtained by S3, the network parameters are updated by using Adam optimizer, so as to complete the spatial transcriptome spatial domain identification.
[0084] The purpose of the present application is to provide a spatial transcriptome data spatial domain identification method based on multi-space self-supervised contrast learning, which mainly solves the technical problem that the latent representation extracted in a single spatial scale cannot fully capture the overall data distribution and the sparse expression spectrum in ST affects the quality of expression features. The method aims to explore the multi-scale information in the spatial transcriptome data by designing a novel contrast framework to improve the accuracy and robustness of spatial domain annotation.
[0085] In the embodiment, in the S1, the data standardization processing is as follows: first, 3000 high-variation genes are screened from the original gene expression matrix to obtain a screened gene expression matrix, then the screened gene expression matrix is normalized, the values in the matrix are added by 1, and log transformation is performed, and finally each gene expression feature is standardized to obtain a final gene expression matrix after data standardization.
[0086] In the embodiment, in the S1, the construction of the spatial neighborhood graph is obtained by using the spatial position information in the spatial transcriptome data and based on the nearest neighbor algorithm, a non-directional neighborhood graph with a pre-defined number of neighbors is obtained, and the expression is as follows:
[0087] ;
[0088] wherein, V represents a set of spots, and the number of spots is , E represents a set of edges connected between the spots, , and the adjacency matrix is defined as if j∈V is a neighbor of i∈V, a ij is 1, otherwise 0, wherein i and j represent nodes, and a ij represents an element in the adjacency matrix, reflecting the linking relationship between the node i and the node j.
[0089] In the embodiment, in the S1, the data enhancement operation is to create an enhanced graph by randomly shuffling the gene expression vectors between the spots while keeping the topology of the original graph unchanged, by giving a neighborhood graph and a normalized gene expression matrix .
[0090] wherein, M represents the gene feature dimension;
[0091] Let denote the enhanced graph, then denotes the shuffled gene expression matrix.
[0092] In the embodiment, in the S2 and the S3, a graph neural network is used to construct an encoder to extract the latent embedding of the spatial transcriptome data, and further, a graph convolution autoencoder is introduced to more comprehensively fuse the gene expression information and the spatial position information, and to learn a compact latent representation for the spatial transcriptome data.
[0093] The fusion of the graph feature representation E and the latent embedding refers to a splicing operation on the feature dimension of the low-dimensional embedding representation Z and the graph feature representation E, to obtain a fused representation ;
[0094] Wherein, the encoder and the decoder are both composed of a single-layer graph convolutional network GCN, the input includes the normalized gene expression matrix X and the adjacency matrix A generated by the spatial coordinates, under this framework, the encoder maps the input to a low-dimensional embedding representation Z, and the decoder will reconstruct the gene expression matrix H according to the low-dimensional embedding representation Z and the fusion result , Formally, Z and H are expressed as:
[0095]
[0096]
[0097] Wherein, represents the normalized adjacency matrix, , is the unit matrix, is a diagonal matrix whose diagonal elements are , represents a nonlinear activation function such as ReLU (Rectified Linear Unit), and represent the trainable weight matrices in the encoder and the decoder, respectively;
[0098] In order to make full use of the gene expression matrix X, the model is trained by minimizing the reconstruction loss of gene expression, which is represented as:
[0099]
[0100] Wherein, L recon represents the reconstruction loss, represents the expression vector of the i-th node in the gene expression matrix X, h i represents the expression vector of the i-th node in the reconstructed gene expression matrix H.
[0101] In this embodiment, in S2, the multi-space generator adopts a multi-space contrast learning strategy to ensure that the model captures rich global spatial context information of spatial points, and further, the original graph node embedding feature and the enhanced graph node embedding feature encoded by the single-layer graph convolutional network GCN are input into the multi-space generator MSG respectively to obtain multiple sets of graph embedding, i.e. global embedding;
[0102] When the input is the original graph node embedding feature When encoded by the space generator MSG, this process is represented as:
[0103]
[0104] in, The number of spaces that need to be compared. Embed the node of the i-th space. Let l be the node feature dimension, and l represent the l-th space.
[0105] When the input is an augmented graph node embedding feature When encoded by the space generator MSG, the process is similar to the previous one, and is also represented as:
[0106]
[0107] in, Embed the node of the i-th space.
[0108] Regarding the internal details of MSG, such as Figures 2-6 As shown, it is a global multi-feature generator based on a self-attention mechanism, and in which, Figures 2-5 This is a schematic diagram of the overall framework of the spatial domain identification method for spatial transcriptome data. The feature matrix is mapped to key embedding K and value embedding V through two independent linear projections, and the calculation method is as follows:
[0109] ;
[0110] ;
[0111] in, and These represent different projection matrices related to the key and value, respectively.
[0112] In addition, this invention introduces a set of query vectors. This approach focuses on multiple spaces of global features, where each query vector represents a space and guides specific representation learning. The number of query vectors determines the number of target spaces. Furthermore, the dimension of each query vector needs to be proportional to the matrix... The number of columns in the middle is the same. The matrix consists of trainable parameters, which are randomly initialized at the start of training and participate in the training process together. This is achieved by utilizing the query vector. Key Attention is used to generate new attention weights for node features. A larger attention weight indicates that the corresponding node contains richer information in the space corresponding to the query vector. The attention weight is normalized along the node dimension, as shown in the following expression:
[0113] ;
[0114] Finally, the node features are weighted and summed based on these attention weights to obtain the final result. Global embedding of a space:
[0115] .
[0116] In this embodiment, in S3, the contrastive learning loss refers to using intra-space and inter-space contrastive losses to learn diverse and information-rich representations, thereby capturing important global information of the graph;
[0117] For the intra-spatial contrast loss, the goal is to maximize the mutual information (MI) between the two view representations within each group, making the representation of each individual group more informative. The paired representations are... The spatial contrast loss formula is then:
[0118]
[0119] in, and , respectively, are the encoder parameters in the original graph and the enhanced graph, where k represents the k-th space;
[0120] For inter-spatial contrast loss, pairwise relationships between different groups within the same view are constrained to enhance spatial diversity. Furthermore, an inter-spatial contrast loss based on mutual information minimization is used to ensure that any two representations within the same view capture different features of a given graph. Inter-spatial contrast focuses on the view... Each pair of representations between different groups within the same group, i.e. The spatial contrast loss formula is then:
[0121]
[0122] Combining intra-spatial contrast loss and inter-spatial contrast loss, the final contrast loss function is obtained as follows:
[0123]
[0124] in, λ represents the contrast loss, and is a parameter that balances the effects of intra-space contrast loss and inter-space contrast loss.
[0125] In this embodiment, in step S3, the reconstruction loss L obtained in the autoencoder section is combined with... reconAnd the contrastive loss obtained in the self-supervised contrastive learning part Calculate the total loss function L total The expression is:
[0126] ;
[0127] Where α and β are both weighting parameters;
[0128] By minimizing the total loss function L total To obtain better gene expression remodeling results H.
[0129] Throughout the learning process, reconstruction loss aims to extract useful features from spatial location information and gene expression data, while contrastive learning loss optimizes the latent embedding from a global perspective to obtain a more comprehensive and discriminative representation.
[0130] In this embodiment, for the spatial contrast loss, since when and When the distribution is unknown, mutual information This becomes difficult to handle, so a lower bound estimation of mutual information based on sampling samples is used instead of maximizing mutual information. The Jensen-Shannon mutual information estimation is employed, and the calculation formula is as follows:
[0131]
[0132] in, It is a discriminator that takes the representations of two views as input and scores the consistency between them. Here, the discriminator is simply instantiated as the dot product between the two representations, i.e. SP(·) is the activation function. For the joint distribution expectation of two views within the same space k, The product of the independent distribution expectations of two views within the same space k;
[0133] For spatial contrast loss, we similarly introduce an upper bound estimate of mutual information to replace minimizing mutual information, which is to invert the Jensen-Shannon mutual information estimation formula.
[0134] The final contrastive loss function is determined as follows:
[0135] ;
[0136] in, This represents the expectation of the joint distribution expectation of two views within group k. This represents the expectation of the product of the independent distribution expectations of two views within group k. This represents the expectation obtained by taking group l and group k respectively under the joint distribution expectation of the two views in group k and group l.
[0137] In this embodiment, step S4, spatial domain identification of the spatial transcriptome, further includes: taking the gene expression matrix H reconstructed by step S3 as input, assigning a pseudo-label of a spatial region to each spatial site using the Mclust clustering algorithm. The pseudo-label is an integer value, ranging from [0, D], where D is the number of pre-specified spatial domain regions. Subsequently, the clustering accuracy is evaluated using relevant metrics, such as the adjusted Landry index (ARI) and normalized mutual information (NMI). The ARI ranges from [-1, 1], and the NMI ranges from [0, 1]. Higher values indicate better evaluation metrics, while lower values indicate worse evaluation metrics.
[0138] In this embodiment, two ST datasets of different cell types were obtained from different platforms: (1) ST dataset from the 10x Visium platform: human dorsolateral prefrontal cortex cells (DLPFC); (2) ST dataset from Merfish: mouse hypothalamus dataset.
[0139] To further verify the superiority of this method, the present invention provides the following embodiment, which compares it with other algorithms on the dorsolateral prefrontal cortex DLPFC dataset. The specific process is as follows:
[0140] 1. Comparison of algorithms and metrics
[0141] Based on relevant research, this embodiment selects the following five comparison algorithms:
[0142] 1) SCANPY: A high-efficiency single-cell transcriptome data analysis toolkit based on Python, supporting a complete single-cell data analysis workflow from preprocessing, dimensionality reduction, clustering to visualization. (Paper title: "SCANPY: large-scale single-cell gene expression data analysis")
[0143] 2) SpaceFlow: This paper uses the Deep Graph Infomax (DGI) framework to compare information between the spot representation and the global representation, and introduces an embedding regularization mechanism to guide the model to learn an expression pattern that reflects meaningful spatial structure. (Paper title: "Identifying multicellular spatiotemporal organization of cells with SpaceFlow")
[0144] 3) STAGATE: Utilizes graph attention networks and combines gene expression and spatial information to learn low-dimensional representations of ST points for spatial domain detection. (Paper title: "Deciphering spatial domains from spatially resolved transcriptomics with an adaptive graph attention auto-encoder")
[0145] 4) GraphST: In its proposed self-supervised contrastive learning framework, it first uses GCN as the base encoder, and then obtains better feature representations by contrastive learning through information between a single spot and its spatial neighbors. (Paper title: "Spatially informed clustering, integration, and deconvolution of spatial transcriptomics with GraphST")
[0146] 5) SEDR: This method uses a deep autoencoder network to learn low-dimensional gene expression representations and embeds spatial information into the representation via a variational autoencoder for subsequent spatial domain recognition. (Paper title: "Unsupervised spatiallyembedded deep representation of spatial transcriptomics")
[0147] To verify the effectiveness of the present invention, NMI, ARI and Purity were used as evaluation indicators, where a higher value indicates better performance.
[0148] 2. Comparison Results
[0149] The DLPFC dataset consists of 12 slices, and a comprehensive comparison of all 12 slices was performed. Figures 7-9 The results of all methods for measuring ARI and NMI are shown. The results demonstrate that this invention consistently outperforms other metrics across all metrics, exhibiting a particularly significant advantage in ARI. This indicates that simultaneously exploring multi-scale information is effective. Furthermore, Figure 9 The visualization results of the present invention on 151,672 slices are shown, with an ARI value of 0.82 and an NMI value of 0.79. As can be seen from the figure, the clustering depiction of the present invention is good and can accurately identify the spatial domain structure of cells.
[0150] at last, Figure 10 and Figure 11These are the UMAP diagram and PAGA trajectory inference results of this invention, respectively. The UMAP results clearly show the different regions of each layer, indicating that the method of this invention can effectively distinguish the domains of each layer. In addition, the PAGA diagram reveals a linear trajectory from WM to the 3rd layer, further demonstrating that the developmental trajectory inferred by this invention is highly consistent with the spatial topology of the slice.
[0151] To further verify the superiority of this method, the present invention provides the following embodiment, which compares the method with the five comparative algorithms in the above embodiment on the mouse hypothalamus MERFISH dataset. The specific process is as follows:
[0152] Figure 12 and Figure 13 The results of index clustering for six methods on a mouse hypothalamic dataset are presented. Among these methods, the ARI and NMI values of this invention are significantly higher than those of the other methods, indicating its superior performance in spatial domain segmentation. Figures 14-16 The visualization results of the present invention are further demonstrated, proving its ability to effectively segment and identify complex spatial domains, wherein... Figure 14 On the m0.04 slice, the ARI value is 0.40 and the NMI value is 0.51. Figure 15 On the m0.09 slice, the ARI value is 0.49 and the NMI value is 0.55. Figure 16 On the m0.14 slice, the ARI value is 0.46 and the NMI value is 0.52.
[0153] This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the spatial domain identification method for spatial transcriptome data as described above in the multi-spatial self-supervised contrastive learning method.
[0154] See Figure 17 The present invention also provides a computer device, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the spatial transcriptome data spatial domain identification method described above for multi-spatial self-supervised contrastive learning.
[0155] This invention also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the steps of the spatial domain identification method for spatial transcriptome data as described above in the multi-spatial self-supervised contrastive learning method.
[0156] It is understood that the systems, devices, and storage media provided in the embodiments of the present invention correspond to the methods provided in the embodiments of the present invention, and the explanations, examples, and beneficial effects of the relevant content can be referred to the corresponding parts of the above-described method for spatial domain identification of spatial transcriptome data in multi-spatial self-supervised contrastive learning.
[0157] It should be noted that those skilled in the art will understand that all or part of the steps implemented in the embodiments of the present invention can be implemented entirely or partially by software, hardware, firmware, or any combination thereof. When implemented in hardware, it can be implemented entirely or partially by purchasing standard parts or modifications. When implemented in software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid state disks (SSDs)).
[0158] In summary, this invention addresses the limitations of single-scale feature representation and insufficient spatial information extraction by providing a spatial domain identification method for spatial transcriptome data based on multi-spatial self-supervised contrastive learning. Specifically, the method involves: first, establishing graph data and randomly shuffling node features during the training phase; second, constructing an encoder based on a graph neural network to extract latent embeddings of spatial transcriptome data that integrate spatial and genetic information, and generating multiple sets of rich graph features using a multi-spatial generator; subsequently, reconstructing the gene expression matrix using a decoder, employing contrastive learning loss and reconstruction loss as objective functions, and updating network parameters using an Adam optimizer to complete the identification of the spatial domain of the spatial transcriptome. This invention demonstrates stronger robustness and adaptability in spatial information extraction and clustering accuracy, fully mining spatial transcriptome data from both global and local perspectives to achieve accurate spatial domain identification.
[0159] It should be understood that the examples and embodiments described herein are for illustrative purposes only and are not intended to limit the invention. Those skilled in the art can make various modifications or changes based on them. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.
Claims
1. A spatial domain identification method for spatial transcriptome data using multi-spatial self-supervised contrastive learning, characterized in that, Includes the following steps: S1. Take the gene expression and spatial location of the spatial transcriptome data as input, perform data standardization, and then build a model based on the spatial information of the spatial transcriptome data to generate a spatial neighborhood graph. Take the gene expression data after data standardization as node features, and perform data augmentation by shuffling the node features for this spatial neighborhood graph while keeping the graph structure unchanged, to create an augmented graph. S2. An encoder is constructed based on a graph neural network to extract potential embeddings from spatial transcriptome data that integrates spatial and genetic information, and these potential embeddings are fed into a multi-space generator to generate multiple sets of rich graph feature representations. S3. The graph feature representation obtained from S2 is fused with the latent embedding to obtain a refined representation, and the refined representation is reconstructed into a gene expression matrix through a decoder. In this decoding and reconstruction process, the contrastive learning loss and the reconstruction loss are summed as the total objective function. S4. Based on the overall objective function obtained in S3, the Adam optimizer is used to update the network parameters to complete the spatial domain identification of the spatial transcriptome. In S3, contrastive learning loss refers to using intra-space and inter-space contrastive losses to learn diverse and information-rich representations, thereby capturing important global information of the graph; For the intra-spatial contrast loss, the goal is to maximize the mutual information (MI) between the two view representations within each group, making the representation of each individual group more informative. The paired representations are... The spatial contrast loss formula is then: in, and , respectively, are the encoder parameters in the original graph and the enhanced graph, where k represents the k-th space; For inter-spatial contrast loss, pairwise relationships between different groups within the same view are constrained to enhance spatial diversity. Furthermore, an inter-spatial contrast loss based on mutual information minimization is used to ensure that any two representations within the same view capture different features of a given graph. Inter-spatial contrast focuses on the view... Each pair of representations between different groups within the same group, i.e. The spatial contrast loss formula is then: Combining intra-spatial contrast loss and inter-spatial contrast loss, the final contrast loss function is obtained as follows: in, λ represents the contrast loss, and is a parameter that balances the effects of intra-space contrast loss and inter-space contrast loss.
2. The spatial domain identification method for spatial transcriptome data using multi-spatial self-supervised contrastive learning as described in claim 1, characterized in that, In S1, the data standardization process involves the following operations on the original gene expression matrix: First, the top 3000 highly variable genes are selected from the original gene expression matrix to obtain the selected gene expression matrix. Then, the selected gene expression matrix is normalized, and the values in the matrix are incremented by 1. Logarithmic transformation is then performed, and finally, each gene expression feature is standardized to obtain the final standardized gene expression matrix.
3. The spatial domain identification method for spatial transcriptome data using multi-spatial self-supervised contrastive learning as described in claim 1, characterized in that, In S1, the construction of the spatial neighborhood map utilizes spatial location information from spatial transcriptome data and is based on... The nearest neighbor algorithm yields a set of neighbors with a predefined number of neighbors. Undirected neighborhood graph The expression is: ; in, This represents the set of sites, where the number of sites is... , Let A ∈ R be the set of edges connecting points. N ×N , is defined as Given an adjacency matrix, if j∈V is a neighbor of i∈V, then a ij The value is 1 if it is not 0 otherwise, where i and j both represent nodes, and a ij This represents an element in the adjacency matrix, reflecting the connection relationship between node i and node j.
4. The spatial domain identification method for spatial transcriptome data using multi-spatial self-supervised contrastive learning as described in claim 1, characterized in that, In S1, the data augmentation operation is performed by providing a neighborhood graph. and normalized gene expression matrix The gene expression vectors between loci are randomly shuffled to create an enhanced graph while maintaining the topology of the original graph. Where, X∈R N×M , M represents the gene feature dimension; make If we represent an augmented graph, then This represents the shuffled gene expression matrix.
5. The spatial domain identification method for spatial transcriptome data using multi-spatial self-supervised contrastive learning as described in claim 1, characterized in that, In S2 and S3, a graph neural network is used to construct an encoder to extract potential embeddings from spatial transcriptome data. Further, a graph convolutional autoencoder is introduced to more comprehensively integrate gene expression information and spatial location information, and to learn a compact potential representation for spatial transcriptome data. The fusion of graph feature representation E and latent embedding refers to the concatenation operation of the low-dimensional embedding representation Z and the graph feature representation E along the feature dimension to obtain the fused representation. ; Both the encoder and decoder are composed of a single-layer graph convolutional network (GCN). The input includes a normalized gene expression matrix X and an adjacency matrix A generated by spatial coordinates. Within this framework, the encoder maps the input to a low-dimensional embedding representation Z, and the decoder combines the low-dimensional embedding representation Z with the fusion result. The gene expression matrix H was reconstructed. In form, Z and H are expressed as follows: in, This represents the normalized adjacency matrix. , It is the identity matrix. It is a diagonal matrix with diagonal elements as follows: , Represents a non-linear activation function. and These represent the trainable weight matrices in the encoder and decoder, respectively. To fully utilize the gene expression matrix X, the model is trained by minimizing the gene expression reconstruction loss, which can be represented as follows: Among them, L recon Indicates the reconstruction loss. h represents the expression vector of the i-th node in the gene expression matrix X. i This represents the expression vector of the i-th node in the reconstructed gene expression matrix H.
6. The spatial domain identification method for spatial transcriptome data using multi-spatial self-supervised contrastive learning as described in claim 1, characterized in that, In S2, the multi-space generator employs a multi-space contrastive learning strategy to ensure that the model captures rich global spatial context information of spatial points. Furthermore, it embeds features from the original graph nodes encoded by a single-layer graph convolutional network (GCN). and enhanced graph node embedding features As input, they are fed into the multi-space generator MSG to obtain multiple graph embeddings, i.e., global embeddings; When the input is the original graph node embedding features When encoded by the space generator MSG, this process is represented as: in, u represents the number of spaces that need to be compared. (i) ∈R C / p Embed the node of the i-th space. Let l be the node feature dimension, and l represent the l-th space. When the input is an augmented graph node embedding feature When encoded by the space generator MSG, the process is similar to the previous one, and is also represented as: Where, r (i) ∈R C / p Embed the node of the i-th space.
7. The spatial domain identification method for spatial transcriptome data using multi-spatial self-supervised contrastive learning as described in claim 1, characterized in that, In S3, the reconstruction loss L obtained in the autoencoder part is incorporated. recon And the contrastive loss obtained in the self-supervised contrastive learning part Calculate the total loss function L total The expression is: ; Where α and β are both weighting parameters; By minimizing the total loss function L total To obtain better gene expression remodeling results H.
8. The spatial domain identification method for spatial transcriptome data using multi-spatial self-supervised contrastive learning as described in claim 1, characterized in that, For intra-spatial contrast loss, since when and When the distribution is unknown, mutual information This becomes difficult to handle, so a lower bound estimation of mutual information based on sampling samples is used instead of maximizing mutual information. The Jensen-Shannon mutual information estimation is employed, and the calculation formula is as follows: ; in, It is a discriminator that takes the representations of two views as input and scores the consistency between them. Here, the discriminator is simply instantiated as the dot product between the two representations, i.e. SP(·) is the activation function. For the joint distribution expectation of two views within the same space k, The product of the independent distribution expectations of two views within the same space k; For spatial contrast loss, we similarly introduce an upper bound estimate of mutual information to replace minimizing mutual information, which is to invert the Jensen-Shannon mutual information estimation formula. The final contrastive loss function is determined as follows: ; in, This represents the expectation of the joint distribution expectation of two views within group k. This represents the expectation of the product of the independent distribution expectations of two views within group k. This represents the expectation obtained by taking group l and group k respectively under the joint distribution expectation of the two views in group k and group l.
9. The spatial domain identification method for spatial transcriptome data using multi-spatial self-supervised contrastive learning as described in claim 1, characterized in that, In step S4, spatial domain identification of the spatial transcriptome further includes: taking the gene expression matrix H reconstructed in step S3 as input, assigning a pseudo-label of a spatial region to each spatial site using the Mclust clustering algorithm. The pseudo-label is an integer value with a range of [0, D], where D is the number of pre-specified spatial domain regions. Subsequently, the clustering accuracy is evaluated using relevant metrics, such as the adjusted Landry index (ARI) and the normalized mutual information (NMI). The ARI ranges from [-1, 1], and the NMI ranges from [0, 1]. Higher values indicate better evaluation metrics, while lower values indicate worse evaluation metrics.
Citation Information
Patent Citations
Spatial domain identification method based on multi-view weighted fusion GCN network
CN120148635A
Transcriptomics spatial domain identification method
CN120600121A