Infectious Disease Trend Prediction Method Based on Hybrid Decomposition and Time2Vec-BiLSTM-SA Model
By combining hybrid decomposition and the Time2Vec-BiLSTM-SA model, multi-scale features are extracted using VMD and SSD decomposition algorithms. The Time2Vec-BiLSTM-SA model is then used for flexible time encoding and feature extraction, which solves the problem of insufficient multi-scale feature mining in existing models for COVID-19 epidemic trend prediction and achieves higher prediction accuracy.
Patent Information
- Application Number
- CN202411763506.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-12-03
AI Technical Summary
Existing methods for predicting the COVID-19 epidemic trend based on time series data combined with hybrid deep learning models are insufficient to fully exploit multi-scale features, and the hybrid deep learning model structure fails to achieve complementary advantages of different modules, resulting in insufficient prediction accuracy.
By employing a hybrid decomposition and Time2Vec-BiLSTM-SA model, the intrinsic mode features and multi-scale variation details of the signal are extracted through VMD and SSD decomposition algorithms. The Time2Vec-BiLSTM-SA combined model is used for flexible time coding and multi-level feature extraction to capture the complex dynamic changes in the number of newly confirmed COVID-19 cases per day.
It significantly improves the accuracy and reliability of epidemic trend prediction. Through rich feature information and adaptive feature focusing, it enhances the model's prediction accuracy and generalization ability.
Smart Images

Figure CN119560176B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for predicting infectious disease trends based on hybrid decomposition and the Time2Vec-BiLSTM-SA model, belonging to the field of infectious disease trend prediction in artificial intelligence. Background Technology
[0002] Studying the development trend of the epidemic, reflecting its changing trends and future direction, provides objective evidence for government departments' epidemic prevention and control measures, and is of great significance for future epidemic prevention and control. Most research on predicting the development trend of infectious disease epidemics relies on time series models based on confirmed case data to predict future trends. In recent years, machine learning methods have been widely used in COVID-19 epidemic prediction; however, traditional machine learning model combinations may struggle to fully extract data features. Deep learning, on the other hand, utilizes the powerful automatic learning and feature mining capabilities of neural networks for feature extraction. Combined with time series data, it offers good versatility and strong predictive power. However, combining time series data with different deep learning hybrid models, due to the input of only a single time series, results in insufficient ability to extract periodic and non-periodic features of the time series, failing to fully uncover the multi-scale features of the data, and thus requiring further improvement in prediction accuracy.
[0003] The current COVID-19 epidemic trend prediction method based on time series combined with hybrid deep learning model still has the following problems: (1) It is difficult to extract multi-scale features of the signal by only inputting a single time series; (2) The hybrid deep learning model structure fails to achieve the complementary advantages of different modules and has insufficient ability to extract multi-scale features. Summary of the Invention
[0004] This invention provides an infectious disease trend prediction method based on hybrid decomposition and the Time2Vec-BiLSTM-SA model. This method cleverly introduces VMD+SSD to construct a hybrid decomposition algorithm. VMD focuses on extracting the intrinsic modal features of the signal, while SSD supplements the detailed information of multi-scale changes. Together, they can improve the ability to capture multi-level features of daily newly confirmed COVID-19 cases, thus providing richer feature information for the prediction model. Furthermore, the Time2Vec-BiLSTM-SA combined model, with its flexible time encoding, multi-level feature extraction, bidirectional temporal modeling, and adaptive feature focusing, can more accurately capture the complex dynamic changes in the number of daily newly confirmed COVID-19 cases, significantly improving the accuracy and reliability of epidemic trend prediction.
[0005] The technical solution of the present invention is:
[0006] According to a first aspect of the present invention, a method for predicting infectious disease trends based on hybrid decomposition and a Time2Vec-BiLSTM-SA model is provided, comprising the following steps: S1, acquiring daily newly confirmed case data of the target infectious disease; smoothing the daily newly confirmed case data to obtain smoothed daily newly confirmed case data; S2, constructing a first feature matrix directly based on the sample sliding window width of the smoothed daily newly confirmed case data; performing L-type decomposition on the smoothed daily newly confirmed case data using a hybrid decomposition algorithm to obtain L-type decomposed daily newly confirmed case component data; constructing a second feature matrix for each of the L-type daily newly confirmed case component data based on the sample sliding window width; S3, constructing a multi-branch input network prediction model; S4, using the first feature matrix and the L-type second feature matrices as inputs to the multi-branch input network prediction model, and using the multi-branch input network prediction model to output the predicted value of the daily newly confirmed cases in a single step.
[0007] Furthermore, the smoothing process is a 7-day average smoothing process.
[0008] Furthermore, the hybrid decomposition algorithm specifically involves: simultaneously using both VMD and SSD decomposition algorithms to decompose the smoothed daily newly confirmed case data to obtain two decomposed components of the daily newly confirmed case data; constructing a second feature matrix 1 for the daily newly confirmed case component data under the VMD branch based on the sample sliding window width, and constructing a second feature matrix 2 for the daily newly confirmed case component data under the SSD branch based on the sample sliding window width.
[0009] Furthermore, the method for determining the optimal number of VMD decomposition components when using the VMD decomposition algorithm to decompose the smoothed daily new confirmed case data is as follows: An initial value for the optimal number of VMD decomposition components is set. Starting from this initial value, the value of the optimal number of VMD decomposition components is sequentially increased. With different values for the optimal number of VMD decomposition components, VMD decomposition is performed on the smoothed daily new confirmed case data. Correlation analysis is then performed between the decomposed components and the smoothed daily new confirmed case data to obtain correlation coefficients. These correlation coefficients are compared with a preset threshold until a correlation coefficient falls below the preset threshold, at which point the increase in the optimal number of VMD decomposition components is stopped. The maximum value of the optimal number of VMD decomposition components corresponding to a correlation coefficient greater than the preset threshold is taken as the final optimal number of VMD decomposition components.
[0010] Furthermore, the number of SSD decomposition components is adaptive.
[0011] Furthermore, the multi-branch input network prediction model has a total of 1+L branches, each branch containing a cascaded Time2Vec module and a BiLSTM module. The size of the input feature matrix for each branch is j×N. The feature matrix is input to each branch to extract the temporal features of the daily newly confirmed cases. The extracted temporal features are fused through the Adding layer to obtain the spatiotemporal features of the daily newly confirmed cases data. The spatiotemporal features are then passed through the SA module and the Dropout layer to form the output. The output of the Dropout layer is then passed through a fully connected layer to obtain the predicted value of the daily newly confirmed cases in a single step. Here, j is the width of the sample sliding window, and N is the dimension of the data samples obtained by 1+L processing methods.
[0012] Furthermore, the infectious disease trend prediction method based on hybrid decomposition and the Time2Vec-BiLSTM-SA model was applied to predict the number of newly confirmed COVID-19 cases daily.
[0013] According to a second aspect of the present invention, an infectious disease trend prediction device based on hybrid decomposition and Time2Vec-BiLSTM-SA model is provided, comprising a module of the infectious disease trend prediction method based on hybrid decomposition and Time2Vec-BiLSTM-SA model as described in any one of the above.
[0014] According to a third aspect of the invention, a terminal is provided, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, the processor being configured to execute the infectious disease trend prediction method based on hybrid decomposition and Time2Vec-BiLSTM-SA model as described in any one of the preceding claims.
[0015] The beneficial effects of this invention are as follows: This invention uses daily newly confirmed case data for 7-day moving average smoothing, which not only reduces data fluctuations and eliminates the influence of outliers, but also improves the robustness of the model and enhances prediction accuracy. Simultaneously, it utilizes VMD and SSD decomposition algorithms to decompose the smoothed daily newly confirmed case data. Different decomposition methods generate multi-scale components with different modalities and low complexity with strong regularity for complex new case sequences. The combination of two different modal sub-components forms a hybrid component, achieving feature complementarity among the multi-scale components of different modalities, enriching the input feature information, and providing a basis for extracting feature information from different aspects of complex nonlinear sequences. This invention provides a foundation for the proposed method. Based on this, undecomposed matrix features are introduced and used as input to a three-branch Time Vector Embedding (TVA) and Bidirectional Long Short-Term Memory (LSTM) Self-Attention (SA) network. The TVA module flexibly encodes temporal information, automatically learning the periodic and aperiodic variations in the data. The LSTM network extracts features representing the bidirectional long-term dependencies of the time-series signals. The SA module uses a weighted mechanism to highlight key time points, improving the accuracy of feature representation. The entire model effectively enhances prediction accuracy through the complementary information of different features. Finally, the invention was experimentally validated using county-level data from eight counties in California, USA, and national-level data from India and Italy, and compared with various data processing methods and model structures. The results show that the proposed method significantly outperforms existing methods in all prediction error metrics, demonstrating its effectiveness in improving the accuracy of COVID-19 epidemic trend prediction and exhibiting good universality and generalization ability. Attached Figure Description
[0016] Figure 1 This is a flowchart of the present invention;
[0017] Figure 2 A decomposition component diagram of VMD and SSD decomposition of daily new confirmed cases data in Los Angeles and San Francisco, USA, provided as an example of the present invention;
[0018] Figure 3 A graph illustrating the predictive effect of three trends in the daily new confirmed cases data in Los Angeles, USA, provided as an example of the present invention;
[0019] Figure 4 A diagram of the Time2Vec-BiLSTM-SA network structure provided for an example of the present invention;
[0020] Figure 5 The method provided in this invention is used to predict the trend of daily new confirmed cases in eight states of California under different combined models.
[0021] Figure 6 A graph illustrating the predictive effect of the method provided in this invention on the trend of changes in daily new confirmed cases in India under different data preprocessing methods.
[0022] Figure 7 The image shows the predictive effect of the method provided in this invention on the trend of the length change of a 200-day test set of daily new confirmed cases in Italy. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. 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. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be arbitrarily combined with each other.
[0024] Example 1: As Figure 1-7 As shown, according to one aspect of the present invention, an infectious disease trend prediction method based on hybrid decomposition and Time2Vec-BiLSTM-SA model is provided, comprising: S1, acquiring daily newly confirmed case data; smoothing the daily newly confirmed case data to obtain smoothed daily newly confirmed case data; S2, constructing a first feature matrix directly based on the sample sliding window width of the smoothed daily newly confirmed case data; performing L-type decomposition on the smoothed daily newly confirmed case data using a hybrid decomposition algorithm to obtain L-type decomposed daily newly confirmed case component data; constructing a second feature matrix for each of the L-type daily newly confirmed case component data based on the sample sliding window width; S3, constructing a multi-branch input network prediction model; S4, using the first feature matrix and the L-type second feature matrices as inputs to the multi-branch input network prediction model, and using the multi-branch input network prediction model to output the single-step predicted value of the daily newly confirmed cases.
[0025] Furthermore, the smoothing process is a 7-day average smoothing process.
[0026] Considering that COVID-19 is typically influenced by social behavior and the operational cycles of the healthcare system—for example, reduced testing on weekends may lead to a lower number of confirmed cases, while increased testing on weekdays may lead to an increase—and that epidemiological analyses usually use a 7-day moving average as the basic unit of analysis, the World Health Organization (WHO) and national epidemic reports typically provide a 7-day moving average to reduce volatility and reflect trends. Using a window width consistent with public health analyses ensures consistency between the model and real-world data analysis results; therefore, the sample sliding window width is set to 7. Choosing a 7-day input window width provides the model with sufficient historical information to help predict trends for the next day. If the input window width is too small (e.g., 3 days), the model may struggle to learn complex patterns due to a lack of contextual information; if the window width is too large (e.g., 14 days), the dimensionality of the input features may be too high, increasing model complexity and computational costs without necessarily improving prediction accuracy.
[0027] Furthermore, the hybrid decomposition algorithm specifically involves: simultaneously using both VMD and SSD decomposition algorithms to decompose the smoothed daily newly confirmed case data to obtain two decomposed components of the daily newly confirmed case data; constructing a second feature matrix 1 for the daily newly confirmed case component data under the VMD branch based on the sample sliding window width, and constructing a second feature matrix 2 for the daily newly confirmed case component data under the SSD branch based on the sample sliding window width.
[0028] Furthermore, the method for determining the optimal number of decomposition components *n* when using the VMD decomposition algorithm to decompose the smoothed daily new confirmed case data is as follows: An initial value for the optimal number of VMD decomposition components is set. Starting from this initial value, the value of the optimal number of VMD decomposition components is sequentially increased. With different values of the optimal number of VMD decomposition components, VMD decomposition is performed on the smoothed daily new confirmed case data. Correlation analysis is performed between the decomposed components and the smoothed daily new confirmed case data to obtain correlation coefficients. These correlation coefficients are compared with a preset threshold until a correlation coefficient falls below the preset threshold, at which point the increase in the optimal number of VMD decomposition components is stopped. The maximum value of the optimal number of VMD decomposition components corresponding to a correlation coefficient greater than the preset threshold is selected. The number of SSD decomposition components *z* is adaptive.
[0029] For example, the initial value of the optimal number of decomposition components for VMD is set to 3. By sequentially increasing the value of the optimal number of decomposition components for VMD, VMD decomposition is performed on the smoothed daily new confirmed case data under different values of the optimal number of decomposition components for VMD. In this embodiment of the invention, when the optimal number of decomposition components for VMD is 6, the obtained correlation coefficient is less than the preset threshold of 0.1. Therefore, the value of the optimal number of decomposition components for VMD is not increased further. Thus, VMD decomposition is performed when the optimal number of decomposition components for VMD is 3, 4, 5, and 6. When the optimal number of decomposition components for VMD is 3, 4, and 5, the correlation coefficient is greater than the preset threshold. Therefore, the maximum value of the optimal number of decomposition components for VMD corresponding to the case where the correlation coefficient is greater than the preset threshold, 5, is taken as the final optimal number of decomposition components for VMD.
[0030] The Pearson correlation coefficient r is used. p The correlation analysis was performed using the following formula:
[0031]
[0032] In the formula, N is the total number of smoothed daily new confirmed case data samples obtained for the current region; x i y i For each of the decomposition components x = (x1, x2, ..., x...), the decomposition components are respectively... N The daily new confirmed cases data y = (y1, y2, ..., y) after original smoothing. N The i-th value in ) Let x and y be the average values.
[0033] Variational Mode Decomposition (VMD) is an adaptive, fully non-recursive signal processing method that overcomes the endpoint effects and mode component aliasing problems of Empirical Mode Decomposition (EMD), and can better reduce the non-stationarity and complexity of time series. The VMD algorithm constructs the signal f(t) as a constrained variational problem, and finds the optimal solution of the variational model through multiple iterations to determine the center frequency and bandwidth in the signal decomposition algorithm. The specific process of the VMD algorithm is as follows:
[0034]
[0035] In the formula: u p ω represents the p-th modal component derived from the signal decomposition. p δ(t) represents the center frequency corresponding to the p-th modal component; n represents the total number of pre-decomposed components; and f(t) represents the time series sequence of the daily newly confirmed cases after the original smoothing process.
[0036] For example, the daily new confirmed case data in Los Angeles, USA, is decomposed into five components after being processed by VMD, such as... Figure 2 As shown in (a); the daily new confirmed cases data in San Francisco, USA, after being decomposed by VMD, are divided into 5 components, such as... Figure 2 As shown in (c).
[0037] Singular Spectral Decomposition (SSD) is an adaptive time-frequency analysis method that adaptively decomposes non-stationary signals into several singular spectral components (SSCs) in order from high to low frequency. This overcomes the problem of traditional SSA methods, which rely on experience to manually select the embedding dimension M, and can better suppress mode aliasing and eliminate spurious components. The basic steps of SSD are as follows:
[0038] 1) Construct the trajectory matrix. For a time series x(n) with data length M and embedding dimension N, we can construct an M-row N-column matrix X, where the i-th column is x. i =[x1,x2,...,x M If i = 1, ..., N, then the matrix X = [x1, x2, ..., xn]. M ];
[0039] 2) Adaptive selection of embedding dimension N. SSA selects the embedding dimension N empirically, but the embedding dimension N has a significant impact on the analysis results of SSA. To avoid the error caused by empirical selection, SSD selects the embedding dimension N used in the l-th iteration through an adaptive rule.
[0040] First, calculate the residual signal v at the l-th iteration. l The power spectral density (PSD) of (n), where the residual signal v l The formula for calculating (n) is as follows:
[0041]
[0042] Then, estimate the frequency f corresponding to the maximum peak value in the PSD. max When j=1, if the normalized frequency f max / f s <ε(where f) s Here, ε is the sampling frequency, and ε is a given threshold, typically set to 10. -3 If the residual signal is considered to be a major trend term, the embedding dimension M is set to N / 3. If the above condition is not met and l > 1, the embedding dimension M is set to 1.2(f). s / f max ).
[0043] 3) Singular Value Decomposition. Perform singular value decomposition on the constructed trajectory matrix X:
[0044] X = UDV T
[0045] In the formula: U = M × M and V = K × K are both orthogonal matrices, each containing left and right singular vectors respectively; the diagonal matrix D = M × K is a singular value matrix, and all its elements are the singular values σ of the matrix. i K = N - M + 1. Therefore, the trajectory matrix X can be used as X i The set, X i Expressed as:
[0046] X i =σ i u i v i T
[0047] Where: σ i Let u be the i-th singular value of the matrix. i Let v be the i-th row of matrix U. i Let be the i-th row of matrix V.
[0048] 4) Reconstruct singular spectral components. When l=1, if a major trend term is detected, the estimated trajectory matrix is calculated using the first left and right eigenvectors. The first signal component g is obtained by angular averaging. (1) (n). Otherwise, when l>1, the signal component g (l) (n) Frequency components are mainly concentrated in the frequency band [f max -Δf,f max +Δf] on, Δf is the residual signal v l The half-bandwidth of the main peak in the PSD of (n). Then, analyze all the characteristic groups with prominent spectral peaks in this frequency band and the characteristic groups that contribute the most to the energy of the main peak, constructing a subset I from these principal components. l (I l ={i1,...,i p}), corresponding to the reconstructed estimated trajectory matrix X Il =X i1 +X i2 +…+X ip , for X Il g is obtained using the diagonal mean method (l) (n).
[0049] 5) Set the termination condition. Each iteration will generate a new signal component. Separate it from the original signal to obtain a new residual signal v (l+1) (n)=v (l) (n)-g (l)(n). Calculate the normalized mean square error (NMSE) between the residual signal and the original signal after l iterations, i.e.:
[0050]
[0051] The iteration terminates when the normalized mean square error is less than a given threshold (typically th = 0.01). Otherwise, the residual signal is used as the new original signal, and the above decomposition process is repeated until the termination condition is met. If z singular spectral components are finally obtained, the decomposition result is:
[0052]
[0053] For example, the daily new confirmed case data in Los Angeles, USA, is decomposed into two components after being processed by SSD, such as... Figure 2 As shown in (b); the daily new confirmed cases data of San Francisco, USA, after being decomposed by SSD, are divided into 5 components, such as... Figure 2 As shown in (d).
[0054] Furthermore, the multi-branch input network prediction model, namely the Time2Vec-BiLSTM-SA model, has a total of 3 branches. Each branch contains a cascaded Time2Vec module and a BiLSTM module. After feature extraction by the two modules of each branch, the output is formed by the Adding layer, the SA module, and the Dropout layer. The output of the Dropout layer is then passed through a fully connected layer to obtain the predicted value of the daily number of newly confirmed cases. The feature extraction methods of each module in the 3 branches are as follows:
[0055] For the Time2Vec module, the sample sliding window width of this invention is 7, the sliding step size s is 1, and the size of the input matrix of each branch is 7×N, where N is the dimension of the data samples obtained by the three processing methods (the dimension is 1 for the undecomposed method; the dimension for the VMD decomposition method is the number of optimal decomposition components, i.e., 5; the dimension for the SSD decomposition method is the number of decomposition components, which varies depending on the region). The model uses the 7×N matrix before point i as input to predict the number of newly confirmed cases per day from point i to point i+s-1, uses the 7×N matrix before point i+s as input to predict the number of newly confirmed cases per day from point i+s to point i+2s-1, uses the 7×N matrix before point i+2s as input to predict the number of newly confirmed cases per day from point i+2s to point i+3s-1, and so on, continuously making predictions.
[0056] The Time2Vec module can be used to extract periodic and non-periodic features from samples. Setting the embedding dimension k=32, the output is a high-dimensional vector of dimension 32 containing these features. This allows for the acquisition of multi-scale, multi-scale features from newly confirmed daily cases, thus enhancing the model's feature extraction capabilities. The calculation process of the three input branches in the Time2Vec module is as follows:
[0057]
[0058] In the formula: x i (i = 1, 2, 3) represents the daily newly confirmed cases sample input from the three branches. It is an N-dimensional vector of j × N, where j is the time step in each sample window and N is the number of decomposed components of each sample (N is 1 for undecomposed components; N is n = 5 for VMD decomposed components; and N is z for SSD decomposed components). Represents a j×N matrix; ω m and These are learnable parameters; The features at each time step are the input samples from different branches. Embedding each N-dimensional feature into k (k=32) dimensions, the output is... That is, a j×k matrix.
[0059] If the batch size of the training parameters is h, then the outputs of the three Time2Vec modules are all h×j×k, which are used as the inputs of the BiLSTM module.
[0060] For the BiLSTM module, the h×j×k feature matrix is input into the BiLSTM module. By strengthening the connection between historical and future data through forward and backward propagation, the temporal features of the daily newly confirmed cases are extracted. The calculation process is as follows:
[0061]
[0062] In the formula: i = 1, 2, 3; and The input variables for the three branches are the outputs of the forward hidden layer and the backward hidden layer at time t; and These are the weight matrices that map the input layer to the forward hidden layer and the backward hidden layer, respectively. and These are the weight matrices that map the outputs of the forward and backward hidden layers from the previous time step to the current time step, respectively. and These are the biases for the forward hidden layer and the backward hidden layer, respectively; and These are the weight matrices that map the outputs of the forward and backward hidden layers to the output layer, respectively; δt i Use the Tanh activation function; This is the output of the Time2Vec module; The output of the output layer is represented by the input of the three branches h×j×k, which all output h×j×2k after passing through the BiLSTM module. Then, tensor slicing is performed on the output features of each branch to extract all features of the last time step of each sample, thus obtaining the h×2k feature matrix.
[0063] Temporal features extracted by BiLSTM module Feature fusion is performed to obtain the spatiotemporal features F of the daily newly confirmed cases data. C (h×6k), and then the information at different positions in the sequence is associated and interacted with each other through the self-attention mechanism, so as to learn the dependencies in the sequence more comprehensively and focus on the important information in the sequence. The calculation process is shown below.
[0064] F C =f c1 ⊕f c2 ⊕f c3
[0065]
[0066] Randomly initialize the weight matrix W q W k W v The spatiotemporal characteristics of the daily newly confirmed cases data F C Multiplying with the weight matrix yields Q, K, and V; the inner product of matrices Q and K is normalized using the softmax function to obtain the relevance weight matrix, which is then weighted and summed with matrix V to obtain the weight coefficients Z; finally, Z is multiplied by the initialization matrix W to obtain the spatiotemporal feature information F containing the attention mechanism. CSA .
[0067] The spatiotemporal characteristics of the attention mechanism F CSA After regularization by the Dropout layer, neurons are discarded to prevent overfitting, significantly improving the model's generalization ability. Finally, after passing through a fully connected layer, the predicted value y for the daily number of newly confirmed cases is output. i .
[0068] The evaluation metrics used in this invention are: mean squared error (MSE), root mean square error (RMSE), mean absolute error (MAE), mean absolute percentage error (MAPE), and coefficient of determination (R²). 2 The calculation formula is as follows:
[0069]
[0070] in, y represents the actual number of newly confirmed cases each day. i This represents the predicted daily increase in confirmed cases. This represents the average of the actual daily number of newly confirmed cases.
[0071] According to a second aspect of the present invention, an infectious disease trend prediction device based on hybrid decomposition and Time2Vec-BiLSTM-SA model is provided, comprising modules of the infectious disease trend prediction method based on hybrid decomposition and Time2Vec-BiLSTM-SA model described in any one of the above embodiments; specifically comprising: a first module, configured to perform S1: acquiring daily newly confirmed case data of the target infectious disease; smoothing the daily newly confirmed case data to obtain smoothed daily newly confirmed case data; a second module, configured to perform S2: directly constructing a first feature matrix based on the sample sliding window width of the smoothed daily newly confirmed case data; performing L-type decomposition on the smoothed daily newly confirmed case data using a hybrid decomposition algorithm to obtain L-type decomposed daily newly confirmed case component data; constructing a second feature matrix for each of the L-type daily newly confirmed case component data based on the sample sliding window width; a third module, configured to perform S3: constructing a multi-branch input network prediction model; a fourth module, configured to perform S4: using the first feature matrix and L-type second feature matrices as inputs to the multi-branch input network prediction model, and using the multi-branch input network prediction model to output the single-step predicted value of the daily newly confirmed cases.
[0072] As used above, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the system described in the above embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated. For any parts of the modules not described in detail, please refer to the relevant descriptions in this embodiment.
[0073] According to a third aspect of the present invention, a terminal is provided, including a processor, a memory, and a computer program stored in the memory and executable on the processor, the processor being configured to execute the infectious disease trend prediction method based on hybrid decomposition and Time2Vec-BiLSTM-SA model as described in any one of the preceding embodiments.
[0074] In one exemplary embodiment, the terminal may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0075] Example 2: The following describes specific, optional embodiments of the present invention in conjunction with data:
[0076] A method for predicting infectious disease trends based on hybrid decomposition and the Time2Vec-BiLSTM-SA model, specifically including the following steps:
[0077] 1) Data on the number of newly confirmed cases per day in different regions were obtained, specifically including: ① Daily new confirmed case data for eight counties in California, USA, with the dataset collected from February 1, 2020 to September 5, 2022; ② Daily new confirmed case data for India, with the dataset collected from February 19, 2020 to December 14, 2020; ③ Daily new confirmed case data for Italy, with the dataset collected from February 21, 2020 to October 12, 2021.
[0078] The smoothed daily new confirmed case data obtained from each region were used to divide the data into training and test sets, as follows: ① Daily new confirmed case data from eight regions in California, USA: February 1, 2020 – July 11, 2022 as Training Set I, July 12, 2022 – September 5, 2022 as Test Set I; ② Downward trend prediction for Los Angeles, California: February 1, 2020 – July 11, 2022 as Training Set II, July 12, 2022 – September 5, 2022 as Test Set II; ③ Upward + Downward trend prediction for Los Angeles: February 1, 2020 – June 11, 2022 as Training Set. III. Test set III: June 12, 2022 to August 5, 2022; Los Angeles upward trend prediction: February 1, 2020 to May 22, 2022 (Training set IV), May 23, 2022 to July 17, 2022 (Test set IV); ② Daily new confirmed cases data in India: February 19, 2020 to October 15, 2020 (Training set V), October 16 to December 14, 2020 (Test set V); ③ Daily new confirmed cases data in Italy: February 21, 2020 to March 26, 2021 (Training set VI), March 27 to October 12, 2021 (Test set VI);
[0079] 2) The above data was smoothed using a 7-day average to obtain the smoothed daily number of newly confirmed cases.
[0080] 3) Construct the first feature matrix directly based on the sample sliding window width of the smoothed daily new confirmed cases data; decompose the smoothed daily new confirmed cases data using VMD and SSD algorithms respectively to obtain the daily new confirmed cases data component data after VMD decomposition and the daily new confirmed cases data component data after SSD decomposition; construct the second feature matrix for each daily new confirmed cases data component data based on the sample sliding window width;
[0081] In this embodiment of the invention, the number of VMD decomposition components with a correlation coefficient above 0.1 is 5, therefore the optimal number of VMD decomposition components is 5. The number of decomposition components corresponding to the daily new confirmed cases data after SSD decomposition varies for each region; the results obtained from decomposing data from different regions are used as the standard. Taking Los Angeles and San Francisco as examples, the decomposition components after VMD and SSD decomposition are as follows: Figure 2 As shown, the number of VMD components is 5, and the number of SSD decomposition components corresponding to Los Angeles and San Francisco are 2 and 5 respectively.
[0082] The first feature matrix obtained without decomposition is input into branch 1 of the multi-branch input network prediction model, and the second feature matrix obtained after VMD and SSD decomposition is input into branches 2 and 3 of the multi-branch input network prediction model.
[0083] Furthermore, the optional implementation process of the present invention will be described and verified below with reference to experimental data:
[0084] ① Verification with Different Decomposition Methods: To demonstrate the predictive performance of the hybrid decomposition and combination prediction method of this invention compared to the combination of the single-mode decomposition prediction method and the Time2Vec-BiLSTM-SA model, and to verify the adaptability and generalization ability of this invention to different data trends, experiments were conducted on training sets II, III, and IV, and test sets II, III, and IV, using different prediction methods. These experiments included undecomposed prediction, single-mode decomposition prediction, dual-mode decomposition prediction, and the hybrid decomposition and combination prediction method of this invention. (Undecomposed prediction and single-mode decomposition prediction were input into a single-branch Time2Vec-BiLSTM, then sequentially passed through the SA module, Dropout layer, and fully connected layer; dual-mode decomposition prediction involved inputting each decomposition into a single-branch Time2Vec-BiLSTM, then sequentially passing through the Adding layer, SA module, Dropout layer, and fully connected layer). The results covered decreasing, decreasing + increasing, and increasing trends. The prediction error comparison results are as follows: Figure 3 As shown in Table 1, by comparing the prediction results of different decomposition methods for different trends in Los Angeles data, it can be seen that the prediction accuracy of the single decomposition model, ranked from high to low, is VMD, SSD, and the original input. Furthermore, by constructing a combination of two decompositions as VMD+SSD, the method of this invention combines VMD+SSD+the original input.
[0085] Table 1 Error evaluation indicators for different decomposition methods
[0086]
[0087] Analysis shows that when predicting using only smoothed data without decomposition, the MAPE for decreasing, increasing + decreasing, and decreasing trends are 3.971%, 3.985%, and 3.286%, respectively. In contrast, the MAPE of this invention is reduced by 44.57%, 44.768%, and 33.019%, respectively. When using the VMD decomposition method, the MAPE for decreasing, increasing + decreasing, and decreasing trends are 4.848%, 2.941%, and 3.107%, respectively. In contrast, the MAPE of this invention is reduced by 54.60%, 24.311%, and 16.479%, respectively. For the SSD decomposition method, the MAPE for decreasing, increasing + decreasing, and increasing trends are 5.963%, 3.836%, and 5.145%, respectively. In contrast, the MAPE of this invention is reduced by 63.089%, 42.623%, and 49.563%, respectively. When using the VMD+SSD dual-branch input method for prediction, the MAPE for decrease, increase + decrease, and increase were 3.952%, 2.632%, and 4.217%, respectively. In contrast, the MAPE of the present invention was reduced by 44.307%, 15.425%, and 38.463%, respectively. These results demonstrate that the prediction method of the present invention can achieve smaller overall error and higher prediction accuracy under different trends in newly confirmed case data, indicating that the present invention has a good effect on COVID-19 prediction with complex dynamic data characteristics, verifying its strong generalization ability and superior prediction performance.
[0088] ② Validation with different models: The first feature matrix obtained from the daily new confirmed cases data of 8 counties in California, USA (i.e., training set I and test set I without decomposition) is input into branch 1 of the multi-branch input network prediction model. The second feature matrix obtained by VMD and SSD decomposition is input into branches 2 and 3 of the multi-branch input network prediction model. Using the prediction model, the prediction result of the daily new confirmed cases of COVID-19 is output in a single step. Next, to verify the superiority of the present invention in predicting the daily new confirmed cases of COVID-19, the data is input into each split model of the multi-branch input network prediction model for prediction (in Table 2, the model of the present invention is the Time2Vec-BiLSTM-SA model; the difference between "BiLSTM" and the model of the present invention is that the Time2Vec module + BiLSTM module + SA module of the present invention is replaced by a model constructed using only the BiLSTM module). The model described above is as follows: "Time2Vec" differs from the present invention in that it replaces the Time2Vec module + BiLSTM module + SA module of the present invention with a model constructed using only the Time2Vec module; "BiLSTM+SA" differs from the present invention in that it replaces the Time2Vec module + BiLSTM module + SA module of the present invention with a model constructed using the BiLSTM module + SA module; "Time2Vec+SA" differs from the present invention in that it replaces the Time2Vec module + BiLSTM module + SA module of the present invention with a model constructed using the Time2Vec module + SA module; "Time2Vec+BiLSTM" differs from the present invention in that it replaces the Time2Vec module + BiLSTM module + SA module of the present invention with a model constructed using the Time2Vec module + BiLSTM module. The prediction results are shown in the figure below. Figure 5 As shown in Table 2, to more accurately illustrate the prediction results, the error between the predicted and actual daily new confirmed cases in eight counties of California is presented.
[0089] Table 2. Evaluation Indicators of Prediction Errors for 8 Regions Using Different Models
[0090]
[0091] As shown in Table 2, the method proposed in this invention outperforms other combined models in predicting various regions. For example, the coefficient of determination R in Los Angeles... 2 The determination coefficient was 99.468%, higher than BiLSTM's 99.236% and Time2Vec's 90.459%; Riverside's determination coefficient R0 was 99.468%. 2 The determination coefficient reached 99.563%, the highest among all models, higher than BiLSTM (99.460%) and Time2Vec (98.465%); Sacramento's determination coefficient R0 was also the highest.2 The accuracy was 99.325%, significantly better than BiLSTM+SA (98.978%) and Time2Vec (97.296%). This further demonstrates that the combination of self-attention mechanisms significantly enhances the model's prediction accuracy. In summary, the experimental results show that the combination of Time2Vec, BiLSTM, and SA is not a simple superposition, but rather achieves an optimal balance of performance in time series prediction by fully leveraging the advantages of each, thus verifying the superiority of the proposed method.
[0092] ③ Validation of different data preprocessing methods: The first feature matrix obtained from the undecomposed training set V and test set V of the daily new confirmed cases in India is input into branch 1 of the multi-branch input network prediction model. The second feature matrix obtained by VMD and SSD decomposition is input into branches 2 and 3 of the multi-branch input network prediction model. Using the prediction model, the prediction result of the daily new confirmed cases of COVID-19 is output in a single step. Next, to verify the impact of different data preprocessing methods on the prediction performance of the daily new confirmed cases of COVID-19, the data is subjected to different smoothing preprocessing and then input into the Time2Vec-BiLSTM-SA model proposed in this invention for prediction. The prediction effect is shown in the figure below. Figure 6 As shown in Table 3, to more accurately illustrate the prediction results, the errors between the predicted and actual daily new confirmed cases in India under different preprocessing methods are presented.
[0093] Table 3. Evaluation Indicators of Prediction Errors for Different Data Preprocessing Methods in India
[0094] Data preprocessing methods MSE RMSE MAE MAPE / % <![CDATA[R 2 / % <!-- 12 -->]]> Unsmoothing 2566425.119 1601.382 1319.888 3.144 96.581 3-day average smoothing 1706332.640 1306.266 964.487 2.292 97.492 7-day mean smoothing 1008575.838 1004.278 737.787 1.803 98.462
[0095] Table 3 shows that the prediction accuracy of the unsmoothed data is low, especially with an MSE of 2,566,425.119 and a root mean square error (RMSE) of 1,601.382, significantly higher than the smoothed values. This indicates that the unsmoothed data exhibits greater volatility and error. In contrast, after using 3-day mean smoothing, all indicators improved significantly, with the MSE decreasing to 1,706,332.640, a reduction of 33.513%. This demonstrates that smoothing effectively reduced data volatility, thereby lowering the model's prediction error. After 7-day mean smoothing, the indicators were further optimized, with the MSE decreasing to 1,008,575.838, a reduction of 40.892%, and the MAPE decreasing to 1.803%, indicating a significant reduction in error and R². 2The accuracy rate was improved to 98.462%. This indicates that the method not only effectively reduced prediction errors but also improved prediction accuracy. Therefore, for time series prediction of daily new confirmed cases of COVID-19, 7-day mean smoothing performs best in reducing noise, improving model stability and accuracy. However, simulations show that if the mean is longer than 7 days, it reduces the randomness and complexity of the data, which may prevent the model from capturing enough features for effective prediction. A larger smoothing window also introduces a significant lag effect, meaning that the smoothed values will delay reflecting changes in the actual data.
[0096] ④ Longer Test Set Validation: To verify the effectiveness of this invention in predicting the daily number of newly confirmed COVID-19 cases using a longer test set, the first feature matrix obtained from the undecomposed training set VI and test set VI of the daily newly confirmed cases in Italy was input into branch 1 of the multi-branch input network prediction model. The second feature matrix obtained through VMD and SSD decomposition was input into branches 2 and 3 of the multi-branch input network prediction model. The Time2Vec-BiLSTM-SA model proposed in this invention was used for prediction, and the prediction results are shown in the figure below. Figure 7 As shown in Table 4, to more accurately illustrate the prediction results, the error between the predicted and actual daily new confirmed cases in Italy over a 200-day test set is presented.
[0097] Table 4. Evaluation Indicators for 200-Day Forecast Errors in Italy
[0098] Dataset Data preprocessing methods test set length MSE RMSE MAE MAPE / % <![CDATA[R 2 / %]]> Italy 7-day mean smoothing 200 days 323404 568.686 458.152 11.336 98.982
[0099] As shown in Table 4, on the 200-day test set, the model of this invention, combined with a 7-day sliding window, achieved the best overall performance, with error indices of MAE = 1319.888, RMSE = 1601.382, and MAPE = 3.144%. This verifies that the model proposed in this invention is also suitable for long-term series forecasting, effectively capturing short-term fluctuations while maintaining the accuracy of long-term trends, demonstrating strong robustness and generalization ability.
[0100] The specific embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Within the scope of knowledge possessed by those skilled in the art, various changes can be made without departing from the spirit of the present invention.
Claims
1. A method for predicting infectious disease trends based on hybrid decomposition and the Time2Vec-BiLSTM-SA model, characterized in that, Includes the following steps: S1. Obtain daily new confirmed case data for the target infectious disease; smooth the daily new confirmed case data to obtain smoothed daily new confirmed case data. S2. Construct the first feature matrix directly based on the sample sliding window width of the smoothed daily newly confirmed case data; simultaneously, decompose the smoothed daily newly confirmed case data using VMD and SSD decomposition algorithms to obtain two decomposed daily newly confirmed case component data; construct the second feature matrix 1 for the daily newly confirmed case component data under the VMD branch based on the sample sliding window width, and construct the second feature matrix 2 for the daily newly confirmed case component data under the SSD branch based on the sample sliding window width. S3. Construct a multi-branch input network prediction model; S4. Use the first feature matrix, the second feature matrix 1, and the second feature matrix 2 as inputs to the multi-branch input network prediction model, and use the multi-branch input network prediction model to output the predicted value of the daily number of newly confirmed cases in a single step. The multi-branch input network prediction model has a total of 1+ L There are branches, each containing a cascaded Time2Vec module and a BiLSTM module. The size of the input feature matrix for each branch is . j × N The feature matrix is input into each branch to extract the temporal features of the daily newly confirmed cases; the extracted temporal features are fused through the Adding layer to obtain the spatiotemporal features of the daily newly confirmed cases data. The spatiotemporal features are then passed sequentially through the SA module and the Dropout layer to form the output. The output of the Dropout layer is then passed through a fully connected layer to obtain the predicted value of the daily new confirmed cases for a single step. j The width of the sample sliding window. N 1+ L The dimension of the data samples obtained by each processing method; among which, L =2.
2. The infectious disease trend prediction method based on hybrid decomposition and Time2Vec-BiLSTM-SA model according to claim 1, characterized in that, The smoothing process is a 7-day average smoothing process.
3. The infectious disease trend prediction method based on hybrid decomposition and Time2Vec-BiLSTM-SA model according to claim 1, characterized in that, The method for determining the optimal number of VMD decomposition components when using the VMD decomposition algorithm to decompose the smoothed daily new confirmed case data is as follows: Set an initial value for the optimal number of decomposition components of VMD. Starting from this initial value, the VMD decomposition is performed on the smoothed daily new confirmed case data by sequentially increasing the value of the optimal number of decomposition components of VMD. The decomposed components are then compared with the smoothed daily new confirmed case data to obtain correlation coefficients. These correlation coefficients are then compared with a preset threshold until a correlation coefficient is found to be less than the preset threshold, at which point the increase in the value of the optimal number of decomposition components of VMD is stopped. The maximum number of optimal decomposition components of the VMD corresponding to the condition that the correlation coefficient is greater than a preset threshold is taken as the final number of optimal decomposition components of the VMD.
4. The infectious disease trend prediction method based on hybrid decomposition and Time2Vec-BiLSTM-SA model according to claim 1, characterized in that, The number of SSD decomposition components is adaptive.
5. The infectious disease trend prediction method based on hybrid decomposition and Time2Vec-BiLSTM-SA model according to claim 1, characterized in that, The infectious disease trend prediction method based on hybrid decomposition and Time2Vec-BiLSTM-SA model was used to predict the number of newly confirmed cases of COVID-19 daily.
6. An infectious disease trend prediction device based on hybrid decomposition and the Time2Vec-BiLSTM-SA model, characterized in that, The module includes the infectious disease trend prediction method based on hybrid decomposition and Time2Vec-BiLSTM-SA model as described in any one of claims 1-5.
7. A terminal, characterized in that, The invention includes a processor, a memory, and a computer program stored in the memory and executable on the processor, the processor being configured to perform the infectious disease trend prediction method based on hybrid decomposition and the Time2Vec-BiLSTM-SA model as described in any one of claims 1-5.
Citation Information
Patent Citations
Photovoltaic power ultra-short-term prediction method based on multi-mode decomposition and multi-branch input
CN116995670A
Early warning method for novel coronavirus epidemic based on improved triple exponential smoothing model and LSTM model
WO2022160370A1