Method for predicting epidemic trend of respiratory infectious diseases by using multi-source heterogeneous data based on LSTM (Long Short Term Memory)
Through the multi-source heterogeneous data prediction method based on LSTM, combined with different data sources and whale optimization algorithms, the problem that a single data source cannot fully reflect the spread of infectious diseases is solved, and a more accurate and rapid prediction of the epidemic trend of respiratory infectious diseases is achieved. Provide support for public health decisions.
Patent Information
- Application Number
- CN202410829113.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-11-12
AI Technical Summary
A single data source cannot fully reflect the spread of infectious diseases, and traditional prediction methods are difficult to capture complexity and nonlinear relationships, resulting in distortion and delay in prediction results.
The multi-source heterogeneous data prediction method based on LSTM is adopted, combined with case reports, mobile data, social media and meteorological data, and the LSTM model is optimized through whale optimization algorithm to improve the prediction accuracy and adaptability of the model.
Achieve more accurate and rapid forecasts of the epidemic trend of respiratory infectious diseases, providing more comprehensive and reliable information to support public health decisions.
Smart Images

Figure CN118942724A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of infectious disease prediction, and specifically to a method for predicting the epidemic trend of respiratory infectious diseases by using multi-source heterogeneous data based on LSTM. Background Art
[0002] A single data source often cannot fully reflect the true situation of infectious disease transmission. The development of infectious diseases is affected by many factors, such as region, climate, population density, etc. It is difficult to fully consider these factors with a single data source, resulting in distorted prediction results. In addition, a single data source may not be able to quickly obtain the latest data when responding to sudden infection transmission, thereby delaying the best time for prediction. Compared with traditional prediction methods, artificial intelligence has significant advantages in infectious disease prediction. Traditional prediction methods usually cannot capture the complexity and nonlinear relationships in the process of infectious disease transmission. Artificial intelligence, especially deep learning algorithms, can process large amounts of data, identify complex patterns and trends, and take into account various influencing factors. At the same time, it can quickly adapt to new data and changes through self-learning and optimization, update prediction results in real time, and continuously improve the accuracy and reliability of predictions, providing timely and effective support for the prevention and control of infection transmission. Therefore, combining multi-source data and artificial intelligence prediction methods will help to more accurately predict the development trend of respiratory infectious diseases. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a method for predicting the epidemic trend of respiratory infectious diseases by using multi-source heterogeneous data based on LSTM.
[0004] The specific scheme of the present invention is as follows: A method for predicting the epidemic trend of respiratory infectious diseases using multi-source heterogeneous data based on LSTM comprises the following steps:
[0005] Step 1: Collect daily comprehensive feature data related to the target infectious disease from multiple data source target areas. The comprehensive feature data includes case report data, mobile data, social media data, and meteorological data. Aggregate the comprehensive data for multiple days to obtain the initial feature set for training;
[0006] Step 2: Preprocess the data in the initial feature set for training, filter, scale and normalize the data to obtain the preprocessed training data set;
[0007] Step 3: Input the training set into the LSTM model, and the LSTM model outputs the prediction results of the infectious disease case data for the day. By minimizing the error between the number of reported cases predicted by the model and the number of actual reported cases, the trained target infectious disease outbreak prediction LSTM model is obtained.
[0008] Step 4: Collect comprehensive data related to the target infectious disease on the day from multiple data source target areas to obtain an initial data set to be predicted; after data screening of the initial data set to be predicted, obtain the comprehensive data of the day as a feature data set;
[0009] Step 5: Input the feature data set into the trained target infectious disease outbreak prediction LSTM model and output the prediction results of the case data for that day.
[0010] Furthermore, in step 2, the method for screening data includes the following steps:
[0011] Step 2.1: Filter out features with high missing frequencies, remove duplicate features, and exclude features with serious data missing;
[0012] Step 2.2: Perform Spearman rank correlation analysis on the characteristic variables to obtain the correlation degree between each characteristic variable and the target variable, and screen out characteristic variables that are strongly correlated with the target variable, that is, those that satisfy the correlation coefficient > 0.5.
[0013] Furthermore, in step 3, the whale optimization algorithm is used to train the LSTM model. The specific steps are:
[0014] Step 3.1, Initialize parameters: For each individual whale, generate a random probability value P and a random coefficient A. P is generated by np.random.random(self.dim), which takes a random value between 0 and 1. A and C are calculated by the formula A=2*a*r1-a and C=2*r2, where a decreases from 2 to 0 as the number of iterations increases, and r1 and r2 are two random numbers.
[0015] Step 3.2, surround the prey: If P is greater than or equal to 0.5, the individual whale will perform the behavior of surrounding the prey, calculate the distance d between the current whale and the optimal whale, update the position of the whale, and use the formula x1=A*d, which means that the whale moves towards the position of the optimal whale.
[0016] Step 3.3, search for prey: If P is less than 0.5 and A is greater than or equal to 1, the individual whale will perform the search for prey behavior, select a random position x3 = np.random.uniform(self.bounds[:,0], self.bounds[:,1], size = self.dim), update the position of the whale, and use the formula x4 = self.agents[i]-A*d, which means that the whale moves randomly in the solution space;
[0017] Step 3.4, capture prey: If P is less than 0.5 and A is less than 1, the whale individual will perform the capture behavior and update the whale's position using the formula agent_new = np.where(np.random.random(self.dim)<0.5,x1,x2), which means that the whale approaches the prey in a spiral manner;
[0018] Step 3.5, position update: According to the random probability P, decide which moving direction to use to update the current whale's position, and use np.clip to ensure that the whale's new position does not exceed the boundary of the search space;
[0019] Step 3.6, update the optimal solution: if the objective function value of the new position is better than the current optimal whale position, then update the optimal whale position;
[0020] Step 3.7, save the current number of iterations and the objective function value of the current optimal solution, add 1 to the number of iterations, and determine whether the number of iterations has reached the maximum number of iterations. If so, output the objective function value of the optimal solution obtained by the last iteration, otherwise return to step 3.1.
[0021] The beneficial effects of the present invention are:
[0022] (1) The present invention integrates data from different sources and different types into a real-time prediction model for a respiratory infectious disease, and considers the weight of the impact of different data on a respiratory infectious disease; the use of multi-source heterogeneous data can provide more comprehensive and accurate information, thereby improving the prediction accuracy of the model. For example, data from different regions, different time periods, different populations, and different diseases can be used to better understand the laws of disease transmission.
[0023] (2) The WOA-LSTM model is an innovative model that combines the Whale Optimization Algorithm (WOA) with the Long Short-Term Memory (LSTM). The WOA algorithm can more efficiently search the parameter space and find a better combination of parameters, thereby improving the performance of the model and performing better when faced with complex time series data. By comparing and analyzing the prediction effects of each model, it is found that the WOA-LSTM method has higher prediction accuracy and better results, and can better reflect the true level of a certain respiratory infectious disease.
[0024] (3) The establishment of this model can provide a faster, more accurate and more reliable method to predict the daily incidence of the disease based on external data, thereby providing support for public health decision-making. For example, corresponding prevention and control measures can be formulated based on the model's prediction results to avoid further spread of the infection.
[0025] (4) The model can be applied to different scenarios and fields, for example, it can be used to predict the spread trend of other diseases or for time series prediction in other fields. Therefore, the establishment of this model has important application value. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 The present invention is a flow chart of the method. DETAILED DESCRIPTION
[0027] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than the entire embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] like Figure 1 As shown, a method for predicting the epidemic trend of respiratory infectious diseases using multi-source heterogeneous data based on LSTM includes the following steps:
[0029] Step 1. Data collection.
[0030] Collect data related to infectious diseases in the target area from multiple data sources, including case report data, mobile data, social media data, meteorological data, etc. a. Case report data collection unit, used to obtain case report data from health departments or relevant institutions; b. Mobile data collection unit, used to obtain users' mobile data from mobile operators; c. Social media data collection unit, used to obtain text, pictures and other data related to the spread of infection from social media platforms; d. Meteorological data collection unit, used to obtain meteorological data from meteorological departments.
[0031] In this embodiment, the target area is a city; the data is collected on a daily basis; the case report data include infectious disease detection positivity rate and other respiratory infectious disease outpatient visit rates; the mobility data include daily in-migration index and out-migration index in the target area; the social media data include Baidu search index of related keywords; the meteorological data include daily temperature, relative humidity, wind speed, visibility, atmospheric pressure, and air quality index (AQI).
[0032] Step 2. Data preprocessing
[0033] Data processing and cleaning: filter out features with high missing frequencies; screen out duplicate variables; exclude variables with serious missing data.
[0034] The Spearman rank correlation analysis was performed on the characteristic variables to obtain the correlation degree between each characteristic variable and the target variable, and the characteristic variables that were strongly correlated with the target variable (correlation coefficients were all > 0.5) were screened out.
[0035] Step 3. Data preparation
[0036] The filtered features are combined into a new dataset. The dataset is divided according to the time series, 80% of which is used for training the model and 20% for validating the model.
[0037] The collected data were processed by cleaning, filling, scaling and normalization.
[0038] 1. Data Scaling
[0039] The original data is converted to between 0 and 1 according to a certain ratio, eliminating the differences in characteristic attributes such as dimensions and orders of magnitude between different samples, and converted into a dimensionless relative value. The resulting characteristic values of each sample are at the same order of magnitude.
[0040] 2. Data Normalization
[0041] Min-Max normalization, also known as the range method, is the simplest method for dealing with dimensional problems. It scales the values of a column in the data set to between 0 and 1. The calculation formula is as follows:
[0042]
[0043] Among them, x′ represents the result after normalization; x represents the unnormalized data; x max Indicates the maximum value in the corresponding feature data; x min Indicates the minimum value in the corresponding feature data.
[0044] Step 4. LSTM model establishment.
[0045] The model mainly consists of two parts: preprocessing stage and prediction stage, in which the prediction stage includes prediction module and correction module.
[0046] Preprocessing module: First, the data set is normalized to improve the speed of gradient descent solution and eliminate the adverse effects caused by the large numerical range of the data. Then, in order to improve the disadvantage of the single feature of the data set, the idea of sliding window is used to reconstruct the data set.
[0047] Prediction module: The processed data set is trained through the improved LSTM model, and then the output result is used as input to the Transformer model. LSTM can obtain the time dependency of the time series data set. The Transformer model can make up for the shortcomings of the LSTM cell state matrix, which has a fixed dimension and can only accommodate certain information. When the given sequence information is too long, it cannot be preserved after multiple layers. The models are connected by a fully connected layer.
[0048] The first step in building the LSTM model is to input h t-1 and x t , output a number between 0 and 1. 1 means "keep this value completely", while 0 means "throw away this value completely".
[0049] f(t)=σ(W f ·[h t-1 ,x t ])+b f
[0050] The second step has two parts: a sigmoid layer that calls the "input gate" to decide which data needs to be updated; and a tanh layer that creates a vector for the new candidate values.
[0051] i t =σ(W i ·[h t-1 ,x t ]+b i
[0052]
[0053] After deciding which memories need to be discarded and which need to be added, the current state can be updated and new long-term memory information can be formed.
[0054]
[0055] Finally, we need to decide what to output, that is, from the new long-term information C t Filter out the short-term information h that is most suitable for the current time step t .
[0056] o t =σ(W o ·[h t-1 ,x t ]+b o
[0057] h t =o t *tamh(C t )
[0058] Step 5. Select the local optimal parameters of the LSTM model according to the whale optimization algorithm.
[0059] Whale Optimization Algorithm (WOA) is a new swarm intelligence optimization algorithm inspired by the predation behavior of humpback whales. WOA simulates the behaviors of humpback whales such as surrounding prey, attacking with bubble nets, and searching for prey, and searches for the optimal solution in the solution space. The specific algorithm flow in this study is as follows:
[0060] 1. Initialization parameters:
[0061] For each individual whale, generate a random probability value P and a random coefficient A.
[0062] P is generated by np.random.random(self.dim) and takes random values between 0 and 1.
[0063] A and C are calculated by the formula A=2*a*r1-a and C=2*r2, where a decreases from 2 to 0 as the number of iterations increases, and r1 and r2 are two random numbers.
[0064] 2. Surround the prey:
[0065] If P is greater than or equal to 0.5, the individual whale will perform the prey encirclement behavior.
[0066] Calculate the distance d between the current whale and the best whale.
[0067] Update the whale’s position using the formula x1=A*d, which means the whale moves towards the optimal whale’s position.
[0068] 3. Searching for prey:
[0069] If P is less than 0.5 and A is greater than or equal to 1, the individual whale will perform prey search behavior.
[0070] Choose a random position x3 = np.random.uniform(self.bounds[:,0],self.bounds[:,1],size=self.dim).
[0071] Update the whale’s position using the formula x4 = self.agents[i] - A*d, which means the whale moves randomly in the solution space.
[0072] 4. Capturing prey:
[0073] If P is less than 0.5 and A is less than 1, the individual whale will perform prey capture behavior.
[0074] Update the whale’s position using the formula agent_new = np.where(np.random.random(self.dim)<0.5,x1,x2) , which indicates that the whale is approaching its prey in a spiral.
[0075] 5. Location Update:
[0076] According to the random probability P, decide which moving direction to use to update the current whale position.
[0077] Use np.clip to ensure that the whale’s new position does not exceed the boundaries of the search space.
[0078] 6. Optimal solution update:
[0079] If the objective function value of the new position is better than the current optimal whale position, then update the optimal whale position.
[0080] 7. Iteration process:
[0081] Repeat the above steps until the specified number of iterations num_iterations is reached. After each iteration, the current number of iterations and the objective function value of the current optimal solution are printed. Finally, the optimize method returns the position of the optimal whale, which is the optimal solution of the objective function.
[0082] Step 6. Evaluation of model prediction effect.
[0083] The mean absolute error (MAE), mean square error (MSE) and root mean square error (RMSE) were used to compare the prediction effects of different models.
[0084] MAE is the average of the absolute values of the differences between the predicted values and the true values. It indicates the average error of the predicted values and is not affected by positive or negative errors. The smaller the MAE, the higher the prediction accuracy of the model. The formula is:
[0085]
[0086] Where: y i is the true value of the ith observation point, is the corresponding predicted value and n is the total number of observations.
[0087] MSE is the average of the squares of the differences between the predicted value and the true value. MSE gives greater weight to larger errors and is therefore more affected by outliers. The smaller the MSE, the higher the prediction accuracy of the model. The formula is:
[0088]
[0089] Where: y i is the true value of the ith observation point, is the corresponding predicted value and n is the total number of observations.
[0090] RMSE is the square root of the mean square error. RMSE has the same unit as the original data, so it can intuitively represent the deviation between the predicted value and the true value. The smaller the RMSE, the higher the prediction accuracy of the model. The formula is:
[0091]
[0092] Where: y i is the true value of the ith observation point, is the corresponding predicted value and n is the total number of observations.
[0093] Examples:
[0094] This example uses various monitoring data from a city during the rebound period of infection and spread of a new respiratory infectious disease from April to June 2023. After preprocessing the multi-source data, a deep learning LSTM model is established, the LSTM parameters are optimized using the whale optimization method, and compared with several other artificial intelligence models.
[0095] (1) Data sources include: various monitoring data on the infection and spread of a new respiratory infectious disease in a certain city during the rebound period from April to June 2023, including infection and spread report data, sewage detection data, Baidu search data, symptom data, etc. The data obtained in the database are sorted and classified to extract the available data on a daily basis.
[0096] (2) Data preprocessing: Data processing and cleaning: Filter out features with high missing frequencies; screen out duplicate variables; exclude cases with serious data missing, and screen out symptom-related data, sewage monitoring data, and Baidu search data feature variables.
[0097] The Spearman rank correlation analysis was performed on the characteristic variables to obtain the correlation between each characteristic variable and the target variable. The results showed that except for the Baidu search keyword "fever" (correlation coefficient = 0.345), the remaining characteristic variables were strongly correlated with the target variable (correlation coefficients were all > 0.5), and the correlation coefficients were: number of patients visiting the fever clinic > virus concentration in sewage > nucleic acid test positive rate > Baidu search keyword "a new respiratory infectious disease" > Baidu search keyword "cough" > Baidu search keyword "fever".
[0098] Descriptions of characteristic variables and Spearman correlation coefficients are shown in the table.
[0099] Table 1 Spearman rank correlation analysis between the number of confirmed cases of a new respiratory infectious disease (target variable, l abe l) and the characteristic variable
[0100]
[0101] Based on various monitoring data during the rebound period of infection and spread of a new respiratory infectious disease in a certain city, we tried to use a variety of artificial intelligence methods to establish an infection spread prediction model, using the linear regression (LR) model as a representative linear model method, the random forest (RF) model and the extreme gradient boosting (XGBoost) model as representative tree classification-based methods, and the long short-term memory recursive neural network (LSTM) neural network method as a representative artificial neuron connection-based method. The whale optimization method was used to find the optimal parameters to predict the infection spread.
[0102] Analysis process and description
[0103] ##(1). Read data
[0104] #Import data and make sure the data is sorted by date
[0105] ##(2). Clean and fill the data, calculate the Spearman rank correlation coefficient, and scale and normalize the data.
[0106] ##(3). Training set and test set division
[0107] Combine the filtered features into a new dataset. Divide the dataset into time series, 80% for training the model and 20% for validating the model. Convert the data into tensors and create a data loader.
[0108] ##(4).Build WOA-LSTM model
[0109] Preprocessing module: First, the data set is normalized to improve the speed of gradient descent solution and eliminate the adverse effects caused by the large numerical range of the data. Then, in order to improve the disadvantage of the single feature of the data set, the idea of sliding window is used to reconstruct the data set.
[0110] Prediction module: The processed data set is trained through the LSTM model, which can obtain the time dependency of the time series data set. The models are connected by a fully connected layer.
[0111] #Hyperparameter setting, model parameter settings are shown in Table 2.
[0112] Table 2 LSTM modeling process hyperparameter settings and value ranges
[0113] optimizer Adam batch_size 1,4,8,16 hidden_size 10-200 dropout 0.1-0.5 num_layers 1-3 learning_rate 0.001-0.01 epochs 20 - 200 with step=20 activation function Sigmoid, Tanh
[0114] The parameters of the LSTM model are adjusted according to the whale optimization algorithm, and an iterative search is performed according to the range of the LSTM model hyperparameters. The values of these hyperparameters are continuously updated, and the performance of each set of hyperparameters is evaluated according to the objective function (such as the accuracy of the model or the loss function value), and finally the optimal set of hyperparameters is obtained:
[0115] hidden_size=102,num_layers=1,dropout=0.2605558813125617,learning_rate=0.001
[0116] This example observes the performance of 7 machine learning models in terms of MAE, MSE, and RMSE indicators. Taking into account the model operation results, the WOA-LSTM model performs best among the 7 machine learning models.
[0117] The operating result indicators of each machine learning model are shown in Table 3.
[0118] Table 3 Model prediction performance for the spread of a new respiratory infectious disease in a city from April to June 2023
[0119]
[0120] in conclusion
[0121] Traditional respiratory infectious disease prediction methods mainly rely on a single data source, such as case report data, which cannot fully reflect the true situation of infection transmission. In addition, when responding to sudden infection transmission, traditional methods often cannot quickly obtain the latest data, resulting in inaccurate prediction results. The multi-source heterogeneous respiratory infectious disease prediction model based on the WOA-LSTM model combines the existing multi-source data well, identifies complex patterns and trends, and takes into account various influencing factors. Through self-learning and optimization, it continuously improves the accuracy and reliability of predictions. Therefore, combining multi-source data and the WOA-LSTM prediction method will help to more accurately predict the development trend of respiratory infectious diseases and provide an important basis for formulating scientific and reasonable prevention and control strategies.
[0122] 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 principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for predicting the epidemic trend of respiratory infectious diseases using multi-source heterogeneous data based on LSTM, characterized in that: The following steps are involved: Step 1: Collect daily comprehensive feature data related to the target infectious disease from multiple data source target areas. The comprehensive feature data includes case report data, mobile data, social media data, and meteorological data. Aggregate the comprehensive data for multiple days to obtain the initial feature set for training; Step 2: Preprocess the data in the initial feature set for training, filter, scale and normalize the data to obtain the preprocessed training data set; Step 3: Input the training set into the LSTM model, and the LSTM model outputs the prediction results of the infectious disease case data for the day. By minimizing the error between the number of reported cases predicted by the model and the number of actual reported cases, the trained target infectious disease outbreak prediction LSTM model is obtained. Step 4: Collect comprehensive data related to the target infectious disease on the day from multiple data source target areas to obtain an initial data set to be predicted; after data screening of the initial data set to be predicted, obtain the comprehensive data of the day as a feature data set; Step 5: Input the feature data set into the trained target infectious disease outbreak prediction LSTM model and output the prediction results of the case data for that day.
2. The method for predicting the epidemic trend of respiratory infectious diseases using multi-source heterogeneous data based on LSTM according to claim 1 is characterized in that: In step 2, the method for filtering data includes the following steps: Step 2.1: Filter out features with high missing frequencies, remove duplicate features, and exclude features with serious data missing; Step 2.2: Perform Spearman rank correlation analysis on the characteristic variables to obtain the correlation degree between each characteristic variable and the target variable, and screen out characteristic variables that are strongly correlated with the target variable, that is, those that satisfy the correlation coefficient > 0.
5.
3. The method for predicting the epidemic trend of respiratory infectious diseases using multi-source heterogeneous data based on LSTM according to claim 1 is characterized in that: In step 3, the whale optimization algorithm is used to train the LSTM model. The specific steps are: Step 3.1, Initialize parameters: For each individual whale, generate a random probability value P and a random coefficient A. P is generated by np.random.random(self.dim), which takes a random value between 0 and 1. A and C are calculated by the formula A=2*a*r1-a and C=2*r2, where a decreases from 2 to 0 as the number of iterations increases, and r1 and r2 are two random numbers. Step 3.2, surround the prey: If P is greater than or equal to 0.5, the individual whale will perform the behavior of surrounding the prey, calculate the distance d between the current whale and the optimal whale, update the position of the whale, and use the formula x1=A*d, which means that the whale moves towards the position of the optimal whale. Step 3.3, search for prey: If P is less than 0.5 and A is greater than or equal to 1, the individual whale will perform the search for prey behavior, select a random position x3 = np.random.uniform(self.bounds[:,0], self.bounds[:,1], size = self.dim), update the position of the whale, and use the formula x4 = self.agents[i]-A*d, which means that the whale moves randomly in the solution space; Step 3.4, capture prey: If P is less than 0.5 and A is less than 1, the whale individual will perform the capture behavior and update the whale's position using the formula agent_new = np.where(np.random.random(self.dim)<0.5,x1,x2), which means that the whale approaches the prey in a spiral manner; Step 3.5, position update: According to the random probability P, decide which moving direction to use to update the current whale's position, and use np.clip to ensure that the whale's new position does not exceed the boundary of the search space; Step 3.6, update the optimal solution: if the objective function value of the new position is better than the current optimal whale position, then update the optimal whale position; Step 3.7, save the current number of iterations and the objective function value of the current optimal solution, add 1 to the number of iterations, and determine whether the number of iterations has reached the maximum number of iterations. If so, output the objective function value of the optimal solution obtained by the last iteration, otherwise return to step 3.1.
Citation Information
Cited By
Intelligent infectious disease monitoring and early warning disposal system and method
CN119153126A
Virus propagation prediction method based on neural network
CN119851973A
