A pathogen evolution timing prediction method and system
Patent Information
- Application Number
- CN202610844091.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-11
- Publication Date
- 2026-10-23
AI Technical Summary
[0004]有鉴于此,本发明提出一种病原体演化时序预测方法及系统,能够有效解决现有技术所存在的模型泛化能力差、预测精度低的缺陷
[0043]本发明的有益效果是:通过将演化时序矩阵分解为长期特征序列和短期特征序列,并分别利用Transformer(擅长捕捉全局依赖)和CNN(擅长捕捉局部波动)进行处理,实现了对病原体演化规律的精细化解耦,这种双路特征提取机制能够更全面地捕捉数据中的多尺度信息,从而显著提升模型对不同演化模式的适应能力,增强了模型的泛化能力;其次,依据直接偏好优化DPO思想构建可优化的偏好对,并结合领域特异性表征及梯度信号训练跨域编码器,这种方法能够显式地学习并对齐源域与目标域在长期趋势和短期波动上的差异,有效消除了域间偏差,使得模型在数据稀缺的目标域上也能获得高精度的预测结果;此外,采用少步梯度更新策略,利用目标病原体的少量历史数据即可快速调整共享参数,这种机制不仅降低了计算成本,还使得模型能够迅速适应新出现的病原体变异,在保证高精度的同时实现了快速响应。
Smart Images

Figure CN122967781A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of pathogen evolution technology, and in particular to a method and system for predicting the time series of pathogen evolution. Background Technology
[0002] In current bioinformatics and epidemiology research, the prediction of pathogen evolution timelines is of vital importance for public health control, vaccine development and drug design. However, accurate prediction of the evolutionary trends of specific target pathogens (such as novel influenza viruses or mutant strains) faces severe challenges of data scarcity and insufficient samples.
[0003] Existing deep learning methods typically rely on large-scale labeled data for model training. However, when faced with emerging infectious diseases or specific subtypes of pathogens, there is often a lack of sufficient historical observation data to support adequate model training, resulting in poor model generalization ability and low prediction accuracy. Summary of the Invention
[0004] In view of this, the present invention proposes a method and system for predicting the evolution time series of pathogens, which can effectively solve the defects of poor model generalization ability and low prediction accuracy in the existing technology.
[0005] The technical solution of this invention is implemented as follows:
[0006] A method for predicting the time series evolution of pathogens, specifically including:
[0007] Time series data of pathogens from multiple source domains were obtained, and the time series data of pathogens from multiple source domains were preprocessed to obtain the evolution time series matrix of pathogens from the source domains.
[0008] The evolution time series matrix of source domain pathogens is decomposed into long-term characteristic sequences and short-term characteristic sequences;
[0009] Long-term feature sequences are input into the Transformer module, which captures global dependencies through a self-attention mechanism to obtain long-term representations; short-term feature sequences are input into the convolutional neural network module, which captures fluctuations within a local time window through convolution operations to obtain short-term representations.
[0010] Based on the idea of direct preference optimization (DPO), and combining long-term and short-term features, optimizable preference pairs are constructed.
[0011] Based on long-term features, short-term features, and optimizable preference pairs, a single-domain encoder is trained. At the same time, the domain-specific representation of the single-domain encoder output, as well as the corresponding gradient signal and parameter update amount, are recorded.
[0012] A cross-domain encoder is trained based on long-term features, short-term features, optimizable preference pairs, domain-specific representations, and corresponding gradient signals and parameter update amounts.
[0013] Obtain historical time-series data of the target pathogen;
[0014] Based on the historical time-series data of the target pathogen, the shared parameters of the trained cross-domain encoder are updated using a few steps of gradient. The cross-domain encoder with updated shared parameters is then used to predict the evolution of the target pathogen, thus obtaining the evolution results of the target pathogen.
[0015] As a further optional scheme of the pathogen evolution time series prediction method, the decomposition of the source domain pathogen evolution time series matrix into long-term feature sequences and short-term feature sequences specifically includes:
[0016] The source domain pathogen evolution time series matrix is smoothed using a moving average operator, and low-frequency trend components in the time series data are extracted as long-term feature sequences.
[0017] Subtracting the long-term feature sequence from the source domain pathogen evolution time series matrix yields a short-term residual sequence, which is then used as the short-term feature sequence.
[0018] The long-term characteristic sequence represents the global trend pattern of the evolution of pathogens in the source domain, while the short-term characteristic sequence represents the fluctuation pattern within a local time window of the evolution of pathogens in the source domain.
[0019] As a further alternative to the pathogen evolution time-series prediction method, the convolutional neural network module uses ResNet18 as the convolutional backbone network.
[0020] As a further optional scheme of the pathogen evolution time-series prediction method, the construction of optimizable preference pairs based on the direct preference optimization (DPO) idea, combining long-term and short-term features, specifically includes:
[0021] Based on the joint prediction probability of long-term and short-term representations, the log probability ratio of long-term features to short-term features is calculated as the preference score. The time series prediction results with preference scores higher than a preset threshold are regarded as advantageous samples, and those with preference scores lower than the preset threshold are regarded as disadvantageous samples, thus constructing preference pairs.
[0022] As a further optional scheme of the pathogen evolution time-series prediction method, the step of training a single-domain encoder based on long-term features, short-term features, and optimizable preference pairs, while recording the domain-specific representation of the single-domain encoder output, as well as the corresponding gradient signal and parameter update amount, specifically includes:
[0023] For each source domain pathogen, the long-term and short-term representations of the source domain pathogen and the corresponding optimizable preference pair are used as input. The single-domain encoder is trained by minimizing the DPO loss function of the preference pair, so that the single-domain encoder learns the temporal dependency preferences within the source domain pathogen. In each training iteration, the domain-specific representation output by the single-domain encoder, as well as the corresponding gradient signal and parameter update amount, are recorded.
[0024] As a further optional scheme of the pathogen evolution time-series prediction method, the training of the cross-domain encoder based on long-term features, short-term features, optimizable preference pairs, domain-specific representations, and corresponding gradient signals and parameter update amounts specifically includes:
[0025] Using the long-term characterization, short-term characterization, and optimizable preference pairs of all source domain pathogens as input, the DPO loss gradient is obtained for the shared parameters of the cross-domain encoder.
[0026] The DPO loss gradient, gradient signal and parameter update amount are weighted and aggregated to obtain the aggregated gradient. The weights of the weighted aggregation are based on the domain-specific characterization of each source domain pathogen to calculate the DPO loss contribution.
[0027] The shared parameters of the cross-domain encoder are updated by performing unified gradient descent using the aggregated gradients to obtain the trained cross-domain encoder. The current shared parameters of the trained cross-domain encoder are then output as the initialization parameters for meta-learning.
[0028] As a further optional scheme of the pathogen evolution time-series prediction method, the step of performing a few-step gradient update on the shared parameters of the trained cross-domain encoder based on the historical time-series data of the target pathogen, and using the cross-domain encoder with updated shared parameters to predict the target pathogen, to obtain the evolution result of the target pathogen, specifically includes:
[0029] The historical time series data of the target pathogen are preprocessed to obtain the supporting evolution time series matrix and the query evolution time series matrix;
[0030] The support set evolution time series matrix is decomposed into a long-term feature sequence and a short-term feature sequence of the support set. The long-term feature sequence and the short-term feature sequence of the support set are then input into the trained cross-domain encoder. The deviation between the forward calculation output and the support set label is used as the optimization objective. The shared parameters of the cross-domain encoder are updated by a few steps of gradient descent to obtain the cross-domain encoder after updating the shared parameters by a few steps of gradient descent.
[0031] Based on the cross-domain encoder with shared parameters updated by a few steps gradient, the evolutionary time series matrix of the query is combined to predict the evolution of the target pathogen and obtain the evolution result of the target pathogen.
[0032] A pathogen evolution time-series prediction system, comprising:
[0033] The source domain pathogen data acquisition module is used to acquire time-series data of multiple source domain pathogens and preprocess the time-series data of multiple source domain pathogens to obtain the source domain pathogen evolution time-series matrix.
[0034] The sequence decomposition module is used to decompose the evolution time series matrix of source domain pathogens into long-term characteristic sequences and short-term characteristic sequences;
[0035] The feature extraction module is used to input long-term feature sequences into the Transformer module, and capture global dependencies through a self-attention mechanism to obtain long-term representations; and input short-term feature sequences into the convolutional neural network module, and capture fluctuations within a local time window through convolution operations to obtain short-term representations.
[0036] The preference pair building module is used to optimize DPO based on the direct preference optimization idea, combining long-term and short-term features to build optimizable preference pairs;
[0037] The single-domain training module is used to train a single-domain encoder based on long-term features, short-term features, and optimizable preference pairs. At the same time, it records the domain-specific representation of the single-domain encoder output, as well as the corresponding gradient signal and parameter update amount.
[0038] The cross-domain training module is used to train a cross-domain encoder based on long-term features, short-term features, optimizable preference pairs, domain-specific representations, and corresponding gradient signals and parameter update amounts.
[0039] The target pathogen data acquisition module is used to acquire historical time-series data of the target pathogen;
[0040] The few-step update and prediction module is used to perform a few-step gradient update on the shared parameters of the trained cross-domain encoder based on the historical time-series data of the target pathogen, and then use the cross-domain encoder with updated shared parameters to predict the evolution of the target pathogen, thereby obtaining the evolution results of the target pathogen.
[0041] A computing device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the above-described pathogen evolution timing prediction methods.
[0042] A computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the above-described pathogen evolution timing prediction methods.
[0043] The beneficial effects of this invention are as follows: By decomposing the evolutionary time series matrix into long-term feature sequences and short-term feature sequences, and processing them using Transformer (which excels at capturing global dependencies) and CNN (which excels at capturing local fluctuations) respectively, a refined decoupling of pathogen evolution patterns is achieved. This dual-path feature extraction mechanism can more comprehensively capture multi-scale information in the data, thereby significantly improving the model's adaptability to different evolutionary patterns and enhancing its generalization ability. Secondly, based on the Direct Preference Optimization (DPO) idea, optimizable preference pairs are constructed, and cross-domain encoders are trained by combining domain-specific representations and gradient signals. This method can explicitly learn and align the differences between the source domain and the target domain in long-term trends and short-term fluctuations, effectively eliminating inter-domain bias, enabling the model to obtain high-precision prediction results even in data-scarce target domains. In addition, by adopting a few-step gradient update strategy, shared parameters can be quickly adjusted using a small amount of historical data of the target pathogen. This mechanism not only reduces computational costs but also enables the model to quickly adapt to newly emerging pathogen mutations, achieving rapid response while ensuring high accuracy. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is a flowchart illustrating a pathogen evolution time-series prediction method according to the present invention;
[0046] Figure 2 This is a schematic diagram of the composition of a pathogen evolution time-series prediction system according to the present invention;
[0047] Figure 3 This is a schematic diagram of the composition of a computing device according to the present invention. Detailed Implementation
[0048] The technical solutions in the embodiments of the present invention will be clearly and completely described below. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0049] refer to Figures 1 to 3 A method for predicting the time series evolution of pathogens, specifically including:
[0050] Time-series data of pathogens from multiple source domains are acquired and preprocessed to obtain a source domain pathogen evolution time-series matrix. In some embodiments, the source domain pathogen evolution time-series matrix includes two or more of the following: pathogen mutation frequency sequence, mutant strain proportion sequence, genomic locus change sequence, antigenic epitope change sequence, sampling time, host type, geographical region, vector type, environmental factors, number of cases, and epidemiological indicators.
[0051] Specifically, time-series data of pathogens from multiple source domains (such as influenza virus, coronavirus, etc.) are obtained from public health databases and monitoring systems. The data is cleaned to remove outliers and duplicate records, and data from different sources are standardized and aligned. In some embodiments, the source domain pathogen evolution time-series matrix includes two or more of the following: pathogen mutation frequency sequence, variant strain proportion sequence, genomic site change sequence, antigenic epitope change sequence, sampling time, host type, geographical region, vector type, environmental factors, number of cases, and epidemiological indicators. Through the fusion and recombination of multi-source heterogeneous data, a high-dimensional feature matrix is constructed to characterize the complex evolutionary state of pathogens.
[0052] Thus, by introducing multi-dimensional biological and epidemiological indicators to construct an evolutionary time series matrix, the limitations of single sequence data in information representation are overcome. This multi-feature fusion processing method can comprehensively capture the integrated evolutionary information of pathogens at the gene, phenotypic, and transmission environment levels, significantly enhancing the model's ability to understand the complex variation patterns of pathogens. The rich feature input provides solid data support for the subsequent decoupling of long-term and short-term features, thereby effectively improving the robustness and accuracy of cross-domain prediction models when facing complex evolutionary scenarios.
[0053] The evolution time series matrix of source domain pathogens is decomposed into long-term characteristic sequences and short-term characteristic sequences, specifically including:
[0054] The source domain pathogen evolution time series matrix is smoothed using a moving average operator, and low-frequency trend components in the time series data are extracted as long-term feature sequences.
[0055] Subtracting the long-term feature sequence from the source domain pathogen evolution time series matrix yields a short-term residual sequence, which is then used as the short-term feature sequence.
[0056] The long-term characteristic sequence represents the global trend pattern of the evolution of pathogens in the source domain, while the short-term characteristic sequence represents the fluctuation pattern within a local time window of the evolution of pathogens in the source domain.
[0057] Specifically, through mathematical time-series decomposition, the complex pathogen evolution data was successfully decoupled into trend and fluctuation terms. This separation mechanism allows the model to specialize in modeling features at different time scales, avoiding mutual interference between single models when dealing with long-term and short-term dependencies. The extraction of long-term feature sequences effectively filters out noise from random fluctuations, ensuring the model's grasp of the overall evolutionary direction. Meanwhile, the preservation of short-term residual sequences fully records key details such as sudden mutations or seasonal fluctuations. This refined feature separation significantly improves the model's analytical depth of pathogen evolution patterns, laying a high-quality data foundation for subsequent use of Transformer to capture global dependencies and CNN to capture local fluctuations. This effectively solves the problems of poor generalization ability and low prediction accuracy caused by feature mixing in existing technologies.
[0058] Long-term feature sequences are input into the Transformer module, which captures global dependencies through a self-attention mechanism to obtain long-term representations; short-term feature sequences are input into the convolutional neural network module, which captures fluctuations within a local time window through convolution operations to obtain short-term representations; in some embodiments, the convolutional neural network module uses ResNet18 as the convolutional backbone network.
[0059] Specifically, the long-term feature sequences obtained from the above decomposition are input into the Transformer module, which contains 6 self-attention layers, each with 8 attention heads. By calculating the global dependencies between sequences, long-term representations that characterize long-term evolution trends are extracted. At the same time, the short-term residual sequences are input into the convolutional neural network module, which uses ResNet18 as the convolutional backbone network. Through multi-layer convolutional operations, it captures the fluctuation features within the local time window, thereby obtaining short-term representations.
[0060] Thus, by introducing a hybrid architecture of Transformer and ResNet18, differentiated modeling of short-term and long-term features is achieved. Transformer effectively captures global dependencies across time steps using a self-attention mechanism, solving the problem of information loss caused by large time spans in long-term trend prediction. Meanwhile, ResNet18 effectively extracts local details in short-term fluctuations through residual connections of deep convolutional networks, avoiding gradient vanishing. This targeted feature extraction strategy significantly improves the model's ability to analyze evolution patterns at different time scales, thereby effectively overcoming the shortcomings of existing technologies where a single model cannot take into account both global and local features, and greatly improving prediction accuracy.
[0061] Based on the direct preference optimization (DPO) concept, and combining long-term and short-term features, optimizable preference pairs are constructed, specifically including:
[0062] Based on the joint prediction probability of long-term and short-term representations, the log probability ratio of long-term features to short-term features is calculated as the preference score. The time series prediction results with preference scores higher than a preset threshold are regarded as advantageous samples, and those with preference scores lower than the preset threshold are regarded as disadvantageous samples, thus constructing preference pairs.
[0063] Specifically, after extracting the long-term and short-term representations, they are input into the corresponding branches of the joint prediction module: the long-term representation is mapped to a long-term prediction probability P_long through a fully connected layer with 256 neurons (activation function ReLU), and the short-term representation is mapped to a short-term prediction probability P_short through a fully connected layer with 128 neurons (activation function ReLU); then, a weighted fusion strategy is used to calculate the joint prediction probability, setting the weight of the long-term feature to 0.7 and the weight of the short-term feature to 0.3, i.e., P_joint = 0.7×P_long + 0.3 × P_short; Next, the log probability ratio of long-term features to short-term features is calculated, and this value is used as the preference score; To determine the preset threshold, a grid search is performed on the validation set to test the F1-macro scores at four thresholds: 0.5, 0.6, 0.65, and 0.7. Finally, 0.65, which gives the highest F1-macro score, is selected as the preset threshold; Finally, prediction results with preference scores higher than 0.65 are marked as dominant samples, and those lower than 0.65 are marked as suboptimal samples. An optimizable preference pair containing dominant and suboptimal samples is constructed for subsequent direct preference optimization training.
[0064] Thus, by calculating the joint prediction probability through a specific weighted fusion strategy, the contributions of long-term trends and short-term fluctuations are effectively balanced, avoiding the bias of a single feature dominating the prediction results. The calculation of the log probability ratio quantifies the relative importance of long-term and short-term features in the prediction, providing a clear mathematical basis for the calculation of preference scores. The optimal threshold is determined by grid search on the validation set, ensuring that the division of advantageous and disadvantageous samples is data-driven and reasonable, thus improving the quality of preference pairs. High-quality preference pairs provide accurate supervision signals for direct preference optimization training, enabling the model to more effectively align the feature distributions of the source and target domains, significantly reducing the risk of negative transfer in cross-domain transfer, thereby greatly improving the model's prediction accuracy and generalization ability in the target domain.
[0065] Based on long-term features, short-term features, and optimizable preference pairs, a single-domain encoder is trained. Simultaneously, the domain-specific representation of the single-domain encoder output, along with the corresponding gradient signal and parameter update, is recorded. Specifically, this includes:
[0066] For each source domain pathogen, the long-term and short-term representations of the source domain pathogen and the corresponding optimizable preference pair are used as input. The single-domain encoder is trained by minimizing the DPO loss function of the preference pair, so that the single-domain encoder learns the temporal dependency preferences within the source domain pathogen. In each training iteration, the domain-specific representation output by the single-domain encoder, as well as the corresponding gradient signal and parameter update amount, are recorded.
[0067] Specifically, for each source domain pathogen, a single-domain encoder with three fully connected layers is constructed, with 512, 256, and 128 neurons per layer, respectively. The activation function is ReLU, and the output layer is a linear layer to generate a domain-specific representation. During training, the long-term and short-term representations of the source domain pathogen, along with the corresponding optimizable preference pairs (advantageous and disadvantageous samples), are used as inputs. Training is performed by minimizing the DPO loss function, which uses a ranking loss with a temperature coefficient of 0.1 and incorporates an L2 regularization term (coefficient of 0.001) to prevent overfitting. In each training iteration (e.g., every 100 iterations), the domain-specific representation output by the single-domain encoder is recorded (stored as a feature vector specific to the source domain pathogen), and the corresponding gradient signals (e.g., the gradient tensors of the weights of each layer) and parameter update amounts (calculated as the L2 norm of the weight difference between the current and previous iterations) are extracted and saved.
[0068] Thus, by constructing a dedicated single-domain encoder and combining it with the DPO loss function, the model can accurately capture the temporal dependency patterns within the source domain pathogen. The introduction of preference pairs provides the encoder with a clear optimization direction, effectively improving its ability to learn source domain features. The recording of domain-specific representations preserves the unique evolutionary information of each source domain, avoiding feature confusion in cross-domain training. The recording of gradient signals and parameter update amounts provides crucial data for subsequent model debugging. For example, training bottlenecks can be identified by analyzing gradient changes, or training stability can be monitored by monitoring parameter update amounts, thereby optimizing the network structure and hyperparameter settings. This refined training and recording mechanism significantly enhances the feature extraction capability of the single-domain encoder, laying a high-quality source domain feature foundation for subsequent cross-domain transfer learning, and effectively solving the problem of insufficient source domain feature learning by single-domain encoders in existing technologies.
[0069] Based on long-term features, short-term features, optimizable preference pairs, domain-specific representations, and corresponding gradient signals and parameter update amounts, a cross-domain encoder is trained, specifically including:
[0070] Using the long-term characterization, short-term characterization, and optimizable preference pairs of all source domain pathogens as input, the DPO loss gradient is obtained for the shared parameters of the cross-domain encoder.
[0071] The DPO loss gradient, gradient signal and parameter update amount are weighted and aggregated to obtain the aggregated gradient. The weights of the weighted aggregation are based on the domain-specific characterization of each source domain pathogen to calculate the DPO loss contribution.
[0072] The shared parameters of the cross-domain encoder are updated by performing unified gradient descent using the aggregated gradients to obtain the trained cross-domain encoder. The current shared parameters of the trained cross-domain encoder are then output as the initialization parameters for meta-learning.
[0073] Specifically, a cross-domain encoder is constructed, with the same structure as the single-domain encoder, containing three fully connected layers (512, 256, and 128 neurons respectively), using ReLU as the activation function, and a linear output layer to generate cross-domain shared representations. During training, the long-term and short-term representations of all source domain pathogens, along with their corresponding optimizable preference pairs (advantageous and disadvantageous samples), are used as input. First, the DPO loss gradient of the shared parameters of the cross-domain encoder is calculated: using a ranking loss function with a temperature coefficient of 0.1, the loss is calculated for each source domain preference pair, and then summed to obtain the total DPO loss. The gradient ∇L_DPO of the shared parameters is obtained through backpropagation. Next, the weighted aggregation weights are calculated: the domain-specific representations output by each single-domain encoder (such as the feature vector v_i of source domain i) are input into the attention module, and the DPO loss contribution weight w_i = softmax(v_i· v_avg) of each source domain is calculated, where v_avg is the average value of all source domain domain-specific representations, reflecting the correlation between the source domain and the whole. Then, the DPO loss gradient, gradient signals (such as the gradient tensor g_i of the weights of each layer in the single-domain encoder), and parameter update amounts (such as the L2 norm Δ_i of the weight difference in the single-domain encoder) are weighted and aggregated to obtain the aggregated gradient ∇L_agg = Σ(w_i×(∇L_DPO_i+α×g_i+β×Δ_i)), where α=0.2 and β=0.1 are balancing coefficients used to fuse the information of gradient signals and parameter update amounts. Finally, the Adam optimizer (learning rate 0.001, β1=0.9, β2=0.999) is used to perform unified gradient descent updates on the shared parameters of the cross-domain encoder. After 1000 iterations, the trained cross-domain encoder is obtained, and its current shared parameters are output as the initialization parameters for meta-learning.
[0074] Thus, through a weighted aggregation mechanism, source domain-specific information (domain-specific representation) and gradient information (DPO loss gradient, gradient signal, parameter update amount) are effectively fused, preserving the unique evolutionary characteristics of each source domain while optimizing the learning process of cross-domain shared parameters. The weights calculated by the attention mechanism make the source domains with high contribution (such as those with strong correlation to the target domain) have a greater impact on gradient aggregation, avoiding noise interference from irrelevant source domains. The addition of gradient signals and parameter update amounts further utilizes the dynamic information in single-domain training, improving the cross-domain encoder's ability to capture temporal dependencies within the source domain. The output of meta-learning initialization parameters provides a high-quality starting point for rapid adaptation to new target domains, significantly reducing the training cost and data requirements for new domain adaptation. This method effectively solves the negative transfer problem caused by neglecting source domain specificity in existing cross-domain encoders, greatly improving the model's prediction accuracy and generalization ability in unseen target domains.
[0075] Obtain historical time-series data of the target pathogen;
[0076] Based on the historical time-series data of the target pathogen, the shared parameters of the trained cross-domain encoder are updated using a few steps of gradient. The cross-domain encoder with updated shared parameters is then used to predict the evolution of the target pathogen, yielding the evolution results of the target pathogen, specifically including:
[0077] The historical time series data of the target pathogen are preprocessed to obtain the supporting evolution time series matrix and the query evolution time series matrix;
[0078] The support set evolution time series matrix is decomposed into a long-term feature sequence and a short-term feature sequence of the support set. The long-term feature sequence and the short-term feature sequence of the support set are then input into the trained cross-domain encoder. The deviation between the forward calculation output and the support set label is used as the optimization objective. The shared parameters of the cross-domain encoder are updated by a few steps of gradient descent to obtain the cross-domain encoder after updating the shared parameters by a few steps of gradient descent.
[0079] Based on the cross-domain encoder with shared parameters updated by a few steps gradient, the evolutionary time series matrix of the query is combined to predict the evolution of the target pathogen and obtain the evolution result of the target pathogen.
[0080] Specifically, historical time-series data of the target pathogen (e.g., weekly infection cases over the past 12 months) is obtained. Preprocessing is then performed: Z-score normalization is used to map the data to the [0,1] interval. Then, a sliding window (4 weeks in size) is used to divide the data into a support evolution time-series matrix (containing data from the first 8 weeks) and a query evolution time-series matrix (containing data from the last 4 weeks). Next, the support evolution time-series matrix is decomposed into a long-term support set feature sequence (global trend) and a short-term support set feature sequence (local fluctuations) using a moving average operator (12 time steps in size) consistent with the source domain. These two sequences are then input into a trained cross-domain encoder (3 fully connected layers, with the following number of neurons respectively). The encoder output is obtained by using 512, 256, and 128 values, ReLU activation function, and a linear output layer. The mean squared error (MSE) between this output and the support set labels (such as the actual number of infected cases in the next 4 weeks) is calculated as the optimization objective. The gradient of the shared parameters is calculated through backpropagation. The Adam optimizer (learning rate 0.005, β1=0.9, β2=0.999) is used to perform 5 steps of gradient descent update to obtain the cross-domain encoder after a few steps of update. Finally, the query evolution time series matrix is decomposed into long-term feature sequences and short-term feature sequences of the query set, which are input into the updated cross-domain encoder to output the evolution results of the target pathogen in the next 4 weeks (such as the predicted number of infected cases per week).
[0081] Thus, by employing a few-step gradient update mechanism and fully utilizing the meta-learning initialization parameters of the cross-domain encoder, the feature distribution of the target domain is quickly adapted in just 5 optimization steps, effectively solving the problem of insufficient historical data for the target domain. The long-short term feature decomposition of the support set preserves the global trend and local fluctuations of the target domain's evolution, enabling the encoder to accurately capture the temporal dependencies of the target domain. The MSE optimization objective directly aligns the encoder output with the ground truth label, quickly adjusting shared parameters to adapt to the target domain. Combining the prediction with the query set fully utilizes the local information of the target domain, significantly improving prediction accuracy. This method greatly reduces the training cost and data requirements of the target domain, effectively overcoming the problems of large prediction errors and poor generalization ability caused by insufficient target domain data in existing technologies, providing an efficient solution for pathogen evolution prediction in small-sample scenarios.
[0082] A pathogen evolution time-series prediction system, comprising:
[0083] The source domain pathogen data acquisition module is used to acquire time-series data of multiple source domain pathogens and preprocess the time-series data of multiple source domain pathogens to obtain the source domain pathogen evolution time-series matrix.
[0084] The sequence decomposition module is used to decompose the evolution time series matrix of source domain pathogens into long-term characteristic sequences and short-term characteristic sequences;
[0085] The feature extraction module is used to input long-term feature sequences into the Transformer module, and capture global dependencies through a self-attention mechanism to obtain long-term representations; and input short-term feature sequences into the convolutional neural network module, and capture fluctuations within a local time window through convolution operations to obtain short-term representations.
[0086] The preference pair building module is used to optimize DPO based on the direct preference optimization idea, combining long-term and short-term features to build optimizable preference pairs;
[0087] The single-domain training module is used to train a single-domain encoder based on long-term features, short-term features, and optimizable preference pairs. At the same time, it records the domain-specific representation of the single-domain encoder output, as well as the corresponding gradient signal and parameter update amount.
[0088] The cross-domain training module is used to train a cross-domain encoder based on long-term features, short-term features, optimizable preference pairs, domain-specific representations, and corresponding gradient signals and parameter update amounts.
[0089] The target pathogen data acquisition module is used to acquire historical time-series data of the target pathogen;
[0090] The few-step update and prediction module is used to perform a few-step gradient update on the shared parameters of the trained cross-domain encoder based on the historical time-series data of the target pathogen, and then use the cross-domain encoder with updated shared parameters to predict the evolution of the target pathogen, thereby obtaining the evolution results of the target pathogen.
[0091] A computing device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the above-described pathogen evolution timing prediction methods.
[0092] A computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of any of the above-described pathogen evolution timing prediction methods.
[0093] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for predicting the time series evolution of pathogens, characterized in that, Specifically, it includes: Time series data of pathogens from multiple source domains were obtained, and the time series data of pathogens from multiple source domains were preprocessed to obtain the evolution time series matrix of pathogens from the source domains. The evolution time series matrix of source domain pathogens is decomposed into long-term characteristic sequences and short-term characteristic sequences; Long-term feature sequences are input into the Transformer module, which captures global dependencies through a self-attention mechanism to obtain long-term representations; short-term feature sequences are input into the convolutional neural network module, which captures fluctuations within a local time window through convolution operations to obtain short-term representations. Based on the idea of direct preference optimization (DPO), and combining long-term and short-term features, optimizable preference pairs are constructed. Based on long-term features, short-term features, and optimizable preference pairs, a single-domain encoder is trained. At the same time, the domain-specific representation of the single-domain encoder output, as well as the corresponding gradient signal and parameter update amount, are recorded. A cross-domain encoder is trained based on long-term features, short-term features, optimizable preference pairs, domain-specific representations, and corresponding gradient signals and parameter update amounts. Obtain historical time-series data of the target pathogen; Based on the historical time-series data of the target pathogen, the shared parameters of the trained cross-domain encoder are updated using a few steps of gradient. The cross-domain encoder with updated shared parameters is then used to predict the evolution of the target pathogen, thus obtaining the evolution results of the target pathogen.
2. The pathogen evolution time-series prediction method according to claim 1, characterized in that, The process of decomposing the source domain pathogen evolution time series matrix into long-term characteristic sequences and short-term characteristic sequences specifically includes: The source domain pathogen evolution time series matrix is smoothed using a moving average operator, and low-frequency trend components in the time series data are extracted as long-term feature sequences. Subtracting the long-term feature sequence from the source domain pathogen evolution time series matrix yields a short-term residual sequence, which is then used as the short-term feature sequence. The long-term characteristic sequence represents the global trend pattern of the evolution of pathogens in the source domain, while the short-term characteristic sequence represents the fluctuation pattern within a local time window of the evolution of pathogens in the source domain.
3. The pathogen evolution time-series prediction method according to claim 1, characterized in that, The convolutional neural network module uses ResNet18 as the convolutional backbone network.
4. The pathogen evolution time-series prediction method according to claim 1, characterized in that, The method of optimizing DPO based on direct preference, combining long-term and short-term features, constructs optimizable preference pairs, specifically including: Based on the joint prediction probability of long-term and short-term representations, the log probability ratio of long-term features to short-term features is calculated as the preference score. The time series prediction results with preference scores higher than a preset threshold are regarded as advantageous samples, and those with preference scores lower than the preset threshold are regarded as disadvantageous samples, thus constructing preference pairs.
5. The pathogen evolution time-series prediction method according to claim 4, characterized in that, The process involves training a single-domain encoder based on long-term features, short-term features, and optimizable preference pairs. Simultaneously, it records the domain-specific representation of the single-domain encoder output, along with the corresponding gradient signal and parameter update amounts. Specifically, this includes: For each source domain pathogen, the long-term and short-term representations of the source domain pathogen and the corresponding optimizable preference pair are used as input. The single-domain encoder is trained by minimizing the DPO loss function of the preference pair, so that the single-domain encoder learns the temporal dependency preferences within the source domain pathogen. In each training iteration, the domain-specific representation output by the single-domain encoder, as well as the corresponding gradient signal and parameter update amount, are recorded.
6. The pathogen evolution time-series prediction method according to claim 5, characterized in that, The training of the cross-domain encoder based on long-term features, short-term features, optimizable preference pairs, domain-specific representations, and corresponding gradient signals and parameter update amounts specifically includes: Using the long-term characterization, short-term characterization, and optimizable preference pairs of all source domain pathogens as input, the DPO loss gradient is obtained for the shared parameters of the cross-domain encoder. The DPO loss gradient, gradient signal and parameter update amount are weighted and aggregated to obtain the aggregated gradient. The weights of the weighted aggregation are based on the domain-specific characterization of each source domain pathogen to calculate the DPO loss contribution. The shared parameters of the cross-domain encoder are updated by performing unified gradient descent using the aggregated gradients to obtain the trained cross-domain encoder. The current shared parameters of the trained cross-domain encoder are then output as the initialization parameters for meta-learning.
7. The pathogen evolution time-series prediction method according to claim 6, characterized in that, The process involves updating the shared parameters of the trained cross-domain encoder using a few steps of gradient data based on the historical time-series data of the target pathogen, and then using the updated cross-domain encoder to predict the target pathogen, thereby obtaining the evolution results of the target pathogen. Specifically, this includes: The historical time series data of the target pathogen are preprocessed to obtain the supporting evolution time series matrix and the query evolution time series matrix; The support set evolution time series matrix is decomposed into a long-term feature sequence and a short-term feature sequence of the support set. The long-term feature sequence and the short-term feature sequence of the support set are then input into the trained cross-domain encoder. The deviation between the forward calculation output and the support set label is used as the optimization objective. The shared parameters of the cross-domain encoder are updated by a few steps of gradient descent to obtain the cross-domain encoder after updating the shared parameters by a few steps of gradient descent. Based on the cross-domain encoder with shared parameters updated by a few steps gradient, the evolutionary time series matrix of the query is combined to predict the evolution of the target pathogen and obtain the evolution result of the target pathogen.
8. A pathogen evolution time-series prediction system, characterized in that, include: The source domain pathogen data acquisition module is used to acquire time-series data of multiple source domain pathogens and preprocess the time-series data of multiple source domain pathogens to obtain the source domain pathogen evolution time-series matrix. The sequence decomposition module is used to decompose the evolution time series matrix of source domain pathogens into long-term characteristic sequences and short-term characteristic sequences; The feature extraction module is used to input long-term feature sequences into the Transformer module, and capture global dependencies through a self-attention mechanism to obtain long-term representations; and input short-term feature sequences into the convolutional neural network module, and capture fluctuations within a local time window through convolution operations to obtain short-term representations. The preference pair building module is used to optimize DPO based on the direct preference optimization idea, combining long-term and short-term features to build optimizable preference pairs; The single-domain training module is used to train a single-domain encoder based on long-term features, short-term features, and optimizable preference pairs. At the same time, it records the domain-specific representation of the single-domain encoder output, as well as the corresponding gradient signal and parameter update amount. The cross-domain training module is used to train a cross-domain encoder based on long-term features, short-term features, optimizable preference pairs, domain-specific representations, and corresponding gradient signals and parameter update amounts. The target pathogen data acquisition module is used to acquire historical time-series data of the target pathogen; The few-step update and prediction module is used to perform a few-step gradient update on the shared parameters of the trained cross-domain encoder based on the historical time-series data of the target pathogen, and then use the cross-domain encoder with updated shared parameters to predict the evolution of the target pathogen, thereby obtaining the evolution results of the target pathogen.
9. A computing device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the pathogen evolution timing prediction method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the pathogen evolution timing prediction method according to any one of claims 1-7.