Analysis method for predicting number of pediatric asthma patients based on LSTM (Long Short Term Memory) model
By using the stacked neural network model of LSTM and Attention mechanisms in predicting the number of children's asthma doctor visits, combined with the random forest algorithm, the deficiencies of the traditional model in terms of expression ability and time series modeling are solved, and accurate prediction of the number of children's asthma doctor visits is achieved. Prediction and assessment of complex causes improve prediction accuracy and interpretability.
Patent Information
- Application Number
- CN202410731308.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-03
AI Technical Summary
In the existing technology, traditional models have limited expressive capabilities in capturing the complex nonlinear relationships and high-order interactive effects between disease incidence and environmental changes, are difficult to effectively predict the number of childhood asthma visits, and lack dynamic modeling of time series data. Segmented forecasting support for capabilities and specific disease types.
A stacked neural network model based on LSTM is used, combined with the Attention mechanism and the random forest algorithm, to build a multi-factor prediction model, capture long-term dependencies and periodic patterns in time series data, and perform feature screening on multi-pollutant data to achieve Accurate prediction of asthma doctor visits in children.
It improves the prediction accuracy and generalization ability, can better capture the dynamic trends and complex causes of disease incidence, provides more valuable decision support, and enhances the interpretability and scope of application of the model.
Smart Images

Figure CN118588301A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of prediction analysis, and more specifically, relates to an analysis method for predicting the number of children with asthma seeking medical treatment based on an LSTM model. Background Art
[0002] The patent "An Analytical Prediction Model of the Impact of Environmental Changes on Disease Onset" (application number CN201510170135.7) discloses an analytical prediction model of the impact of environmental changes on disease onset, which specifically includes: by analyzing the correlation between outpatient volume data and meteorological changes and environmental pollution data, a quantitative analysis model of the impact of environmental changes on disease incidence based on a non-parametric Poisson regression model is constructed, and on this basis, a prediction model of the impact of environmental changes on outpatient volume based on a support vector regression machine is constructed to predict the weekly outpatient volume of each department of the hospital. Patients can avoid the impact of adverse meteorological conditions and environmental pollution factors that cause disease in advance, and arrange daily activities reasonably: hospitals can reasonably allocate medical resources and manpower for each department for high-incidence diseases; public health departments can make emergency preparations in advance, etc., and intervene in specific populations in advance, thereby reducing the incidence of diseases and improving the quality of human life.
[0003] In the existing technology, traditional machine learning models such as non-parametric Poisson regression model and support vector regression machine are used to try to establish a quantitative analysis model, which can quantitatively evaluate the impact of environmental changes on disease incidence and provide a basis for formulating corresponding countermeasures; it combines two important environmental influencing factors, meteorological change and environmental pollution, and can better reflect the changes in the macro environment. However, there are some major shortcomings: the model has limited expression ability and it is difficult to effectively capture the complex nonlinear relationship and high-order interaction effects between disease incidence and environmental changes. These traditional models are usually based on simple linear or kernel functions and cannot fully explore potential deep-level connection patterns. The model lacks the ability to dynamically model time series data and cannot well capture the long-term trend and cyclical fluctuation characteristics of disease incidence, which brings difficulties to long-term disease monitoring and medical resource allocation. The existing model predicts the overall outpatient volume, lacks the segmentation of specific disease types and patient populations, and is difficult to provide accurate decision support for disease prevention and intervention for specific populations.
[0004] Therefore, there is an urgent need for a new analytical method based on the LSTM model to predict the number of children with asthma. Summary of the invention
[0005] The present invention proposes an analysis method for predicting the number of children with asthma based on the LSTM model. The disease incidence prediction model based on LSTM can better overcome the shortcomings of the existing technical solutions, improve the prediction accuracy, generalization ability and practical application value of the model, and is a promising technical solution.
[0006] LSTM is a recurrent neural network structure that can capture long-term dependencies and periodic patterns in time series data, thereby more accurately modeling and predicting the dynamic trends of disease incidence. LSTM has powerful nonlinear mapping capabilities and can automatically learn the complex functional relationship between input variables and target variables, which effectively solves the problem of limited expressive power of traditional models. By adjusting and expanding the LSTM model, segmented predictions of different disease types and populations can be achieved, providing more valuable decision-making basis for accurate disease prevention and intervention measures. The black box nature of the LSTM model is relatively weak, and changes in the internal state of the model are relatively explainable, which helps to analyze key influencing factors and their mechanisms of action, and provide clues for a deeper understanding of the causes of the disease.
[0007] In order to solve at least one of the above technical problems, according to one aspect of the present invention, an analysis method for predicting the number of children with asthma based on an LSTM model is provided, a stacked LSTM model structure is set, and the multi-pollutant lagged concentration data set and the single-factor and multi-factor models are predicted separately.
[0008] The method specifically comprises the following steps:
[0009] Step 1: Obtain the data on the number of children with asthma and the original data set of pollutants in the target area through the data information system;
[0010] Step 2: Clean the collected data, including processing missing data, erroneous data and abnormal data;
[0011] Step 3: Decide whether to use a single factor prediction model or a multi-factor prediction model based on the preprocessed data set; if it is a single factor prediction model, go to step 4; if it is a multi-factor prediction model, go to step 7;
[0012] Step 4: Normalize the preprocessed data set and build a sliding window;
[0013] Step 5: Send the sliding window into the LSTM+Attention model for training to obtain a trained model;
[0014] Step 6: Input the patient number data to be predicted into the trained LSTM+Attention model to obtain the prediction result of the patient number data to be predicted;
[0015] Step 7: For the preprocessed data, use random forest to perform feature screening to identify the meteorological conditions and lagged days related to the number of asthma patients, and construct a multi-pollutant dataset;
[0016] Step 8: Normalizing the multi-pollutant data set to accelerate gradient descent;
[0017] Step 9: Send the normalized data set into the stacked LSTM model to obtain a trained model;
[0018] Step 10: Using a stacked LSTM model, the multi-pollutant dataset is processed to capture multi-dimensional features, thereby obtaining a prediction result of the number of patients.
[0019] For the data collection and preprocessing stage, including:
[0020] Obtain the historical data of the number of children with asthma and record it as the number of patients: y = [y1, y2, ..., y n ], n is the length of the patient number data y; obtain the pollutant factor data set X with the same date as the historical data of the number of children with asthma, recorded as X = [x1, x2,…, x t ,…,x n ], where t is in the range [1,n], in Respectively represent the PM of date t 2.5 、PM 10 , SO2, NO2, CO, and O3 concentrations.
[0021] After normalizing the preprocessed data set in the single factor model, a sliding window is constructed, including:
[0022] The number of patients data is converted into normalized number of patients data within [0,1], and the normalization formula is as follows: y'=(yy min ) / (y max -y min )
[0023] Among them, y' is the normalized value of the number of patients, y is the characteristic value of the number of patients, and y min is the minimum number of patients, y max is the maximum number of patients;
[0024] Assume the window length is d, then the actual length of the input data is L = nd; at time t> d, the model input is y t-d ,y t-d+1 ,…y t-1 .
[0025] Send the sliding window into the LSTM+Attention model for training to obtain a trained model, including:
[0026] Divide the preprocessed data into training set and test set;
[0027] Train the LSTM+Attention model based on the training set; specifically, LSTM adds input gate, forget gate, and output gate to RNN;
[0028] The output gate formula is as follows:
[0029] f t =σ(W f ·[h t-1 ,x t ]+b f )
[0030] The input gate formula is as follows:
[0031] i t =σ(W i ·[h t-1 ,x t ]+b i )
[0032] The new cell state formula is as follows:
[0033] c t =σ(W c ·[h t-1 ,x t ]+b c )
[0034] c t =f t ·c t-1 +i t ·c t
[0035] The output gate formula is as follows:
[0036] o t =σ(W o ·[h t-1 ,x t ]+b o )
[0037] The output formula is as follows:
[0038] h t =o t tanh(c t )
[0039] Among them, i, f and o are used to represent the input, forget and output gates, w and b represent the weight matrix and bias vector of the network, and the operators × and + represent the multiplication and addition of matrices and elements;
[0040] When the input of the LSTM model contains features at time K, the hidden layer has K output vectors h k,k=1,2,…,K,The output vector is input into a fully connected network to obtain the influence score S of each output vector on the final output of the model k Weight coefficient formula α k And the final predicted value y formula is as follows:
[0041] S k =tanh(W k ·h k +b k )
[0042]
[0043]
[0044] Where W k 、b k is the weight coefficient and bias of the fully connected network, W c 、b c is the output layer weight coefficient and bias, and active is the activation function.
[0045] For the preprocessed data set described in the multifactorial model, the meteorological conditions and lagged days associated with the number of asthma visits were selected based on feature screening using random forests, including:
[0046] Configure a multi-pollutant dataset, including PM 2.5 、PM 10 , SO2, NO2, CO, O3 concentrations and the lag concentration data set of each concentration from 0 to 10 days; the data set is used as the input feature, and the random forest model is used for model training. During the training process, each decision tree is trained based on randomly sampled training samples and randomly selected feature subsets; the Gini index is used to evaluate the importance of each feature, and the formula is as follows:
[0047]
[0048] Among them, p i is the proportion of the data set belonging to the i-th class, and k is the number of classes;
[0049] The calculation formula for the reduction value of the Gini index of a feature split at a certain node can be expressed as:
[0050]
[0051] Among them, G is the Gini index of the parent node, G(left) and G(right) are the Gini indexes of the left and right child nodes respectively, and N, N left ,N right are the number of samples of the parent node, left child node, and right child node respectively;
[0052] According to the Gini index, each pollutant and the optimal number of days were ranked by importance and then feature screening was performed. The screened features and the number of patients were combined to construct a multi-factor data set and then normalized.
[0053] It is fed into the stacked LSTM model to obtain a trained model, including:
[0054] The stacked LSTM network is a 3-layer LSTM stacked network; the first layer includes 32 LSTM units; the second layer includes 32 LSTM units; the third layer includes 1 fully connected layer unit;
[0055] Among them, the LSTM unit includes a forget gate, an update gate and an output gate; the input vector and the previous state at any time are input through the update gate operation, and then updated with the corrected forget gate to generate the current state; at the same time, the current state is filtered using a nonlinear activation function, and the state at the next moment is output after operation with the output gate.
[0056] The stacked LSTM model is used to process the multi-pollutant dataset to capture multi-dimensional features, and then the patient visit prediction results are obtained, including:
[0057] Divide the multi-factor dataset into training and testing sets;
[0058] Train the stacked LSTM model based on the training set;
[0059] The diagnostic results of the stacked LSTM model that meets the performance conditions are evaluated based on the test set, and the evaluation index corresponding to the stacked LSTM model is obtained, including the root mean square error, mean absolute error, and mean absolute percentage error, and is visualized.
[0060] According to another aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of the analysis method of the present invention for predicting the number of childhood asthma patients based on the LSTM model are implemented.
[0061] According to another aspect of the present invention, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the analysis method for predicting the number of childhood asthma visits based on the LSTM model of the present invention are implemented.
[0062] Compared with the prior art, the above method of the present invention has the following beneficial effects:
[0063] (1) The time series modeling capability is improved. The present invention adopts a long short-term memory (LSTM) neural network model, which can effectively capture the long-term dependencies and periodic patterns in the sequence data. Compared with traditional models such as non-parametric Poisson regression and support vector regression used in the prior art, the LSTM network has stronger modeling capabilities when processing time series prediction tasks.
[0064] This advantage mainly comes from the use of LSTM+Attention model in step 5 and the use of stacked LSTM model in step 9. LSTM solves the problem of gradient vanishing in recurrent neural networks through the gating mechanism and can learn time-dependent patterns for a long time step. The Attention mechanism also allows the model to pay more attention to the time step that is more important to the prediction target. Stacked LSTM further enhances the model's expressiveness.
[0065] (2) Improved coverage of influencing factors. Traditional models only consider single environmental influencing factors such as meteorology and environmental pollution. In step 7, the present invention uses a random forest algorithm to automatically screen out features related to childhood asthma from multiple pollutants and their lagged data, thereby constructing a multi-factor prediction model. This not only considers the impact of different pollutants, but also includes the time lag effect, which helps to comprehensively evaluate the complex causes of the disease.
[0066] (3) Improved prediction accuracy and generalization capability The present invention has made detailed designs in data preprocessing, feature engineering, model selection, etc., which improves the prediction accuracy and generalization performance of the model. For example, the normalization processing in steps 4 and 8 can speed up the gradient descent; the feature screening in step 7 avoids the influence of redundant features; the attention mechanism and stacking structure enhance the expression ability of the LSTM network, etc. These designs help the model to better fit the data and capture the complex mapping relationship between input and output.
[0067] (4) Enhanced model interpretability. Traditional machine learning models are often uninterpretable black box systems that make it difficult to analyze key influencing factors. However, the internal state changes of the LSTM model are relatively interpretable, and some potential time series patterns and important features can be discovered from it. At the same time, the use of the random forest algorithm in step 7 to evaluate feature importance can also reveal the degree of influence of each pollutant and its lag period on the onset of asthma. All of these help to gain a deeper understanding of the essential causes of the disease.
[0068] (5) A variety of evaluation indicators are provided. In step 6 and step 10, the present invention not only calculates commonly used regression indicators such as root mean square error (RMSE) and mean absolute error (MAE), but also introduces mean absolute percentage error (MAPE). These diverse evaluation indicators can comprehensively evaluate model performance from different angles, providing more basis for model selection and tuning.
[0069] In general, the technical solution of the present invention significantly improves the accuracy and interpretability of disease incidence prediction and expands the scope of application by innovatively introducing advanced deep learning models, optimizing data preprocessing and feature engineering processes, designing novel model structures and evaluation index systems, etc. It is an innovative technology with important theoretical significance and application value. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings of the embodiments will be briefly introduced below. Obviously, the drawings in the following description only relate to some embodiments of the present invention, but are not intended to limit the present invention.
[0071] Figure 1 This is a flow chart of the present invention for predicting the number of children with asthma based on the LSTM model;
[0072] Figure 2 This is a structural diagram of the memory unit in the LSTM+Attention prediction model of the present invention;
[0073] Figure 3 This is a structural diagram of the attention mechanism in the LSTM+Attention prediction model of the present invention;
[0074] Figure 4 It is a structural diagram of the stacked LSTM prediction model of the present invention;
[0075] Figure 5 A comparison chart of the predicted value and the true value of the LSTM+Attention prediction model of the present invention;
[0076] Figure 6 It is a comparison chart of the predicted value and the true value of the stacked LSTM prediction model of the present invention. DETAILED DESCRIPTION
[0077] To make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the embodiments of the present invention will be described clearly and completely in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them.
[0078] Unless otherwise defined, technical or scientific terms used herein shall have the same meaning as commonly understood by one of ordinary skill in the art to which the invention belongs.
[0079] Embodiment 1:
[0080] like Figure 1 As shown, the present invention proposes an analysis method for predicting the number of children with asthma based on the LSTM model, comprising the following steps:
[0081] Step 1: Obtain the data on the number of children with asthma and the original data set of pollutants in the target area through the data information system;
[0082] Step 2: To ensure the accuracy and reliability of the data, the collected data is cleaned, including processing missing data, erroneous data and abnormal data.
[0083] Step 3: Decide whether to use a single factor prediction model or a multi-factor prediction model based on the preprocessed data set; if it is a single factor prediction model, go to step 4; if it is a multi-factor prediction model, go to step 7;
[0084] Step 4: Normalize the preprocessed data set and build a sliding window;
[0085] Step 5: Send the sliding window into the LSTM+Attention model for training to obtain a trained model;
[0086] Step 6: Input the data of the number of patients to be predicted into the trained LSTM+Attention model to obtain the prediction result of the data of the number of patients to be predicted;
[0087] Step 7: For the preprocessed data, use random forest to perform feature screening to identify the meteorological conditions and lagged days related to the number of asthma patients, and construct a multi-pollutant dataset;
[0088] Step 8: Normalizing the multi-pollutant data set to accelerate gradient descent;
[0089] Step 9: Send the normalized data set into the stacked LSTM model to obtain a trained model;
[0090] Step 10: Using a stacked LSTM model, the multi-pollutant dataset is processed to capture multi-dimensional features, thereby obtaining a prediction result of the number of patients.
[0091] On the basis of the above technical solution, the present invention can also be improved as follows:
[0092] Furthermore, the data collection and preprocessing stage includes:
[0093] Obtain the historical data of the number of children with asthma and record it as the number of patients: y = [y1, y2, ..., y n ], n is the length of the patient number data y; obtain the pollutant factor data set X with the same date as the historical data of the number of children with asthma, recorded as X = [x1, x2,…, x t ,…,x n ], where t is in the range [1,n], in Respectively represent the PM of date t 2.5 、PM 10 , SO2, NO2, CO, and O3 concentrations.
[0094] Furthermore, the preprocessed data set in the single factor model is normalized and then a sliding window is constructed, including:
[0095] The number of patients data is converted into normalized number of patients data within [0,1], and the normalization formula is as follows: y'=(yy min ) / (y max -y min )
[0096] Among them, y' is the normalized value of the number of patients, y is the characteristic value of the number of patients, and y min is the minimum number of patients, y max The maximum number of patients.
[0097] Assume the window length is d, then the actual length of the input data is L = nd. At time t>d, the model input is y t-d ,y t-d+1 ,…y t-1 .
[0098] Furthermore, the sliding window is sent to the LSTM+Attention model for training to obtain a trained model, including:
[0099] Divide the preprocessed data into training set and test set;
[0100] The LSTM+Attention model is trained based on the training set; specifically, LSTM adds an input gate, a forget gate, and an output gate on the basis of RNN.
[0101] The output gate formula is as follows:
[0102] f t =σ(W f ·[h t-1 ,x t ]+b f )
[0103] The input gate formula is as follows:
[0104] i t =σ(W i ·[h t-1 ,x t ]+b i )
[0105] The new cell state formula is as follows:
[0106] c t =σ(W c ·[h t-1 ,x t ]+b c )
[0107] c t =f t ·c t-1 +i t ·c t
[0108] The output gate formula is as follows:
[0109] o t =σ(W o ·[h t-1 ,x t ]+b o )
[0110] The output formula is as follows:
[0111] h t =o t tanh(c t )
[0112] Among them, i, f and o are used to represent the input, forget and output gates, w and b represent the weight matrix and bias vector of the network, and the operators × and + represent the multiplication and addition of matrices and elements.
[0113] When the input of the LSTM model contains features at time K, the hidden layer has K output vectors h k ,k=1,2,…,K,The output vector is input into a fully connected network to obtain the influence score S of each output vector on the final output of the model k Weight coefficient formula α k And the final predicted value y formula is as follows:
[0114] S k =tanh(W k ·h k +b k )
[0115]
[0116]
[0117] Where W k 、b k is the weight coefficient and bias of the fully connected network, W c 、b c is the output layer weight coefficient and bias, and active is the activation function.
[0118] Furthermore, the sliding window is sent to the LSTM+Attention model for training to obtain a trained model, which is characterized by further comprising:
[0119] Evaluate the diagnosis result of the LSTM+Attention model that meets the performance condition based on the test set, and obtain the evaluation index corresponding to the LSTM+Attention model including root mean square error, mean absolute error and mean absolute percentage error;
[0120] The calculation formula of the root mean square error is:
[0121]
[0122] The mean absolute error is calculated as follows:
[0123]
[0124] The mean absolute percentage error is calculated as follows:
[0125]
[0126] In the formula, y i is the model’s predicted value for the number of patients, y i is the true value of the number of patients, and n is the number of samples.
[0127] Furthermore, for the preprocessed data set in the multi-factor model, the meteorological conditions and lagged days related to the number of asthma patients were screened based on the use of random forests, including:
[0128] Configure a multi-pollutant dataset, including PM 2.5 、PM 10 , SO2, NO2, CO, O3 concentrations and the lag concentration data set of each concentration from 0 to 10 days; the data set is used as the input feature, and the random forest model is used for model training. During the training process, each decision tree is trained based on randomly sampled training samples and randomly selected feature subsets; the Gini index is used to evaluate the importance of each feature, and the formula is as follows:
[0129]
[0130] Among them, p i is the proportion of the data set belonging to the i-th class, and k is the number of classes.
[0131] The calculation formula for the reduction value of the Gini index of a feature split at a certain node can be expressed as:
[0132]
[0133] Among them, G is the Gini index of the parent node, G(left) and G(right) are the Gini indexes of the left and right child nodes respectively, and N, N left ,N right are the number of samples of the parent node, left child node, and right child node respectively.
[0134] According to the Gini index, each pollutant and the optimal number of days were ranked by importance and then feature screening was performed. The screened features and the number of patients were combined to construct a multi-factor data set and then normalized.
[0135] Furthermore, it is fed into the stacked LSTM model to obtain a trained model, including:
[0136] The stacked LSTM network is a 3-layer LSTM stacked network; the first layer includes 32 LSTM units; the second layer includes 32 LSTM units; the third layer includes 1 fully connected layer unit;
[0137] Among them, the LSTM unit includes a forget gate, an update gate and an output gate; the input vector and the previous state at any time are input through the update gate operation, and then updated with the corrected forget gate to generate the current state; at the same time, the current state is filtered using a nonlinear activation function, and the state at the next moment is output after operation with the output gate.
[0138] Furthermore, the stacked LSTM model is used to process the multi-pollutant dataset to capture multi-dimensional features, thereby obtaining the patient number prediction results, including:
[0139] Dividing the multi-factor dataset into a training set and a test set;
[0140] Training the stacked LSTM model based on the training set;
[0141] The diagnostic result of the stacked LSTM model that meets the performance conditions is evaluated based on the test set, and the evaluation index corresponding to the stacked LSTM model is obtained, including the root mean square error, the mean absolute error and the mean absolute percentage error, and is visualized.
[0142] To obtain experimental data on the performance of a product or result:
[0143] The present invention uses the same data set, especially compares the LSTM+Attention model with the ARIMA model and the basic LSTM model; the evaluation indicators of the traditional prediction method include: RMSE, MAE and MAPE, as shown in Table 1. Among these indicators, lower RMSE, MAE and MAPE values reflect smaller errors and better stability of the model, so lower values correspond to better model performance.
[0144] Compared with other machine learning models or traditional methods, the model proposed in the present invention performs better in terms of RMSE, MAE and MAPE indicators, which shows that the LSTM+Attention model has achieved better performance advantages in predicting the number of patients.
[0145] Table 1
[0146]
[0147] The present invention uses the same data set, especially compares the stacked LSTM model with the ARIMA model and the basic LSTM model; the evaluation indicators of the traditional prediction method include: RMSE, MAE and MAPE, as shown in Table 2. Among these indicators, lower RMSE, MAE and MAPE values reflect smaller errors and better stability of the model, so lower values correspond to better model performance.
[0148] Compared with other machine learning models or traditional methods, the model proposed in the present invention performs better in terms of RMSE, MAE and MAPE indicators, which shows that the stacked LSTM model has achieved better performance advantages in predicting the number of patients.
[0149] Table 2
[0150]
[0151] 1. The use of recurrent neural network models such as LSTM can effectively capture long-term dependencies and periodic patterns in time series data, significantly improving the ability to predict the dynamic trends of disease incidence.
[0152] 2. It incorporates a variety of possible influencing factors, such as pollutant concentrations, meteorological conditions, etc., rather than being limited to a single environmental influencing factor, which is conducive to a comprehensive assessment of the complex causes of disease onset.
[0153] 3. Through technical means such as attention mechanism and stacked LSTM, the nonlinear fitting ability of the model is improved, and the complex relationship between input variables and target variables is better captured.
[0154] 4. Detailed designs have been made in data preprocessing and feature engineering, such as feature screening, normalization, sliding windows, etc., which help improve the training efficiency and generalization performance of the model.
[0155] 5. A variety of evaluation indicators have been introduced to more comprehensively evaluate model performance and provide a basis for model selection and tuning.
[0156] 6. The model has a certain degree of interpretability, which is conducive to analyzing key influencing factors and their mechanisms of action, and providing clues for a deeper understanding of the causes of the disease.
[0157] In general, the technical solution proposed in the present invention has effectively solved the shortcomings of existing methods in terms of time series modeling, coverage of influencing factors, prediction accuracy, etc. It is a relatively advanced and effective disease incidence prediction model with good theoretical significance and application prospects.
[0158] Embodiment 2:
[0159] The computer-readable storage medium of this embodiment stores a computer program thereon, and when the program is executed by a processor, the steps in the analysis method for predicting the number of children with asthma based on the LSTM model in Example 1 are implemented.
[0160] The computer-readable storage medium of this embodiment may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal; the computer-readable storage medium of this embodiment may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card, a secure digital card, a flash memory card, etc. equipped on the terminal; further, the computer-readable storage medium may also include both an internal storage unit of the terminal and an external storage device.
[0161] The computer-readable storage medium of this embodiment is used to store computer programs and other programs and data required by the terminal. The computer-readable storage medium can also be used to temporarily store data that has been output or is to be output.
[0162] Embodiment 3:
[0163] The computer device of this embodiment includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps in the analysis method for predicting the number of childhood asthma patients based on the LSTM model in Example 1 are implemented.
[0164] In this embodiment, the processor may be a central processing unit, or other general-purpose processors, digital signal processors, application-specific integrated circuits, readily available programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0165] Those skilled in the art will appreciate that the disclosed content of the embodiments may be provided as methods, systems, or computer program products. Therefore, the present solution may adopt the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Moreover, the present solution may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program codes.
[0166] The present solution is described with reference to the flowchart and / or block diagram of the method and computer program product according to the embodiment of the present solution. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions; these computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0167] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0168] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0169] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0170] The examples described in the present invention are merely descriptions of the preferred implementation modes of the present invention, and are not intended to limit the concept and scope of the present invention. Without departing from the design concept of the present invention, various modifications and improvements made to the technical solutions of the present invention by engineers and technicians in this field should all fall within the protection scope of the present invention.
Claims
1. An analysis method for predicting the number of children with asthma based on LSTM model, characterized in that: A stacked LSTM model structure was set up to predict the multi-pollutant lagged concentration dataset and the single-factor and multi-factor models separately.
2. The method according to claim 1, characterized in that: The method specifically comprises the following steps: Step 1: Obtain the data on the number of children with asthma and the original data set of pollutants in the target area through the data information system; Step 2: Clean the collected data, including processing missing data, erroneous data and abnormal data; Step 3: Decide whether to use a single factor prediction model or a multi-factor prediction model based on the preprocessed data set; if it is a single factor prediction model, go to step 4; if it is a multi-factor prediction model, go to step 7; Step 4: Normalize the preprocessed data set and build a sliding window; Step 5: Send the sliding window into the LSTM+Attention model for training to obtain a trained model; Step 6: Input the patient number data to be predicted into the trained LSTM+Attention model to obtain the prediction result of the patient number data to be predicted; Step 7: For the preprocessed data, use random forest to perform feature screening to identify the meteorological conditions and lagged days related to the number of asthma patients, and construct a multi-pollutant dataset; Step 8: Normalize the multi-pollutant dataset to accelerate gradient descent; Step 9: Feed the normalized data set into the stacked LSTM model to obtain a trained model; Step 10: Use the stacked LSTM model to process the multi-pollutant dataset to capture multi-dimensional features and obtain the prediction results of the number of patients.
3. The method according to claim 2, characterized in that For the data collection and preprocessing stage, including: Obtain the historical data of the number of children with asthma and record it as the number of patients: y = [y1, y2, ..., y n ], n is the length of the patient number data y; obtain the pollutant factor data set X with the same date as the historical data of the number of children with asthma, recorded as X = [x1, x2,…, x t ,…,x n ], where t is in the range [1,n], in Respectively represent the PM of date t 2.5 、PM 10 , SO2, NO2, CO, and O3 concentrations.
4. The method according to claim 3, characterized in that After normalizing the preprocessed data set in the single factor model, a sliding window is constructed, including: The number of patients data is converted into normalized number of patients data within [0,1], and the normalization formula is as follows: y'=(yy min ) / (y max -y min ) Among them, y' is the normalized value of the number of patients, y is the characteristic value of the number of patients, and y min is the minimum number of patients, y max is the maximum number of patients; Assume the window length is d, then the actual length of the input data is L = nd; at time t> d, the model input is y t-d ,y t-d+1 ,…y t-1 .
5. The method according to claim 4, characterized in that Send the sliding window into the LSTM+Attention model for training to obtain a trained model, including: Divide the preprocessed data into training set and test set; Train the LSTM+Attention model based on the training set; specifically, LSTM adds input gate, forget gate, and output gate to RNN; The output gate formula is as follows: f t =σ(W f ·[h t-1 ,x t ]+b f ) The input gate formula is as follows: i t =σ(W i ·[h t-1 ,x t ]+b i ) The new cell state formula is as follows: c t =σ(W c ·[h t-1 ,x t ]+b c ) c t =f t ·c t-1 +i t ·c t The output gate formula is as follows: the t =σ(W o ·[h t-1 ,x t ]+b o ) The output formula is as follows: h t =o t fishy t ) Among them, i, f and o are used to represent the input, forget and output gates, w and b represent the weight matrix and bias vector of the network, and the operators × and + represent the multiplication and addition of matrices and elements; When the input of the LSTM model contains features at time K, the hidden layer has K output vectors h k ,k=1,2,…,K,The output vector is input into a fully connected network to obtain the influence score S of each output vector on the final output of the model k Weight coefficient formula α k And the final predicted value y formula is as follows: S k =tanh(W k ·h k +b k ) Where W k 、b k is the weight coefficient and bias of the fully connected network, W c 、b c is the output layer weight coefficient and bias, and active is the activation function.
6. The method according to claim 5, characterized in that For the preprocessed data set described in the multifactorial model, the meteorological conditions and lagged days associated with the number of asthma visits were selected based on feature screening using random forests, including: Configure a multi-pollutant dataset, including PM 2.5 、PM 10 , SO2, NO2, CO, O3 concentrations and the lag concentration data set of each concentration from 0 to 10 days; the data set is used as the input feature, and the random forest model is used for model training. During the training process, each decision tree is trained based on randomly sampled training samples and randomly selected feature subsets; the Gini index is used to evaluate the importance of each feature, and the formula is as follows: Among them, p i is the proportion of the data set belonging to the i-th class, and k is the number of classes; The calculation formula for the reduction value of the Gini index of a feature split at a certain node can be expressed as: Among them, G is the Gini index of the parent node, G(left) and G(right) are the Gini indexes of the left and right child nodes respectively, and N, N left ,N right are the number of samples of the parent node, left child node, and right child node respectively; According to the Gini index, each pollutant and the optimal number of days after the pollutant were ranked by importance and then feature screening was performed. The screened features and the number of patients were combined to construct a multi-factor data set and then normalized.
7. The method according to claim 6, characterized in that It is fed into the stacked LSTM model to obtain a trained model, including: The stacked LSTM network is a 3-layer LSTM stacked network; the first layer includes 32 LSTM units; the second layer includes 32 LSTM units; the third layer includes 1 fully connected layer unit; Among them, the LSTM unit includes a forget gate, an update gate and an output gate; the input vector and the previous state at any time are input through the update gate operation, and then updated with the corrected forget gate to generate the current state; at the same time, the current state is filtered using a nonlinear activation function, and the state at the next moment is output after operation with the output gate.
8. The method according to claim 7, characterized in that The multi-pollutant dataset is processed using a stacked LSTM model to capture multi-dimensional features, thereby obtaining patient visit prediction results, including: Dividing the multi-factor dataset into a training set and a test set; Training the stacked LSTM model based on the training set; The diagnostic result of the stacked LSTM model that meets the performance conditions is evaluated based on the test set, and the evaluation index corresponding to the stacked LSTM model is obtained, including the root mean square error, the mean absolute error and the mean absolute percentage error, and is visualized.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in the analysis method for predicting the number of children with asthma based on an LSTM model as described in any one of claims 1 to 8 are implemented.
10. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the analysis method for predicting the number of children with asthma seeking medical treatment based on the LSTM model as described in any one of claims 1 to 8 are implemented.
Citation Information
Cited By
CNN-LSTM model-based weather-related children allergic disease onset risk prediction method
CN119740196A
