Training method of lifetime prediction model, lifetime prediction method and apparatus
By jointly utilizing population and spatial training data to train the survival prediction model, the problem of scarce clinical samples of spatial transcriptomes was solved, accurate correlation prediction between gene expression and survival was achieved, and the accuracy and interpretability of survival prediction were improved.
Patent Information
- Application Number
- CN202510796805.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-10-03
AI Technical Summary
Since spatial transcriptomics technology has not yet been widely used in clinical practice, clinical prognostic information such as patient survival samples are scarce, making it difficult to effectively learn the underlying patterns between spatial features and survival.
By jointly utilizing population training data and spatial training data to train a survival prediction model, a basic association model between gene expression and survival is established using population transcriptome representation vectors with rich survival annotations. The spatial dependence of the tissue microenvironment is encoded through a spatial constraint matrix, and the spatial characteristics of gene expression and its potential association with survival are captured with the help of a spatial smoothness loss function.
It effectively overcomes the limitation of the scarcity of clinical samples of spatial transcriptomes, achieves accurate prediction of the potential association between gene expression and survival, and improves the accuracy and interpretability of survival prediction.
Smart Images

Figure CN120748501A_ABST
Abstract
Description
Technical Field
[0001] The disclosed technical solution relates to the technical field of bioinformatics, and in particular to a training method for a survival prediction model, a survival prediction method, and a device. Background Art
[0002] Population transcriptomics is a gene expression analysis technique based on the entire tissue sample. It can obtain the average gene expression of all cells in the sample tissue, but it cannot analyze the spatial characteristics of gene expression. Spatial transcriptomics is a high-throughput gene expression analysis technique that preserves the spatial location information of the sample tissue. It can simultaneously detect gene expression levels and record the spatial coordinates of each expression signal in the tissue section, thereby revealing the spatial heterogeneity of gene expression and its association with the tissue microenvironment.
[0003] However, since spatial transcriptomics technology has not yet been widely used in clinical practice, spatial transcriptomics samples with clinical prognostic information, such as patient survival, are very scarce, resulting in supervised learning methods that rely on large amounts of labeled data to find it difficult to effectively learn the underlying patterns between spatial features and survival. Summary of the Invention
[0004] In view of this, the embodiments of the present disclosure provide a training method for a survival prediction model, a survival prediction method, and an apparatus.
[0005] According to a first aspect of the present disclosure, a method for training a survival prediction model is proposed, the method comprising:
[0006] Obtaining population training data and spatial training data; the population training data includes at least one population transcriptome representation vector annotated with a survival period, and the spatial training data includes at least one spatial transcriptome representation vector group annotated with a spatial constraint matrix, wherein the spatial constraint matrix is jointly generated based on the spatial distance between each sampling point corresponding to each spatial transcriptome representation vector group in the sample tissue and the gene expression similarity of each sampling point;
[0007] For the population training data: inputting the population transcriptome representation vector in the population training data into the survival prediction model to be trained, obtaining the distribution parameters corresponding to each population transcriptome representation vector output by the survival prediction model; constructing a likelihood loss function based on the distribution parameters and the survival period corresponding to each population transcriptome representation vector in the population training data, and adjusting the network parameters of the survival prediction model based on the likelihood loss function;
[0008] For the spatial training data: the spatial transcriptome representation vector group in the spatial training data is input into the survival prediction model to be trained, and the distribution parameters corresponding to each spatial transcriptome representation vector in each spatial transcriptome representation vector group are obtained as output by the survival prediction model; based on the distribution parameters, the predicted survival period corresponding to each spatial transcriptome representation vector is determined respectively; according to the predicted survival period corresponding to each spatial transcriptome representation vector and the spatial constraint information corresponding to the spatial transcriptome representation vector group in the training data, a loss function for characterizing spatial smoothness is constructed, and the network parameters of the survival prediction model are adjusted based on the loss function.
[0009] In combination with any embodiment provided by the present disclosure,
[0010] The population transcriptome representation vector is obtained based on the following method: obtaining a population transcriptome expression matrix, wherein the population transcriptome expression matrix includes gene expression data of at least one sample tissue; inputting the population transcriptome expression matrix into a pre-trained variational autoencoder model to obtain a population transcriptome representation vector output by the variational autoencoder model corresponding to each sample tissue in the population transcriptome expression matrix;
[0011] The spatial transcriptome representation vector group is obtained based on the following method: obtaining a spatial transcriptome expression matrix, wherein the spatial transcriptome expression matrix includes the spatial position coordinates of multiple sampling points for the same sample tissue and their corresponding gene expression data; inputting the spatial transcriptome expression matrix into a pre-trained variational autoencoder model to obtain a spatial transcriptome representation vector output by the variational autoencoder model corresponding to each sampling point in the spatial transcriptome expression matrix;
[0012] The variational autoencoder model includes a domain-specific batch normalization (DSBN) layer for performing normalization operations on the population transcriptome expression matrix and the spatial transcriptome expression matrix, respectively.
[0013] In combination with any embodiment provided in the present disclosure, the spatial constraint matrix is obtained based on the following method:
[0014] After calculating the spatial distance between every two sampling points according to the spatial position coordinates of each sampling point in the spatial transcriptome expression matrix, an adjacency matrix is constructed according to the spatial distance;
[0015] After calculating the gene expression similarity between every two sampling points based on the gene expression data of each sampling point in the spatial transcriptome expression matrix, a similarity coefficient matrix is constructed based on the gene expression similarity;
[0016] The adjacency matrix and the similarity coefficient matrix are multiplied bit by bit to obtain the spatial constraint matrix.
[0017] In combination with any embodiment provided in the present disclosure, the pre-trained variational autoencoder model is trained based on the following method:
[0018] Acquire training data; the training data includes at least one training data set, the training data set including a population transcriptome expression matrix and a spatial transcriptome expression matrix;
[0019] Inputting the population transcriptome expression matrix and the spatial transcriptome expression matrix included in the first training data group in the training data into the variational autoencoder model to be trained, respectively, to obtain the predicted population transcriptome representation vector corresponding to the population transcriptome expression matrix and the predicted spatial transcriptome representation vector corresponding to the spatial transcriptome expression matrix, respectively output by the variational autoencoder model;
[0020] Calculating the distribution distance between the predicted population transcriptome representation vector and the predicted spatial transcriptome representation vector;
[0021] At least according to the distribution distance, the network parameters of the variational autoencoder model to be trained are adjusted to obtain the pre-trained variational autoencoder model.
[0022] In combination with any embodiment provided by the present disclosure,
[0023] The gene expression data includes multiple genes and the expression level of each gene;
[0024] The step of inputting the population transcriptome expression matrix and the spatial transcriptome expression matrix included in the first training data group in the training data into the variational autoencoder model to be trained comprises:
[0025] Filtering the spatial transcriptome expression matrix for genes that meet a preset gene filtering condition to obtain spatial transcriptome expression genes; the preset gene filtering condition includes at least one of the following: the detection rate at each sampling point is less than or equal to a first threshold, and the average expression level at the sampling points expressing the gene is less than or equal to a second threshold;
[0026] Taking the intersection of the spatial transcriptome expression genes and the multiple genes included in the population transcriptome expression matrix to obtain characteristic genes;
[0027] Filtering other genes except the characteristic genes in the population transcriptome expression matrix and the spatial transcriptome expression matrix to obtain a filtered population transcriptome expression matrix and a filtered spatial transcriptome expression matrix;
[0028] The filtered population transcriptome expression matrix and spatial transcriptome expression matrix are respectively input into the variational autoencoder model to be trained.
[0029] In combination with any embodiment provided by the present disclosure,
[0030] Before filtering the genes in the spatial transcriptome expression matrix that meet the preset gene filtering conditions to obtain the spatial transcriptome expression genes, the method further includes:
[0031] Filtering the sampling points that meet the preset sampling point filtering conditions among the multiple sampling points included in the spatial transcriptome expression matrix;
[0032] The preset sampling point filtering condition includes at least one of the following:
[0033] The gene type is less than or equal to the third threshold;
[0034] The ratio of the total expression level of mitochondrial genes to the total expression level of all genes is greater than or equal to a fourth threshold.
[0035] According to a second aspect of the present disclosure, a method for predicting survival period is proposed, the method comprising:
[0036] Obtaining a spatial transcriptome expression matrix; the spatial transcriptome expression matrix includes the spatial position coordinates of multiple sampling points for the same sample tissue and their corresponding gene expression data;
[0037] Inputting the spatial transcriptome expression matrix into a pre-trained variational autoencoder model to obtain a spatial transcriptome representation vector output by the variational autoencoder model corresponding to each sampling point in the spatial transcriptome expression matrix;
[0038] Inputting the spatial transcriptome representation vector corresponding to each sampling point into a survival prediction model to obtain a distribution parameter corresponding to each sampling point output by the survival prediction model; the survival prediction model is trained by the survival prediction training method described in any embodiment of the present disclosure;
[0039] Based on the distribution parameters, the predicted survival period corresponding to each sampling point is determined respectively.
[0040] According to a third aspect of the present disclosure, a training device for a survival prediction model is proposed, the device comprising:
[0041] A training data acquisition module is configured to acquire population training data and spatial training data; the population training data includes at least one population transcriptome representation vector annotated with a survival period, and the spatial training data includes at least one spatial transcriptome representation vector group annotated with a spatial constraint matrix, wherein the spatial constraint matrix is jointly generated based on the spatial distance between each sampling point in the sample tissue corresponding to each spatial transcriptome representation vector group and the gene expression similarity of each sampling point;
[0042] A population training data training module is configured to input the population transcriptome representation vectors in the population training data into a survival prediction model to be trained, obtain distribution parameters corresponding to each population transcriptome representation vector output by the survival prediction model; construct a likelihood loss function based on the distribution parameters and the survival period corresponding to each population transcriptome representation vector in the population training data, and adjust network parameters of the survival prediction model based on the likelihood loss function;
[0043] A spatial training data training module is used to input the spatial transcriptome representation vector group in the spatial training data into the survival prediction model to be trained, and obtain the distribution parameters corresponding to each spatial transcriptome representation vector in each spatial transcriptome representation vector group output by the survival prediction model; based on the distribution parameters, the predicted survival period corresponding to each spatial transcriptome representation vector is determined respectively; according to the predicted survival period corresponding to each spatial transcriptome representation vector and the spatial constraint information corresponding to the spatial transcriptome representation vector group in the training data, a loss function for characterizing spatial smoothness is constructed, and the network parameters of the survival prediction model are adjusted based on the loss function.
[0044] According to a fourth aspect of the present disclosure, a survival prediction device is provided, comprising:
[0045] A matrix acquisition module is used to obtain a spatial transcriptome expression matrix; the spatial transcriptome expression matrix includes the spatial position coordinates of multiple sampling points for the same sample tissue and their corresponding gene expression data;
[0046] A vector acquisition module is used to input the spatial transcriptome expression matrix into a pre-trained variational autoencoder model to obtain a spatial transcriptome representation vector output by the variational autoencoder model corresponding to each sampling point in the spatial transcriptome expression matrix;
[0047] a distribution parameter acquisition module, configured to input the spatial transcriptome representation vector corresponding to each sampling point into a survival prediction model to obtain the distribution parameters corresponding to each sampling point output by the survival prediction model; the survival prediction model is trained using the survival prediction model training device described in any embodiment of the present disclosure;
[0048] The survival period determination module is used to determine the predicted survival period corresponding to each sampling point based on the distribution parameters.
[0049] According to a fifth aspect of the present disclosure, a computer-readable storage medium is provided, wherein the machine-readable storage medium stores machine-readable instructions, and when the machine-readable instructions are called and executed by a processor, the processor is prompted to implement the training method of the survival prediction model and the survival prediction method of any embodiment of the present disclosure.
[0050] According to a sixth aspect of the present disclosure, there is provided an electronic device, comprising
[0051] processor;
[0052] a memory for storing processor-executable instructions;
[0053] The processor is configured to execute the training method of the survival prediction model and the survival prediction method of any embodiment of the present disclosure.
[0054] The technical solutions provided by the embodiments of the present disclosure may have the following beneficial effects:
[0055] The training method and device, storage medium and electronic device of the survival prediction model provided by the embodiments of the present disclosure effectively overcome the limitation of the scarcity of clinical samples of spatial transcriptomes in the prior art by jointly utilizing group training data and spatial training data to train the survival prediction model. Specifically, in this training method, a basic correlation model between gene expression and survival can be established by using a group transcriptome representation vector with rich survival annotations. At the same time, the spatial dependence of the tissue microenvironment is encoded by a spatial constraint matrix, and the spatial smoothness loss function is used to guide the model to capture the spatial characteristics of gene expression and its potential correlation with survival.
[0056] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0058] Figure 1 is a flowchart of a method for training a survival prediction model according to an exemplary embodiment of the present disclosure;
[0059] Figure 2 is a schematic diagram of a network structure of a life span prediction model according to an exemplary embodiment of the present disclosure;
[0060] Figure 3 is a flowchart of another method for training a survival prediction model according to an exemplary embodiment of the present disclosure;
[0061] Figure 4 is a flowchart of another method for training a survival prediction model according to an exemplary embodiment of the present disclosure;
[0062] Figure 5 1 is a schematic diagram of a network structure of a variational autoencoder model according to an exemplary embodiment of the present disclosure;
[0063] Figure 6 is a flowchart of another method for training a survival prediction model according to an exemplary embodiment of the present disclosure;
[0064] Figure 7 is a flowchart of a method for training a variational autoencoder model according to an exemplary embodiment of the present disclosure;
[0065] Figure 8 is a flowchart of a method for predicting survival period according to an exemplary embodiment of the present disclosure;
[0066] Figure 9 is a schematic diagram of a survival prediction result according to an exemplary embodiment of the present disclosure;
[0067] Figure 10 1 is a structural diagram of a training device for a survival prediction model according to an exemplary embodiment of the present disclosure;
[0068] Figure 11 is a structural diagram of a survival period prediction device according to an exemplary embodiment of the present disclosure;
[0069] Figure 12 It is a structural diagram of an electronic device according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0070] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numerals in different drawings represent the same or similar elements.
[0071] Population transcriptomics is a gene expression analysis technique based on the entire tissue sample. It can obtain the average gene expression of all cells in the sample tissue, but it cannot analyze the spatial characteristics of gene expression. Spatial transcriptomics is a high-throughput gene expression analysis technique that preserves the spatial location information of the sample tissue. It can simultaneously detect gene expression levels and record the spatial coordinates of each expression signal in the tissue section, thereby revealing the spatial heterogeneity of gene expression and its association with the tissue microenvironment.
[0072] However, since spatial transcriptomics technology has not yet been widely used in clinical practice, spatial transcriptomics samples with clinical prognostic information, such as patient survival, are very scarce, resulting in supervised learning methods that rely on large amounts of labeled data to find it difficult to effectively learn the underlying patterns between spatial features and survival.
[0073] In view of this, the embodiments of the present disclosure provide a method for training a survival prediction model. In this method, by jointly using group training data and spatial training data to train the survival prediction model, the limitation of the scarcity of clinical samples of spatial transcriptomes in related technologies can be effectively overcome. Specifically, in this method, a population transcriptome representation vector with rich survival annotations can be used to establish a basic association model between gene expression and survival. At the same time, the spatial dependence of the tissue microenvironment is encoded through a spatial constraint matrix, and the spatial smoothness loss function is used to guide the model to capture the spatial characteristics of gene expression and its potential association with survival.
[0074] Before introducing this example method in detail, the following terms are introduced:
[0075] Spatial transcriptomics: Spatial transcriptomics is an emerging biological technology that combines spatial information and gene expression information to analyze the spatial distribution patterns of gene expression in tissue sections.
[0076] Population transcriptomics: Population transcriptomics technology is a sequencing technology based on the RNA of entire cell clusters or sample tissues. It converts RNA transcripts into sequenceable cDNAs and uses high-throughput sequencing technology to sequence and quantify these cDNAs. By comparing gene expression between sample tissues, we can understand the differences in gene expression and then understand the biological differences and functions between different cells or sample tissues. Although population transcriptomics technology can provide overall information about cell clusters and sample tissues, it cannot provide gene expression information of single cells and may mask single-cell heterogeneity in some cases because it cannot distinguish between different types of cells. At the same time, it cannot provide gene expression information at different spatial locations in the sample tissue.
[0077] Overall survival (OS) refers to the time from randomization to death from any cause. It is the most reliable indicator of the efficacy of anticancer drugs and the optimal efficacy endpoint in cancer clinical trials. If the patient has not died by the end of follow-up, the OS is calculated based on the last follow-up date and is generally calculated in months or years. For example, after treatment, a cancer patient is followed for a period of time, and the difference between the time of death and the end of follow-up is recorded as OS. An increase in this indicator can reflect a clear clinical benefit.
[0078] 10X Visium: 10X Visium is a high-throughput spatial transcriptomics technology that simultaneously captures gene expression and spatial location information on tissue sections, enabling spatial resolution of gene expression. This technology combines the high-throughput advantages of single-cell RNA sequencing (scRNA-seq) with the ability to analyze tissues in situ, providing a powerful tool for studying tissue microenvironments, cellular heterogeneity, and disease mechanisms.
[0079] DSBN (Domain-Specific Batch Normalization) is a technique used in deep neural networks to address domain adaptation and generalization. Its core concept is that DSBN retains multiple sets of BN parameters for each domain, normalizing data from different domains separately to capture domain-specific information.
[0080] MMD (Maximum Mean Discrepancy): is a non-parametric statistical test method widely used in machine learning and statistics. Its basic idea is to compare two distributions by embedding their means in the Reproducing Kernel Hilbert Space (RKHS).
[0081] Weibull distribution: Weibull distribution, also known as Weibull distribution or Weibull distribution, is the theoretical basis of reliability analysis and life testing.
[0082] In the following embodiments, the training process of the survival period prediction model will be described first, and then it will be explained how to perform survival period prediction using the trained survival period prediction model.
[0083] Figure 1 This is a flowchart of a method for training a survival prediction model according to an exemplary embodiment of the present disclosure. The method can be executed by various computing devices, including but not limited to computer devices. Figure 1 As shown, the exemplary embodiment method may include the following steps:
[0084] In step 101, group training data and space training data are obtained.
[0085] The population training data includes at least one population transcriptome representation vector annotated with a survival period, and the spatial training data includes at least one spatial transcriptome representation vector group annotated with a spatial constraint matrix, wherein the spatial constraint matrix is jointly generated based on the spatial distance between each sampling point corresponding to each spatial transcriptome representation vector group in the sample tissue and the gene expression similarity of each sampling point.
[0086] For the group training data, perform the following steps:
[0087] In step 102, the population transcriptome representation vector in the population training data is input into a life span prediction model to be trained, and a distribution parameter corresponding to each population transcriptome representation vector output by the life span prediction model is obtained.
[0088] It is understood that in practical applications, during a single model training process, the number of population transcriptome representation vectors input to the model can be one. Alternatively, to improve training efficiency, during a single model training process, the number of population transcriptome representation vectors input to the model can be multiple, which is not limited in this disclosure.
[0089] When the number of population transcriptome representation vectors input to the model during a training process is one, the model outputs a set of distribution parameters. Specifically, when the survival prediction model to be trained is a Weibull distribution model, the model outputs one λ and one k value. When the number of population transcriptome representation vectors input to the model during a training process is N, the model outputs N λ and N k values accordingly. The network structure of the model can be as follows Figure 2 shown.
[0090] In an optional embodiment, if Figure 3 As shown, the aforementioned population transcriptome representation vector can be obtained based on the following steps:
[0091] In step 301, a population transcriptome expression matrix is obtained.
[0092] The population transcriptome expression matrix includes gene expression data of at least one sample tissue.
[0093] For example, the population transcriptome expression matrix can be shown in Table 1 below:
[0094] Table 1
[0095] Gene Sample tissue A Sample tissue B Sample tissue C … TP53 10.2 8.5 15.0 … ACTB 1000 1200 800 … EGFR 5.0 20.1 3.2 … … … … … …
[0096] Gene expression data includes multiple genes and the expression level of each gene (ie, the values in Table 1).
[0097] In step 302, the population transcriptome expression matrix is input into a pre-trained variational autoencoder model to obtain a population transcriptome representation vector output by the variational autoencoder model corresponding to each sample tissue in the population transcriptome expression matrix.
[0098] In this example, after obtaining the population transcriptome expression matrix, it can be input into a pre-trained variational autoencoder model for dimensionality reduction. Specifically, the variational autoencoder model outputs a population transcriptome representation vector corresponding to each sample tissue in the population transcriptome expression matrix.
[0099] Specifically, in the above example, we can obtain the population transcriptome representation vector A corresponding to sample tissue A, the population transcriptome representation vector B corresponding to sample tissue B, and the population transcriptome representation vector C corresponding to sample tissue C...
[0100] The training process of the variational autoencoder model is introduced in subsequent embodiments and will not be repeated here.
[0101] In step 103, a likelihood loss function is constructed based on the distribution parameters and the survival period corresponding to each population transcriptome representation vector in the population training data, and the network parameters of the survival period prediction model are adjusted based on the likelihood loss function.
[0102] In this example, the negative log-likelihood loss function can be designed as follows:
[0103]
[0104] OS is used to represent the survival time in the survival data corresponding to each population transcriptome representation vector, and c is used to represent the event in the survival data. Specifically, when c = 0, it means that the data is right-censored, that is, the patient has not died at the time of the last follow-up, and when c = 1, it means that the patient has died.
[0105] When the number of population transcriptome representation vectors input to the model during a training run is one, the model outputs a single λ and a single k value corresponding to that population transcriptome representation vector. In this case, this λ and k value, along with the survival period corresponding to that population transcriptome representation vector in the population training data, can be applied to the aforementioned negative log-likelihood loss function, and the network parameters of the survival prediction model can be adjusted based on the calculated results.
[0106] When N population transcriptome representation vectors are input to the model during a training run, the model outputs a lambda value and a k value corresponding to each population transcriptome representation vector. A calculation result is then calculated for each population transcriptome representation vector using the aforementioned negative log-likelihood loss function. Finally, the N calculated results are averaged to obtain a mean, which is then used to adjust the network parameters of the survival prediction model.
[0107] It is understandable that this example only describes a single training process of a model based on group data. In actual applications, the training process can be repeated, for example, hundreds or thousands of times, and this disclosure does not limit this.
[0108] For the spatial training data, perform the following steps:
[0109] In step 104, the spatial transcriptome representation vector group in the spatial training data is input into the survival prediction model to be trained to obtain the distribution parameters output by the survival prediction model corresponding to each spatial transcriptome representation vector in each spatial transcriptome representation vector group.
[0110] In this example, the spatial transcriptome representation vectors corresponding to the sampling points of the same sample tissue can be regarded as a spatial transcriptome representation vector group. For example, the 100 spatial transcriptome representation vectors corresponding to the 100 sampling points of the same tissue section can be regarded as a spatial transcriptome representation vector group.
[0111] At this time, the spatial transcriptome representation vector group is input into the survival prediction model to be trained, and the model can output λ and k values corresponding to the 100 spatial transcriptome representation vectors included in the spatial transcriptome representation vector group.
[0112] In an optional embodiment, if Figure 4 As shown in Figure 2, the aforementioned spatial transcription group representation vector group can be obtained based on the following steps:
[0113] In step 401, a spatial transcriptome expression matrix is obtained.
[0114] The spatial transcriptome expression matrix includes the spatial position coordinates of multiple sampling points for the same sample tissue and their corresponding gene expression data. In this example, the spatial transcriptome expression matrix from the 10X Visium platform can be obtained.
[0115] For example, the spatial transcriptome expression matrix can be shown in Table 2 below:
[0116] Table 2
[0117] Gene Sampling point A (X1, Y1) Sampling point B (X2, Y2) Sampling point C (X3, Y3) … TP53 15.2 8.5 0.0 … ACTB 1000 200 1500 … EGFR 5.0 20.1 3.2 … … … … … …
[0118] The gene expression data includes multiple genes and the expression level of each gene (ie, the values in Table 2).
[0119] In step 402, the spatial transcriptome expression matrix is input into a pre-trained variational autoencoder model to obtain a spatial transcriptome representation vector output by the variational autoencoder model corresponding to each sampling point in the spatial transcriptome expression matrix.
[0120] In this example, after obtaining the spatial transcriptome expression matrix, the matrix can be input into a pre-trained variational autoencoder model for dimensionality reduction. Specifically, the variational autoencoder model outputs a spatial transcriptome representation vector corresponding to each sampling point in the spatial transcriptome expression matrix.
[0121] Specifically in the above example, we can obtain the spatial transcriptome representation vector A corresponding to sampling point A, the spatial transcriptome representation vector B corresponding to sampling point B, and the spatial transcriptome representation vector C corresponding to sampling point C...
[0122] Considering the significant distribution differences between spatial transcriptomes and population transcriptomes, in order to obtain a common representation space for the two types of data, in this example, the structure of the traditional variational autoencoder model can be improved.
[0123] Specifically, DSBN can be introduced into the variational autoencoder model to perform normalization operations on the group transcriptome expression matrix and the spatial transcriptome expression matrix, that is, to calculate the mean and variance of the group transcriptome expression matrix and the spatial transcriptome expression matrix, respectively. Figure 5 In this way, the introduction of DSBN can align spatial transcriptome data with population transcriptome data to a certain extent, making it easier to accurately transfer the prognostic survival period in the population transcriptome data to the spatial transcriptome data.
[0124] then Figure 4 The example shown is Figure 6 As shown in , the spatial constraint matrix corresponding to the aforementioned spatial transcription group representation vector group can be obtained based on the following steps:
[0125] In step 601, after calculating the spatial distance between every two sampling points based on the spatial position coordinates of each sampling point in the spatial transcriptome expression matrix, an adjacency matrix is constructed based on the spatial distance.
[0126] In practical applications, after calculating the spatial distance between every two sampling points, a binary matrix (adjacent=1, otherwise=0) can be generated by setting a spatial distance threshold.
[0127] For example, the adjacency matrix can be expressed as the following Table 3:
[0128] Table 3
[0129] Sampling point A Sampling point B Sampling point C … Sampling point A 1 1 0 … Sampling point B 1 1 0 … Sampling point C 0 0 1 … … … … … …
[0130] Based on this table, we can confirm that in the sample tissue, sampling point A is close to sampling point B, sampling point B is not close to sampling point C, sampling point A is not close to sampling point C, and so on.
[0131] In step 602, after calculating the gene expression similarity between every two sampling points based on the gene expression data of each sampling point in the spatial transcriptome expression matrix, a similarity coefficient matrix is constructed based on the gene expression similarity.
[0132] In order to reflect the similarity of data at the transcriptome level, the Pearson correlation coefficient between each two sampling points can be calculated based on the gene expression data of each sampling point. The Pearson correlation coefficient here corresponds to the aforementioned gene expression similarity.
[0133] For example, the similarity coefficient matrix can be expressed as the following Table 4:
[0134] Table 4
[0135] Sampling point A Sampling point B Sampling point C … Sampling point A Pearson correlation coefficient1 Pearson correlation coefficient2 Pearson correlation coefficient3 … Sampling point B Pearson correlation coefficient 4 Pearson correlation coefficient 5 Pearson correlation coefficient 6 … Sampling point C Pearson correlation coefficient 7 Pearson correlation coefficient8 Pearson correlation coefficient 9 … … … … … …
[0136] In step 603, the adjacency matrix and the similarity coefficient matrix are multiplied bit by bit to obtain the spatial constraint matrix.
[0137] In this example, the accuracy and interpretability of the survival prediction model were effectively improved by constructing a spatial constraint matrix that integrates spatial distance and gene expression similarity. The adjacency matrix captures the spatial topology of tissue samples, ensuring that the model can identify interactions between physically adjacent regions. Simultaneously, the similarity coefficient matrix quantifies the similarity of molecular features between sampling points, identifying important functionally related but spatially discrete regions. The resulting spatial constraint matrix, generated by bitwise multiplication of the two, applies spatial neighbor constraints to the prediction results, ensuring consistency in survival predictions across similar adjacent regions in space.
[0138] In step 105, based on the distribution parameters, the predicted survival period corresponding to each spatial transcriptome representation vector is determined.
[0139] In this example, the quantile of the Weibull distribution corresponding to the distribution parameter can be taken as the predicted survival time OS corresponding to the spatial transcriptome representation vector pred ,Right now
[0140] OS pred =λ(-log0.5) 1 / k
[0141] After obtaining the lambda and k values corresponding to the 100 spatial transcriptome representation vectors included in the spatial transcriptome representation vector group, the corresponding predicted survival (OS) can be calculated for each spatial transcriptome representation vector. pred .
[0142] In step 106, a loss function for characterizing spatial smoothness is constructed based on the predicted survival period corresponding to each spatial transcriptome representation vector and the spatial constraint information corresponding to the spatial transcriptome representation vector group in the training data, and the network parameters of the survival period prediction model are adjusted based on the loss function.
[0143] In this example, the following loss function can be constructed:
[0144]
[0145] Among them, a i,j It is used to represent the parameter located in the i-th row and j-th column of the spatial constraint matrix, v i -v j Used to represent the difference in predicted survival time corresponding to two spatial transcriptome representation vectors.
[0146] In fact, it is to calculate the square of the difference in survival time corresponding to the predicted spatial transcriptome representation vector, and then multiply it with the corresponding weight to minimize this goal to achieve spatial smoothness.
[0147] It is understandable that this example only describes a training process of the model based on spatial data. In actual applications, the training process can be repeated, for example, hundreds or thousands of times, and this disclosure does not limit this.
[0148] It should be noted that the present disclosure does not limit the order and alternation strategy of using group training data and spatial training data during model training. In specific implementation, any of the following training paradigms can be flexibly adopted: (1) First, multiple rounds of iterative training (such as hundreds of epochs) are performed based on group training data. After the model initially establishes a basic correlation between gene expression and survival period, spatial training data is introduced to optimize spatial features. (2) The model is first trained using spatial training data to capture spatial distribution patterns, and then statistical robustness is enhanced through group training data. (3) The two types of data are input alternately in a predetermined ratio (such as 1 batch of group data followed by 1 batch of spatial data) to achieve synchronous optimization.
[0149] In the training method of the survival prediction model provided by the embodiment of the present disclosure, the survival prediction model is trained by jointly utilizing group training data and spatial training data, which effectively overcomes the limitation of the scarcity of clinical samples of spatial transcriptomes in the prior art. Specifically, in this training method, a basic association model between gene expression and survival can be established by using a group transcriptome representation vector with rich survival annotations. At the same time, the spatial dependence of the tissue microenvironment is encoded by a spatial constraint matrix, and the spatial smoothness loss function is used to guide the model to capture the spatial characteristics of gene expression and its potential association with survival.
[0150] The following is a detailed introduction to the training process of the variational autoencoder model.
[0151] Figure 7 This is a flowchart of a method for training a variational autoencoder model according to an exemplary embodiment of the present disclosure. The method can also be executed by various computing devices, including but not limited to computer devices.
[0152] like Figure 7 As shown, the exemplary embodiment method may include the following steps:
[0153] In step 701, training data is obtained.
[0154] The training data includes at least one training data set, and the training data set includes a population transcriptome expression matrix and a spatial transcriptome expression matrix.
[0155] In practical applications, the dimensions of the population transcriptome expression matrix and the spatial transcriptome expression matrix included in each set of training data are the same.
[0156] In step 702, for the population transcriptome expression matrix and the spatial transcriptome expression matrix included in the first training data group in the training data, sampling points that meet preset sampling point filtering conditions among the multiple sampling points included in the spatial transcriptome expression matrix are filtered.
[0157] Each training data group in the training data can be regarded as the aforementioned first training data group, that is, the subsequent operations are performed on each training data group in the training data.
[0158] The preset sampling point filtering conditions include at least one of the following: the type of gene is less than or equal to a third threshold, and the ratio of the total expression level of mitochondrial genes to the total expression levels of all genes is greater than or equal to a fourth threshold.
[0159] The third threshold may be, for example, 200. At this point, if the number of gene types detected at a sampling point is less than or equal to 200, the sampling point may be filtered. Corresponding to Table 2, the column data corresponding to the sampling point may be filtered.
[0160] The aforementioned fourth threshold value may be, for example, 10%. In this case, if it is determined that the ratio of the total expression of mitochondrial genes (the sum of the expression of mitochondrial genes corresponding to the sampling point) among the genes detected at a certain sampling point to the total expression of all genes (the sum of the expression of all genes corresponding to the sampling point) is greater than or equal to 10%, the sampling point may be filtered. Corresponding to Table 2 above, the column data corresponding to the sampling point may be filtered.
[0161] In step 703, the genes that meet the preset gene filtering conditions in the spatial transcriptome expression matrix are filtered to obtain spatial transcriptome expression genes.
[0162] The preset gene filtering condition includes at least one of the following: the detection rate at each sampling point is less than or equal to a first threshold, and the average expression level in the sampling points expressing the gene is less than or equal to a second threshold.
[0163] The first threshold may be 5%, for example. In this case, if a gene is detected in less than or equal to 5% of the sampling points, the gene may be filtered. Corresponding to Table 2, the row data corresponding to the gene may be filtered.
[0164] The aforementioned second threshold value may be, for example, 1.12. In this case, if it is determined that the average expression level of a gene in the sampling points expressing the gene is less than or equal to 1.12, the gene may be filtered. Corresponding to Table 2, the row data corresponding to the gene may be filtered.
[0165] In this example, after obtaining the spatial transcriptome expression matrix, the sampling points corresponding to rare genes, low-expression genes, and cells about to undergo apoptosis in the spatial transcriptome expression matrix can be filtered first, thereby improving the accuracy and reliability of subsequent analysis. At the gene level, by setting the detection rate threshold and the average expression threshold, low-quality or low-expression gene data are effectively filtered, and technical noise and biological background signals are removed. At the sampling point level, by using the gene type threshold and the mitochondrial gene ratio threshold, cells about to undergo apoptosis or low-quality sampling points are excluded, ensuring the biological representativeness of the data. This dual filtering mechanism not only retains high-quality data with biological significance, but also significantly reduces computational complexity, providing a cleaner and more reliable data foundation for subsequent spatial feature analysis and survival prediction model training, ultimately improving the model's prediction accuracy and clinical practicality.
[0166] In step 704, the intersection of the spatial transcriptome expression genes and the multiple genes included in the population transcriptome expression matrix is taken to obtain characteristic genes.
[0167] In step 705 , the genes other than the characteristic genes in the first population transcriptome expression matrix and the first spatial transcriptome expression matrix are filtered to obtain a filtered population transcriptome expression matrix and a filtered spatial transcriptome expression matrix.
[0168] In step 706, the filtered population transcriptome expression matrix and spatial transcriptome expression matrix are respectively input into the variational autoencoder model to be trained, and the variational autoencoder model outputs a predicted population transcriptome representation vector corresponding to the population transcriptome expression matrix and a predicted spatial transcriptome representation vector corresponding to the spatial transcriptome expression matrix.
[0169] In step 707 , the distribution distance between the predicted population transcriptome representation vector and the predicted spatial transcriptome representation vector is calculated.
[0170] Exemplarily, the distribution distance may be calculated based on MMD.
[0171] Specifically, you can make Represents the transcriptome representation vector of the population, represents the spatial transcriptome representation vector, φ(.) is the function mapping to RKHS, |.| H is the distance between vectors of different dimensions in RKHS, then there is the MMD loss function:
[0172]
[0173] It should be noted that the above description of calculating the distribution distance based on MMD is merely illustrative, and is intended to enable those skilled in the art to better understand the technical solutions of the embodiments of the present disclosure. In practical applications, the distribution distance can also be calculated based on methods including but not limited to KL divergence, Wasserstein distance, etc., which are not limited in the present disclosure.
[0174] In step 708, the network parameters of the variational autoencoder model to be trained are adjusted at least according to the distribution distance to obtain the pre-trained variational autoencoder model.
[0175] In practical applications, in addition to adjusting the network parameters of the variational autoencoder model to be trained based on the aforementioned distribution distance, it is also necessary to adjust the network parameters of the variational autoencoder model based on the loss function of the variational autoencoder model. The loss function can be obtained based on the following process:
[0176] First, align and extract the representation vectors of the group transcriptome expression matrix and the spatial transcriptome expression matrix. Use a shared conditional variational autoencoder to represent the group transcriptome expression matrix and the spatial transcriptome expression matrix as representation vectors in a unified latent space. Then use the following process to model the expression value x of gene g in data n ng :
[0177] z n ~Normal(0,I)
[0178] wng =f w (z n ,s n )
[0179] x ng ~Poisson(l n w ng )
[0180] Among them, z n The standard multivariate normal distribution is often used in the variational autoencoder model, s n Represents the sample batch information of the data, l n represents the total library size of the data. f is a neural network that maps the representation vector and sample batch information into the gene expression vector space. w ng Represents the expression ratio of gene g in data n predicted by the neural network, that is, ∑ g w ng = 1. The conditional variational autoencoder optimizes two main objectives by jointly training the encoder and decoder: reconstruction loss and KL divergence loss. That is, the optimization goal of the CVAE is to maximize the following formula:
[0181] Loss VAE =E z~Q(z|x,s) [logP(x|z,s)]-D KL [Q(z|x,s)||P(z)]
[0182] About the loss function of the variational autoencoder model VAE The specific calculation process of can be found in the records of relevant technical documents, and this disclosure will not describe it in detail.
[0183] Then we can get the total loss function in the process of training the variational autoencoder model:
[0184] Loss=Loss VAE +λ MMD Loss MMD
[0185] Among them, Loss VAE is the loss function of the variational autoencoder model, λ MMD Represents the weight of MMD loss.
[0186] In this example, by introducing a distribution distance-based optimization strategy during the training of the variational autoencoder model, an innovative deep alignment of cross-modal data was achieved. Specifically, this method uses the MMD distribution distance metric to explicitly match the probability distributions of spatial transcriptome data and population transcriptome data at the latent space level, effectively narrowing the data distribution differences generated by the two technical platforms. This distribution alignment mechanism not only solves the data heterogeneity problem caused by different technical principles, but more importantly, it establishes a shared feature representation space across modalities, allowing the lifetime correlation features learned in the population data to be transferred to the spatial data through latent variables while retaining spatial-specific information.
[0187] After the above-mentioned survival prediction model is trained, it can be used to predict survival.
[0188] Figure 8 This is a flowchart of a method for predicting life span according to an exemplary embodiment of the present disclosure. This method can also be executed by various computing devices, including but not limited to computer devices. Figure 8 As shown, the exemplary embodiment method may include the following steps:
[0189] In step 801, a spatial transcriptome expression matrix is obtained.
[0190] The spatial transcriptome expression matrix includes the spatial position coordinates of multiple sampling points for the same sample tissue and their corresponding gene expression data.
[0191] For example, a spatial transcriptome expression matrix as shown in Table 2 above may be obtained. The spatial transcriptome expression matrix may be, for example, a spatial transcriptome expression matrix for the stomach of a certain patient.
[0192] In step 802, the spatial transcriptome expression matrix is input into a pre-trained variational autoencoder model to obtain a spatial transcriptome representation vector output by the variational autoencoder model corresponding to each sampling point in the spatial transcriptome expression matrix.
[0193] In an optional embodiment, before the aforementioned spatial transcriptome expression matrix is input into the pre-trained variational autoencoder model, the sampling points and / or genes in the spatial transcriptome expression matrix may be filtered.
[0194] Optionally, the sampling points included in the spatial transcriptome expression matrix can be filtered out, where the number of gene types is less than or equal to a third threshold, and / or the ratio of the total expression of mitochondrial genes to the total expression of all genes is greater than or equal to a fourth threshold.
[0195] Optionally, genes whose detection rate at each sampling point is less than or equal to a first threshold and / or whose average expression level at the sampling points expressing the gene is less than or equal to a second threshold may be filtered out from the multiple genes included in the spatial transcriptome expression matrix.
[0196] Then, the filtered spatial transcriptome expression matrix can be input into the pre-trained variational autoencoder model to obtain the spatial transcriptome representation vector output by the variational autoencoder model corresponding to each sampling point in the aforementioned spatial transcriptome expression matrix.
[0197] In step 803, the spatial transcriptome representation vector corresponding to each sampling point is input into a life span prediction model to obtain distribution parameters corresponding to each sampling point output by the life span prediction model.
[0198] The survival prediction model is obtained by training using the survival prediction model training method described in any embodiment of the present disclosure.
[0199] In this example, by inputting the spatial transcriptome representation vector corresponding to each sampling point in the spatial transcriptome expression matrix into the survival prediction model, we can obtain the distribution parameters corresponding to each sampling point output by the survival prediction model. Specifically, we can obtain the λ and K values corresponding to each sampling point output by the survival prediction model.
[0200] In step 804, the predicted survival period corresponding to each sampling point is determined based on the distribution parameters.
[0201] After obtaining the λ and K values corresponding to each sampling point output by the survival prediction model, the predicted survival period corresponding to each sampling point can be calculated based on the following formula:
[0202] OS pred =λ(-log0.5) 1 / k
[0203] For example, we can get Figure 9 The prediction results shown are used to characterize the predicted survival period corresponding to each sampling point in the patient's stomach.
[0204] Furthermore, after obtaining the predicted survival period of each sampling point, the contribution score of each sampling point to the disease development can be obtained according to the following formula:
[0205]
[0206] It's easy to understand that the shorter the predicted survival period, the higher the score, indicating that the corresponding sampling point has a greater contribution to disease progression. Then, using a spatial structure recognition algorithm based on the Moran index, we can identify regions with high scores that exhibit spatial clustering effects in the spatial transcriptome, ultimately obtaining the predicted spatial structure or characteristic regions associated with survival.
[0207] The survival prediction method provided in the disclosed embodiments utilizes rigorous quality control of the spatial transcriptome expression matrix to remove low-quality sampling points and noise genes, improving the accuracy of subsequent predictions. Furthermore, by using a survival prediction model to predict the survival period corresponding to each sampling point, it can precisely locate high-risk areas in the sample tissue and identify the spatial structures or characteristic regions that have the greatest impact on disease progression, providing more precise guidance for clinical treatment.
[0208] For the sake of simplicity, the aforementioned method embodiments are all expressed as a series of action combinations. However, those skilled in the art should know that the present disclosure is not limited to the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously.
[0209] Corresponding to the aforementioned method embodiments, the present disclosure also provides apparatus embodiments.
[0210] Figure 10 FIG. 1 is a structural diagram of a training device for a survival prediction model according to an exemplary embodiment of the present disclosure. Figure 10 The training device of the survival prediction model may include:
[0211] The training data acquisition module 101 is used to acquire population training data and spatial training data; the population training data includes at least one population transcriptome representation vector annotated with a survival period, and the spatial training data includes at least one spatial transcriptome representation vector group annotated with a spatial constraint matrix, wherein the spatial constraint matrix is jointly generated based on the spatial distance between each sampling point corresponding to each spatial transcriptome representation vector group in the sample tissue and the gene expression similarity of each sampling point.
[0212] The population training data training module 102 is used to input the population transcriptome representation vector in the population training data into the survival prediction model to be trained, and obtain the distribution parameters corresponding to each population transcriptome representation vector output by the survival prediction model; construct a likelihood loss function based on the distribution parameters and the survival period corresponding to each population transcriptome representation vector in the population training data, and adjust the network parameters of the survival prediction model based on the likelihood loss function.
[0213] The spatial training data training module 103 is used to input the spatial transcriptome representation vector group in the spatial training data into the survival prediction model to be trained, and obtain the distribution parameters corresponding to each spatial transcriptome representation vector in each spatial transcriptome representation vector group output by the survival prediction model; based on the distribution parameters, determine the predicted survival period corresponding to each spatial transcriptome representation vector respectively; construct a loss function for characterizing spatial smoothness according to the predicted survival period corresponding to each spatial transcriptome representation vector and the spatial constraint information corresponding to the spatial transcriptome representation vector group in the training data, and adjust the network parameters of the survival prediction model based on the loss function.
[0214] Optional, in Figure 10 Based on the modules shown, the training device for the survival prediction model may further include:
[0215] A population transcriptome representation vector acquisition module is used to obtain a population transcriptome expression matrix, which includes gene expression data of at least one sample tissue; input the population transcriptome expression matrix into a pre-trained variational autoencoder model to obtain the population transcriptome representation vector output by the variational autoencoder model corresponding to each sample tissue in the population transcriptome expression matrix.
[0216] The spatial transcriptome representation vector acquisition module is used to obtain a spatial transcriptome expression matrix, which includes the spatial position coordinates of multiple sampling points for the same sample tissue and their corresponding gene expression data; the spatial transcriptome expression matrix is input into a pre-trained variational autoencoder model to obtain the spatial transcriptome representation vector output by the variational autoencoder model corresponding to each sampling point in the spatial transcriptome expression matrix.
[0217] The variational autoencoder model includes a domain-specific batch normalization (DSBN) layer for performing normalization operations on the population transcriptome expression matrix and the spatial transcriptome expression matrix, respectively.
[0218] Optional, in Figure 10 Based on the modules shown, the training device for the survival prediction model may further include:
[0219] The spatial constraint matrix acquisition module is configured to calculate the spatial distance between each two sampling points based on the spatial position coordinates of each sampling point in the spatial transcriptome expression matrix, and then construct an adjacency matrix based on the spatial distance. Based on the gene expression data of each sampling point in the spatial transcriptome expression matrix, the gene expression similarity between each two sampling points is calculated, and then a similarity coefficient matrix is constructed based on the gene expression similarity. The adjacency matrix and the similarity coefficient matrix are bitwise multiplied to obtain the spatial constraint matrix.
[0220] Optional, in Figure 10 Based on the modules shown, the training device for the survival prediction model may further include:
[0221] A variational autoencoder model training module is used to obtain training data; the training data includes at least one training data group, and the training data group includes a population transcriptome expression matrix and a spatial transcriptome expression matrix. The population transcriptome expression matrix and the spatial transcriptome expression matrix included in the first training data group in the training data are respectively input into the variational autoencoder model to be trained, and the variational autoencoder model outputs a predicted population transcriptome representation vector corresponding to the population transcriptome expression matrix, and a predicted spatial transcriptome representation vector corresponding to the spatial transcriptome expression matrix. The distribution distance between the predicted population transcriptome representation vector and the predicted spatial transcriptome representation vector is calculated. At least according to the distribution distance, the network parameters of the variational autoencoder model to be trained are adjusted to obtain the pre-trained variational autoencoder model.
[0222] Optionally, the gene expression data includes multiple genes and the expression level of each gene.
[0223] The variational autoencoder model training module, when used to input the population transcriptome expression matrix and the spatial transcriptome expression matrix included in the first training data group in the training data into the variational autoencoder model to be trained, includes:
[0224] Filter the genes in the spatial transcriptome expression matrix that meet the preset gene filtering conditions to obtain spatial transcriptome expression genes; the preset gene filtering conditions include at least one of the following: the detection rate at each sampling point is less than or equal to a first threshold, and the average expression amount in the sampling points expressing the gene is less than or equal to a second threshold.
[0225] The spatial transcriptome expression genes and the multiple genes included in the population transcriptome expression matrix are intersected to obtain characteristic genes.
[0226] The genes other than the characteristic genes in the population transcriptome expression matrix and the spatial transcriptome expression matrix are filtered to obtain a filtered population transcriptome expression matrix and a filtered spatial transcriptome expression matrix.
[0227] The filtered population transcriptome expression matrix and spatial transcriptome expression matrix are respectively input into the variational autoencoder model to be trained.
[0228] Optionally, the variational autoencoder model training module is further used, before filtering the genes that meet the preset gene filtering conditions in the spatial transcriptome expression matrix to obtain the spatial transcriptome expression genes:
[0229] Sampling points that meet a preset sampling point filtering condition among the multiple sampling points included in the spatial transcriptome expression matrix are filtered.
[0230] The preset sampling point filtering condition includes at least one of the following:
[0231] The gene type is less than or equal to a third threshold.
[0232] The ratio of the total expression level of mitochondrial genes to the total expression level of all genes is greater than or equal to a fourth threshold.
[0233] Figure 11 FIG. 1 is a structural diagram of a survival prediction device according to an exemplary embodiment of the present disclosure. Figure 11 As shown, the survival prediction device may include:
[0234] The matrix acquisition module 111 is used to acquire a spatial transcriptome expression matrix; the spatial transcriptome expression matrix includes the spatial position coordinates of multiple sampling points for the same sample tissue and their corresponding gene expression data.
[0235] The vector acquisition module 112 is used to input the spatial transcriptome expression matrix into a pre-trained variational autoencoder model to obtain the spatial transcriptome representation vector output by the variational autoencoder model corresponding to each sampling point in the spatial transcriptome expression matrix.
[0236] The distribution parameter acquisition module 113 is used to input the spatial transcriptome representation vector corresponding to each sampling point into the survival prediction model to obtain the distribution parameters corresponding to each sampling point output by the survival prediction model; the survival prediction model is trained by the survival prediction model training device of any embodiment of the present disclosure.
[0237] The survival period determination module 114 is configured to determine the predicted survival period corresponding to each sampling point based on the distribution parameters.
[0238] As for the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can be referred to the partial description of the method embodiment.
[0239] Figure 12 FIG1 is a schematic diagram showing the structure of an electronic device 1200 according to an exemplary embodiment of the present disclosure. The electronic device may be any type of computing device, including but not limited to a computer device.
[0240] Reference Figure 12 , the electronic device 1200 may include one or more of the following components: a processing component 1202 , a memory 1204 , a power component 1206 , a multimedia component 1208 , an audio component 1210 , an input / output (I / O) interface 1212 , a sensor component 1214 , and a communication component 1216 .
[0241] The processing component 1202 generally controls the overall operation of the electronic device 1200, such as operations associated with display, phone calls, data communications, camera operation, and recording operations. The processing component 1202 may include one or more processors 1220 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 1202 may include one or more modules to facilitate interaction between the processing component 1202 and other components. For example, the processing component 1202 may include a multimedia module to facilitate interaction between the multimedia component 1208 and the processing component 1202.
[0242] The memory 1204 is configured to store various types of data to support operations on the device 1200. Examples of such data include instructions for any application or method operating on the electronic device 1200, contact data, phone book data, messages, pictures, videos, etc. The memory 1204 can be implemented by any type of volatile or non-volatile storage device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0243] The power supply component 1206 provides power to the various components of the electronic device 1200. The power supply component 1206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 1200.
[0244] The multimedia component 1208 includes a screen that provides an output interface between the electronic device 1200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensors may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide action. In some embodiments, the multimedia component 1208 includes a front camera and / or a rear camera. When the electronic device 1200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0245] The audio component 1210 is configured to output and / or input audio signals. For example, the audio component 1210 includes a microphone (MIC), which is configured to receive external audio signals when the electronic device 1200 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal can be further stored in the memory 1204 or transmitted via the communication component 1216. In some embodiments, the audio component 1210 also includes a speaker for outputting audio signals.
[0246] I / O interface 1212 provides an interface between processing component 1202 and peripheral interface modules, such as a keyboard, click wheel, buttons, etc. These buttons may include but are not limited to: a home button, volume buttons, a start button, and a lock button.
[0247] The sensor assembly 1214 includes one or more sensors for providing various aspects of the status assessment of the electronic device 1200. For example, the sensor assembly 1214 can detect the open / closed state of the electronic device 1200, the relative positioning of components, such as the display and keypad of the electronic device 1200. The sensor assembly 1214 can also detect changes in the position of the electronic device 1200 or a component of the electronic device 1200, the presence or absence of user contact with the electronic device 1200, the orientation or acceleration / deceleration of the electronic device 1200, and changes in the temperature of the electronic device 1200. The sensor assembly 1214 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1214 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1214 can also include an accelerometer, a gyroscope, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0248] The communication component 1216 is configured to facilitate wired or wireless communication between the electronic device 1200 and other devices. The electronic device 1200 can access a wireless network based on a communication standard, such as WiFi, 4G or 5G, 4G LTE, 5G NR or a combination thereof. In an exemplary embodiment, the communication component 1216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1216 further includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0249] In an exemplary embodiment, the electronic device 1200 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0250] In an exemplary embodiment, a non-temporary computer-readable storage medium is also provided, such as a memory 1204 including instructions. When the instructions in the storage medium are executed by the processor 1220 of the electronic device 1200, the electronic device 1200 is enabled to execute the training method of the lifetime prediction model and the lifetime prediction method of any embodiment of the present disclosure.
[0251] The non-transitory computer-readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
[0252] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A training method for a survival prediction model, characterized in that: The method comprises: Obtaining population training data and spatial training data; the population training data includes at least one population transcriptome representation vector annotated with a survival period, and the spatial training data includes at least one spatial transcriptome representation vector group annotated with a spatial constraint matrix, wherein the spatial constraint matrix is jointly generated based on the spatial distance between each sampling point corresponding to each spatial transcriptome representation vector group in the sample tissue and the gene expression similarity of each sampling point; For the population training data: inputting the population transcriptome representation vector in the population training data into the survival prediction model to be trained, obtaining the distribution parameters corresponding to each population transcriptome representation vector output by the survival prediction model; constructing a likelihood loss function based on the distribution parameters and the survival period corresponding to each population transcriptome representation vector in the population training data, and adjusting the network parameters of the survival prediction model based on the likelihood loss function; For the spatial training data: the spatial transcriptome representation vector group in the spatial training data is input into the survival prediction model to be trained, and the distribution parameters corresponding to each spatial transcriptome representation vector in each spatial transcriptome representation vector group are obtained as output by the survival prediction model; based on the distribution parameters, the predicted survival period corresponding to each spatial transcriptome representation vector is determined respectively; according to the predicted survival period corresponding to each spatial transcriptome representation vector and the spatial constraint information corresponding to the spatial transcriptome representation vector group in the training data, a loss function for characterizing spatial smoothness is constructed, and the network parameters of the survival prediction model are adjusted based on the loss function.
2. The method according to claim 1, characterized in that The population transcriptome representation vector is obtained based on the following method: obtaining a population transcriptome expression matrix, wherein the population transcriptome expression matrix includes gene expression data of at least one sample tissue; inputting the population transcriptome expression matrix into a pre-trained variational autoencoder model to obtain a population transcriptome representation vector output by the variational autoencoder model corresponding to each sample tissue in the population transcriptome expression matrix; The spatial transcriptome representation vector group is obtained based on the following method: obtaining a spatial transcriptome expression matrix, wherein the spatial transcriptome expression matrix includes the spatial position coordinates of multiple sampling points for the same sample tissue and their corresponding gene expression data; inputting the spatial transcriptome expression matrix into a pre-trained variational autoencoder model to obtain a spatial transcriptome representation vector output by the variational autoencoder model corresponding to each sampling point in the spatial transcriptome expression matrix; The variational autoencoder model includes a domain-specific batch normalization (DSBN) layer for performing normalization operations on the population transcriptome expression matrix and the spatial transcriptome expression matrix, respectively.
3. The method according to claim 2, characterized in that The spatial constraint matrix is obtained based on the following method: After calculating the spatial distance between every two sampling points according to the spatial position coordinates of each sampling point in the spatial transcriptome expression matrix, an adjacency matrix is constructed according to the spatial distance; After calculating the gene expression similarity between every two sampling points based on the gene expression data of each sampling point in the spatial transcriptome expression matrix, a similarity coefficient matrix is constructed based on the gene expression similarity; The adjacency matrix and the similarity coefficient matrix are multiplied bit by bit to obtain the spatial constraint matrix.
4. The method according to claim 2, characterized in that The pre-trained variational autoencoder model is trained based on the following method: Acquire training data; the training data includes at least one training data set, the training data set including a population transcriptome expression matrix and a spatial transcriptome expression matrix; Inputting the population transcriptome expression matrix and the spatial transcriptome expression matrix included in the first training data group in the training data into the variational autoencoder model to be trained, respectively, to obtain the predicted population transcriptome representation vector corresponding to the population transcriptome expression matrix and the predicted spatial transcriptome representation vector corresponding to the spatial transcriptome expression matrix, respectively output by the variational autoencoder model; Calculating the distribution distance between the predicted population transcriptome representation vector and the predicted spatial transcriptome representation vector; At least according to the distribution distance, the network parameters of the variational autoencoder model to be trained are adjusted to obtain the pre-trained variational autoencoder model.
5. The method according to claim 4, characterized in that The gene expression data includes multiple genes and the expression level of each gene; The step of inputting the population transcriptome expression matrix and the spatial transcriptome expression matrix included in the first training data group in the training data into the variational autoencoder model to be trained comprises: Filtering the spatial transcriptome expression matrix for genes that meet a preset gene filtering condition to obtain spatial transcriptome expression genes; the preset gene filtering condition includes at least one of the following: the detection rate at each sampling point is less than or equal to a first threshold, and the average expression level at the sampling points expressing the gene is less than or equal to a second threshold; Taking the intersection of the spatial transcriptome expression genes and the multiple genes included in the population transcriptome expression matrix to obtain characteristic genes; Filtering other genes except the characteristic genes in the population transcriptome expression matrix and the spatial transcriptome expression matrix to obtain a filtered population transcriptome expression matrix and a filtered spatial transcriptome expression matrix; The filtered population transcriptome expression matrix and spatial transcriptome expression matrix are respectively input into the variational autoencoder model to be trained.
6. The method according to claim 5, characterized in that Before filtering the genes in the spatial transcriptome expression matrix that meet the preset gene filtering conditions to obtain the spatial transcriptome expression genes, the method further includes: Filtering the sampling points that meet the preset sampling point filtering conditions among the multiple sampling points included in the spatial transcriptome expression matrix; The preset sampling point filtering condition includes at least one of the following: The gene type is less than or equal to the third threshold; The ratio of the total expression level of mitochondrial genes to the total expression level of all genes is greater than or equal to a fourth threshold.
7. A method for predicting survival period, characterized in that: The method comprises: Obtaining a spatial transcriptome expression matrix; the spatial transcriptome expression matrix includes the spatial position coordinates of multiple sampling points for the same sample tissue and their corresponding gene expression data; Inputting the spatial transcriptome expression matrix into a pre-trained variational autoencoder model to obtain a spatial transcriptome representation vector output by the variational autoencoder model corresponding to each sampling point in the spatial transcriptome expression matrix; Inputting the spatial transcriptome representation vector corresponding to each sampling point into a survival prediction model to obtain distribution parameters corresponding to each sampling point output by the survival prediction model; the survival prediction model is trained by the method according to any one of claims 1 to 6; Based on the distribution parameters, the predicted survival period corresponding to each sampling point is determined respectively.
8. A training device for a survival prediction model, characterized in that: The device comprises: A training data acquisition module is configured to acquire population training data and spatial training data; the population training data includes at least one population transcriptome representation vector annotated with a survival period, and the spatial training data includes at least one spatial transcriptome representation vector group annotated with a spatial constraint matrix, wherein the spatial constraint matrix is jointly generated based on the spatial distance between each sampling point in the sample tissue corresponding to each spatial transcriptome representation vector group and the gene expression similarity of each sampling point; A population training data training module is configured to input the population transcriptome representation vectors in the population training data into a survival prediction model to be trained, obtain distribution parameters corresponding to each population transcriptome representation vector output by the survival prediction model; construct a likelihood loss function based on the distribution parameters and the survival period corresponding to each population transcriptome representation vector in the population training data, and adjust network parameters of the survival prediction model based on the likelihood loss function; A spatial training data training module is used to input the spatial transcriptome representation vector group in the spatial training data into the survival prediction model to be trained, and obtain the distribution parameters corresponding to each spatial transcriptome representation vector in each spatial transcriptome representation vector group output by the survival prediction model; based on the distribution parameters, the predicted survival period corresponding to each spatial transcriptome representation vector is determined respectively; according to the predicted survival period corresponding to each spatial transcriptome representation vector and the spatial constraint information corresponding to the spatial transcriptome representation vector group in the training data, a loss function for characterizing spatial smoothness is constructed, and the network parameters of the survival prediction model are adjusted based on the loss function.
9. A survival prediction device, characterized in that: The device comprises: A matrix acquisition module is used to obtain a spatial transcriptome expression matrix; the spatial transcriptome expression matrix includes the spatial position coordinates of multiple sampling points for the same sample tissue and their corresponding gene expression data; A vector acquisition module is used to input the spatial transcriptome expression matrix into a pre-trained variational autoencoder model to obtain a spatial transcriptome representation vector output by the variational autoencoder model corresponding to each sampling point in the spatial transcriptome expression matrix; a distribution parameter acquisition module, configured to input the spatial transcriptome representation vector corresponding to each sampling point into a survival prediction model to obtain the distribution parameters output by the survival prediction model corresponding to each sampling point; the survival prediction model is trained by the apparatus of claim 8; The survival period determination module is used to determine the predicted survival period corresponding to each sampling point based on the distribution parameters.
10. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the steps of the method according to any one of claims 1 to 6 or claim 7 are implemented.
11. An electronic device comprising: processor; a memory for storing processor-executable instructions; The processor is configured to execute the steps of the method according to any one of claims 1 to 6 or claim 7.