Index sequence generation method, device, electronic device and storage medium
Through the index sequence generation method, the gene expression data is mapped to the latent space by using encoder and quantization processing. Combined with autoregressive modeling and adversarial training, the problem of high computational complexity and difficulty in capturing the global regulatory relationship in traditional methods is solved, and a more efficient construction of gene regulation network is achieved.
Patent Information
- Application Number
- CN202411721886.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-11-28
AI Technical Summary
Traditional gene expression data analysis methods have high computational complexity, severe data noise interference, and difficulty in capturing global regulatory relationships.
Through an index sequence generation method, the gene expression data is mapped to the latent space using an encoder, the codebook index matrix is generated by quantitative processing, and the model parameters are optimized through autoregressive modeling and adversarial training.
The computational burden of high-dimensional data modeling is reduced, the ability of the model to capture global data patterns is improved, and a more accurate and biologically significant gene regulation network is built.
Smart Images

Figure CN119207562B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to an index sequence generation method, device, electronic equipment and storage medium. Background Art
[0002] Using gene expression data to predict gene regulatory networks is very important in biomedical research. With the development of high-throughput sequencing technology, large-scale gene expression data can be obtained, including gene expression levels under different conditions. These data provide valuable resources for studying gene regulation.
[0003] Gene regulatory networks describe the regulatory relationships between genes and help us understand the role of genes in cell and tissue functions. By predicting gene regulatory networks, we can infer which genes have important effects on the expression of other genes and identify key regulatory factors and regulatory pathways. This prediction can reveal the topological structure of gene regulatory networks and provide important clues for a deeper understanding of the complexity of biological systems and the mechanisms of biological processes.
[0004] Methods for predicting gene regulatory networks usually use gene expression data as input features and apply machine learning and statistical models for analysis. These models can discover potential regulatory relationships from large-scale gene expression data. However, predicting gene regulatory networks also faces some challenges and limitations. The complexity of biological systems still makes the construction and interpretation of gene regulatory networks difficult. For example, traditional gene expression data analysis methods often face problems such as high computational complexity, severe data noise interference, and difficulty in capturing global regulatory relationships when faced with high-dimensional and large data matrices. In addition, the large number of genes and sample dimensions in gene expression data brings huge data volume and complexity, making direct modeling and analysis extremely difficult. Summary of the invention
[0005] In view of this, the present invention provides an index sequence generation method, device, electronic device and storage medium to solve the problems of high computational complexity, serious data noise interference and difficulty in capturing global regulatory relationships in traditional gene expression data analysis methods.
[0006] In a first aspect, the present invention provides a method for generating an index sequence, the method comprising:
[0007] Acquire first gene expression data and at least one codebook entry, wherein each of the codebook entries includes a one-to-one corresponding codebook index and an initial vector;
[0008] encoding the first gene expression data, extracting local information from the first gene expression data, and mapping the local information to a latent space to obtain a latent representation of the local information;
[0009] quantizing the potential representation of the local information based on the at least one codebook entry to generate a first codebook index matrix and at least one quantization vector, wherein the first codebook index matrix is composed of a plurality of discrete and new codebook indexes, and each new codebook index corresponds to a quantization vector;
[0010] Decoding and reconstructing the first codebook index matrix, outputting second gene expression data, discriminating the second gene expression data to obtain a discrimination result, and performing adversarial training on the decoder and the at least one quantization vector according to the discrimination result, and outputting optimization parameters, wherein the optimization parameters include: an optimized decoder and at least one new codebook entry;
[0011] Performing autoregressive modeling processing on the at least one new codebook entry to generate a second codebook index matrix;
[0012] The second codebook index matrix is processed by using the optimized decoder to obtain data samples.
[0013] The core of the index sequence generation method provided in this aspect is to map high-dimensional and complex gene expression data to a low-dimensional and discretized potential space through the process of quantization and encoding. It not only reduces the computational burden of high-dimensional data modeling, but also improves the ability of the model to capture the global pattern of the data, providing an effective way to build a more accurate and biologically meaningful gene regulatory network. In addition, breakthroughs in global pattern recognition, conditional generation, and biological information retention in high-dimensional gene expression data have been achieved through data compression, providing an efficient and explanatory analysis tool for biomedical research.
[0014] In combination with the first aspect, in a possible implementation manner, before encoding the first gene expression data, the method further includes: acquiring condition information, wherein the condition information includes biological characteristics;
[0015] The encoding of the first gene expression data, extracting local information from the first gene expression data, and mapping the local information to a latent space to obtain a latent representation of the local information includes: encoding the first gene expression data and the conditional information, extracting key features, and mapping the key features to the latent representation in a latent space, wherein the key features include the local information.
[0016] In combination with the first aspect, in another possible implementation, before encoding the first gene expression data, the method further includes: obtaining a loss function, wherein the loss function includes a reconstruction loss function;
[0017] The encoding of the first gene expression data and the conditional information, extracting key features, and mapping the key features to the latent representation in a latent space includes: using the reconstruction loss function to encode the first gene expression data and the conditional information, extracting the key features, and mapping them to the latent representation in a latent space.
[0018] In combination with the first aspect, in yet another possible implementation, the loss function further includes: a codebook loss function and a commitment loss function;
[0019] The quantizing the potential representation of the local information based on the at least one codebook entry to generate a first codebook index matrix includes: adding the codebook loss function and the commitment loss function in the process of quantizing the potential representation of the local information based on the at least one codebook entry to generate the first codebook index matrix.
[0020] Optionally, the loss function is expressed as:
[0021]
[0022] in, represents the reconstruction loss function, represents the codebook loss function, represents the commitment loss function, sg[] represents the stop gradient operation, represents the loss function, E represents the encoder, G represents the decoder, Z represents the codebook entry, x represents the first gene expression data, represents the second gene expression data, E(x) represents the output of the data x after the encoder E, Indicates the encoding result after quantizing the data.
[0023] In combination with the first aspect, in yet another possible implementation, performing adversarial training on the decoder and the at least one quantization vector according to the discrimination result and outputting an optimization parameter includes:
[0024] The decoder and the at least one quantization vector are subjected to adversarial training by using an adversarial loss function to generate the optimization parameters; the adversarial loss function is:
[0025]
[0026] in, represents the discriminator's prediction of the true gene expression data, represents the prediction of the discriminator on the reconstructed gene expression data, and D represents the discriminator;
[0027] The optimization parameters are , The expression is:
[0028]
[0029] in, represents the optimization parameters, Denotes that the decoder minimizes the overall objective function, and the discriminator D maximizes the objective function, is the balancing factor, and the expectation Represents the calculation of the loss on the gene expression data distribution p(x).
[0030] In combination with the first aspect, in another possible implementation, the process of performing adversarial training on the decoder and the at least one quantization vector by using an adversarial loss function further includes:
[0031] Extracting part of batch data from a data set, wherein the data set is a set of at least one gene expression data; respectively calculating a vector discretization loss and an adversarial loss for each gene expression data in the set; and calculating an average loss value of the part of the batch data according to the vector discretization loss and the adversarial loss, so as to obtain an average value that approximates the overall expectation.
[0032] In combination with the first aspect, in yet another possible implementation, the method further includes:
[0033] Calculate the gradient of the adversarial loss and the gradient of the reconstruction loss during adversarial training respectively;
[0034] The balance factor is calculated according to the gradient of the adversarial loss and the gradient of the reconstruction loss according to a relational expression; wherein the relational expression for calculating the balance factor is:
[0035]
[0036] in, is the balance factor, represents the gradient of the reconstruction loss, represents the gradient of the adversarial loss with respect to the decoder G, and δ is a constant.
[0037] In combination with the first aspect, in yet another possible implementation, performing autoregressive modeling processing on the at least one new codebook entry to obtain a second codebook index matrix includes:
[0038] The method includes predicting a codebook index corresponding to the at least one new codebook entry by using an autoregressive method to obtain a prediction result, wherein each new codebook index in the prediction result is predicted based on a previous codebook index; after the prediction, the probability of the entire codebook index sequence is modeled to obtain a dependency relationship between new codebook indexes; and generating the second codebook index matrix according to the prediction result and the dependency relationship.
[0039] In combination with the first aspect, in another possible implementation, predicting the codebook index corresponding to the at least one new codebook entry by using an autoregressive method to obtain a prediction result includes:
[0040] In the process of predicting the codebook index corresponding to the at least one new codebook entry by using an autoregressive method, the prediction accuracy is evaluated by a negative log-likelihood loss so as to minimize the loss; the negative log-likelihood loss is expressed as:
[0041]
[0042] in, represents the negative log-likelihood loss corresponding to the new codebook entry, Represents the probability modeling corresponding to the new codebook entry.
[0043] In combination with the first aspect, in yet another possible implementation, performing autoregressive modeling processing on the at least one new codebook entry to obtain a second codebook index matrix includes:
[0044] Obtaining a discretization model, encoding condition information using the discretization model, and generating a condition index sequence;
[0045] Adding the conditional index sequence to the at least one new codebook entry, and performing autoregressive modeling processing on the at least one new codebook entry after the addition to obtain a third codebook index matrix;
[0046] The using the optimized decoder to process the second codebook index matrix to obtain data samples includes:
[0047] The optimized decoder is used to map the input third codebook index matrix back to a potential vector in the codebook space; and new gene expression data is generated according to the potential vector as the data sample.
[0048] In a second aspect, the present invention provides an index sequence generating device, the device comprising:
[0049] an encoder, configured to obtain first gene expression data and at least one codebook entry, encode the first gene expression data, extract local information in the first gene expression data, and map the local information into a latent space to obtain a latent representation of the local information, wherein each of the codebook entries includes a one-to-one corresponding codebook index and an initial vector;
[0050] A compression module, configured to quantize the potential representation of the local information based on the at least one codebook entry to generate a first codebook index matrix and at least one quantization vector, wherein the first codebook index matrix is composed of a plurality of discrete and new codebook indexes, and each new codebook index corresponds to a quantization vector;
[0051] A decoder, configured to decode and reconstruct the first codebook index matrix, output second gene expression data, discriminate the second gene expression data using a discriminator to obtain a discrimination result, and perform adversarial training on the decoder and the at least one quantization vector according to the discrimination result, and output optimization parameters, wherein the optimization parameters include: an optimized decoder and at least one new codebook entry;
[0052] The processing module is used to perform autoregressive modeling processing on the at least one new codebook entry to obtain a second codebook index matrix, and use the optimized decoder to process the second codebook index matrix to obtain a data sample.
[0053] In a third aspect, the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the index sequence generation method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0054] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the index sequence generation method of the first aspect or any corresponding embodiment thereof.
[0055] In addition, the present invention provides a computer program product, including computer instructions, which are used to enable a computer to execute the index sequence generation method of the above-mentioned first aspect or any corresponding embodiment thereof.
[0056] The present invention provides an index sequence generation method, device and apparatus, which specifically include the following beneficial effects:
[0057] 1. Discrete encoding: First, the high-dimensional gene expression data is mapped into a latent space through an encoder. This latent space is a low-dimensional representation of the original gene expression data. Then, in order to further compress the data, a quantization process is introduced. The quantization process discretizes the continuous latent representation into a finite set of codebook entries, which constitute a discrete codebook. Through discretization, the original gene expression data is converted into a discrete codebook index matrix, which greatly reduces the dimensionality and complexity of the data and makes the data representation more compact.
[0058] 2. Codebook index: During the discretization process, the output of the encoder is mapped to a predefined codebook. This means that each potential representation in the original high-dimensional space is replaced by a discrete vector index in the codebook. In this way, the first gene expression data is compressed into a set of codebook indices, thereby achieving a compressed representation of the data. This process ensures that the complex patterns of gene expression data can be described by a limited set of representative features, thereby achieving effective compression of the data.
[0059] 3. Autoregressive modeling: In order to capture the global interactions in gene expression data, the present invention uses a latent model to perform autoregressive modeling on discrete codebook index sequences. This modeling process not only further compresses the data, but also preserves the global dependencies in the data. By learning the interactions between genes in the latent space, the model can capture the complex features of high-dimensional data in a low-dimensional space, thereby achieving further compression of the data.
[0060] 4. Global modeling of the latent space of the expression matrix: The present invention performs global modeling on the quantified gene expression latent space to capture the complex regulatory relationships and global dependencies in the gene expression data, thereby improving the overall description capability of the gene expression data.
[0061] In addition, an autoregressive modeling approach is used to generate a codebook index sequence for gene expression data, so that the prediction of each index not only depends on the previous index but also combines conditional information, thus achieving accurate modeling of complex patterns of gene expression data.
[0062] 5. Quantification of conditional expression information: Through discretization models, such as the VQ-GAN model, conditional gene information is quantified, and complex biological features (such as different gene expression states, cell types) are encoded into discrete codebook index sequences, so that conditional information can be effectively used in the generation process. In addition, the VQ-GAN model is used to quantify and decode gene expression data, and the hidden Transformer is used for sequence modeling, which realizes the effective generation and reconstruction of high-dimensional gene expression data.
[0063] 6. Presetting mechanism of conditional expression information: The present invention proposes a mechanism to add the index sequence of conditional gene information before the index sequence of the gene expression latent codebook, so that the latent Transformer can make full use of this conditional information when generating gene expression data and generate an expression matrix that conforms to the biological background.
[0064] 7. Discretization of data latent space: By quantizing and discretizing the continuous gene expression latent space into a codebook index sequence, the complexity of the gene expression data is reduced, making the model more robust and computationally efficient when processing high-dimensional gene expression data. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0066] Figure 1 is a flow chart of a method for generating an index sequence according to an embodiment of the present invention;
[0067] Figure 2 is a flow chart of a data sample training process according to an embodiment of the present invention;
[0068] Figure 3 is a flow chart of another index sequence generation method according to an embodiment of the present invention;
[0069] Figure 4 is a flowchart of another index sequence generation method according to an embodiment of the present invention;
[0070] Figure 5 is a structural block diagram of an index sequence generating device according to an embodiment of the present invention;
[0071] Figure 6 It is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0072] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are 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 those skilled in the art without creative work are within the scope of protection of the present invention.
[0073] In the embodiments of the present invention, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance. The technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0074] Gene expression matrix is a commonly used data type in biological research, which records the expression levels of genes under different conditions. By analyzing the gene expression matrix, we can reveal the interactions and regulatory relationships between genes, thereby gaining a deeper understanding of cell functions and disease mechanisms. In the gene expression matrix, some specific genes play key roles, called hub genes. Identifying key hub genes is crucial to revealing the functions and complexity of biological systems.
[0075] The gene expression matrix can also be called gene expression data, or a part of gene expression data.
[0076] Methods for predicting gene regulatory networks usually use gene expression data as input features and apply machine learning and statistical models for analysis. These models can discover potential regulatory relationships from large-scale gene expression data. Common methods include: correlation analysis, linear models, cluster analysis, factor analysis, and Bayesian networks. Through these methods, gene regulatory network models can be constructed to reveal regulatory relationships between genes.
[0077] Predicting gene regulatory networks has a wide range of applications in biomedical research. It can help discover important regulatory factors and pathways, and provide important clues for studying the occurrence and development of biological processes. In addition, predictions based on gene regulatory networks can also support research such as gene function annotation, gene expression pattern analysis, and biomarker discovery.
[0078] Some progress has been made in the technology of constructing gene regulatory networks based on gene expression data. These technologies mainly include: (1) correlation analysis, (2) linear models, (3) cluster analysis, (4) factor analysis and (5) Bayesian networks.
[0079] (1) Correlation analysis is one of the most common methods, which can help discover the degree of association between genes. By calculating the correlation coefficient between gene pairs in gene expression data, the regulatory relationship between them can be inferred. Correlation analysis can help us find gene groups with similar expression patterns, thereby revealing the modular structure in the gene regulatory network.
[0080] (2) Linear model is another commonly used method, which can identify the linear regulatory relationship between genes. By establishing a linear regression model, it is possible to predict how the expression level of a gene is regulated by other genes. Linear model can help identify key regulatory factors and regulatory pathways and further understand the complexity of gene regulatory networks.
[0081] (3) Cluster analysis is a method of grouping genes with similar expression patterns. By clustering gene expression data, genes with similar expression patterns can be classified into the same category, thereby identifying regulatory modules. Cluster analysis can help us understand the patterns and structures in gene regulatory networks and reveal the regulatory relationships between genes.
[0082] (4) Factor analysis is a method used to explore potential factors in gene regulatory networks. It can help identify shared regulatory mechanisms hidden in gene expression data. Through factor analysis, a large number of genes can be decomposed into a set of co-regulated factors, thereby simplifying the complexity of gene regulatory networks.
[0083] (5) Bayesian network is a probabilistic graphical model that can describe the probabilistic dependency between genes. It is based on Bayesian theorem and uses probabilistic reasoning to infer the regulatory relationship between genes. Bayesian network can help build more accurate gene regulatory network models and reveal the potential mechanisms of gene regulation.
[0084] The above methods play an important role in predicting gene regulatory networks. They can mine meaningful regulatory relationships from gene expression data, thereby gaining a deeper understanding of the complexity of biological systems. However, these methods also face some challenges, such as data noise, sample size and quality. It is necessary to consider a variety of factors and continuously optimize algorithms and models to improve the accuracy and reliability of predictions. In addition, with the continuous development of technology, more advanced methods and tools can be explored in the future to build more accurate and comprehensive gene regulatory network models.
[0085] As mentioned above, currently commonly used technologies are generally based on traditional machine learning, relying on manually selected and optimized feature parameters, which usually require professional knowledge and experience, and are a time-consuming and laborious process. Different feature parameter selections may lead to different results, and manually selected feature parameters may not capture all information.
[0086] In addition, these methods usually require manual participation in the selection of feature parameters and the training process of the model. This limits the degree of automation of the method and increases the cost and time of manual intervention. At the same time, the performance of the model is also highly dependent on the selection and optimization of feature parameters, which may have limitations. These methods are also limited to the expressive power of shallow models. These models may not be able to capture deeper relationships and patterns when dealing with complex gene regulatory networks.
[0087] In summary, traditional gene expression data analysis methods often face problems such as high computational complexity, severe data noise interference, and difficulty in capturing global regulatory relationships when faced with high-dimensional and large data matrices. The large number of genes and sample dimensions in gene expression data brings huge data volume and complexity, making direct modeling and analysis extremely difficult.
[0088] In addition, data compression is particularly important in this context because it not only reduces the dimensionality of the data and the computational cost of data modeling, but also filters out irrelevant noise components while retaining key biological information, thereby improving the ability to accurately model and biologically interpret data patterns.
[0089] In view of the above shortcomings and difficulties, the embodiment of the present invention proposes an effective method based on data compression for the complexity of high-dimensional gene expression data, the capture of global interactions, and the analysis and generation under data scarcity. The technical solution of the embodiment of the present invention achieves effective dimensionality reduction of data by compressing high-dimensional gene expression data into a set of discrete potential representations. It not only reduces the complexity of data representation, but also improves the efficiency of modeling gene expression patterns, and retains key biological information in the original data.
[0090] In summary, an embodiment of the present invention provides an index sequence generation method. First, a neural network encoder is used to map gene expression data into a latent space, capture its local features, and obtain a latent representation; then, these latent representations are discretized into a set of representative codebook indexes using a quantization process. This process belongs to a data compression process, which not only reduces the complexity of the data, but also reduces the interference of noise through discretization, making the data representation more compact and robust.
[0091] In addition, on this basis, the technical solution of the present invention also introduces autoregressive modeling, and uses implicit models, such as implicit transformers, to globally model the codebook index sequence, thereby compressing the data while retaining the long-range interactions between genes.
[0092] The index sequence generation method provided by the embodiment of the present invention not only reduces the computational burden of high-dimensional data modeling, but also improves the model's ability to capture the global pattern of data, providing an effective way to build a more accurate and biologically meaningful gene regulatory network. Through data compression, breakthroughs in global pattern recognition, conditional generation, and biological information retention in high-dimensional gene expression data have been achieved, providing an efficient and explanatory analysis tool for biomedical research.
[0093] The technical solution of the present invention deeply explores the application of transfer learning in gene expression data analysis, and the technical solution of the present invention brings innovative tools and methods to the fields of bioinformatics and precision medicine. With the technology provided by the present invention, researchers can interpret complex gene expression data more accurately, thereby revealing deep biological processes and disease mechanisms, providing strong support for promoting the progress of biomedical research and clinical practice.
[0094] This solution combines transfer learning with background noise processing, so that when faced with scarce or unlabeled data, the model can still accurately classify and predict new biological processes. Using the method of the present invention, researchers can analyze the key features in gene expression patterns more deeply and reveal gene regulatory networks and functional modules in different biological processes. Such analysis not only provides a new perspective for basic biological research, but can also be widely used in the study of disease mechanisms.
[0095] For example, by analyzing gene expression data related to cancer, metabolic diseases, or immune-related diseases, researchers can identify core genes hidden in complex regulatory networks, and then find new therapeutic targets or biomarkers, providing new scientific basis for the diagnosis, treatment and prevention of diseases.
[0096] An embodiment of the present invention provides an embodiment of an index sequence generation method. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0097] In this embodiment, a method for generating an index sequence is provided, which can be used in an electronic device, such as a server. Figure 1 is a flowchart of a method for generating an index sequence according to an embodiment of the present invention. Figure 1 As shown, the method includes:
[0098] Step S101: Acquire first gene expression data and at least one codebook entry.
[0099] Among them, the first gene expression data can be a gene expression matrix, and the gene expression matrix sample can be specifically obtained by using high-throughput sequencing technology on the sample. Furthermore, the RNA extracted from the sample is transcribed into cDNA, and sequencing or probe hybridization experiments are performed on it to generate a large amount of data, which records the expression of each gene in different samples, and finally obtains the gene expression matrix sample based on these expression conditions.
[0100] In this embodiment, each row of the gene expression matrix represents a specific gene, and each column represents a sample. Each element in the matrix can represent the expression amount of the gene, the logarithmic transformation value of the expression level, or the standardized expression value. The higher the value of the gene expression level, the higher the expression level of the gene in the corresponding sample.
[0101] In one example, the first gene expression data includes a first entry and a second entry, wherein the first entry records the gene hub of Alzheimer's disease, such as the APP gene of Alzheimer's disease; the second entry records Parkinson's disease and the gene hub of Parkinson's disease. In the gene expression matrix, some specific genes play a key role, called gene hubs.
[0102] Gene hubs can be some specific gene sequences in the gene network, which have a great correlation with specific biological processes. Biological processes refer to a series of interrelated molecular events that occur in organisms, which together realize specific biological functions or biological activities. Biological processes can include cell signaling, metabolic pathways, gene expression regulation, etc. These processes are essential for maintaining life and realizing various biological functions of organisms. By analyzing the expression matrix corresponding to the gene and predicting the key gene hubs, the interaction and regulatory relationship between genes can be revealed.
[0103] In addition, in at least one codebook entry, each codebook entry includes a one-to-one corresponding codebook index and an initial vector. The codebook index is used to indicate the position of a certain initial vector in the codebook. At least one codebook entry contains part or all of the first gene expression data.
[0104] Optionally, at least one codebook entry is represented by letter Z.
[0105] Step S102: Encode the first gene expression data, extract local information in the first gene expression data, and map the local information into a latent space to obtain a latent representation of the local information.
[0106] like Figure 2As shown, this step can be performed by an encoder, where the first gene expression data is input into a neural network encoder (referred to as "encoder"), and the encoder maps it into a latent space to capture local information (or local features) in the data and complex gene expression patterns.
[0107] This step extracts the key features of gene expression data, namely local features, and converts them into a compact representation that is convenient for subsequent compression and modeling. In the next step, the encoder transmits this latent representation to the compression module.
[0108] Optionally, the potential representation is E(x), and the encoder is E. Wherein, x is the first gene expression data, and the encoder E encodes and maps the first gene expression data x, and outputs the potential representation as E(x).
[0109] Step S103: quantize the potential representation of the local information based on at least one codebook entry to generate a first codebook index matrix and at least one quantization vector.
[0110] The first codebook index matrix is composed of a plurality of discrete and new codebook indexes, and each new codebook index corresponds to a quantization vector.
[0111] The compression module receives the latent representation E(x) from the encoder, quantizes the encoded latent representation E(x), discretizes the continuous latent representation into a set of discrete codebook indexes, and forms a first codebook index matrix.
[0112] Optionally, each codebook index in a set of discrete codebook indices can be represented as s ij Specifically, it is understood that: E(x) corresponds to the index of the codebook at position (i, j), and the quantization vector zij is represented at position (i, j) in the codebook entry.
[0113] The first codebook index matrix is represented as s, and the codebook indexes contained in the first codebook index matrix s include s1, s2, ..., sn, n is the number of codebook indexes, n ≥ 2 and is a positive integer, and then the first codebook index matrix s is represented as s = {s1, s2, ..., sn}, s1, s2, ..., sn are discrete and new codebook indexes, and each new codebook index corresponds to a quantization vector.
[0114] The compression module sends the first codebook index matrix {s1, s2, ..., sn} to the decoder.
[0115] This step further compresses the data E(x) in the latent space into an index sequence in the discrete codebook, thereby reducing the complexity of the data and removing some noise, making the latent representation more compact and robust.
[0116] Step S104: Decode and reconstruct the first codebook index matrix, output the second gene expression data, discriminate the second gene expression data to obtain a discrimination result, and perform adversarial training on the decoder and at least one quantization vector according to the discrimination result to output optimization parameters.
[0117] The optimization parameters include: an optimized decoder (G') and at least one new codebook entry (Z'), wherein the at least one codebook entry (Z') is a result of updating and optimizing the at least one codebook entry Z in the aforementioned step S101.
[0118] Optionally, the optimization parameters may also include an optimized encoder E'.
[0119] A specific implementation of step S104 is that the decoder receives the first codebook index matrix {s1, s2, ..., sn} from the compression module, decodes and restores the first codebook index matrix to obtain restored gene expression data, namely, second gene expression data.
[0120] In addition, on this basis, in this step, the decoder also sends the second gene expression data to the discriminator for adversarial training to ensure that the generated gene expression data is not only close to the original data in terms of numerical value, but also authentic in terms of biological characteristics. During the process of the discriminator discriminating and adversarial training the second gene expression data, the decoder and the discriminator compete with each other. The decoder tries to generate more realistic gene expression data, and the discriminator tries to distinguish between real data and newly generated data. Through this competition process, the decoder is forced to learn richer biological features, thereby retaining the key biological information in the original data when reconstructing the gene expression data.
[0121] In this step, in adversarial training, optimization parameters are generated, which include an optimized decoder G' and an optimized codebook entry Z', that is, at least one new codebook entry Z' is the result of updating at least one codebook entry Z in step S1, and the optimized decoder G' is used for subsequent training of sampled data.
[0122] After generating the optimization parameters, the decoder sends at least one new codebook entry Z' in the optimization parameters to the processing module, which is used for model training.
[0123] Step S105: performing autoregressive modeling processing on at least one new codebook entry to obtain a second codebook index matrix.
[0124] One possible implementation is to use a hidden Transformer to process at least one new codebook entry Z', learn the global structure between new codebook indexes corresponding to the new codebook entry, and obtain a second codebook index matrix.
[0125] Optionally, the new codebook entry may also include a conditional index sequence. The conditional index sequence is used to represent conditional information, which includes information such as gene expression status or cell type, and can reflect biological characteristics. For example, the specific gene expression status of tumor cells can be used as conditional information to guide the generation of gene expression data under corresponding conditions, thereby simulating gene regulatory networks under different cell states.
[0126] In order to capture the global interactions in gene expression data, the present invention introduces a hidden Transformer to perform autoregressive modeling on at least one new codebook entry output after discretization training, learn the long-range dependency of the first gene expression data in the latent space, which belongs to part or all of the global structure, and use it as a new codebook index matrix, i.e., the aforementioned second codebook index matrix. The second codebook index matrix is generated by the aforementioned first codebook index matrix after quantization and adversarial training, and the first codebook index matrix is associated with the decoder to generate the second gene expression data.
[0127] Step S106: using the optimized decoder to process the second codebook index matrix to obtain data samples.
[0128] Specifically, one implementation includes: when the processing module uses the conditional information to synthesize new gene expression data, the conditional information is first encoded through an independent discretization module, such as a VQ-GAN model, to obtain a conditional index sequence, for example, the conditional index sequence is represented by r. Then, the conditional index sequence r is added to the front of the potential index sequence s to be generated to form a new input sequence [r, s1, s2, ..., sn]. The optimized decoder predicts each codebook index in an autoregressive manner for the new input sequence [r, s1, s2, ..., sn] to obtain a prediction result, and the prediction result is used as a data sample of gene expression.
[0129] The decoder maps the first codebook index matrix back to the latent vectors in the codebook space, and then uses these latent vectors to generate the final gene expression data. In this process, the conditional index sequence r affects the generated latent codebook index sequence, thereby ensuring that the generated gene expression data conforms to the given biological context.
[0130] The core of the index sequence generation method provided in this embodiment is to map high-dimensional and complex gene expression data to a low-dimensional and discretized potential space through the process of quantization and encoding. It not only reduces the computational burden of high-dimensional data modeling, but also improves the ability of the model to capture the global pattern of data, and provides an effective way to build a more accurate and biologically meaningful gene regulatory network. In addition, breakthroughs in global pattern recognition, conditional generation, and biological information retention in high-dimensional gene expression data are achieved through data compression, providing an efficient and explanatory analysis tool for biomedical research.
[0131] Furthermore, the method of this embodiment can be used to analyze and generate gene expression data under various biological conditions. For example, when studying the difference in gene expression between brain tumors and normal cells, the method of the present invention can be used to model a large amount of gene expression data, capture the unique expression pattern of tumor cells, and generate an expression matrix that meets biological conditions, thereby providing important technical support for related research and precision medicine.
[0132] First, the concepts and symbols involved in the embodiments of the present invention are introduced. The following are the symbols and overall design for gene expression data:
[0133] Gene expression data or gene expression matrix, the gene expression data may be the first gene expression data of the aforementioned embodiment, represented by the letter x, wherein, . represents the first gene expression data x input, N represents the number of samples, M represents the number of genes, H represents the number of rows, W represents the number of columns, and R is a real number.
[0134] Encoder (E): : The encoder E is a neural network used to downsample the input first gene expression data x into a potential representation E(x).
[0135] Quantization process: The quantization result after quantization by the compression module can be expressed as , , a quantized version of the latent representation z. By mapping z into discrete codebook entries. quantization is performed by using the nearest entry in , where K represents the size of the codebook entry, represents a vector in the codebook, belonging to the predefined feature vector set Z, Corresponding to the codebook index k, corresponds to a codebook entry.
[0136] It is the quantized encoding result, expressed as a discretized potential representation. That is, the continuous potential representation generated by the encoder is converted into a discrete representation through a quantization process.
[0137] Quantization function: , each element of the potential representation are replaced by the most recent codebook entry.
[0138] Codebook or codebook entry (Z): : A set of learned discrete vectors that represent common patterns or features in gene expression data. Each codebook vector The size is .
[0139] Decoder (G), the relationship is expressed as: Decoder .
[0140] The decoder G reconstructs the gene expression data from the quantized latent representation. The decoder G can be a neural network decoder for upsampling the quantized features to the size of the original gene expression data.
[0141] The steps S101 to S106 of the above embodiment are described in detail below.
[0142] First, the first gene expression data of step S102 is mapped into a latent space through a neural network encoder. The purpose of this encoding process is to capture the local information in the gene expression data (capture its local features) so that complex gene expression patterns can be effectively represented in a low-dimensional space. The encoder E generates a latent representation E(x) by processing the first gene expression data, laying the foundation for the subsequent quantization and decoding steps.
[0143] Then, the quantization module of step S103 quantizes the potential representation E(x) into a set of discrete features, and the matrix composed of these features is the first codebook index matrix. The quantization process is to map the continuous potential representation into a discrete set, which represents the common expression patterns in the gene expression data. In this way, the present embodiment can simplify the complex gene expression data into a set of discrete potential representations, reduce the complexity of data modeling, and make the subsequent modeling process more efficient.
[0144] After quantization, in step S104, the neural network decoder is responsible for converting the quantized representation E(x) back into gene expression data (outputting second gene expression data). The design of the decoder ensures that the spatial consistency of the gene expression data is maintained during the reconstruction process (i.e., the neural network decoder decodes these new potential coding sequences into high-quality gene expression data), so that the reconstructed gene expression data can be as faithful to the original data as possible. The goal of this step is to ensure that key biological information in the gene expression data is not lost during the encoding and quantization process.
[0145] In order to capture the global interactions in the gene expression data, an autoregressive model / autoregressive modeling is introduced in step S105 of the above embodiment. The purpose of autoregressive modeling is to ensure a coordinated expression pattern between different genes, so as to reflect more biologically meaningful interactions when generating a gene regulatory network. Through this autoregressive model, long-range dependencies in gene expression data can be better captured.
[0146] In order to maintain the biological relevance and authenticity of the data throughout the process, adversarial training is introduced in step S104 of this embodiment. Adversarial training uses the loss function of the Generative Adversarial Network (GAN) to ensure that the generated gene expression data has high-quality biological features during the encoding, quantization and decoding process. This process improves the authenticity of the reconstructed gene expression data, making it closer to actual biological data.
[0147] The index sequence generation method provided in this embodiment can effectively process complex gene expression data by compressing the information in the gene expression data into discrete potential representations and using autoregressive modeling to capture global gene interactions. It can reduce the computational complexity while retaining the ability to model the deep-level characteristics of the gene expression data.
[0148] In a possible implementation of this embodiment, before encoding the first gene expression data in step S102, the process further includes: obtaining condition information, wherein the condition information includes biological features, and the condition information is used to conditionally control the generation process. Such condition information may be any additional information that has a constraint or guiding effect on the generation result.
[0149] Optionally, conditional information is represented by the letter c.
[0150] The above step S102 specifically includes: encoding the first gene expression data and the condition information, extracting key features, and mapping the key features into a latent representation in a latent space, wherein the key features include local information.
[0151] In the method flow of this embodiment, a loss function is also used in the above processing process, and the loss function plays a key role in different steps to ensure that the generated data is both of high quality and biologically realistic. The loss function is gradually introduced to effectively train and optimize the encoder, quantization and decoder.
[0152] Specifically, in step S102 encoding phase, the encoder is responsible for encoding the given gene expression data or conditional information into a representation in a latent space to extract the key features of the data. In order to ensure that the representation generated by the encoder can accurately reconstruct the original data after decoding, the model will add a reconstruction loss. The goal of this reconstruction loss is to ensure that the output of the encoder is as close to the input data as possible when the decoder reconstructs it.
[0153] Furthermore, if Figure 3 As shown, the above step S102 may be performed by an encoder, and specifically includes:
[0154] Step S1021: Obtain a loss function, where the loss function includes a reconstruction loss function, and the reconstruction loss function is used to ensure that the difference between the reconstructed second gene expression data and the original first gene expression data is minimized; so that the first gene expression data and the second gene expression data are as close as possible.
[0155] Step S1022: Encode the first gene expression data and conditional information using a reconstruction loss function, extract key features, and map them into a latent representation in a latent space.
[0156] In addition, the loss function also includes: codebook loss function and commitment loss function; the codebook loss function is used to make the encoder use specific codebook entries and obtain a potential representation of representative discretized features, and the commitment loss function is used to constrain the stability of the potential representation.
[0157] The above step S103: quantizing the potential representation of the local information based on at least one codebook entry to generate a first codebook index matrix and at least one quantization vector, specifically includes:
[0158] In the process of quantizing the potential representation of the local information based on at least one codebook entry, a codebook loss function and a commitment loss function are added to generate a first codebook index matrix and at least one quantization vector.
[0159] In this step, the codebook loss function is added to ensure that the output encoding result of the encoder can be well mapped to the appropriate entry in the codebook, thereby obtaining a representative discretized feature representation. The commitment loss function further constrains the stability of the encoder output to ensure that the generated representation does not fluctuate arbitrarily. The addition of these loss functions at this stage helps the quantization process to be more accurate and stable, enabling the model to retain key information while reducing data complexity.
[0160] Quantization step S103, in this embodiment, the quantization step corresponds to the encoder output , mapped to the codebook Specifically, each element zij representing the encoded gene expression data is replaced by the closest codebook entry, in which the quantized encoding result It is expressed as:
[0161] (1)
[0162] This step ensures that the encoder output can be represented by a set of discrete vectors in the codebook, namely, at least one quantized vector mentioned above, thereby realizing the discretization representation of gene expression data.
[0163] After the quantization step, the decoder G reconstructs the gene expression data through the quantized latent code. The specific process is:
[0164] (2)
[0165] Here, the encoder first maps the input first gene expression data x to the potential representation E(x), then quantizes it, and finally passes it through the decoder. q Reconstruction of second gene expression data .
[0166] The loss function used in the embodiment of the present invention includes three parts. Expression (3) of the loss function is as follows:
[0167] (3)
[0168] in, represents the reconstruction loss function, represents the codebook loss function, represents the commitment loss function, sg[] represents the stop gradient operation, represents the loss function, E represents the encoder, G represents the decoder, Z represents the codebook entry, x represents the first gene expression data, represents the second gene expression data, E(x) represents the output of the data x after the encoder E, Indicates the encoding result after quantizing the data.
[0169] Furthermore, the reconstruction loss function , ensuring that the reconstructed gene expression data is as close as possible to the original gene expression data. Codebook loss function , which encourages the encoder to use specific codebook entries to ensure the stability of the quantization process. Commitment loss function Used to ensure that the codebook entries are close enough to the encoder output. sg[] indicates the stop gradient operation, which prevents gradients from flowing into certain parts of the network during backpropagation.
[0170] After the loss function is introduced in this implementation, the encoding, quantification and reconstruction of gene expression data are realized, and the key patterns in the gene expression data are captured by using discrete codebooks to ensure the construction of an effective and biologically meaningful gene expression network.
[0171] In addition, the above loss function introduction process also includes gradient calculation. In the back propagation process of the present invention, the non-differentiable quantization step is handled by treating the operation as the identity function I. This means that during back propagation, the gradient will pass directly through the quantization step, just as the quantization simply returns the input without any modification. This processing ensures that the encoder can receive gradient updates, thereby maintaining the trainability of the model during the quantization process.
[0172] Furthermore, a stop gradient operation (sg) is applied to the second and third terms of the loss function to control the impact of gradient updates on the encoder and codebook.
[0173] The second term of the above relationship (3) (Codebook loss function): In this term, the stop gradient operation is used on E(x) to ensure that only the codebook is updated, while the encoder remains unchanged. This mechanism allows the codebook to learn a better representation that matches the encoder output. (Commitment loss): In this item, q Using a stop gradient operation ensures that only the encoder E(x) is updated while the codebook remains fixed. This encourages the encoder to output a representation closer to the quantized codebook entry, thereby improving the representation power of the model.
[0174] This embodiment uses a straight-through estimator during the back-propagation process, treating quantization as an identity operation so that the gradient can flow through the non-differentiable quantization step. At the same time, the introduction of the stop gradient operation ensures that only the codebook is updated in the second term of the loss function, and only the encoder is updated in the third term. These mechanisms work together to enable this embodiment to efficiently learn the encoder and codebook, and achieve effective quantization and modeling of gene expression data.
[0175] In another specific implementation of this embodiment, in the decoding stage of the above step S104, the decoder uses the discrete representation obtained by quantization in the previous stage to generate a complete gene expression matrix. In this stage, adversarial loss is introduced to optimize the generator (i.e., the combination of the encoder and the decoder) and the discriminator through adversarial training. The role of adversarial loss is to improve the authenticity of the generated data. The goal of the generator is to minimize the adversarial loss so that the generated data can "cheat" the discriminator and make the discriminator think that the generated data is real. The goal of the discriminator is to maximize the adversarial loss in order to better distinguish between real data and generated data. This adversarial mechanism ensures that the generated data is not only close to the real data in terms of numerical value, but also reasonable in terms of biological characteristics.
[0176] Specifically, step S104 includes: performing adversarial training on at least one quantized vector outputted in step S103 by using an adversarial loss function to generate optimization parameters; the adversarial loss function is expressed by equation (4):
[0177] (4)
[0178] in, represents the discriminator's prediction of the true gene expression data, The output is yes or no. Denotes the prediction of the discriminator on the reconstructed gene expression data, and D denotes the discriminator. Adversarial loss plays a key role in the model training process. By establishing a competitive relationship between the decoder and the discriminator, it ensures that the generated gene expression data is not only close to the original matrix in terms of numerical value, but also has authenticity in terms of biological characteristics. In adversarial training, the loss functions of the discriminator and decoder usually contain logarithmic terms.
[0179] The above-mentioned adversarial training process can be performed by the discriminator and the decoder to generate the optimization parameters.
[0180] The optimization parameters are , The expression (5) is:
[0181] (5)
[0182] in, represents the optimization parameters, Denotes that the decoder minimizes the overall objective function, and the discriminator D maximizes the objective function, is the balancing factor, and the expectation Represents the calculation of the loss on the gene expression data distribution p(x). Here, the decoder generates more realistic gene expression data by minimizing the loss, while the discriminator distinguishes the real gene expression data from the generated matrix by maximizing the loss. This adversarial process ensures that the output of the decoder is not only numerically close to the original gene expression data, but also more realistic in biological characteristics.
[0183] Expectation symbol This is similar to taking an average value across the entire data distribution, meaning that the objective function is calculated over multiple real gene expression data sampled from the data distribution. In practical applications, it is impossible to calculate all samples due to the high computational cost, so this expectation is usually approximated by extracting a subset (mini-batch) from the dataset in each iteration.
[0184] The process of adversarially training the decoder itself and at least one quantized vector by adversarial loss function also includes:
[0185] Extract some mini-batch data from the dataset, which is a collection of at least one gene expression data; then calculate the vector quantization (VQ) loss and the generative adversarial network (GAN) loss of each gene expression data in the collection. Calculate the average loss of some batch data based on the VQ loss and GAN loss, and get an average value that approximates the overall expectation.
[0186] GAN consists of two parts: a generator and a discriminator, which learn and improve together through a process of mutual confrontation and optimization to generate realistic data. It should be noted that in this embodiment, the generator can be the aforementioned decoder.
[0187] also, This ensures the accuracy of reconstruction and the correct learning of the codebook. This improves the perceived quality of the generated gene expression data. Used to adjust the contribution of GAN loss relative to VQ loss to balance reconstruction quality and perceptual quality.
[0188] Furthermore, in the process of adversarially training the generator and the discriminator through the adversarial loss function, it also includes: respectively calculating the gradient of the adversarial loss and the gradient of the reconstruction loss in the adversarial training process; according to the gradient of the adversarial loss and the gradient of the reconstruction loss, calculating the balance factor according to the relationship; wherein the relationship (6) for calculating the balance factor is:
[0189] (6)
[0190] in, is the balance factor, represents the gradient of the reconstruction loss, represents the gradient of the adversarial loss with respect to the decoder G, and δ is a constant.
[0191] In the adversarial training of the present invention, the goal of the discriminator D is to maximize Specifically, the discriminator maximizes To ensure that it can identify the real gene expression data, that is, output D(x)≈1. This means that if the discriminator mistakenly identifies the real gene expression data as fake, it will be punished more. Similarly, for the reconstructed gene expression data, the discriminator's goal is to maximize , so that ≈ 0. In other words, the discriminator needs to learn to distinguish the reconstructed gene expression data produced by the decoder from the real data. If the discriminator mistakenly regards the reconstructed matrix as real, it will be penalized larger.
[0192] On the other hand, the decoder aims to minimize To achieve this, the decoder attempts to generate gene expression data that is realistic enough to fool the discriminator. In other words, the decoder hopes ≈1, making it impossible for the discriminator to distinguish between the generated gene expression data and the real gene expression data. If the decoder succeeds in doing this, it will effectively minimize the second term in the loss function , thereby reducing its total loss.
[0193] In this adversarial game, the discriminator and decoder compete with each other. The discriminator strives to maximize to accurately distinguish between real and generated gene expression data, thereby improving its ability to judge the authenticity of the data. To generate realistic gene expression data in an attempt to deceive the discriminator. Through this competitive relationship, the decoder is forced to learn richer biological features, so that when reconstructing gene expression data, the biological authenticity of the original data can be better maintained. The success of this adversarial process enables the present invention to learn a perceptually rich codebook. This codebook not only captures the numerical characteristics of gene expression data, but also reflects the biological significance of the regulatory relationship between genes. Through continuous adjustment during the generation and discrimination process, the present invention is ultimately able to generate high-quality gene expression data, and these matrices have a high degree of authenticity in both biological features and practical applications.
[0194] In practice, this expectation is approximated by using small batches of training data. Mathematically, the expectation represents the calculation of the loss on the gene expression data distribution p(x). However, since it is impossible to calculate for an infinite number of samples, we extract a mini-batch from the dataset during training and take the average of the loss on the mini-batch to approximate this expectation. In each training iteration, a set of real gene expression data of size N is extracted for calculation. Then, the VQ loss and GAN loss are calculated for each gene expression data, and the overall expectation is approximated by the average of the mini-batch. The relationship (7) is expressed as follows:
[0195] (7)
[0196] Where N is the size of the mini-batch (e.g. 32 or 64), x iRepresents each true gene expression data in the mini-batch. The overall expectation is approximated by summing the losses of the mini-batch samples and dividing by the number of samples. In each iteration, the parameters of the decoder and discriminator are updated based on the average loss of this mini-batch, thereby gradually improving the performance of the model.
[0197] In addition, the above relationship (6) also involves the balance factor , also known as adaptive weights, are used to balance the contribution of adversarial loss (GAN loss) and reconstruction loss in the overall objective, so that the model’s attention to reconstruction quality and perceived authenticity is effectively balanced during training.
[0198] Specifically, in the above relation (6) represents the gradient of the reconstruction loss (from the VQ loss) and is calculated with respect to the decoder G. This gradient quantifies how much the decoder needs to adjust its parameters in order to improve the quality of the reconstruction of the gene expression data. By measuring this gradient, we can understand how much room there is for improvement in the model to accurately reconstruct the gene expression data at the current stage of training. Represents the gradient of the adversarial loss with respect to the decoder G. This gradient reflects the improvement requirement of the decoder in terms of perceptual authenticity, that is, the generated gene expression data should look more like real gene expression data in order to better deceive the discriminator. By evaluating this gradient, we can understand the potential of the model in improving perceptual quality.
[0199] In addition, to ensure the robustness of the calculation, a constant δ is introduced in equation (6) to avoid the denominator being zero. This setting is very important in numerical calculation because it ensures that the calculation of the adaptive weights will not cause numerical instability due to too small gradients.
[0200] The above balance factor In the relation (6), the perceptual reconstruction loss function Mainly refers to the reconstruction loss, which is a part of the VQ loss and aims to ensure that the reconstructed gene expression data is consistent with the original matrix. This loss emphasizes the reconstruction accuracy of the gene expression data by minimizing the difference between the reconstructed matrix and the original matrix. The perceptual reconstruction loss is not equivalent to the sum of the VQ loss and the GAN loss. It emphasizes that the model balances the reconstruction loss and the adversarial loss during the training process to achieve the dual goals of high fidelity and high perceptual quality.
[0201] Balance Factor The relative importance of reconstruction loss and adversarial loss is balanced according to the needs of the current training stage. When the gradient of reconstruction loss is large, λ increases, indicating that the model needs to focus more on improving reconstruction quality. When the gradient of adversarial loss is large, λ decreases, indicating that the model should focus more on improving perceptual realism. By comparing the gradients of the two, the model can dynamically determine which goals should be prioritized at different training stages. This adaptive adjustment prevents the model from over-focusing on one goal, such as generating perceptually realistic but inaccurate gene expression data, or generating accurate expression data that lacks perceptual quality.
[0202] If λ is a fixed value, the model may focus too much on generating realistic-looking gene expression data but inaccurate reconstructions, or too much on accurate reconstructions but lack perceptual quality. By dynamically adjusting λ, the model is able to achieve a dynamic balance between reconstruction fidelity and perceptual realism, thereby generating gene expression data that is both accurate and biologically realistic.
[0203] In the above embodiment, step S105 also includes generating an implicit transformer, which is specifically a model of discrete data.
[0204] In this embodiment, the hidden Transformer is a training phase independent of the GAN learning phase, and its goal is to model the global structure of the quantized latent space, which is indexed by the codebook instead of directly using the raw gene expression data.
[0205] In addition, the construction of the first codebook index matrix is an important step in latent space modeling. Its core is to convert the quantized latent vector z q Mapped to the codebook index, thus obtaining a discretized representation for subsequent hidden Transformer modeling. The mathematical description of this process is equation (8):
[0206] (8)
[0207] Among them, the definition , and the conditions that k needs to satisfy are: .
[0208] The above relationship (8) converts the quantized latent vector z q Specifically, the encoder encodes the first gene expression data in the first stage to generate a potential representation. Then, the compression module maps this potential representation to the closest codebook vector in the codebook Z to generate a quantized representation z q The discrete codebook index sij is the quantized potential vector z qConverted into a sequence of codebook indices to obtain a first codebook index matrix.
[0209] On this basis, the hidden Transformer will model the first codebook index matrix instead of directly modeling the original gene expression data. Since the index sequence is discrete, it can be learned by autoregression. All of them depend on the previous index, and the hidden Transformer captures the global structure of gene expression data in the latent space by learning this dependency. This approach not only reduces the complexity of the model, but also makes it easier for the model to capture long-range dependencies in the data.
[0210] Specific implementation process, such as Figure 4 As shown, the above step S105: performing autoregressive modeling processing on at least one new codebook entry to obtain a second codebook index matrix specifically includes:
[0211] Step S1051: predicting a codebook index corresponding to at least one new codebook entry using an autoregressive method to obtain a prediction result, wherein each new codebook index in the prediction result is predicted based on a previous codebook index.
[0212] Step S1052: after prediction, the probability of the entire codebook index sequence is modeled to obtain the dependency relationship between new codebook indexes.
[0213] Step S1053: Generate a second codebook index matrix according to the prediction result and the dependency relationship.
[0214] Furthermore, the above step S1051 specifically includes: in the process of predicting the codebook index corresponding to at least one new codebook entry by using the autoregressive method, evaluating the prediction accuracy by using the negative log-likelihood loss so as to minimize the loss; the negative log-likelihood loss is expressed as:
[0215] (9)
[0216] in, represents the negative log-likelihood loss corresponding to the new codebook entry Z', Represents the probability modeling corresponding to the new codebook entry Z'.
[0217] The goal of the hidden Transformer is to minimize this loss so that the model can accurately predict the new sequence of codebook indices in the new codebook entry Z', which actually represents the latent structure of the gene expression data.
[0218] When actually calculating the negative log-likelihood loss, the hidden Transformer predicts the sequence in an autoregressive manner. Each new codebook index The predictions are based on the previous index The probability of the entire new codebook entry is modeled as:
[0219] (10)
[0220] For each position in the sequence, the hidden Transformer outputs a probability distribution over all possible codebook indices. Then, sampling is performed through this probability distribution to select the most likely next index. This autoregressive modeling approach ensures that the model can learn complex dependencies between elements in the sequence.
[0221] In addition, the specific calculation method of negative log-likelihood loss is as follows: for each codebook index For example, the hidden Transformer predicts its conditional probability , and then calculate the log probability of this correct index. Then sum the log probabilities in the entire codebook index sequence to calculate the total log probability sum. The negative value of this sum is used as the loss, which means that if the hidden Transformer assigns a lower probability to the correct index sequence, the loss will increase, thereby penalizing the model. The formula is expressed as:
[0222] (11)
[0223] in, It is a conditional generation probability, which indicates the sequence of previously generated indexes that the index at the generated position (i, j) depends on. It is a condition used to refer to all indexes before the generated position and is used in the autoregressive modeling process.
[0224] The training goal of the hidden Transformer is to minimize this negative log-likelihood loss, thereby encouraging the model to assign higher probabilities to the correct sequence of codebook indices. This process enables the model to better understand the global dependencies in the latent space, thereby generating more consistent latent representations.
[0225] It should be noted that the training process of the hidden transformer is separate from the first stage. It focuses on modeling the first codebook index matrix rather than directly processing the raw gene expression data. In the first stage, the latent vector is mapped to the codebook vector to obtain a quantized codebook index sequence. The input of the hidden transformer is precisely these index sequences, and the global structure in these index sequences is learned through autoregressive modeling. Negative log-likelihood loss It is used to measure the Transformer's prediction accuracy for the correct index sequence. The goal is to minimize this loss to improve the hidden Transformer's ability to generate consistent representations in the latent space. In this way, the hidden Transformer is able to learn how to generate new latent coding sequences. These sequences represent the global features of the gene expression data and can be further decoded by the decoder into high-quality and overall consistent gene expression data.
[0226] In another specific implementation, the above step S106, adding the conditional index sequence to the first codebook index matrix to generate the second codebook index matrix, specifically includes: obtaining a discretization model, encoding the conditional information using the discretization model, and generating a conditional index sequence (r); for example, the discretization model is an independent discretization VQ-GAN model. Add the conditional index sequence (r) to at least one new codebook entry, and perform autoregressive modeling on the at least one new codebook entry after the addition to obtain a third codebook index matrix.
[0227] In the above step S106, the second codebook index matrix is input into the optimized decoder for processing to generate data samples, including: using the optimized decoder (G') to map the input third codebook index matrix ([r, s1, ..., sn]) back to the latent vector in the codebook space; generating new gene expression data as data samples based on the latent vector.
[0228] Specifically, the process of generating the expression matrix, in the embodiment of the present invention, uses the condition information c to generate gene expression data:
[0229] (12)
[0230] Among them, the relationship (12) represents the generation of a series of potential codebook indexes { }. Here represents the codebook index at position i in the potential sequence, and Represents all the indices before position i in the sequence, such as s 1 ,s 2 ,…, .
[0231] In addition, the conditional information c may include biological features such as gene expression status or cell type. This equation conditions the latent codebook index through an autoregressive process, where each index The predictions depend on the previous index And conditional information c. This modeling approach ensures that the model takes into account all relevant conditional information when generating gene expression data.
[0232] In order to process conditional information with spatial structure (such as gene expression feature matrix or other complex feature maps), the conditional information c needs to be encoded first. The conditional information c is encoded into a quantized, index-based representation through an independent proposed discretization model. Then, this conditional index sequence r is added to the front of the first codebook index matrix s to be generated, so that the hidden Transformer can refer to the information in the combined sequence [r, s] when generating autoregressively, so that when predicting each codebook index, it takes into account both the previous index and the context provided by the conditional information c.
[0233] Furthermore, in the specific process of using conditional information to synthesize new gene expression data, the conditional information c is first encoded through an independent VQ-GAN model (discretization model) to obtain a conditional index sequence. Then, the conditional index sequence r is added to the front of the potential codebook sequence to form a new codebook index sequence [r, s1, s2, …, sn], that is, the second codebook index matrix mentioned above.
[0234] In this embodiment, after the hidden transformer generates the codebook index sequence, the decoder uses the sequence to reconstruct the gene expression data. The decoder maps the index sequence back to the latent vector in the codebook space, and then uses these latent vectors to generate the final gene expression data. In this process, the conditional information affects the generated latent sequence, thereby ensuring that the generated gene expression data conforms to the given biological context.
[0235] The index sequence generation method and model training method provided in this embodiment have the following beneficial effects:
[0236] 1. Discrete encoding: First, the high-dimensional gene expression data is mapped into a latent space through an encoder. This latent space is a low-dimensional representation of the original gene expression data. Then, in order to further compress the data, a quantization process is introduced. The quantization process discretizes the continuous latent representation into a finite set of codebook entries, which constitute a discrete codebook. Through discretization, the original gene expression data is converted into a discrete codebook index matrix, which greatly reduces the dimensionality and complexity of the data and makes the data representation more compact.
[0237] 2. Codebook index: During the discretization process, the output of the encoder is mapped to a predefined codebook. This means that each potential representation in the original high-dimensional space is replaced by a discrete vector index in the codebook. In this way, the first gene expression data is compressed into a set of codebook indices, thereby achieving a compressed representation of the data. This process ensures that the complex patterns of gene expression data can be described by a limited set of representative features, thereby achieving effective compression of the data.
[0238] 3. Autoregressive modeling: In order to capture the global interactions in gene expression data, the present invention uses a hidden Transformer model to perform autoregressive modeling on the discrete codebook index sequence (i.e., the first codebook index matrix). This modeling process not only further compresses the data, but also preserves the global dependencies in the data. By learning the interactions between genes in the latent space, the model can capture the complex features of high-dimensional data in a low-dimensional space, thereby achieving further compression of the data.
[0239] 4. Global modeling of the latent space of the expression matrix: The present invention performs global modeling on the quantified gene expression latent space to capture the complex regulatory relationships and global dependencies in the gene expression data, thereby improving the overall description capability of the gene expression data.
[0240] In addition, an autoregressive modeling approach is used to generate a codebook index sequence for gene expression data, so that the prediction of each index not only depends on the previous index but also combines conditional information, thus achieving accurate modeling of complex patterns of gene expression data.
[0241] 5. Quantification of conditional expression information: Through discretization models, such as the VQ-GAN model, conditional gene information is quantified, and complex biological features (such as different gene expression states, cell types) are encoded into discrete codebook index sequences, so that conditional information can be effectively used in the generation process. In addition, the VQ-GAN model is used to quantify and decode gene expression data, and the hidden Transformer is used for sequence modeling, which realizes the effective generation and reconstruction of high-dimensional gene expression data.
[0242] 6. Mechanism for presetting conditional expression information: The present invention proposes a mechanism for presetting the index sequence of conditional gene information before the index sequence of the gene expression latent codebook, so that the latent Transformer can make full use of this conditional information when generating gene expression data and generate an expression matrix that conforms to the biological background.
[0243] 7. Discretization of data latent space: By quantizing and discretizing the continuous gene expression latent space into a codebook index sequence, the complexity of the gene expression data is reduced, making the model more robust and computationally efficient when processing high-dimensional gene expression data.
[0244] 8. Negative log-likelihood loss optimization of expression data: By minimizing the negative log-likelihood loss of the gene expression codebook index sequence, the autoregressive generation ability of the hidden Transformer is optimized, enabling it to accurately predict the correct codebook index sequence of gene expression data, thereby better reflecting the global structure of gene expression in the latent space.
[0245] 9. Multi-stage gene expression modeling process: A multi-stage gene expression modeling process was designed, including encoding gene expression data, quantizing latent representations, learning codebook index sequences using hidden Transformers, and reconstructing gene expression data using a decoder containing a VQ-GAN model, completing the entire process from gene expression quantization to generation.
[0246] In addition, this method applies the combination of VQ-GAN model and hidden Transformer to the modeling of gene expression data, uses VQ-GAN model to quantify and decode gene expression data, and uses hidden Transformer for sequence modeling, thereby realizing the effective generation and reconstruction of high-dimensional gene expression data.
[0247] 10. Ability to integrate expression data context: The method provided in the embodiment of the present invention can integrate various biologically significant conditional gene information (such as gene status, cell type) into the generation of gene expression data, ensuring that the generated gene expression data is biologically reasonable and interpretable, and providing users with efficient gene expression data analysis functions.
[0248] In this embodiment, an index sequence generating device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0249] This embodiment provides an index sequence generating device, such as Figure 5 As shown, the device includes: an encoder 510, a compression module 520, a decoder 530 and a processing module 540. In addition, the device may also include other more or fewer modules, such as a discriminator 550, a storage module, a sending module, etc., which is not limited in this embodiment.
[0250] The encoder 510 is used to obtain the first gene expression data and at least one codebook entry, encode the first gene expression data, extract local information in the first gene expression data, and map the local information to a latent space to obtain a latent representation of the local information, wherein each codebook entry includes a one-to-one corresponding codebook index and an initial vector.
[0251] The compression module 520 is used to quantize the potential representation of the local information based on at least one codebook entry to generate a first codebook index matrix and at least one quantization vector, wherein the first codebook index matrix is composed of multiple discrete and new codebook indexes, and each new codebook index corresponds to a quantization vector.
[0252] The decoder 530 is used to decode and reconstruct the first codebook index matrix, output the second gene expression data, and use the discriminator to discriminate the second gene expression data to obtain a discrimination result, and perform adversarial training on the decoder and at least one quantization vector according to the discrimination result, and output optimization parameters, wherein the optimization parameters include: an optimized decoder and at least one new codebook entry.
[0253] The processing module 540 is configured to perform autoregressive modeling processing on the at least one new codebook entry to obtain a second codebook index matrix, and process the second codebook index matrix using the optimized decoder to obtain a data sample.
[0254] Optionally, in some specific embodiments, the encoder 510 is further used to obtain condition information before encoding the first gene expression data, encode the first gene expression data and the condition information, extract key features, and map the key features to a potential representation in a latent space, wherein the key features include local information. The condition information includes biological features.
[0255] Optionally, in other specific embodiments, the encoder 510 is further used to obtain a loss function before encoding the first gene expression data, encode the first gene expression data and conditional information using the reconstruction loss function, extract key features, and map them into a latent representation in a latent space.
[0256] The loss function includes a reconstruction loss function, and the reconstruction loss function is used to ensure that the difference between the reconstructed second gene expression data and the original first gene expression data is minimized.
[0257] Optionally, in some further specific implementations, the loss function further includes: a codebook loss function and a commitment loss function; wherein the codebook loss function is used to enable the encoder to use specific codebook entries and obtain a potential representation of representative discrete features, and the commitment loss function is used to constrain the stability of the potential representation.
[0258] The compression module 520 is specifically configured to add a codebook loss function and a commitment loss function during a quantization process of a potential representation of local information based on at least one codebook entry to generate a first codebook index matrix.
[0259] Optionally, in some other specific embodiments, the decoder 530 is also used to extract part of the batch data from the data set, where the data set is a set of at least one gene expression data; respectively calculate the vector discretization adversarial network loss and loss of each gene expression data in the set; calculate the loss average of the part of the batch data based on the vector discretization adversarial network loss and the adversarial network loss, and obtain an average value that approximates the overall expectation.
[0260] Optionally, in some specific embodiments, the decoder 530 and the discriminator 550 are also used to respectively calculate the gradient of the adversarial loss and the gradient of the reconstruction loss in the adversarial training process during the adversarial training through the adversarial loss function; and calculate the balance factor according to the gradient of the adversarial loss and the gradient of the reconstruction loss according to the relationship.
[0261] Optionally, in some other specific implementations, the processing module 540 is specifically used to predict the codebook index corresponding to at least one new codebook entry using an autoregressive method to obtain a prediction result, wherein each new codebook index in the prediction result is based on a previous codebook index prediction; after the prediction, the probability of the entire codebook index sequence is modeled to obtain a dependency relationship between new codebook indexes; and a second codebook index matrix is generated according to the prediction result and the dependency relationship.
[0262] Optionally, in some further specific implementations, the processing module 540 is further configured to evaluate the prediction accuracy by using a negative log-likelihood loss during the process of predicting the codebook index corresponding to at least one new codebook entry by using an autoregressive method, so as to minimize the loss.
[0263] Optionally, in some other specific embodiments, the processing module 540 is further used to obtain a discretization model, encode the conditional information using the discretization model, and generate a conditional index sequence; add the conditional index sequence to at least one new codebook entry, and perform autoregressive modeling on the at least one new codebook entry after the addition to obtain a third codebook index matrix; use the optimized decoder to map the input third codebook index matrix back to a latent vector in the codebook space; and generate new gene expression data as a data sample based on the latent vector.
[0264] The index sequence generation device provided in this embodiment maps high-dimensional and complex gene expression data to a low-dimensional and discretized potential space through the process of quantization and encoding. It not only reduces the computational burden of high-dimensional data modeling, but also improves the ability of the model to capture the global pattern of the data, and provides an effective way to build a more accurate and biologically meaningful gene regulatory network. In addition, breakthroughs in global pattern recognition, conditional generation, and biological information retention in high-dimensional gene expression data are achieved through data compression, providing an efficient and explanatory analysis tool for biomedical research.
[0265] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0266] The index sequence generating device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0267] The embodiment of the present invention also provides an electronic device having the above Figure 5 The index sequence generating device shown.
[0268] See also Figure 6 , is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present invention, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or in other ways as needed. The processor 10 can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphic information of the GUI on an external input / output device (such as a display device coupled to the interface).
[0269] In some optional embodiments, if desired, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.
[0270] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0271] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the index sequence generation method shown in the above embodiment.
[0272] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0273] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0274] The electronic device also includes an input device and an output device. The processor 10, the memory 20, the input device and the output device may be connected via a bus or other means.
[0275] Among them, the input device can receive input digital or character information, and generate key signal input related to the user settings and function control of the electronic device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick, etc. The output device may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device may be a touch screen.
[0276] The electronic device further comprises at least one communication interface 30 for the electronic device to communicate with other devices or a communication network.
[0277] In this embodiment, the processor 10, the memory 20 and the at least one communication interface 30 are used to implement the above-mentioned Figure 2 All or part of the functions of the encoder, compression module, decoder, discriminator, processing module and other devices or units shown can reduce the dimension of the data, reduce the computational cost of data modeling, and filter out irrelevant noise components while retaining key biological information, thereby improving the ability to accurately model and biologically interpret data patterns.
[0278] Optionally, the electronic device may be a network device, such as a server or a server cluster. Optionally, the electronic device may also be a client, such as a PC.
[0279] In addition, the technical solution of the embodiment of the present invention can also be applied to the field of drug research and development. Through efficient algorithms and transfer learning models, researchers can quickly identify and verify potential drug targets, thereby accelerating the discovery and development process of new drugs. Compared with traditional methods, the strategy based on transfer learning in this solution not only improves research efficiency, but also significantly reduces research and development costs, providing a more efficient and economical path for new drug research and development.
[0280] In clinical practice, the technology of the present invention also has a wide range of application value. By accurately analyzing the patient's gene expression data, doctors can formulate personalized treatment plans, thereby improving the effectiveness of treatment, reducing unnecessary side effects, and ultimately improving the patient's quality of life. This innovative technology is expected to promote the development of personalized medicine and make medical decisions more scientific, accurate and effective.
[0281] An embodiment of the present invention also provides a computer-readable storage medium, and the above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented by downloading through a network and originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware.
[0282] The storage medium may be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid state drive, etc.; further, the storage medium may also include a combination of the above-mentioned types of memories. It is understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by the computer, processor or hardware, the steps of the index sequence generation method shown in the above embodiment are implemented.
[0283] Embodiments of the present application may also provide a computer program product, including computer program instructions, which, when executed by a processor, cause the processor to perform the steps in the above method. Wherein, the computer program product may be written in any combination of one or more programming languages to perform program codes for performing the operations of the disclosed embodiments, wherein the programming languages include object-oriented programming languages, such as Java, C++, etc., and also include conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on a user computing device, partially on a user device, as an independent software package, partially on a user computing device, partially on a remote computing device, or entirely on a remote computing device or server.
[0284] The above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the embodiments of the present invention are described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for generating an index sequence, characterized in that: The method comprises: Acquire first gene expression data and at least one codebook entry, wherein each of the codebook entries includes a one-to-one corresponding codebook index and an initial vector; encoding the first gene expression data, extracting local information from the first gene expression data, and mapping the local information to a latent space to obtain a latent representation of the local information; quantizing the potential representation of the local information based on the at least one codebook entry to generate a first codebook index matrix and at least one quantization vector, wherein the first codebook index matrix is composed of a plurality of discrete and new codebook indexes, and each new codebook index corresponds to a quantization vector; Decoding and reconstructing the first codebook index matrix, outputting second gene expression data, discriminating the second gene expression data to obtain a discrimination result, and performing adversarial training on a decoder and at least one quantization vector according to the discrimination result, and outputting optimization parameters, wherein the optimization parameters include: an optimized decoder and at least one new codebook entry; Performing autoregressive modeling processing on the at least one new codebook entry to obtain a second codebook index matrix; The second codebook index matrix is processed by using the optimized decoder to obtain data samples.
2. The method according to claim 1, characterized in that Before encoding the first gene expression data, the method further includes: Acquiring condition information, wherein the condition information includes biological characteristics; The encoding of the first gene expression data, extracting local information in the first gene expression data, and mapping the local information to a latent space to obtain a latent representation of the local information includes: The first gene expression data and the condition information are encoded, key features are extracted, and the key features are mapped to the latent representation in a latent space, wherein the key features include the local information.
3. The method according to claim 2, characterized in that Before encoding the first gene expression data, the method further includes: Obtaining a loss function, wherein the loss function includes a reconstruction loss function; The encoding of the first gene expression data and the condition information, extracting key features, and mapping the key features to the potential representation in a potential space includes: The first gene expression data and the conditional information are encoded using the reconstruction loss function, the key features are extracted, and mapped into the latent representation in a latent space.
4. The method according to claim 3, characterized in that The loss function also includes: a codebook loss function and a commitment loss function; The quantizing the potential representation of the local information based on the at least one codebook entry to generate a first codebook index matrix includes: In a process of quantizing the potential representation of the local information based on the at least one codebook entry, the codebook loss function and the commitment loss function are added to generate the first codebook index matrix.
5. The method according to claim 4, characterized in that The loss function is expressed as: in, represents the reconstruction loss function, represents the codebook loss function, represents the commitment loss function, sg[] represents the stop gradient operation, represents the loss function, E represents the encoder, G represents the decoder, Z represents the codebook entry, x represents the first gene expression data, represents the second gene expression data, E(x) represents the output of the data x after the encoder E, Indicates the encoding result after quantizing the data.
6. The method according to any one of claims 1 to 5, characterized in that The performing adversarial training on the at least one quantized vector according to the discrimination result and outputting an optimization parameter comprises: The decoder and the at least one quantization vector are subjected to adversarial training by using an adversarial loss function to generate the optimization parameters; the adversarial loss function is: in, represents the discriminator's prediction of the true gene expression data, represents the prediction of the discriminator on the reconstructed gene expression data, and D represents the discriminator; The optimization parameters are , The expression is: in, represents the optimization parameters, Denotes that the decoder minimizes the overall objective function, and the discriminator D maximizes the objective function, is the balancing factor, and the expectation Represents the calculation of the loss on the gene expression data distribution p(x).
7. The method according to claim 6, characterized in that The process of performing adversarial training on the decoder and the at least one quantized vector by using an adversarial loss function further includes: Extracting a portion of batch data from a data set, wherein the data set is a set of at least one gene expression data; Calculate the vector discretization loss and adversarial network loss of each gene expression data in the set respectively; The loss average of the partial batch data is calculated according to the vector discretization loss and the adversarial network loss, and the average value obtained approximates the overall expectation.
8. The method according to claim 6, characterized in that The method further comprises: Calculate the gradient of the adversarial loss and the gradient of the reconstruction loss during adversarial training respectively; The balance factor is calculated according to the gradient of the adversarial loss and the gradient of the reconstruction loss according to a relational expression; wherein the relational expression for calculating the balance factor is: in, is the balance factor, represents the gradient of the reconstruction loss, represents the gradient of the adversarial loss with respect to the decoder, and δ is a constant.
9. The method according to claim 6, characterized in that The performing autoregressive modeling processing on the at least one new codebook entry to obtain a second codebook index matrix includes: Predicting a codebook index corresponding to the at least one new codebook entry by using an autoregressive method to obtain a prediction result, wherein each new codebook index in the prediction result is predicted based on a previous codebook index; After prediction, the probability of the entire codebook index sequence is modeled to obtain the dependency relationship between the new codebook indexes; The second codebook index matrix is generated according to the prediction result and the dependency relationship.
10. The method according to claim 9, characterized in that The predicting the codebook index corresponding to the at least one new codebook entry by using an autoregressive method to obtain a prediction result includes: In the process of predicting the codebook index corresponding to at least one new codebook entry by using an autoregressive method, the prediction accuracy is evaluated by a negative log-likelihood loss so as to minimize the loss; the negative log-likelihood loss is expressed as: in, represents the negative log-likelihood loss corresponding to the new codebook entry, Represents the probability modeling corresponding to the new codebook entry.
11. The method according to claim 2, characterized in that The performing autoregressive modeling processing on the at least one new codebook entry to obtain a second codebook index matrix includes: Obtaining a discretization model, encoding condition information using the discretization model, and generating a condition index sequence; Adding the conditional index sequence to the at least one new codebook entry, and performing autoregressive modeling processing on the at least one new codebook entry after the addition to obtain a third codebook index matrix; The using the optimized decoder to process the second codebook index matrix to obtain data samples includes: The optimized decoder is used to map the input third codebook index matrix back to a potential vector in the codebook space; and new gene expression data is generated according to the potential vector as the data sample.
12. An index sequence generating device, characterized in that: The device comprises: an encoder, configured to obtain first gene expression data and at least one codebook entry, encode the first gene expression data, extract local information in the first gene expression data, and map the local information into a latent space to obtain a latent representation of the local information, wherein each of the codebook entries includes a one-to-one corresponding codebook index and an initial vector; A compression module, configured to quantize the potential representation of the local information based on the at least one codebook entry to generate a first codebook index matrix and at least one quantization vector, wherein the first codebook index matrix is composed of a plurality of discrete and new codebook indexes, and each new codebook index corresponds to a quantization vector; A decoder, configured to decode and reconstruct the first codebook index matrix, output second gene expression data, discriminate the second gene expression data using a discriminator to obtain a discrimination result, and perform adversarial training on the decoder and the at least one quantization vector according to the discrimination result, and output optimization parameters, wherein the optimization parameters include: an optimized decoder and at least one new codebook entry; The processing module is used to perform autoregressive modeling processing on the at least one new codebook entry to obtain a second codebook index matrix, and use the optimized decoder to process the second codebook index matrix to obtain a data sample.
13. An electronic device, characterized in that: comprising a memory and a processor, wherein the memory and the processor are connected; The memory stores computer instructions, and the processor executes the index sequence generation method according to any one of claims 1 to 11 by executing the computer instructions.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the index sequence generation method according to any one of claims 1 to 11.
15. A computer program product, characterized in that The method comprises computer instructions, wherein the computer instructions are used to cause a computer to execute the index sequence generation method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Anticancer peptide generation model based on strategy gradient and structural information and training method thereof
CN116030908A
Codebook quantization model training method, search data quantization method and device
CN116127164A