A vaccine immune gene expression prediction method based on multi-scale time series pattern
By constructing a multi-scale temporal pattern dictionary and a lightweight dynamic prediction model, the problem of predicting high-dimensional, sparse, and irregular vaccine immune gene expression data was solved, achieving more efficient and interpretable prediction results and improving the auxiliary decision-making capabilities for vaccine design and immune response assessment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- JIMEI UNIV
- Filing Date
- 2026-02-27
- Publication Date
- 2026-06-09
AI Technical Summary
Existing methods for predicting vaccine immune gene expression suffer from problems such as state information decay, high computational complexity, and lack of interpretability when dealing with high-dimensional, sparse, and irregularly sampled time-series transcriptome data, making it difficult to achieve accurate prediction and biological interpretation.
A multi-scale temporal pattern-based approach is adopted. By constructing a multivariate time series tensor and an effective observation mask tensor, the data is preprocessed, a learnable temporal pattern dictionary with multiple time scales is learned, and a distance spectrum feature vector is generated using distance metrics and feature extraction. A lightweight dynamic prediction model is constructed and trained end-to-end to predict future gene expression values.
It improves the robustness and accuracy of predictions for irregular data, provides biological explanations, enhances the model's value in assisting decision-making in vaccine design optimization and immune response assessment, and reduces computational complexity.
Smart Images

Figure CN121747699B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the interdisciplinary technical field of vaccine immunology, computational immunology and artificial intelligence, specifically referring to a method for predicting vaccine immune gene expression based on multi-scale time-series patterns. Background Technology
[0002] Dynamic analysis of the immune response after vaccination is crucial for assessing vaccine efficacy and understanding protective mechanisms. However, longitudinal immune gene expression data obtained from clinical trials often face challenges such as irregular sampling, high-dimensional sparsity, and significant individual variability, making accurate prediction of immune response trends difficult. With the widespread adoption of high-throughput sequencing technology, massive amounts of time-series transcriptome data have been generated. However, this data, especially from clinical cohorts, presents three prominent challenges: irregular sampling (data collection times vary among vaccinated individuals), severe sparsity (limited number of observations at each time point for each gene, with many missing values), and extremely high dimensionality (typically involving tens of thousands of genes).
[0003] Existing prediction methods primarily originate from time series analysis and deep learning. Traditional statistical methods, such as autoregressive models and Gaussian processes, struggle to handle high-dimensional and nonlinear relationships. In recent years, deep learning methods, such as recurrent neural networks (RNNs) and their variants (LSTM and Transformer models), have become dominant. However, their memory mechanisms are prone to state decay or reset when faced with long intervals common in post-vaccine gene expression data, leading to performance degradation. While the Transformer architecture is powerful, its attention mechanism inherently assumes a regular time grid, and its computational complexity increases quadratically with sequence length, making it inefficient for long-sequence gene data. In other words, the core architecture of traditional deep sequence models (such as RNNs, LSTMs, and Transformers) is based on regular time steps, making them highly sensitive to missing values and long intervals, and prone to state decay or distortion. Traditional deep sequence models also heavily rely on the continuity of the global sequence, failing to perform effective matching and prediction under conditions of numerous missing or extremely irregular global sequences, thus reducing their robustness in handling real-world clinical transcriptome data. Recently, some models specifically designed for handling irregular sequences, such as neural differential equations, have been proposed; however, their training is often unstable and computationally expensive. For example, Transformer-type models based on attention mechanisms have limitations when handling long sequences. It has high complexity, large computational and memory overhead, and high requirements for computing equipment.
[0004] Most importantly, the aforementioned advanced deep learning methods generally lack interpretability. While they act as complex function approximators capable of making accurate predictions, their internal mechanisms remain like a "black box," failing to answer the core question that biologists care about: "What temporal dynamic patterns led to this prediction?" This severely limits the in-depth application and value extraction of these models in the life sciences. Furthermore, traditional deep sequence models cannot be intuitively visualized and explained as the dynamics of specific immune response phases, and their predictions cannot provide auxiliary decision-making value in vaccine design optimization, immune response assessment, and vaccination strategy formulation. Summary of the Invention
[0005] To overcome the shortcomings of existing technologies, this application provides a vaccine immune gene expression prediction method based on multi-scale time-series patterns, which can solve the problem of future dynamic prediction of high-dimensional, sparse, and irregularly sampled time-series transcriptome data, and provide a biological interpretation of model decisions.
[0006] This invention provides a method for predicting vaccine immune gene expression based on multi-scale temporal patterns, the method comprising:
[0007] Step S1: Structured characterization and data preprocessing of gene expression data after vaccination, constructing multivariate time series tensors and corresponding effective observation mask tensors;
[0008] Step S2: Construct a multi-timescale learnable temporal pattern dictionary, each of which includes a discriminative local post-vaccination gene expression dynamic subsequence, and perform end-to-end model training to automatically learn and capture the multi-scale immune dynamic features that are most informative for the prediction task.
[0009] Step S3: Temporal pattern matching and feature extraction based on distance metric to obtain the distance spectrum feature vector of the input single vaccine post-gene expression sequence;
[0010] Step S4: Construct a dynamic prediction model based on the distance spectrum feature vector. The dynamic prediction model outputs predicted gene expression levels at one or more time points after vaccination. Based on the mean squared error loss function, jointly optimize the parameters of the time-series pattern dictionary and the weights of the dynamic prediction model, and perform end-to-end training of the entire dynamic prediction model through the backpropagation algorithm.
[0011] Furthermore, according to the vaccine immune gene expression prediction method based on multi-scale time-series patterns provided in this application, step S1, the structured characterization and data preprocessing of post-vaccination gene expression data, constructs a multivariate time-series tensor and the corresponding effective observation mask tensor, including:
[0012] Step S101: Collect post-vaccination gene expression data from multiple vaccine recipients at multiple time points; wherein the data is high-dimensional, sparse, and long-term time-series data with irregular sampling times;
[0013] Step S102: Clean the data, mark missing values, align time points, and normalize the data;
[0014] Step S103: Construct a normalized multivariate time series tensor and the corresponding effective observation mask tensor in a unified format for model input.
[0015] Furthermore, according to the vaccine immune gene expression prediction method based on multi-scale time series patterns provided in this application, step S103, which involves constructing a normalized multivariate time series tensor and the corresponding effective observation mask tensor in a unified format for model input, includes:
[0016] Define the data and formalize the problem; for those containing Individuals receiving vaccinations and In a longitudinal study of individual genes, the data for each vaccinated individual-gene pair are represented as an irregular sequence of timestamp-expression value pairs:
[0017] ;
[0018] in, and These represent the individual who received the vaccine and the gene index, respectively. For the sampling time point, This refers to gene expression levels after vaccination. This refers to the effective number of observations of the vaccine-inoculated individual-gene pair, which can vary between different pairs;
[0019] Perform time alignment and missing value processing; align irregular sequences to a preset, discrete, regular time grid;
[0020] Estimation is performed using forward padding, linear interpolation, or specific value padding strategies, while simultaneously generating a binary mask sequence:
[0021] ;
[0022] in The mask value is the length of the normalized sequence. A mask value of 1 represents the original true observation, and a mask value of 0 represents the estimated or filled value.
[0023] Data standardization and construction of multivariate time series tensors and mask tensors were performed; Z-score standardization was applied to the time series data of each gene across all trained vaccine recipients.
[0024] ;
[0025] in, and These are the mean and standard deviation of the gene on the training set;
[0026] All processed individual-gene sequences of vaccinated individuals were organized into tensors. ,in Set the batch size and generate the corresponding mask tensor. .
[0027] Furthermore, according to the vaccine immune gene expression prediction method based on multi-scale time-series patterns provided in this application, in step S2, the local post-vaccination gene expression dynamic subsequence serves as a basic unit characterizing the complex immune response process.
[0028] Furthermore, according to the vaccine immune gene expression prediction method based on multi-scale time-series patterns provided in this application, step S2 includes:
[0029] The mathematical definition of a multi-scale temporal pattern dictionary is provided; a set of learnable temporal patterns is defined, called a "temporal pattern," and the temporal pattern dictionary is composed of... It consists of several independent pattern groups, each group Focusing on a specific time scale, including A length of The pattern; will the first The set of patterns for a group is represented as a parameter matrix. each of the rows It represents a specific timing pattern;
[0030] Principles for setting pattern size and quantity; pattern length The selection is based on prior knowledge of the time dynamics of the biological system under study, and different pattern lengths are set according to different immune responses; the number of patterns in each group It is a hyperparameter that controls the expressive power of the pattern dictionary at this scale;
[0031] Perform parameter initialization and optimization; timing mode parameters. Random initialization is performed using a normal distribution with a mean of 0 and a small standard deviation; the time series mode parameters Together with the parameters of the subsequent dynamic prediction model, they are considered as the trainable parameters of the model. During training, optimization is performed using gradient descent, and the update direction is guided by the gradient of the loss function of the downstream prediction task.
[0032] Furthermore, according to the vaccine immune gene expression prediction method based on multi-scale temporal patterns provided in this application, in step S3, temporal pattern matching and feature extraction based on distance metric, the distance spectral feature vector of the input single vaccine post-gene expression sequence obtained includes:
[0033] Step S301: For each input single-vaccine post-gene expression sequence, perform multi-scale matching with all patterns in the time-series pattern dictionary;
[0034] Step S302: Calculate the similarity or distance between local sub-segments of the sequence and each pattern, and use differentiable aggregation operation to generate a compact feature vector that characterizes the global dynamic characteristics of the sequence; wherein, the feature vector is input to the distance spectrum between the sequence and all prototype patterns in the dictionary.
[0035] Furthermore, according to the vaccine immune gene expression prediction method based on multi-scale time-series patterns provided in this application, step S302 includes:
[0036] Perform multi-scale subsequence segmentation of the input sequence; for the normalized single post-vaccine gene expression sequence For pattern groups Extract fragments of all possible continuous subsequences using a sliding window; denoted as the fragment set. ,in , Total number of segments; each segment Carrying the corresponding mask fragment This indicates whether each location is a true observation;
[0037] Perform differentiable calculation of the fragment-mode distance; calculate the differentiability of each fragment. With pattern group Each mode The distance; this distance is used for robust handling of missing values, employing a masked distance function; taking the Masked Mean Square Error (MaskedMSE) as the distance metric as an example, its formula is:
[0038] ;
[0039] in It is the mask fragment number The value of the bit. It is the first continuous subsequence segment The value of the bit. It is a pattern group Each mode The value of the bit. It is a very small constant to prevent division by zero;
[0040] Perform sequence-pattern distance aggregation; from local to global: obtain all segments and a given pattern. After determining the distance, we need to aggregate the results to obtain a sequence that represents the entire sequence. Scalar distance to the overall match of the pattern ;
[0041] A differentiable soft minimum approximation is used:
[0042] ;
[0043] in It is a temperature parameter that controls an approximate "hardness"; When it approaches the hard minimum, When the size is smaller, more information from different segments is considered, resulting in a smoother gradient.
[0044] Perform distance-to-similarity weight conversion; for pattern groups The distance vector is calculated. To enhance numerical stability and improve interpretability, a softmax function is applied to the negative distances, converting them into similarity weight vectors that sum to 1.
[0045] ;
[0046] Among them, weight Can be interpreted as a sequence The dynamic characteristics are determined by the pattern The degree of explanation;
[0047] Construct multi-scale feature vectors; from all The similarity weight vectors of each pattern group are concatenated to form the input sequence. The final global feature representation:
[0048] ;
[0049] The multi-scale feature vector It is a fixed-dimensional, information-rich representation that encodes the matching profile of the input sequence with a multi-scale immune dynamics prototype pattern.
[0050] Furthermore, according to the vaccine immune gene expression prediction method based on multi-scale temporal patterns provided in this application, in step S4, the end-to-end training of the dynamic prediction model drives the learnable temporal pattern to automatically tend toward the discriminative pattern that is most helpful in predicting the trend of immune response.
[0051] Furthermore, according to the vaccine immune gene expression prediction method based on multi-scale time-series patterns provided in this application, step S4 includes:
[0052] Construct a dynamic prediction model; Construct a dynamic prediction model The input is the feature vector. Output for the future Predicted gene expression values after vaccination at each time point The dynamic prediction model is a multilayer perceptron (MLP) model, represented as follows:
[0053]
[0054] in These are the trainable weights and bias parameters of the network;
[0055] The training objective and loss function are defined end-to-end; the loss is calculated for the true future observations indicated by the mask, and the mean squared error (MSE) is used as the loss function:
[0056]
[0057] in, For batch size, Individuals who are vaccinated The future true expression sequence, It is the corresponding future observation mask. This represents all trainable parameters of the model, including temporal patterns. and dynamic prediction model parameters;
[0058] Joint optimization and backpropagation; minimizing the loss using a stochastic gradient descent optimizer. The gradient of the loss function is backpropagated to the feature vectors through the dynamic prediction model. Then, through soft minimum value operation and distance calculation, it is further backpropagated to the time series mode parameters. .
[0059] The beneficial effects of this invention are as follows: This invention discloses a vaccine immune gene expression prediction method based on multi-scale temporal patterns. The method first performs normalization preprocessing on irregularly sampled longitudinal post-vaccination gene expression data; then, it constructs and trains an end-to-end multi-scale learnable temporal pattern dictionary; by calculating the mask distance between the input sequence and the patterns in the dictionary, a "distance spectrum" representing the dynamic features of the sequence is generated; finally, a lightweight dynamic prediction model is used to predict future expression values based on this feature. This invention completely abandons the dependence on the continuity of the global sequence, instead relying on the matching of local sub-fragments with prototype patterns for prediction. Even if the global sequence has a large number of missing or extremely irregular parts, as long as there are several complete local fragments with information, effective matching and prediction can be performed, thus exhibiting inherent and stronger robustness when processing real-world clinical transcriptome data. The multi-scale temporal patterns learned by this invention are not black-box features, but rather can be intuitively visualized and interpreted as dynamic prototypes of specific immune response stages, achieving a leap from simply predicting expression values to understanding the underlying immune temporal logic, significantly enhancing the model's auxiliary decision-making value in vaccine design optimization, immune response assessment, and vaccination strategy formulation. The core operation of this invention is to calculate the distance between a sequence segment and a fixed number of patterns, with a complexity of O(n log n). , with sequence length The linear relationship is significantly more efficient, reducing computation and memory usage. Furthermore, the multi-scale design allows the model to flexibly capture different rhythms of immune response processes from the minute to the month. This framework is easily extended to multivariate prediction, and by learning joint temporal patterns for gene pairs or pathways, it can further model the co-dynamics in gene regulatory networks.
[0060] This invention innovatively uses interpretable local temporal patterns as a core component, which not only effectively improves the model's predictive robustness and accuracy for common clinical sparse and irregular data, but also breaks through the limitations of the traditional deep learning "black box". It can directly output dynamic patterns that are relevant to the prediction and have clear biological significance, providing a powerful computational tool for understanding vaccine immunodynamics, assessing immunogenicity, discovering immune biomarkers, and predicting individualized responses. Attached Figure Description
[0061] The technical solution and other beneficial effects of this application will become apparent from the following detailed description of specific embodiments in conjunction with the accompanying drawings.
[0062] Figure 1 This is a flowchart illustrating the vaccine immune gene expression prediction method based on multi-scale temporal patterns provided in an embodiment of the present invention.
[0063] Figure 2 This is a schematic diagram of the framework of the vaccine immune gene expression prediction method based on multi-scale temporal patterns provided in this embodiment.
[0064] Figure 3 This is a schematic diagram of the overall process of the method provided in this embodiment. Detailed Implementation
[0065] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0066] In the description of this application, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," and "counterclockwise," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.
[0067] The following disclosure provides many different embodiments or examples for implementing different structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed. In addition, various specific examples of processes and materials are provided in this application, but those skilled in the art will recognize the application of other processes and / or the use of other materials.
[0068] The embodiments of this application will now be further described in conjunction with the accompanying drawings and specific implementation details.
[0069] To overcome the shortcomings of existing technologies, this invention proposes a vaccine immune gene expression prediction method based on multi-scale temporal patterns. The core idea of this invention stems from a rationally sound immunological assumption: the complex dynamics of immune gene expression after vaccination are composed of a series of local temporal patterns associated with specific immune stages (such as innate immune activation and adaptive immune initiation). These patterns correspond to specific immune response process modules, such as rapid stress responses, slow periodic oscillations, or unimodal activation-decrease processes. Based on this, this invention does not attempt to directly model the chaotic global sequence, but instead learns a multi-scale temporal pattern dictionary. For any input gene expression sequence, the "distance" between its local segments and all patterns in the dictionary is calculated, transforming it into a "distance spectrum" feature vector. This feature vector compactly summarizes the various patterns contained in the sequence and their intensities. Finally, a lightweight dynamic prediction model regresses future expression values based on this feature vector.
[0070] The entire method employs end-to-end training, where gradients from the prediction task are backpropagated to guide the learning of a temporal pattern dictionary, enabling it to automatically discover discriminative patterns truly useful for predicting future trends. This invention not only possesses a natural advantage in handling irregular data, but its greatest breakthrough lies in the fact that the learned temporal patterns themselves are interpretable components. By analyzing these patterns and their matching genes, researchers can directly gain insights into the underlying immune response processes driving expression changes, achieving a balance between predictive performance and scientific interpretability.
[0071] Figure 1 This is a flowchart illustrating the vaccine immune gene expression prediction method based on multi-scale temporal patterns provided in an embodiment of the present invention.
[0072] like Figure 1 As shown, in this embodiment, the method includes:
[0073] Step S1: Structured characterization and data preprocessing of gene expression data after vaccination, constructing multivariate time series tensors and corresponding effective observation mask tensors.
[0074] Specifically, step S1 includes:
[0075] Step S101: Collect post-vaccination gene expression data from multiple vaccine recipients at multiple time points; wherein the data is high-dimensional, sparse, and long-term time-series data with irregular sampling times;
[0076] Step S102: Clean the data, mark missing values, align time points, and normalize the data;
[0077] Step S103: Construct a normalized multivariate time series tensor and the corresponding effective observation mask tensor in a unified format for model input.
[0078] Step S2: Construct a multi-timescale learnable temporal pattern dictionary. Each learnable temporal pattern includes a discriminative local post-vaccination gene expression dynamic subsequence. Perform end-to-end model training to automatically learn and capture the multi-scale immune dynamic features that are most informative for the prediction task.
[0079] Specifically, step S2 includes:
[0080] Step S201: Define and initialize a learnable temporal pattern dictionary containing multiple time scales. Each temporal pattern is a discriminative local post-vaccination gene expression dynamic subsequence, serving as a basic unit for characterizing complex immune response processes.
[0081] Step S202: Through the model training process, these model parameters are optimized end-to-end to enable them to automatically learn and capture the multi-scale immune dynamics features that are most informative for the prediction task.
[0082] Step S3: Temporal pattern matching and feature extraction based on distance metric to obtain the distance spectrum feature vector of the input single vaccine post-gene expression sequence.
[0083] Specifically, step S3 includes:
[0084] Step S301: For each input single-vaccine post-gene expression sequence, perform multi-scale matching with all patterns in the time-series pattern dictionary;
[0085] Step S302: Calculate the similarity or distance between local sub-segments of the sequence and each pattern, and use differentiable aggregation operation to generate a compact feature vector that characterizes the global dynamic characteristics of the sequence; wherein, the feature vector is input to the distance spectrum between the sequence and all prototype patterns in the dictionary.
[0086] Step S4: Construct a dynamic prediction model based on the distance spectrum feature vector. The dynamic prediction model outputs predicted gene expression levels at one or more time points after vaccination. Based on the mean squared error loss function, jointly optimize the parameters of the time-series pattern dictionary and the weights of the dynamic prediction model, and perform end-to-end training of the entire dynamic prediction model through the backpropagation algorithm.
[0087] Specifically, step S4 includes:
[0088] Step S401: Construct a dynamic prediction model, using the feature vector as input, and map it to the predicted value of gene expression level after vaccination at one or more future time points;
[0089] Step S402: Construct a loss function based on mean squared error, jointly optimize the parameters of the time-series pattern dictionary and the weights of the dynamic prediction model, and achieve end-to-end training of the entire framework through the backpropagation algorithm, so that the learned time-series patterns automatically tend to the discriminative patterns that are most helpful in predicting the trend of immune response.
[0090] Figure 2 This is another schematic diagram of the process provided in this embodiment.
[0091] like Figure 2 As shown, in this embodiment, step S1 specifically includes:
[0092] Data definition and problem formalization: For data containing Individuals receiving the vaccine (e.g., patients, experimental subjects) and In longitudinal studies of individual genes, the observational data for each vaccine-inoculated individual-gene pair are represented as an irregular timestamp-expression value pair sequence:
[0093]
[0094] in and These represent the individual who received the vaccine and the gene index, respectively. For the sampling time point, This represents the gene expression level after vaccination (e.g., log2(TPM+1)). This refers to the number of effective observations of the individual-gene pair for this vaccine, which can vary between different pairs.
[0095] Time alignment and missing value handling: To adapt to standard neural network processing, irregular sequences are aligned to a pre-defined, discrete, regular time grid. For missing time points, values are estimated using forward padding, linear interpolation, or specific value padding strategies, while simultaneously generating a binary mask sequence. ,in The normalized sequence length is represented by a mask value of 1, which indicates that the position is the original true observation, and 0 indicates an estimated or filled value.
[0096] Data standardization and batch construction: To eliminate significant differences in baseline and variance of expression levels among different genes, Z-score standardization was performed on the time series data of each gene across all trained vaccine recipients. ,in and This represents the mean and standard deviation of the gene on the training set. Finally, all processed individual-gene sequences from vaccinated individuals are organized into a tensor. ,in Set the batch size and generate the corresponding mask tensor. .
[0097] Step S2 specifically includes:
[0098] Mathematical definition of a multi-scale temporal pattern dictionary: Define a set of learnable temporal patterns, called "temporal patterns" or "shapelets". This dictionary is composed of... It consists of several independent schema groups (or "libraries"), each group Focusing on a specific time scale, including A length of The pattern. The first The set of patterns for a group is represented as a parameter matrix. each of the rows It represents a specific timing pattern;
[0099] Principles for setting the scale and number of patterns: Pattern length The choice of time dynamics is based on prior knowledge of the time dynamics of the biological system being studied. For example, in studies of immune responses, short time dynamics (such as...) can be set. Approximately 2 weeks after vaccination, it captures early post-vaccination inflammation and innate immune activation, as well as (e.g.) This corresponds to approximately one month, capturing the adaptive immune initiation and clonal expansion period, and is longer (e.g., (Corresponding to approximately 6 weeks, capturing three scales: the formation and maintenance phases of immune memory.) Number of patterns in each group. It is a hyperparameter that controls the expressive power of the pattern dictionary at this scale, usually ranging from tens to hundreds;
[0100] Parameter initialization and optimization: timing mode parameters Random initialization is performed using a normal distribution with a mean of 0 and a small standard deviation. These parameters, along with the parameters of the subsequent dynamic prediction model, are considered as the trainable parameters of the model. During training, the algorithm is optimized using gradient descent, and its update direction is guided by the gradient of the loss function of the downstream prediction task, thereby ensuring that the learned pattern is the discriminative pattern most relevant to the prediction target.
[0101] like Figure 2 As shown, step S3 specifically includes:
[0102] Multi-scale subsequence segmentation of the input sequence: for a normalized single post-vaccine gene expression sequence For pattern groups We extract all possible continuous subsequences (segments) using a sliding window. Let the set of segments be denoted as . ,in , This represents the total number of segments. Each segment... Carrying the corresponding mask fragment This indicates whether each location is a true observation;
[0103] Differentiable computation of fragment-mode distance: Calculate the differentiability of each fragment With pattern group Each mode The distance is calculated using a masked distance function to robustly handle missing values. Taking the Masked Mean Square Error (MaskedMSE) as the distance metric, its formula is as follows:
[0104]
[0105] in It is the mask fragment number The value of the bit. It is the first continuous subsequence segment The value of the bit. It is a pattern group Each mode The value of the bit. It is a very small constant to prevent division by zero. Other differentiable distance metrics, such as cosine distance, can also be used.
[0106] Sequence-pattern distance aggregation: from local to global: obtaining all segments and a given pattern After determining the distance, we need to aggregate the results to obtain a sequence that represents the entire sequence. Scalar distance to the overall match of the pattern Ideally, the minimum distance should be taken, but the minimum operation is not differentiable. Therefore, a differentiable soft minimum is used as an approximation:
[0107]
[0108] in It is a temperature parameter that controls an approximate "hardness". When it approaches the hard minimum, When the size is smaller, more information from different segments is considered, resulting in a smoother gradient.
[0109] Distance to similarity weight conversion: for pattern groups The distance vector is calculated. To enhance numerical stability and improve interpretability, a softmax function is applied to the negative distances, converting them into similarity weight vectors that sum to 1.
[0110]
[0111] Weight Can be interpreted as a sequence The dynamic characteristics are determined by the pattern The degree of explanation;
[0112] Construction of multi-scale feature vectors: from all The similarity weight vectors of each pattern group are concatenated to form the input sequence. The final global feature representation:
[0113]
[0114] The vector It is a fixed-dimensional, information-rich representation that encodes the matching profile of the input sequence with a multi-scale immune dynamics prototype pattern.
[0115] Step S4 specifically includes:
[0116] Design of a dynamic prediction model: Constructing a prediction head network Its input is the feature vector obtained in the previous step. Output for the future Predicted gene expression values after vaccination at each time point This network is typically a multilayer perceptron (MLP), which can be represented as:
[0117]
[0118] in These are the trainable weights and bias parameters of the network. The number of layers can be increased or a more complex structure can be used as needed.
[0119] End-to-end training objective and loss function: The overall objective of model training is to minimize the error between predicted values and true future observations. Loss is calculated only for the true future observations indicated by the mask. Mean squared error (MSE) is used as the loss function.
[0120]
[0121] in, For batch size, Individuals who are vaccinated The future true expression sequence, It is the corresponding future observation mask. This represents all trainable parameters of the model (including temporal patterns). and dynamic prediction model parameters);
[0122] Joint optimization and backpropagation: Minimizing the loss using a stochastic gradient descent optimizer (such as Adam). The key point is that the gradient of the loss function is backpropagated to the feature vector through the dynamic prediction model. Then, through soft minimum value operation and distance calculation, it is further backpropagated to the time series mode parameters. This process forces the pattern parameters to be updated in a direction that "can generate distance features that are more helpful in predicting the future," thus achieving a high degree of synergy between pattern learning and prediction tasks.
[0123] In this embodiment, the method provided in this example is illustrated with specific post-vaccination data.
[0124] Figure 3 This is a schematic diagram of the overall process of the method provided in this embodiment.
[0125] like Figure 3 As shown, step S0, the preparation of timing data of post-vaccination immune gene expression, is included before step S1.
[0126] Specifically, step S0, the preparation of post-vaccination immune gene expression time-series data, includes:
[0127] Data Acquisition: We obtained publicly available longitudinal transcriptome data from a cohort of recipients of a viral mRNA vaccine. This data was collected from a clinical study and included peripheral blood mononuclear cell (PBMC) RNA-seq expression profiles at seven time points: before vaccination (day 0), and days 1, 3, 7, 14, 28, and 90 post-vaccination.
[0128] Data preprocessing: Individuals with at least four valid time points were selected. The raw transcript per million reads (TPM) was transformed using log2(TPM+1). Data were randomly divided into training, validation, and test sets in a 6:2:2 ratio to ensure complete independence between individuals in different sets and avoid information leakage. All subsequent data normalization parameters were calculated solely from the training set.
[0129] Task Construction: Setting the Length of Historical Observation Windows (Corresponding to 5 time points from day 0 to day 14), future prediction window length (Corresponding to predicted gene expression levels on day 28 and day 90). Multiple training samples were constructed from continuous time series data for each individual using a sliding window method.
[0130] In step S1, the data is structured and normalized, specifically including:
[0131] Time alignment and mask generation: Align the irregular sampling time points of all individuals to a preset 5-point regular time grid (corresponding to the above). (Points). For expression values at missing time points, forward imputation was used for estimation. Simultaneously, a binary mask sequence was generated for each gene sequence. Where “1” represents the original true observation value and “0” represents the estimated value.
[0132] Data standardization: For each gene, calculate its mean expression across all samples and time points in the training set. ) and standard deviation ( Using formulas Z-score normalization was performed on the training, validation, and test sets to eliminate baseline differences and dimensional effects between different genes.
[0133] Batch construction: Organizing standardized data into three-dimensional tensors and the corresponding mask tensor ,in For batch size, This represents the total number of genes (approximately 5000 immune-related genes were screened in this example). is the length of the normalized sequence (5).
[0134] In step S2, the construction and initialization of the multi-scale temporal pattern dictionary are carried out, specifically including:
[0135] Define mode parameters: Set There are three time series pattern groups, corresponding to short, medium, and long time scales, respectively. The length of each pattern group is set to [value missing]. (Corresponding to the normalization time step). Each pattern group contains A learnable temporal pattern (Shapelet). The first... The set of patterns for a group is represented as a parameter matrix. .
[0136] Parameter initialization: All timing mode parameters Initialize by random sampling from a normal distribution with a mean of 0 and a standard deviation of 0.01.
[0137] In step S3, multi-scale pattern matching and feature extraction are performed, specifically including:
[0138] Sequence segmentation: For a standardized single-gene expression sequence For each mode group Extract all lengths of [length value] using a sliding window. A set of segments is formed from continuous subsequences.
[0139] Calculate the masked distance: For each segment and each mode, calculate the masked mean square error (MaskedMSE) distance. The formula is as follows, where... This is a mask value used to ignore estimated data points during calculations.
[0140]
[0141] Aggregated Sequence-Pattern Distance: For each pattern, a differentiable soft minimum operation is used to aggregate its distances to all segments into a scalar distance representing the overall matching degree. .
[0142]
[0143] Among them, temperature parameter .
[0144] Generating feature vectors: the distance vector obtained for each pattern group. Apply a negative Softmax transform to convert it into a similarity weight vector. Finally, the weight vectors of all three pattern groups are concatenated to form the final feature vector. .
[0145] The construction and training of the prediction model in step S4 specifically includes:
[0146] Dynamic prediction model: A two-layer multilayer perceptron (MLP) is used as the prediction head. Its input is a 240-dimensional feature vector. The hidden layer has a dimension of 128, uses the ReLU activation function and a Dropout layer with a dropout rate of 0.1, and the final output dimension is... Predicted value .
[0147] Loss Function and Training: The mean squared error (MSE) is used as the loss function, and the error is calculated only for future time points of the true observations (indicated by a mask). The Adam optimizer is used, with an initial learning rate of... The batch size is 16. Loss is monitored on the validation set; if the loss does not decrease after 10 consecutive training epochs, training is terminated early. During training, the gradient of the loss function is backpropagated to the feature vector through the dynamic prediction model, and further passed to the temporal pattern parameters through distance calculation, thereby achieving end-to-end joint optimization of the pattern dictionary and the prediction task.
[0148] Specifically, the method provided in this embodiment also includes: step S5, performing model evaluation and result analysis.
[0149] Step S5 specifically includes:
[0150] Performance Evaluation: Model performance was evaluated on an independent test set. Predictions of key immune genes (such as the interferon-stimulated gene ISG15 and the inflammatory factor TNF) were compared with actual values, and mean squared error (MSE) and Pearson correlation coefficient (PCC) were calculated. Experiments showed that, compared with benchmark models such as Transformer and LSTM, the method of this invention reduced MSE by approximately 5% and significantly improved trend correlation (PCC), confirming its predictive accuracy.
[0151] Interpretability analysis: Visualization of the learned temporal patterns. Short patterns (L=3) mostly exhibit a sharp, pulsating pattern, consistent with the strong type I interferon response and inflammatory reaction in the early post-vaccination period; medium- and long patterns (L=4, 5) show a gradual rise or a sustained plateau pattern, corresponding to the gradual activation of adaptive immunity and the antibody production process. Enrichment analysis of genes highly matched to specific patterns revealed that these genes were significantly enriched in immune-related pathways such as "response to the virus" and "T cell activation," confirming the clear biological significance of the learned patterns.
[0152] Application Process: For a new vaccine recipient, gene expression data are collected at multiple time points post-vaccination. After undergoing the same preprocessing and standardization as in steps 1-2 above, the data is input into the trained model. The model can output the predicted expression trajectories of key immune genes for the individual at future time points (e.g., day 28, day 90). Furthermore, the system can analyze which immune response pattern best matches the individual's expression history, providing data support for assessing the intensity and type of their immune response and developing personalized follow-up strategies.
[0153] In summary, this invention discloses a vaccine immune gene expression prediction method based on multi-scale temporal patterns. The method first performs normalization preprocessing on irregularly sampled longitudinal post-vaccination gene expression data; then, it constructs and trains an end-to-end multi-scale learnable temporal pattern dictionary; by calculating the mask distance between the input sequence and the patterns in the dictionary, a "distance spectrum" representing the dynamic features of the sequence is generated; finally, a lightweight dynamic prediction model is used to predict future expression values based on this feature. This invention innovatively uses interpretable local temporal patterns as a core component, which not only effectively improves the model's robustness and accuracy in predicting common sparse and irregular clinical data, but also breaks through the limitations of the traditional deep learning "black box," directly outputting dynamic patterns with clear biological significance related to the prediction. This provides a powerful computational tool for understanding vaccine immunodynamics, assessing immunogenicity, discovering immunobiomarkers, and predicting individualized responses.
[0154] Specifically, this embodiment also has the following advantages:
[0155] Superior ability to handle irregular and sparse data: Traditional deep sequence models (such as RNNs, LSTMs, and Transformers) are based on regular time steps, making them highly sensitive to missing values and long intervals, and prone to state decay or distortion. This invention completely abandons the dependence on global sequence continuity, instead relying on the matching of local sub-fragments with prototype patterns for prediction. Even if the global sequence contains a large number of missing or extremely irregular parts, as long as there are several complete local fragments with information, effective matching and prediction can be performed, thus exhibiting inherent and stronger robustness when processing real-world clinical transcriptome data.
[0156] The groundbreaking interpretability provides direct insights into vaccine development: the multi-scale temporal patterns learned by this method are not black-box features, but rather intuitively visualized and interpretable as dynamic prototypes of specific immune response phases, such as key processes like acute cytokine storms, germinal center (GC) responses, or memory cell formation. By systematically analyzing the association between different patterns and differentially expressed genes, researchers can directly deduce verifiable immunological hypotheses such as "a certain mRNA vaccine platform is more likely to induce a strong Th1-type cellular immune pattern" or "a certain adjuvant formulation may delay but prolong the expression pattern of neutralizing antibody-related genes." This represents a leap from simply predicting expression values to understanding the underlying immune temporal logic, significantly enhancing the model's value in assisting decision-making in vaccine design optimization, immune response assessment, and vaccination strategy formulation.
[0157] Highly efficient linear computational complexity and good scalability: Transformer-like models based on attention mechanisms exhibit excellent performance when processing long sequences. The complexity is high, with significant computational and memory overhead. The core operation of this invention is calculating the distance between a sequence segment and a fixed number of patterns, with a complexity of O(n log n). , with sequence length The model exhibits a linear relationship, resulting in significantly higher efficiency. Furthermore, its multi-scale design allows the model to flexibly capture different rhythms of immune response processes, ranging from minutes to months. This framework is easily extended to multivariate prediction, and by learning joint temporal patterns for gene pairs or pathways, it can further model the co-dynamics within gene regulatory networks.
[0158] Example 2:
[0159] This embodiment also provides a terminal device for predicting vaccine immune gene expression based on a multi-scale time-series model. The terminal device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the embodiments of the method described in Embodiment 1 of the present invention.
[0160] Furthermore, as an executable solution, the vaccine immune gene expression prediction terminal device based on multi-scale time-series patterns can be a computing device such as a desktop computer, laptop, handheld computer, or cloud server. The vaccine immune gene expression prediction terminal device based on multi-scale time-series patterns may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the above-described composition of the vaccine immune gene expression prediction terminal device based on multi-scale time-series patterns is merely an example and does not constitute a limitation on the vaccine immune gene expression prediction terminal device based on multi-scale time-series patterns. It may include more or fewer components than described above, or combine certain components, or different components. For example, the vaccine immune gene expression prediction terminal device based on multi-scale time-series patterns may also include input / output devices, network access devices, buses, etc., and this embodiment of the invention does not limit this.
[0161] Furthermore, as an executable solution, the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices. The general-purpose processor can be a microprocessor or any conventional processor. This processor is the control center of the multi-scale time-series pattern-based vaccine immune gene expression prediction terminal device, connecting all parts of the terminal device via various interfaces and lines.
[0162] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the vaccine immune gene expression prediction terminal device based on multi-scale time-series patterns by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created based on the use of the mobile phone, etc. In addition, the memory may include high-speed random access memory and non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital card (SD), flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0163] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in the embodiments of the present invention.
[0164] If the modules / units integrated in the vaccine immune gene expression prediction terminal device based on multi-scale time-series patterns are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM), a random access memory (RAM), and a software distribution medium, etc.
[0165] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the present invention. Finally, it should be noted that in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0166] The above provides a detailed description of a vaccine immune gene expression prediction method based on multi-scale time-series patterns provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the technical solutions and core ideas of this application. Those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. These modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
Claims
1. A method for predicting vaccine immune gene expression based on multi-scale temporal patterns, characterized in that, The method includes: Step S1: Structured characterization and data preprocessing of gene expression data after vaccination, constructing multivariate time series tensors and corresponding effective observation mask tensors; Step S2: Construct a multi-timescale learnable temporal pattern dictionary, each of which includes a discriminative local post-vaccination gene expression dynamic subsequence, and perform end-to-end model training to automatically learn and capture the multi-scale immune dynamic features that are most informative for the prediction task. Step S2 includes: Step S201: Define the mathematical definition of the multi-scale temporal pattern dictionary; define a set of learnable temporal patterns, called "temporal patterns", the temporal pattern dictionary is composed of... It consists of several independent pattern groups, each group Focusing on a specific time scale, including A length of The pattern; will the first The set of patterns for a group is represented as a parameter matrix. each of the rows It represents a specific timing pattern; Step S202: Set the principles for pattern scale and quantity; pattern length The selection is based on prior knowledge of the time dynamics of the biological system under study, and different pattern lengths are set according to different immune responses; the number of patterns in each group It is a hyperparameter that controls the expressive power of the temporal pattern dictionary at this scale; Step S203: Initialize and optimize parameters; timing mode parameters Random initialization is performed using a normal distribution with a mean of 0 and a small standard deviation; the time series mode parameters Together with the parameters of the subsequent dynamic prediction model, they are considered as the trainable parameters of the model. During training, optimization is performed using gradient descent, and its update direction is guided by the gradient of the loss function of the downstream prediction task. Step S3: Temporal pattern matching and feature extraction based on distance metric to obtain the distance spectrum feature vector of the input single vaccine post-gene expression sequence; Step S3 includes: Step S301: For each input single-vaccine post-gene expression sequence, perform multi-scale matching with all patterns in the time-series pattern dictionary; Step S302: Calculate the similarity or distance between local sub-segments of the sequence and each pattern, and use differentiable aggregation operation to generate a compact feature vector that characterizes the global dynamic characteristics of the sequence; wherein, the feature vector is input to the distance spectrum between the sequence and all prototype patterns in the dictionary; Step S4: Construct a dynamic prediction model based on the distance spectrum feature vector. The dynamic prediction model outputs predicted gene expression levels at one or more time points after vaccination. Based on the mean squared error loss function, jointly optimize the parameters of the time-series pattern dictionary and the weights of the dynamic prediction model, and perform end-to-end training of the entire dynamic prediction model through the backpropagation algorithm. The end-to-end training of the dynamic prediction model drives the learnable time-series pattern to automatically tend towards the discriminative pattern that is most helpful in predicting the trend of immune response. Step S4 includes: Step S401: Construct a dynamic prediction model; Construct a dynamic prediction model. The input is the feature vector. Output for the future Predicted gene expression values after vaccination at each time point The dynamic prediction model is a multilayer perceptron model, represented as follows: in These are the trainable weights and bias parameters of the network; Step S402: Perform end-to-end training of the objective and loss function; calculate the loss for the true future observation points indicated by the mask, and use the mean squared error as the loss function: in, For batch size, Individuals who are vaccinated The future true expression sequence, It is the corresponding future observation mask. This represents all trainable parameters of the model, including temporal patterns. and dynamic prediction model parameters; Step S403, Joint Optimization and Backpropagation: Minimize the loss using a stochastic gradient descent optimizer. The gradient of the loss function is backpropagated to the feature vectors through the dynamic prediction model. Then, through soft minimum value operation and distance calculation, it is further backpropagated to the time series mode parameters. .
2. The vaccine immune gene expression prediction method based on multi-scale temporal patterns according to claim 1, characterized in that, Step S1, the structured characterization and data preprocessing of post-vaccination gene expression data, constructing a multivariate time series tensor and the corresponding effective observation mask tensor, includes: Step S101: Collect post-vaccination gene expression data from multiple vaccine recipients at multiple time points; wherein the data is high-dimensional, sparse, and long-term time-series data with irregular sampling times; Step S102: Clean the data, mark missing values, align time points, and normalize the data; Step S103: Construct a normalized multivariate time series tensor and the corresponding effective observation mask tensor in a unified format for model input.
3. The vaccine immune gene expression prediction method based on multi-scale temporal patterns according to claim 2, characterized in that, In step S103, constructing a normalized multivariate time series tensor and the corresponding effective observation mask tensor in a unified format for model input includes: Define the data and formalize the problem; for those containing Individuals receiving vaccinations and In a longitudinal study of individual genes, the data for each vaccinated individual-gene pair are represented as an irregular sequence of timestamp-expression value pairs: ; in, and These represent the individual who received the vaccine and the gene index, respectively. For the sampling time point, This refers to gene expression levels after vaccination. This refers to the effective number of observations of the vaccine-inoculated individual-gene pair, which can vary between different pairs; Perform time alignment and missing value processing; align irregular sequences to a preset, discrete, regular time grid; Estimation is performed using forward padding, linear interpolation, or specific value padding strategies, while simultaneously generating a binary mask sequence: ; in The mask value is the length of the normalized sequence. A mask value of 1 represents the original true observation, and a mask value of 0 represents the estimated or filled value. Data standardization and construction of multivariate time series tensors and mask tensors were performed; Z-score standardization was applied to the time series data of each gene across all trained vaccine recipients. ; in, and These are the mean and standard deviation of the gene on the training set; All processed individual-gene sequences of vaccinated individuals were organized into tensors. ,in Set the batch size and generate the corresponding mask tensor. .
4. The vaccine immune gene expression prediction method based on multi-scale temporal patterns according to claim 1, characterized in that, In step S2, the local post-vaccination gene expression dynamic subsequence serves as a basic unit characterizing the complex immune response process.
5. The vaccine immune gene expression prediction method based on multi-scale temporal patterns according to claim 1, characterized in that, Step S302 includes: Perform multi-scale subsequence segmentation of the input sequence; for the normalized single post-vaccine gene expression sequence For pattern groups Extract fragments of all possible continuous subsequences using a sliding window; denoted as the fragment set. any one of the segments , Total number of segments; each segment Carrying the corresponding mask fragment This indicates whether each location is a true observation; Perform differentiable calculation of the fragment-mode distance; calculate the differentiability of each fragment. With pattern group Each mode The distance; this distance is used for robust handling of missing values, employing a masked distance function; taking the masked mean square error as the distance metric as an example, its formula is: ; in It is the mask fragment number The value of the bit. It is the first continuous subsequence segment The value of the bit. It is a pattern group Each mode The value of the bit. It is a very small constant to prevent division by zero; Perform sequence-pattern distance aggregation; from local to global: obtain all segments and a given pattern. After determining the distance, we need to aggregate the results to obtain a sequence that represents the entire sequence. Scalar distance to the overall match of the pattern ; A differentiable soft minimum approximation is used: ; in It is a temperature parameter that controls an approximate "hardness"; When it approaches the hard minimum, When the size is smaller, more information from different segments is considered, resulting in a smoother gradient. Perform distance-to-similarity weight conversion; for pattern groups The distance vector is calculated. To enhance numerical stability and improve interpretability, a softmax function is applied to the negative distances, converting them into similarity weight vectors that sum to 1. ; Among them, weight Can be interpreted as a sequence The dynamic characteristics are determined by the pattern The degree of explanation; Construct multi-scale feature vectors; from all The similarity weight vectors of each pattern group are concatenated to form the input sequence. The final global feature representation: ; The multi-scale feature vector It is a fixed-dimensional, information-rich representation that encodes the matching profile of the input sequence with a multi-scale immune dynamics prototype pattern.