Spatial transcriptome spatial domain identification method based on deep learning

Through deep learning technology, the identification of the transcriptome spatial domains has solved the problem that traditional transcriptomics cannot provide spatial distribution of gene expression, achieved evaluation of drug target location and cell type impact, and improved the accuracy of drug development and treatment.

CN119274657APending Publication Date: 2025-01-07HARBIN INST OF TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411002154.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

Traditional transcriptomics technology cannot provide spatial distribution information of gene expression, and cannot study the mechanism of action and effectiveness evaluation of drugs in tissues.

Method used

Using deep learning-based spatial transcriptome spatial domain recognition method, gene expression information is extracted and RGB images are generated through graph neural network and image segmentation model, spatial domains in the tissue are identified, and data processing is performed using Graph Autoencoder and Twins-PCPVT models and Image segmentation.

Benefits of technology

The determination of drug target position distribution and the impact assessment of different cell types are achieved, and the accuracy and effectiveness of drug development and clinical treatment are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119274657A_ABST
    Figure CN119274657A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of biology, in particular to a deep learning-based spatial transcriptome spatial domain identification method, a spatial transcriptome technology can be used for researching an action mechanism and effect evaluation of a drug in a tissue, and through spatial domain identification, a position distribution condition of a drug target in the tissue can be determined; and the influence of the drug on different cell types is evaluated, so that targeted design and drug effect evaluation in the drug development process can be guided, and the accuracy and effectiveness of clinical treatment are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of biological technology, and in particular to a spatial transcriptome spatial domain identification method based on deep learning. Background Art

[0002] Transcriptomics is a discipline that studies gene transcription in cells at a holistic level. It focuses on gene expression and transcriptional regulation. The research objects of transcriptomics include messenger RNA (mRNA), transfer RNA (tRNA), ribosomal RNA (rRNA) and other non-coding RNA (such as micro RNA, small RNA, etc.). In a broad sense, the transcriptome refers to the sum of RNA molecules produced by all gene transcription in a specific cell type or physiological or disease state; in a narrow sense, it refers to the collection of all mRNA molecules under a certain physiological condition. Transcriptomics is the inevitable bridge connecting genomic genetic information and biological phenotype, and is an indispensable and important part of functional genomic research.

[0003] As a revolutionary and efficient tool, transcriptome sequencing (RNA-seq) can remove introns and non-coding regions, thereby interpreting the fine map of gene expression in a more cost-effective manner. This technology can solve problems such as gene expression profiling, discovery of new transcripts, mining of low-abundance transcripts, and regulation of alternative splicing, and is widely used in agronomy, biology, medical research and other fields.

[0004] Traditional transcriptomics techniques typically involve extracting total RNA from tissues or cells, then sequencing and analyzing its gene expression patterns; however, this approach cannot provide information about how gene expression is spatially distributed. Summary of the invention

[0005] 1. Technical issues to be resolved

[0006] In order to solve the above technical problems, the present invention provides a spatial domain identification method of spatial transcriptome based on deep learning.

[0007] (II) Technical solution

[0008] Based on this, the present invention provides the following technical solutions: a spatial domain recognition method for spatial transcriptome based on deep learning, the identification and image segmentation process of the spatial domain in the original histological image, and the spatial domain recognition of spatial transcriptome using deep learning have the following process:

[0009] Step S1: Gene expression information is extracted from the original image, the coordinate information of the points in the histological image is obtained, and data preprocessing is performed. Each observation unit spot in the tissue sample with a small number of cells is modeled as a node, and the measured gene expression is regarded as a node attribute. Since adjacent spots in the tissue slice are connected by undirected edges in the Euclidean space, this grid spot can be modeled based on the graph neural network model SpaGCN, which learns three-dimensional embedding to retain the topological relationship between all points in the transcriptomics space. The three-dimensional embedding of gene expression is mapped to the three color channels of R, G and B in the RGB image, which is visualized as an image of spatial gene expression, which is a gene expression matrix;

[0010] Step S2: Integrate the gene expression information and the coordinate information of the midpoints of the histological image into a graph data structure;

[0011] Step S3: Generate a three-dimensional embedding from the graph data structure through Graph Autoencoder, and then map it to the RGB spectrum to generate an RGB image;

[0012] Step S4: After segmenting the generated RGB image using the deep learning-based image segmentation model, a number of segmentation maps are obtained, each of which corresponds to a spatial domain;

[0013] Step S5: Infer the results through several segmentation maps.

[0014] Preferably, the specific operation steps of step S2 described above are as follows:

[0015] Step S21: Data normalization: Use the logCPM method to normalize the gene expression matrix. edgeR provides a quantitative method called CPM, which stands for count-per-million, i.e. counts per million. CPM is essentially relative abundance, but considering that the total number of sequenced genes is large, the total number of genes is in millions. CPM is used to filter genes with low expression, but because the CPM values ​​of different genes vary greatly, log transformation is used to narrow the differences between different genes, which is the logCPM method;

[0016] Step S13: Missing point filling: Due to technical imperfections, some spots may be missing in tissue sections, which results in blank blocks at the locations of these spots in the RGB image. Such blank blocks, which are incompatible noise, may interfere with the boundary identification of the subsequent spatial architecture. We assume that neighboring spots may have values ​​similar to the missing spots, and estimate these missing spot values ​​by applying a weighted average to the pixels of their valid 6 neighboring spots. Since these missing points are colored, and by default are the same as the background outside the tissue, we need to distinguish them from all-white pixels based on topological structure analysis. First, all contours of the tissue are detected step by step starting from the boundary. The contour with the largest area is determined as the outer contour. Then, all white pixels within the tissue contour are replaced with the interpolated values ​​of the neighbors. Given the missing spot coordinates, search for their nearest k valid spots s i (i=1,2,...k) to calculate the interpolation value x of the target missing point s s , see the following formula:

[0017]

[0018] Where dis(s i ,s)——s i The Euclidean distance from s;

[0019] Softmax()——Activation function, all dis(s i ,s) and its k (k=6 by default) neighbors s i Normalized to weights between 0 and 1.

[0020] Preferably, the specific operation steps of step S3 described above are as follows:

[0021] Step S31: Graph autoencoder reduces the dimension of the gene expression matrix through PCA and selects the first 50 principal components as input. After receiving the input, Graph autoencoder converts it into a weighted undirected graph G(U,V) based on the gene expression and tissue image data, where each spot is a vertex and every two vertices in V are connected by a weighted edge;

[0022] Step S32: Although some spots are physically adjacent to each other, they belong to different tissue layers in the histological image, so other methods need to be considered to determine whether two spots are adjacent. We stipulate that two spots are adjacent if and only if: the two spots are physically adjacent; the two spots have similar pixel similarity in the histological image. Define a distance metric based on the above two points, expand the original two-dimensional coordinates of the spot to three dimensions, and for each spot v, add a coordinate z to it.v ;

[0023] Step S33: In the converted graph G(U,V), the distance value between vertices u and v represents the relative similarity of the two vertices, and the distance value between vertices u and v is determined by the physical distance between u and v on the tissue slice and the histological information related to the two points. In order to derive a single value to represent the histological feature, the graph autoencoder uses the weighted sum z of the RGB values ​​of each spot v , see the following formula:

[0024]

[0025] Where r v ——R value of v;

[0026] g v ——G value of spot v;

[0027] b v ——B value of spot v;

[0028] V r ——The variance of the R values ​​of all spots;

[0029] V g ——The variance of the G value of all spots;

[0030] V b ——The variance of the B values ​​of all spots.

[0031] Then z v Refactored to As the last coordinate value added, see the following formula:

[0032]

[0033] In the formula ——weighted sum of the RGB values ​​of spot v;

[0034] μ z ——z v The mean of

[0035] σ z ——z v The standard deviation of

[0036] σ x ——x v The standard deviation of

[0037] σ y ——y v The standard deviation of

[0038] s – scaling factor, usually set to 1;

[0039] Step S34: After the above operations, all vertices in the graph G(U,V) are constructed, and the coordinates of each vertex v are obtained. There is a weighted edge between every two vertices in the graph. Let's start calculating the weight of each edge. Since the weight of the edge reflects the degree of correlation between the two vertices and is negatively correlated with the distance between the two points, the weight w(u,v) of the edge (u,v) is defined as follows:

[0040]

[0041] Where d(u,v) is the Euclidean distance between vertices u and v;

[0042] l is a hyperparameter, which is the characteristic length scale and determines the rate at which the weight decays.

[0043] After completing the above operations, the weighted undirected graph G(U,V) is constructed, and the adjacency matrix A=[w(u,v)] is used to save the obtained graph data structure as the input of the graph convolution layer.

[0044] Preferably, the image segmentation model in step S4 as described above includes three parts: a backbone network, a decoding head and an auxiliary head;

[0045] The backbone network is implemented based on Twins-PCPVT, which is a parallel cross-parameterized model of Vision Transformer for image segmentation tasks. The model processes multiple stages in parallel, each with different embedding dimensions, number of attention heads, and number of basic blocks. Each stage extracts features by dividing the input image into image patches of different sizes and using Patch Embedding technology. In each stage, the model uses a spatially separable self-attention mechanism to capture local and global relationships in the image. Through the interaction of query, key, and value, the attention mechanism calculates the weight value of the feature, which can better capture the dependency between features.

[0046] Preferably, the decoding head adopts the UPerHead decoding head, which realizes the effective integration and utilization of features at different stages through multi-scale feature fusion and channel attention mechanism. Combined with the cross entropy loss function for classification, it has good feature expression ability and loss optimization performance, and is suitable for multi-category classification tasks. At the same time, the Dropout technology is used to reduce the risk of overfitting and ensure the generalization ability of the model.

[0047] Preferably, the auxiliary head adopts the FCNHead structure, introduces a convolution layer in the feature extraction process, extracts the information of the input features and realizes classification, classifies through the cross entropy loss function, and sets appropriate loss weights to balance the effects of the main classification head and the auxiliary head during the training process.

[0048] Preferably, the specific operation steps of step S4 described above are as follows:

[0049] Step S41: Model training is completed on the MMSegmentation (an open source semantic segmentation toolbox based on PyTorch) platform. The transformations defined in MMSegmentation are applied, including random cropping, rotation, and photometric distortion to enhance the training RGB images. Each RGB image is cropped to a size of 400×400 to provide the model with different ROIs from the entire RGB image.

[0050] Step S42: Perform random rotation (ranging from -180° to 180°) to adapt to the potential irregular layout of the spatial architecture. In the process of loading the dataset into MMSegmentation, some photometric distortion methods such as brightness, contrast, hue and saturation changes are also used to train the samples;

[0051] Step S43: Use singlecell_dataset as the data set and write its corresponding registration file for MMSegmentation, so that the settings, parameters and usage policies of the data set can be directly added to the data set configuration file of the MMSegmentation model configuration. The data set is stored in the data folder under the mmsegmentation directory and is named singlecell_dataset. The format is as follows:

[0052] singelcell_dataset /

[0053] |__ann_dir /

[0054] ||__train

[0055] ||__val

[0056] |__img_dir /

[0057] ||__train

[0058] ||__val

[0059] The training images are stored in img_dir, the label images corresponding to the training images are stored in ann_dir, train is the training set, and val is the validation set;

[0060] The singlecell_dataset contains 12 groups of labeled samples and 4 groups of unlabeled samples. The labeled samples are spatial transcriptome RGB images and their corresponding labeled grayscale images. The unlabeled samples only have spatial transcriptome RGB images. Each group of samples contains 60 spatial transcriptome RGB images generated by GraphAutoencoder with different hyperparameter combinations. The entire dataset is divided into three parts: training set, validation set, and test set. The training set and validation set are used to train the image segmentation model, which are 12 groups of labeled samples; the test set is used to evaluate the inference results of the model, which is divided into 4 groups of unlabeled samples and 4 groups of labeled samples. The unlabeled samples are used to evaluate the segmentation effect of the model on unknown histological images, and the labeled samples are used to evaluate the training effect of the model itself.

[0061] (III) Beneficial effects

[0062] Compared with the prior art, the present invention provides a spatial transcriptome spatial domain identification method based on deep learning, which has the following beneficial effects:

[0063] This is a spatial domain identification method for spatial transcriptomes based on deep learning. Spatial transcriptome technology can be used to study the mechanism of action and effect evaluation of drugs in tissues. Through spatial domain identification, the location distribution of drug targets in tissues can be determined, and the effects of drugs on different cell types can be evaluated. This helps guide targeted design and efficacy evaluation in the drug development process and improve the accuracy and effectiveness of clinical treatment. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] Figure 1 It is a specific working flow diagram of the present invention;

[0065] Figure 2 Schematic diagram of the optimal parameter combination corresponding to the unlabeled sample of the present invention;

[0066] Figure 3 It is a schematic diagram of the RGB image construction results of four groups of samples of the present invention;

[0067] Figure 4 Schematic diagram of RGB image reasoning results of four groups of samples of the present invention;

[0068] Figure 5 Schematic diagram of image segmentation results of the Human_Colorectal_Cancer sample of the present invention;

[0069] Figure 6 This is a schematic diagram of the training effect evaluation of the present invention;

[0070] Figure 7 A schematic diagram of Moran's I index of five image segmentation models of the present invention on an unlabeled sample group;

[0071] Figure 8 Schematic diagram of ARI of the five image segmentation models of the present invention on a labeled sample group. DETAILED DESCRIPTION

[0072] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0073] See also Figure 1-Figure 8 , a spatial transcriptome spatial domain identification method based on deep learning, specifically including the following embodiments:

[0074] Example 1

[0075] The process of identifying the spatial domain and image segmentation in the original histological image and using deep learning to identify the spatial domain of the spatial transcriptome has the following process:

[0076] Step S1: extracting gene expression information and coordinate information of the midpoints of the histological image from the original image and performing data preprocessing;

[0077] Step S2: Integrate the gene expression information and the coordinate information of the midpoints of the histological image into a graph data structure;

[0078] Step S3: Generate a three-dimensional embedding from the graph data structure through Graph Autoencoder, and then map it to the RGB spectrum to generate an RGB image;

[0079] Step S4: After segmenting the generated RGB image using the deep learning-based image segmentation model, a number of segmentation maps are obtained, each of which corresponds to a spatial domain;

[0080] Step S5: Infer the results through several segmentation maps.

[0081] Example 2

[0082] In practical applications, for the same sample, the present invention uses different combinations of pca and res parameters to generate spatial transcriptome RGB images with different effects. Here, only the best images in the unlabeled sample group are shown. The best parameter combinations corresponding to the four groups of unlabeled samples are shown in Figure 2. Figure 2 shown.

[0083] The histological images of each group of samples will generate 60 corresponding spatial transcriptome RGB images according to different parameter combinations. Although these spatial transcriptome RGB images correspond to the same histological image, their specific construction effects and quality are different. The spatial transcriptome RGB images of the best parameter combination generated by GraphAutoencoder for these four groups of samples are shown below. Figure 3 shown.

[0084] In the spatial transcriptome RGB image generated here, the spatial domain is preliminarily displayed as a specific color. The area corresponding to each color in the image can be roughly considered as a spatial domain, but the specific information of the spatial domain is still unknown, which requires the use of subsequent image segmentation models to accurately identify the specific spatial domain.

[0085] The present invention performs image segmentation on four groups of unlabeled samples, Human_Colorectal_Cancer, Human_Glioblastoma, Human_Kidney, and Human_Ovarian_Carcinoma, and four groups of labeled samples, 151509, 151669, 151670, and 151675. Only the image segmentation results of the unlabeled samples are shown here.

[0086] There are two specific steps in the image segmentation part. First, the image segmentation model constructed by the present invention is called to infer the spatial transcriptome RGB image constructed previously. The specific inference result is still an RGB image. After the RGB image is re-dyed by the image segmentation model, the area corresponding to each color has its specific meaning, that is, the specific spatial domain; then, the pixel points specifically contained in each type of spatial domain are separately saved as the corresponding segmentation map, and it is restored from the spatial transcriptome RGB image to the original histological image.

[0087] Next, the image segmentation model is called to infer these images. The specific inference results of RGB images are as follows Figure 4 shown.

[0088] In the existing labeled data, the spatial transcriptome can be divided into eight categories, namely Layer1, Layer2, Layer3, Layer4, Layer5, Layer6, Layer7 and VM. The type of spatial domain of each sample in the above unlabeled sample group is unknown. If the corresponding class does not appear in the final segmentation result, it is considered that the sample does not contain the spatial domain of this class. Here we only show the image segmentation results of the Human_Colorectal_Cancer sample, as shown in Figure 5 shown.

[0089] The training of the image segmentation model of the present invention and the subsequent benchmark evaluation are all carried out on a Windows 10 system with 2TB storage space, 1x AMD Ryzen 7Moblie 3750H 4-core processor, 8GB RAM 8GB DDR41333MHz RAM, and 1xNVIDIA GTX1650 GPU with 4G video memory. mAC and mIOU will be used to evaluate the training effect of the model.

[0090] ACC is the accuracy of the image segmentation model. It is an indicator for evaluating the training effect of the model. It is usually used to measure the proportion of pixels correctly classified by the model in the image segmentation task. ACC is calculated by dividing the number of pixels correctly predicted by the model by the total number of pixels. mAC is the average of the corresponding ACCs of each category. Generally speaking, the size of the ACC of the model can roughly reflect the performance of the segmentation. When mAC is high, there are more correctly classified pixels in the segmentation result and the segmentation performance is better; when mAC is low, it means that there are more misclassified pixels in the segmentation result and the segmentation performance is poor. The calculation of ACC is shown in the formula.

[0091]

[0092] Where TP is the number of pixels that the model will predict as correct and belong to the correct category;

[0093] TN — the number of pixels that the model will belong to the wrong class and be predicted as wrong;

[0094] FP — the number of pixels that the model predicted as correct and belonged to the wrong class;

[0095] FN — The number of pixels that the model predicted as being in the correct class and that were predicted as being incorrect.

[0096] IOU is an important indicator in the image segmentation model. It is the intersection-over-union ratio of the image segmentation model, which is the ratio of the intersection and union of the model's prediction results and the true values ​​for a certain category. It is used to measure the degree of overlap between the model's prediction results for a specific category and the true values. IOU calculates the ratio between the intersection area and the union area of ​​the predicted results and the true segmentation results. The calculation method is to divide the intersection area of ​​the segmentation results predicted by the model and the actual segmentation results by their union area. mIOU is the average of the corresponding IOUs of each category. When mIOU is high, it means that the segmentation result is closer to the true result and the segmentation performance is better; when mIOU is low, it means that the segmentation result is different from the true result and the segmentation performance is poor. The calculation of IOU is shown in the following formula.

[0097]

[0098] Where TP is the number of pixels that the model will predict as correct and belong to the correct category;

[0099] FP — the number of pixels that the model predicted as correct and belonged to the wrong class;

[0100] FN — The number of pixels that the model predicted as being in the correct class and that were predicted as being incorrect.

[0101] The image segmentation model used in this paper is compared with the pspnet, ocrnet, knet, and deeplabv3 models to evaluate the training effect of the model. The corresponding mACC and mIOU are as follows: Figure 6 shown.

[0102] Segmentation map quality assessment

[0103] After obtaining the final result of image segmentation, we need an indicator to evaluate the effect of segmentation. Here we use the modified Moran's I index to evaluate the quality of the segmentation map.

[0104] Moran's I index is a statistical indicator used to measure spatial correlation or spatial autocorrelation. It describes the average degree of correlation between all spatial units and their surroundings in the entire region and is often used in spatial data analysis. Its value range is between -1 and 1. If the Moran's I index is close to 1, it means there is positive spatial autocorrelation, that is, similar values ​​are clustered together; if the Moran's I index is close to -1, it means there is negative spatial autocorrelation, that is, similar values ​​are surrounded by opposite values; if the Moran's I index is close to 0, it means there is no spatial autocorrelation, that is, the spatial distribution is random.

[0105] Different from the conventional Moran's index used to reveal the spatial autocorrelation of a single gene, the present invention modifies the calculation method of the Moran's index to evaluate the quality of the segmentation map under the condition that the actual situation is unknown, so the test set used is an unlabeled sample group. The modified Moran's index analyzes the heterogeneity of the predicted segment by measuring the pixel contrast of any two predicted adjacent segments of each channel. The higher the Moran's index, the higher the spatial domain correlation corresponding to the segmentation map. The calculation of the Moran's index of the present invention is shown in the following formula.

[0106]

[0107] Where a ij ——The binary space of the i-th and j-th segments is adjacent (1≤i≤N,1≤j≤N);

[0108] ——The cth channel of the i-th segment of the RGB channel (1≤c≤3);

[0109] ——The average color value of the cth channel of all pixels in the RGB image.

[0110] The Moran index of the image segmentation model of the present invention and the pspnet, ocrnet, knet, and deeplabv3 models on the unlabeled sample group is as follows: Figure 7 shown.

[0111] It can be seen from the figure that the Moran's I index of the image segmentation model of the present invention is higher than that of other models as a whole, indicating that the overall quality of the segmentation map is better than that of the other four models.

[0112] Evaluation of the model’s predictive accuracy

[0113] For the overall prediction accuracy of the model, we use the ARI indicator to measure the consistency between the two partitions

[22] . ARI is a common external evaluation indicator for clustering, which evaluates the effectiveness of clustering by counting the number of sample pairs that are assigned to the same or different clusters in the true label and clustering results. Given a set S containing n elements, F1 = (X1, X2...X r ) and F2=(Y1,Y2...Y s ) are two partitions of S, where S = ∪ i X i and The same is true for F2. i It can be interpreted as a cluster generated by a certain clustering method. In this way, the calculation method of ARI is as follows.

[0114]

[0115] Where n ij =X i ∩Y j ——X i With Y j the number of objects owned in common;

[0116] a i ——All n ij Medium i_ sum;

[0117] b j ——All n ij Medium _j sum.

[0118] The range of ARI is usually between 0 and 1. The higher the ARI, the higher the consistency of the prediction results. The ARI of the image segmentation model of the present invention and the pspnet, ocrnet, knet, and deeplabv3 models on the labeled sample group is as follows: Figure 8 shown.

[0119] It can be seen from the figure that the ARI of the image segmentation model of the present invention is higher than that of other models as a whole, indicating that the prediction accuracy of the model of the present invention is better than that of the other four models.

[0120] Through spatial domain identification, the location and distribution of drug targets in tissues can be determined, and the effects of drugs on different cell types can be evaluated. This helps guide targeted design and efficacy evaluation during drug development and improves the accuracy and effectiveness of clinical treatment.

[0121] Meanwhile, the contents not described in detail in this specification belong to the prior art known to those skilled in the art.

[0122] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.

[0123] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A spatial transcriptome spatial domain identification method based on deep learning, characterized by: The process of identifying the spatial domain and image segmentation in the original histological image, and using deep learning to identify the spatial domain of the spatial transcriptome has the following process: Step S1: extracting gene expression information and coordinate information of the midpoints of the histological image from the original image and performing data preprocessing; Step S2: Integrate the gene expression information and the coordinate information of the midpoints of the histological image into a graph data structure; Step S3: Generate a three-dimensional embedding from the graph data structure through Graph Autoencoder, and then map it to the RGB spectrum to generate an RGB image; Step S4: After segmenting the generated RGB image using the deep learning-based image segmentation model, a number of segmentation maps are obtained, each of which corresponds to a spatial domain; Step S5: Infer the results through several segmentation maps.

2. The method for spatial domain identification of spatial transcriptome based on deep learning according to claim 1, characterized in that: The specific operation steps of step S1 described above are as follows: Data format: Each observation unit spot in a tissue sample of a small number of cells is modeled as a node, and the measured gene expression is regarded as a node attribute. The SpaGCN model based on the graph neural network is modeled, and the three-dimensional embedding of gene expression is mapped to the three color channels of R, G and B in the RGB image, which is visualized as an image of spatial gene expression, which is a gene expression matrix.

3. The method for spatial domain identification of spatial transcriptome based on deep learning according to claim 1, characterized in that: The specific operation steps of step S2 described above are as follows: Step S21: Data normalization: Use the logCPM method to normalize the gene expression matrix, use CPM to filter genes with low expression, and use log transformation to narrow the differences between different genes; Step S13: Missing point filling: Due to technical imperfections, some spots may be missing in the tissue slices. It is assumed that the neighboring spots may have values ​​similar to the missing spots, and the missing spot values ​​are estimated by applying weighted average to the pixels of its 6 valid neighboring spots. They are distinguished from all white pixels based on topological structure analysis. First, all contours of the tissue are detected step by step starting from the boundary. The contour with the largest area is determined as the outer contour. Then, all white pixels within the tissue contour are replaced with the interpolated values ​​of the neighbors. Given the missing spot coordinates, search for the nearest k valid spots s i (i=1,2,...k) to calculate the interpolation value x of the target missing point s s , see the following formula: Where dis(s i ,s)——s i The Euclidean distance from s; Softmax()——Activation function, all dis(s i ,s) and its k neighbors s i Normalized to weights between 0 and 1.

4. The method for spatial domain identification of spatial transcriptome based on deep learning according to claim 1, characterized in that: The specific operation steps of step S3 described above are as follows: Step S31: Graphautoencoder reduces the dimension of the gene expression matrix through PCA and selects the first 50 principal components as input. After receiving the input, Graphautoencoder converts it into a weighted undirected graph G(U,V) based on the gene expression and tissue image data, where each spot is a vertex and every two vertices in V are connected by a weighted edge; Step S32: Two spots are defined as adjacent if and only if: the two spots are physically adjacent; the two spots have similar pixel similarity on the histological image. Define a distance metric based on the above two points, expand the original two-dimensional coordinates of the spot to three dimensions, and add a coordinate z to each spot v. v ; Step S33: In the converted graph G(U,V), the distance value between vertices u and v represents the relative similarity of the two vertices, and the distance value between vertices u and v is determined by the physical distance between u and v on the tissue slice and the histological information related to the two points. Graphautoencoder uses the weighted sum z of the RGB values ​​of each spot v , see the following formula: Where r v ——R value of v; g v ——G value of spot v; b v ——B value of spot v; V r ——The variance of the R values ​​of all spots; V g ——The variance of the G value of all spots; V b ——The variance of the B values ​​of all spots; Then z v Refactored to As the last coordinate value added, see the following formula: In the formula ——weighted sum of the RGB values ​​of spot v; μ z ——z v The mean of σ z ——z v The standard deviation of σ x ——x v The standard deviation of σ y ——y v The standard deviation of s – scaling factor, usually set to 1; Step S34: After the above operations, all vertices in the graph G(U,V) are constructed, and the coordinates of each vertex v are obtained. There is a weighted edge between every two vertices in the graph. Let's start calculating the weight of each edge. The weight w(u,v) of the edge (u,v) is defined as follows: Where d(u,v) is the Euclidean distance between vertices u and v; l is a hyperparameter, which is the characteristic length scale and determines the rate at which the weight decays. After completing the above operations, the weighted undirected graph G(U,V) is constructed, and the adjacency matrix A=[w(u,v)] is used to save the obtained graph data structure as the input of the graph convolution layer.

5. The method for spatial domain identification of spatial transcriptome based on deep learning according to claim 1, characterized in that: The image segmentation model in step S4 as described above includes three parts: a backbone network, a decoding head and an auxiliary head; The backbone network is implemented based on Twins-PCPVT. The model processes multiple stages in parallel, each with different embedding dimensions, number of attention heads and number of basic blocks. Each stage divides the input image into image blocks of different sizes and uses Patch Embedding technology to extract features. In each stage, the model uses a spatially separable self-attention mechanism to capture local and global relationships in the image. The attention mechanism calculates the weight value of the feature through the interaction of query, key and value.

6. The method for spatial domain identification of spatial transcriptome based on deep learning according to claim 5, characterized in that: The decoding head adopts the UPerHead decoding head, which realizes the effective integration and utilization of features at different stages through multi-scale feature fusion and channel attention mechanism. At the same time, the Dropout technology is used to reduce the risk of overfitting.

7. The method for spatial domain identification of spatial transcriptome based on deep learning according to claim 1, characterized in that: The auxiliary head adopts the FCNHead structure, introduces a convolution layer in the feature extraction process, extracts the information of the input features and realizes classification, classifies through the cross entropy loss function, and sets appropriate loss weights.

8. The method for spatial domain identification of spatial transcriptome based on deep learning according to claim 1, characterized in that: The specific operation steps of step S4 described above are as follows: Step S41: Model training is completed on the MMSegmentation (an open source semantic segmentation toolbox based on PyTorch) platform. The transformations defined in MMSegmentation are applied, including random cropping, rotation, and photometric distortion to enhance the training RGB images. Each RGB image is cropped to a size of 400×400 to provide the model with different ROIs from the entire RGB image. Step S42: performing random rotation (ranging from -180° to 180°) to adapt to the potential irregular layout of the spatial architecture; Step S43: Use singlecell_dataset as the data set and write the corresponding registration file for MMSegmentation. The data set is stored in the data folder under the mmsegmentation directory and is named singlecell_dataset. The format is as follows: The training images are stored in img_dir, the label images corresponding to the training images are stored in ann_dir, train is the training set, and val is the validation set; The singlecell_dataset contains 12 groups of labeled samples and 4 groups of unlabeled samples. The labeled samples are spatial transcriptome RGB images and their corresponding labeled grayscale images. Each group of samples contains 60 spatial transcriptome RGB images generated by Graph Autoencoder with different hyperparameter combinations. The entire dataset is divided into three parts: training set, validation set, and test set. The training set and validation set are used to train the image segmentation model, which are 12 groups of labeled samples; the test set is used to evaluate the inference results of the model, which is divided into 4 groups of unlabeled samples and 4 groups of labeled samples. The unlabeled samples are used to evaluate the segmentation effect of the model on unknown histological images, and the labeled samples are used to evaluate the training effect of the model itself.

Citation Information

Cited By

  • Gene expression deletion filling method and system based on deep learning

    CN120183513A