A Multi-Attribute Population Risk Prediction Method Based on Bidirectional GRU and Complex Networks

By constructing a multi-attribute population risk prediction method based on bidirectional GRU and complex networks, and combining a GRU encoder-decoder structure with a time attention mechanism, the problem that individual attributes and network topology features are not considered in existing technologies is solved, and more accurate epidemic risk prediction is achieved.

CN116453703BActive Publication Date: 2025-12-02BEIHANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310254224.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-16
Publication Date
2025-12-02
Estimated Expiration
2043-03-16

AI Technical Summary

Technical Problem

Existing methods for predicting the risk of epidemics lack consideration for individual attributes and network topology characteristics, resulting in less objective and accurate predictions. In particular, in predictions based on deep learning models, the traditional encoder-decoder structure is insufficient for long-term time-series data prediction.

Method used

A multi-attribute population risk prediction method based on bidirectional GRU and complex networks is adopted. By constructing a weighted contact network and combining a GRU encoder-decoder structure with a time attention mechanism, individual attribute features are extracted and short-term risk prediction is performed.

Benefits of technology

It improves the accuracy of short-term risk prediction for multi-attribute populations in the spread of epidemics, reduces the risk of overfitting, enhances the ability to perceive long-term time-series patterns, and provides a more scientific risk assessment method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116453703B_ABST
    Figure CN116453703B_ABST
Patent Text Reader

Abstract

This invention proposes a multi-attribute population risk prediction method based on bidirectional GRU and complex networks, as follows: 1. Acquire multi-attribute time-series contact data and refine the data; 2. Mine contact patterns between individuals based on the behavioral characteristics of different attribute groups and extract individual characteristics in the network; 3. Analyze the dynamic propagation mechanism and quantitatively assess the risk of different attribute groups based on the propagation results; 4. Integrate individual characteristics and risk indicators according to time characteristics to obtain a time-series dataset with a unified format under different attributes; 5. Construct the overall module structure of GRU for time-series risk prediction; 6. Set the parameters and learning mechanism of the input layer, encoding layer, and decoding layer of the prediction model; 7. Set the module structure of the attention layer in the prediction model; 8. Divide the feature vector dataset for training, validation, and testing; 9. Train and validate the model, and test the prediction accuracy of the model based on the test dataset.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention provides a method for predicting the risk of multi-attribute populations based on bidirectional GRU and complex networks. It involves a technical implementation that cross-integrates the GRU neural network model in deep learning with complex network theory to predict the risk of multi-attribute populations in the spread of epidemics, and belongs to the field of epidemic risk prediction. Background Technology

[0002] In today's information-driven society, people constantly interact and communicate through face-to-face contact. Frequent population movement, accompanied by the spread of various human behaviors, ideas, and diseases, inadvertently promotes the spread of new infectious diseases. Close contact in interpersonal social behavior also facilitates the spread of respiratory infectious diseases such as influenza and tuberculosis. The complex contact networks between people largely determine the transmission process of infectious diseases. Currently, in studies on the risk of epidemic transmission based on complex network theory, most epidemic models do not consider individual attributes and the heterogeneity of contact patterns between people. Therefore, in order to explore the dynamic transmission mechanisms of infectious diseases and more accurately predict transmission risks, an increasing amount of real-world data reflecting interpersonal contact relationships is being used to construct near-realistic interpersonal contact networks, enhancing the robustness of network models.

[0003] Most contact data collected so far is time-series dataset. Contact networks built based on this data reflect the contact relationships between individuals, and the risk of infection varies among individuals exposed at different time intervals. Methods for predicting the risk of epidemic transmission based on time-series data mainly fall into two categories: classic statistical models (e.g., autoregressive models (AR), autoregressive moving average (ARIMA), logistic growth curve models, etc.) and deep learning models, such as recurrent neural networks (e.g., long short-term memory network models (LSTM), gated recurrent unit network models (GRU), etc.) and convolutional neural networks (CNN), are commonly used for time-series data prediction. Statistical models are often used for risk prediction of linear time-series data, while deep learning models are suitable for predicting nonlinear and complex large-scale time-series data. LSTM and GRU models are the most widely used in this type of prediction. This invention primarily uses GRU neural networks for time-series risk prediction. Compared to LSTM and other recurrent network variants, this model contains fewer network parameters, has better computational performance, is more suitable for predicting medium-sized time-series data, and exhibits better convergence, reducing the risk of overfitting.

[0004] Furthermore, most current research on epidemic transmission risk prediction based on time-series data primarily predicts future values ​​based on historical confirmed case data. However, using only confirmed cases as a risk assessment indicator is too simplistic and lacks quantitative descriptions of transmission risk based on individual attributes. To address these issues, this invention proposes a transmission risk prediction method based on bidirectional GRU and complex networks. First, a weighted contact network is constructed based on complex network theory for time-series contact data containing individual attributes, and network features are extracted for individual attributes. Based on the contact network for this period, epidemic transmission is simulated, and the average risk value of multi-attribute groups in epidemic transmission is calculated. To predict time-series risk, this invention proposes a multi-attribute time-series risk short-term prediction framework with a GRU encoder-decoder structure. Since traditional encoder-decoder deep learning structures compress past time information into a fixed-length vector, their predictive ability gradually decreases as the length of the input time series increases. To address this problem, this invention introduces a time attention mechanism as an interface between the encoder and decoder, enhancing the ability to perceive long-term time-series patterns. Therefore, the prediction framework proposed in this invention consists of three parts: Bi-GRU as the encoding part, GRU model as the decoding part, and a temporal attention model to enhance GRU before the decoder. The introduction of the attention mechanism can maximize the mining of dependencies between time steps through continuous learning, and assign higher weights to key information with strong correlation features, which helps to improve the accuracy of the prediction model.

[0005] This invention is based on complex network theory and deep neural network models, and integrates data mining analysis technology with related theories and methods such as epidemic transmission modeling. It can extract features from time-series contact data containing personal attributes, quantitatively assess the risk of different populations under epidemic transmission, and propose a deep learning model to realize short-term prediction of risk for multi-attribute populations, providing a certain methodological reference for scientifically and effectively assessing the risk of epidemic transmission. Summary of the Invention

[0006] (I) Purpose of this invention:

[0007] Since the complex social network structure of a population largely determines the likelihood of epidemic transmission, the risk of epidemic transmission is closely related to the contact networks formed among people. Contact networks abstracted from time-series contact data help to accurately understand the dynamic transmission mechanism of epidemics, thereby constructing scientifically effective models for predicting infectious risk. Traditional statistical models are mainly suitable for predicting linear time-series data. Although machine learning models can be applied to nonlinear systems, their limitation lies in the fact that input variables are usually independent. Currently, deep learning models are widely used for predicting large-scale, complex, nonlinear time-series data, and there are abundant results in predicting and assessing infectious risk. However, most studies mainly use confirmed cases as predictive indicators for risk assessment, lacking research that uses personal attributes and the topological characteristics of contact networks as input features, resulting in less objective and accurate risk prediction results. Based on the shortcomings of current infectious risk prediction methods, this invention combines complex network theory and the GRU neural network model in deep learning to extract node features from time-series contact data containing personal attributes, quantitatively assess the average risk of multi-attribute populations in epidemic transmission, and proposes a neural network model based on an attention mechanism and a GRU encoder-decoder structure to achieve short-term prediction of risk for populations with different attributes.

[0008] (II) Technical Solution

[0009] The technical solution of this invention: The construction process of a multi-attribute population risk prediction method based on bidirectional GRU and complex networks is as follows:

[0010] This invention proposes a multi-attribute population risk prediction method based on bidirectional GRU and complex networks, the steps of which are as follows:

[0011] Step 1: Obtain multi-attribute temporal contact data, perform data mining analysis, and refine the data based on individual attributes and spatiotemporal contact behavior;

[0012] Step 2: Based on the behavioral characteristics of different attribute groups, mine the contact patterns between individuals, construct a weighted interpersonal contact network according to the number of contacts and the duration of contact, and extract the characteristics of individuals in the network;

[0013] Step 3: Simulate the dynamic transmission process of an epidemic using a time-series contact network, analyze the dynamic transmission mechanism, and quantitatively assess the risk to different population groups based on the transmission results;

[0014] Step 4: Integrate individual characteristics and risk indicators according to time characteristics, preprocess the samples of the multi-attribute risk time series dataset, and obtain a time series dataset with a unified format under different attributes.

[0015] Step 5: Construct the overall GRU module structure for time series risk prediction;

[0016] Step 6: Set the parameters and learning mechanism for the input layer, encoding layer, and decoding layer of the prediction model;

[0017] Step 7: Configure the module structure of the attention layer in the prediction model;

[0018] Step 8: Divide the feature vector dataset into three parts based on its purpose of training, validation, and testing;

[0019] Step 9: Train and validate the model using the divided training batch dataset and validation batch dataset, and test the prediction accuracy of the model based on the test dataset;

[0020] The specific steps for "obtaining multi-attribute time-series contact data, performing data mining analysis, and refining the data based on individual attributes and spatiotemporal contact behavior" in step 1 are as follows: This invention obtains multi-attribute time-series contact data from relevant research and websites that specialize in collecting contact data (e.g., SocioPatterns website: http: / / www.sociopatterns.org / datasets / ). Typically, the dataset includes valid contacts collected over a certain time interval. The file specifically includes the individual's anonymous ID and the individual's corresponding type / attribute (e.g., occupation, department, class, etc.). Each line in the time-series data is in the form of: t ij C i C j Where i and j are the anonymous IDs of the contacts, and t ij C represents the moment of contact between two individuals. i and C j Let each represent an attribute of an individual, and let the effective contact time interval be [t-20s, t] (t is in seconds).

[0021] Specifically, the process described in step 2, "mining contact patterns between individuals based on the behavioral characteristics of different attribute groups, constructing a weighted interpersonal contact network according to the number of contacts and contact duration, and extracting the characteristics of individuals in the network," is as follows: Data mining is performed on time-series contact data, considering the behavioral characteristics of different attribute groups, and the data is subdivided into contact relationships over different time periods (e.g., 10 minutes). s The data is divided into n contact relationship networks (e.g., 1 hour, 1 day, etc.). Statistical preprocessing is performed on each group of data, and based on agent-based modeling, the number of contacts N for each ID(i) is counted. Ci The duration of contact T with each contact Cij And the total duration of contact T Ci T Ci =∑ j T CijBy combining the number of contacts and the duration of contact with the weights of the edges, a weighted interpersonal contact network is constructed. Based on the constructed contact network, feature indicators of each ID in the network are extracted, such as the degree, degree centrality, proximity centrality, and clustering coefficient of the node, and each node (ID) is labeled.

[0022] Specifically, the "simulating the dynamic spread of an epidemic based on the time-series contact network, analyzing the dynamic spread mechanism, and quantitatively assessing the risk of different population groups based on the spread results" described in step 3 is as follows: For the constructed time-series contact network, the spread rate in the spread model is improved by combining weights to simulate the spread of an epidemic. Based on the spread results, the risk value of each population group (e.g., different professions such as doctors, nurses, and teachers, or their respective work departments, such as human resources departments) under the spread of an epidemic is quantitatively assessed, including the risk of infection and the risk of being infected.

[0023] Specifically, step 4, which involves "integrating individual characteristics and risk indicators according to time characteristics, preprocessing samples from multi-attribute risk time-series datasets, and obtaining time-series datasets with uniform format under different attributes," is implemented as follows: Based on the individual risk indicators calculated for each time period, data processing is performed according to individual attribute characteristics to obtain the risk indicators for each group of people and their characteristics in the contact network. Then, these are integrated according to time to obtain time-series datasets with uniform format under different attributes. For example, a time-series dataset for teacher risk: t l Risk(in) l Risk(out) l D l DC l CC l ..., where l∈[1,n] represents a temporal contact network relationship, Risk(in) represents the average risk of infection for the teacher group, and Risk(out) represents the average risk of infection from this group to others, D l DC represents the average degree of this type of population within the contact network. l CC represents the average degree centrality of this type of population in the contact network l. l This indicates the average proximity centrality of this type of population within the contact network l.

[0024] The specific steps of “constructing the overall GRU module structure for temporal risk prediction” in step 5 are as follows: This invention proposes a risk prediction framework with a GRU encoder-decoder structure that introduces a temporal attention mechanism. The framework consists of three parts: an encoder composed of bidirectional GRUs, an attention layer with a temporal attention mechanism, and a GRU neural network as a decoder.

[0025] In this invention, the encoder is responsible for learning temporal information from the input time-series risk sequence. The bidirectional GRU neural network model is used to encode the historical time series. Bi-GRU consists of a forward GRU and a backward GRU. The bidirectional GRU model can encode the input time series x = (x1, x2, ... x...). T The hidden state h is then processed recursively in both forward and reverse directions and finally integrated and weighted to output. t The expression is:

[0026]

[0027]

[0028] The arrow indicates the processing direction, x t h represents the input to the Bi-GRU model. t This represents the output of the Bi-GRU model, transmitted through a bidirectional GRU encoder (GRU). encoder The forward GRU output is combined based on the sum of its elements. and reverse output

[0029] The intermediate layer is where the temporal attention mechanism operates. The calculation process of the attention layer is shown below:

[0030]

[0031]

[0032]

[0033] As can be seen from the above formula, firstly, based on the hidden state h output by the current encoder... t And the current hidden state s of the decoder i The similarity between the two is measured by the score function in formula (2). Common calculation methods include: calculating the dot product, calculating the cosine similarity, and using neural networks (Machine Learning, ML) to solve the problem, thereby obtaining the first-order correlation value matrix e. i,t , representing the correlation of the i-th variable at time t∈[1,2,…,j,...,n], where the values ​​in the matrix are then normalized using formula (3) to obtain the attention weight value β. i,t Here, the softmax function is used to apply the softmax function to a vector e of length n. i After normalization, the final state c of the attention layer output is obtained by formula (4). t .

[0034] Then the output state c of the attention layer tAs a decoder GRU (GRU) decoder The input to the neural network is the state s of the hidden layer at the previous time step, which is then processed by the decoder. t-1 With input state c t The predicted value is output recursively using the following expression:

[0035] y t =GRU decoder (c t s t-1 (5)

[0036] Based on the above description, a temporal risk prediction framework based on a GRU encoder-decoder structure using a time attention mechanism is constructed.

[0037] Specifically, the "setting the parameters and learning mechanism of the input layer, encoding layer, and decoding layer of the prediction model" mentioned in step 6 is implemented as follows: Based on the constructed time-series risk prediction model, firstly, the parameters of the input layer are set, with the input dimension being input_dims and the input time step being input_steps. For the GRU neural network model of the encoding and decoding layers, the number of neurons is given as gru_units. The formula for forward propagation of the GRU neural network model is:

[0038] r t =σ(U r x t +W r h t-1 +b r )

[0039] z t =σ(U z x t +W z h t-1 +b z )

[0040]

[0041]

[0042] Where, x t h is the i-th element in the input time series sequence; t-1 Represents the hidden layer state at time t; r t and z t These represent the reset gate and the update gate, respectively. U r W r U z W z U c W c Both represent training weights, b r bz b c The offset is σ(·), which is a non-linear activation function that restricts the gate's value to a specific interval (usually [0, 1]), and ⊙ is the multiplication operator. Reset gate r t h is used to control the hidden layer state at the previous time step. t-1 To what extent is the current hidden layer state updated? The update gate zt is used to control the hidden layer state h of the previous time step. t-1 To what extent is the current hidden layer state h updated? t .

[0043] Specifically, in step 7, "setting the module structure of the attention layer in the prediction model," the details of setting the attention layer are as follows:

[0044] ① The first layer is the permute layer: It mainly takes the output of the Bi-GRU model as the input sequence inputs and permute((2,1))(inputs) to permute the first and second dimensions of the input, that is, to swap the rows and columns; for example, if the input dimension is input_dim=5 and the time step is time_steps=1000, it is adjusted from (1000 rows, 5 columns) to (5 rows, 1000 columns).

[0045] ② The second layer is a dense layer: the softmax activation function is used to calculate the weight of each feature, and the calculation process is based on formula (3);

[0046] ③ The third layer is the Lambda layer: It mainly averages the multidimensional attention weights obtained from the second layer, which is achieved by the formula Lambda(lambda x: K.mean(x, axis=1))(results got from ②), where K.mean is the main function that can take the mean of the weight vector;

[0047] ④ The fourth layer is the RepeatVector layer: The average weights obtained (the result obtained from ③) are copied according to the input dimensions. This is achieved by the command RepeatVector(input_dim)(results got from ③), so that the weights of each feature dimension are consistent.

[0048] ⑤ The fifth layer is still the permute layer: Based on the weights obtained in ④, in order to multiply with the corresponding elements of the input data, the transpose dimension needs to be changed before multiplication. This is done by using the command Permute((2,1))(results got from ④), which transposes the (5 rows, 1000 columns) weight matrix into a (1000 rows, 5 columns) data format.

[0049] ⑥ The sixth layer is the multiplication layer: the transposed attention weight data (the result obtained from ⑤) is multiplied with the corresponding elements of the input data by the command Multiply()([inputs, results gotfrom ⑤]);

[0050] Specifically, the "partitioning of the feature vector sample set based on three purposes: training, validation, and testing" mentioned in step 8 is implemented as follows: Based on the obtained feature vector sample set, i.e., the time-series risk dataset: t l Risk(in) l Risk(out) l D l BC l ..., where l∈[1,n] represents one of the temporal contact networks. Set the ratio of training, validation, and test data, for example, 8:1:1, and divide the sample set to obtain the training set, validation set, and test set respectively. Assuming n=10000, the training set has 8000 samples, the validation set has 1000 samples, and the test set has 1000 samples. Then set the batch size (bach size) of the three datasets (for example, set to 8), and divide the sample set into 8 batches according to the batch size. Finally, obtain the training batch dataset (each batch has 1000 samples), the validation batch dataset, and the test batch dataset. Each batch in the latter two datasets has 125 samples.

[0051] Specifically, step 9, "training and validating the model using the pre-divided training and validation datasets, and testing the model's prediction accuracy based on the test dataset," is implemented as follows: The learning epochs N_epochs of the time-series risk prediction model are set. The proposed model is trained through multiple epochs using the pre-divided training and validation datasets. After multiple epochs, the accuracy of short-term risk prediction for multi-attribute populations during epidemic transmission is validated based on the test dataset. The test dataset is used as input, and the trained model yields the predicted risk results, which are then compared with the actual results to verify the model's prediction effectiveness. Furthermore, this invention uses root mean square error (RMSE) and mean absolute error (MSE) as model error evaluation metrics, calculated using the following formulas:

[0052]

[0053]

[0054] Where, y′ t Represents the predicted value, y t This represents the true value, and N represents the total number of samples in the test batch dataset.

[0055] Through the above steps, a multi-attribute population risk prediction method based on bidirectional GRU and complex networks can be constructed. This invention mines contact patterns between individuals based on time-series contact data of individuals with multiple attributes, constructs a weighted contact network using contact duration and number of contacts, and quantitatively assesses the risk of populations with different attributes by simulating the spread of an epidemic. Individual characteristics and risk indicators are integrated according to time characteristics to obtain a time-series dataset with a unified format under different attributes. This invention introduces an attention mechanism and constructs a GRU encoder-decoder prediction architecture to accurately achieve short-term prediction of multi-attribute population risks.

[0056] (III) Advantages and Efficacy of the Invention

[0057] The advantages of this invention compared to existing technologies are as follows: Currently, there is limited research on risk prediction in epidemic transmission based on multi-attribute individual temporal contact. Although many deep learning models have been applied to predict complex nonlinear time-series data, most studies primarily use confirmed cases as the predictive indicator for risk assessment, lacking consideration of the impact of individual attributes and network topological characteristics on the risk prediction performance of different attribute populations, resulting in inaccurate risk prediction. Previous deep learning risk prediction models were mostly based on LSTM neural networks. This invention proposes a GRU encoder-decoder prediction framework based on an attention mechanism. This model uses a GRU neural network, which has fewer network parameters than LSTM, a relatively simple model structure, and a lower risk of overfitting. Furthermore, the GRU model performs better in terms of convergence time and the number of iterations required. In addition, the introduction of an attention mechanism in this invention helps to dynamically select the most relevant features during prediction, improving the accuracy of short-term risk prediction for multi-attribute populations in epidemic transmission. Attached Figure Description

[0058] Figure 1 This is a schematic diagram of the method flow described in this invention.

[0059] Figure 2 This is a visual representation of the weighted contact network constructed based on time-series contact data in an embodiment of the present invention.

[0060] Figure 3 This describes the process for constructing a sample dataset for multi-attribute population risk prediction in this embodiment of the invention.

[0061] Figure 4 This invention presents a GRU encoder-decoder prediction framework based on an attention mechanism.

[0062] Figure 5 This is a visualization of the risk prediction effect of a prediction framework on multi-attribute populations in an embodiment of the present invention. Detailed Implementation

[0063] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0064] This invention provides a multi-attribute population risk prediction method based on bidirectional GRU and complex networks. It performs temporal feature analysis on acquired time-series contact data to mine interpersonal contact relationships and constructs a weighted contact network. By conducting dynamic epidemic transmission simulations, it quantitatively assesses the risk values ​​of different population attributes during epidemic transmission. Introducing an attention mechanism, it proposes a prediction framework based on bidirectional GRU, enabling accurate prediction of risks for multi-attribute populations. This invention helps to optimize the deployment of epidemic prevention and control strategies for populations with different attributes.

[0065] like Figure 1 As shown, the present invention proposes a multi-attribute population risk prediction method based on bidirectional GRU and complex networks, which includes the following steps:

[0066] Step 1: Obtain multi-attribute temporal contact data, perform data mining analysis, and refine the data based on individual attributes and spatiotemporal contact behavior;

[0067] In this invention example, time-series contact data for seven days from five classes of students at a high school in Marseille, France, was obtained from the SocioPatterns website. Data mining analysis was then performed, and the contact data file included the IDs of individuals with contact relationships collected within 20-second time intervals. Each line is in the form of "t ij "ij", where i and j are the anonymous IDs of the student or teacher, and the effective contact time interval is [t-20s, t] (t is in seconds). The additional data file contains individual attributes, i.e., the group type the individual belongs to (the student's class, such as a math class, engineering research class, etc.), with each line of the file beginning with "i C". i G i The form gives the attribute C of the individual with ID i. i and gender G i (Gender information is not considered in this example). Based on the contact information from these two files, data integration was performed, considering temporal contact behavior and density between individuals. The data was then refined, dividing the long sequence into 3336 (n=3336) temporal contact relationship files at 0.5-hour time intervals. The data format of one of the temporal contact relationships is shown in Table 1:

[0068] Table 1: Timing Contact Data

[0069]

[0070]

[0071] In the table, the attribute "2BIO1" represents Biology Class 1, "MP" represents Mathematics and Physics Class, "PC" represents Physics and Chemistry Class, and "PSI" represents Engineering Research Class.

[0072] Step 2: Based on the behavioral characteristics of different attribute groups, mine the contact patterns between individuals, construct a weighted interpersonal contact network according to the number of contacts and the duration of contact, and extract the characteristics of individuals in the network;

[0073] For the refined files containing contact relationships over equal time periods, data mining is performed on the contact behavior characteristics of different attribute groups. Considering the behavioral characteristics of different attribute groups, based on the agent-based modeling method, the number of contacts N between each ID(i) and each contactor is counted. Cij and the total number of people N contacted Ci The duration of contact T with each contact Cij And the total duration of contact T Ci T Ci =∑ j T Cij The output data format will then be "C". i T Ci N Ci T Cij N Cij C j By combining the weights of the number of people contacted and the duration of contact with the edges, a weighted interpersonal contact network is constructed, where the weights are calculated using the following formula:

[0074]

[0075] Based on the constructed contact network, such as Figure 2 As shown, feature metrics of each ID in each network are extracted, such as node degree, degree centrality, proximity centrality, and clustering coefficient, to label each node (ID).

[0076] Step 3: Simulate the dynamic transmission process of an epidemic using a time-series contact network, analyze the dynamic transmission mechanism, and quantitatively assess the risk to different population groups based on the transmission results;

[0077] For each time period, this invention simulates the dynamic spread of an epidemic based on the SIR (Susceptible-Infected-Recovered) model, assuming that initially 90% of nodes are in the susceptible state (S), 10% are in the infected state (I), and initially no nodes are in the recovered state (R). During the propagation process, the state transition probability of each node (ID)i at time interval Δt is:

[0078] p(S→I)=1-exp(-W ij βΔt)

[0079] p(I→R)=1-exp(-μΔt)

[0080] In the Python simulation, given the propagation parameters β = 0.01, μ = 0.002, and Δt = 1, the spread of an epidemic is simulated, the dynamic propagation mechanism is analyzed, and based on the propagation results, the risk of each node when the spread reaches steady state is quantitatively assessed, including the probability of infection (Risk(in)). l And the average number of secondary infections that occur during a single transmission event (Risk(out)). l For a specific group, such as the "MP" (Mathematics and Physics class) group, the risk calculation formula is as follows:

[0081]

[0082] Where, N i_infected This indicates that node (ID) i in the "MP" group of this contact network l is in N. run The number of times someone is infected in this simulation is N(MP) of the total number of people with the attribute "MP" in the contact network l.

[0083] For the "MP" (Mathematics and Physics) class, the risk calculation formula is as follows:

[0084]

[0085] Where, N i_infect_neighbors This indicates that node (ID) i in the "MP" group of this contact network l is in N. run The number of secondary infections (infecting surrounding neighboring nodes) generated during a single propagation is N. Therefore, the average number of secondary infections generated by node (ID)i during a single propagation is N. i_infect_neighbors / N run Therefore, the average risk value of the group with the attribute "MP" (total number N(MP)) in the contact network l is Risk(out). l .

[0086] Step 4: Integrate individual characteristics and risk indicators according to time characteristics, preprocess the samples of the multi-attribute risk time series dataset, and obtain a time series dataset with a unified format under different attributes.

[0087] like Figure 3 As shown, in the sample dataset construction process for multi-attribute population risk prediction in this embodiment, after obtaining the individual risk index based on step 3, data processing is performed according to the individual attribute characteristics. Figure 3 This paper uses the "MP" (Mathematics and Physics class) group as an example to illustrate the risk indicators of this group and their characteristics in the contact network, such as... Figure 3 Taking the table shown in the first 0.5h example as an example, it is a table formed by data on the risk and network characteristics of each node with the attribute "MP" (total number N (MP)). Each row in the table contains the following information: IDi Label i Risk(in) i Risk(out) i D i DC i CC i Clustering, where i∈[1, N(MP)] represents a node with the attribute "MP", D i DC represents the average degree of node (ID) i in the contact network. i CC represents the degree centrality of node (ID) i in the contact network. i The proximity centrality of node (ID) i in the contact network is represented by , and Clustering represents the clustering coefficient of node (ID) i in the contact network. The network feature values ​​of all nodes (ID) can be obtained using the networkx package in Python, for example:

[0088] DC=networkx.degree_centrality(G)

[0089] CC=networkx.closeness_centrality(G,distance='weight')

[0090] Clustering=networkx.clustering(G, weight='weight')

[0091] Where G represents the network graph, referring here to the link relationships between nodes in the contact network formed by the first 0.5h.

[0092] Then, the data is integrated according to time to obtain a time-series dataset with a uniform format under this attribute. Figure 3 The table on the right contains a time-series dataset of the average risk of students in the "MP" (Mathematics and Physics) class. Each row contains the following information: t l Risk(in) l Risk(out) l D l DC l CC l Clustering l Where l∈[1,n] represents a contact network relationship, in this example n=3336, Risk(in) represents the average risk of this type of student being infected, and Risk(out) represents the average risk of this type of student spreading the infection outwards, D l DC represents the mean degree of this type of population within the contact network. lCC represents the average degree centrality of this type of population within the contact network. l Clustering represents the average proximity centrality of this type of population within the contact network. l This represents the average clustering coefficient of this type of population within the contact network.

[0093] Step 5: Construct the overall GRU module structure for time series risk prediction;

[0094] After obtaining a time-series data sample set of a certain type of student risk based on steps 1-4, this invention proposes a GRU encoder-decoder prediction framework based on an attention mechanism. The structure of this framework is as follows: Figure 4 As shown, multi-attribute temporal risk samples are used as input. First, a bidirectional GRU neural network is used as the encoder, where the encoder is responsible for learning time information from the input temporal risk sequence. Then, the most relevant features are extracted through an attention layer with an attention mechanism. The output state is used as the input to the decoder. The decoder layer is composed of a GRU neural network, and finally, the predicted value is output.

[0095] This invention employs a bidirectional GRU (Bi-GRU) neural network model to encode historical time series. This model can encode the input time series x = (x1, x2, ... x... T The process involves forward and reverse recursion, and finally the weighted forward GRU output is integrated. and reverse output Output hidden state h t The intermediate layer is the temporal attention mechanism layer, and the output state of the attention is then used as the input to the decoder GRU neural network. Based on the above description, a temporal risk prediction framework based on a GRU encoder-decoder structure using a temporal attention mechanism can be constructed.

[0096] Step 6: Set the parameters and learning mechanism for the input layer, encoding layer, and decoding layer of the prediction model;

[0097] In this invention example, based on the constructed time-series risk prediction model, the parameters of the input layer are first set: the dimension of the model input, input_dims = 6, and the time step size of the model input, input_steps = 5. For the GRU neural network model of the encoding and decoding layers, the number of neurons, gru_units = 32, is given. The GRU neural network model code is: GRU(gru_units, batch_input_shape = (batch_size, input_steps, input_steps), and in the experiment, the batch size of the dataset is set to batch_size = 8.

[0098] Step 7: Configure the module structure of the attention layer in the prediction model;

[0099] The attention layer in the prediction model is implemented through the following modules: First, the Permute layer "Permute((2,1))(inputs)" performs row and column swapping; then, the Dense layer calculates the weight of each feature based on the softmax activation function; the lambda layer averages the multidimensional attention weights obtained from the second layer; the RepeatVector layer enables all dimensions of features to share a single attention; then, the Permute layer performs multiplication and transpose; finally, the Multiply layer multiplies the attention weights with the input data.

[0100] Step 8: Divide the feature vector sample set according to its three uses: training, validation, and testing;

[0101] Based on the obtained feature vector sample set, the ratio of training, validation, and test data is set to 8:1:1. The sample set is then divided. In this example, the total number of samples is n = 3336. According to the division ratio, a training set with a total of 2668 samples, a validation set with a total of 334 samples, and a test set with a total of 334 samples are obtained. Then, the batch size of the three datasets is set to batch_size = 8, and the datasets are divided according to the batch size. Finally, a training batch dataset (each batch contains 333 samples), a validation batch dataset, and a test batch dataset are obtained. The number of samples in each batch of the two datasets is 41.

[0102] Step 9: Train and validate the model using the divided training batch dataset and validation batch dataset, and test the prediction accuracy of the model based on the test dataset;

[0103] The time-series risk prediction model was set to have 1000 learning epochs (N_epochs). Multiple training and validation batch datasets were used to train the proposed model. After these multiple epochs, the accuracy of short-term risk prediction for multi-attribute populations in epidemic transmission was validated using a test dataset. Figure 5 As shown in the embodiment of the present invention, the risk prediction effect of the prediction framework on the student population (MP, mathematics and physics classes) is evident. The predicted value is very close to the actual value, indicating the effectiveness of the prediction framework. In addition, the present invention calculates the root mean square error (RMSE) and mean absolute error (MSE) based on the predicted value and the actual value. The calculation formulas for both are as follows:

[0104]

[0105]

[0106] The range of both error evaluation indicators is [0,1]. The larger the value, the greater the error. In the example of this invention, the calculated MSE = 0.007 and RMSE = 0.084, which shows that the error between the predicted value and the true value obtained by this model is small, indicating that the prediction effect of the proposed model is good.

[0107] Through the above steps, a multi-attribute population risk prediction method based on bidirectional GRU and complex networks can be constructed. In this technique, we utilize complex network theory and data mining techniques to refine time-series contact data, analyze contact patterns, construct a weighted interpersonal contact network based on the number of contacts and total contact duration, and calculate the role or influence of individuals in the network, obtaining multiple indicators to label nodes. Simulating the dynamic spread of an epidemic, we quantitatively assess the risk values ​​of different attribute groups during transmission, including the probability of infection and the average number of secondary transmissions. The data is preprocessed to obtain a time-series risk sample dataset for multi-attribute groups. This invention proposes a prediction framework based on an attention-based GRU encoder-decoder structure. Training and learning on the above sample input set enables accurate short-term risk prediction for multi-attribute groups. After a widespread epidemic, this method helps policymakers to specifically predict the risks of different attribute groups based on their attributes, thereby improving the efficient use of resources and maximizing public health protection.

[0108] The above description is only a partial embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Parts of the present invention not described in detail belong to well-known technology in the art.

Claims

1. A multi-attribute population risk prediction method based on bidirectional GRU and complex networks, characterized in that, The steps are as follows: Step 1: Obtain multi-attribute temporal contact data, perform data mining analysis, and refine the data based on individual attributes and spatiotemporal contact behavior; Step 2: Based on the behavioral characteristics of different attribute groups, mine the contact patterns between individuals, construct a weighted interpersonal contact network according to the number of contacts and the duration of contact, and extract the characteristics of individuals in the network; Step 3: Simulate the dynamic transmission process of an epidemic using a time-series contact network, analyze the dynamic transmission mechanism, and quantitatively assess the risk to different population groups based on the transmission results; Step 4: Integrate individual characteristics and risk indicators according to time characteristics, preprocess the samples of the multi-attribute risk time series dataset, and obtain a time series dataset with a unified format under different attributes. Step 5: Construct the overall GRU module structure for time series risk prediction; Step 6: Set the parameters and learning mechanism for the input layer, encoding layer, and decoding layer of the prediction model; Step 7: Configure the module structure of the attention layer in the prediction model; Step 8: Divide the feature vector dataset into three parts based on its purpose of training, validation, and testing; Step 9: Train and validate the model using the divided training batch dataset and validation batch dataset, and test the prediction accuracy of the model based on the test dataset; In step 5, the following steps are taken: a risk prediction framework with a GRU encoder-decoder structure that introduces a temporal attention mechanism is introduced. This framework consists of three parts: an encoder composed of bidirectional GRUs, an attention layer with a temporal attention mechanism, and a GRU neural network as a decoder. The encoder is responsible for learning temporal information from the input time-series risk sequence. It employs a bidirectional GRU neural network model to encode the historical time series. The Bi-GRU consists of a forward GRU and a backward GRU. The bidirectional GRU model encodes the input time series x = (x1, x2, ... x...). T The hidden state h is then processed recursively in both forward and reverse directions and finally integrated and weighted to output. t The expression is: The arrow indicates the processing direction, x t h represents the input to the Bi-GRU model. t The output hidden state of the Bi-GRU model is represented by the bidirectional GRU encoder GRU. encoder The output of the forward GRU is combined based on the sum of its elements. and reverse output The intermediate layer is where the temporal attention mechanism operates. The calculation process of the attention layer is shown below: First, based on the hidden state h output by the current encoder... t And the current hidden state s of the decoder i The similarity between the two is measured by the score function in formula (2). The calculation methods include: calculating the dot product, calculating the cosine similarity, and using a neural network (ML) to solve the problem, thereby obtaining the first-order correlation value matrix e. i,t , representing the relevance of the i-th variable at time t∈[1,2,...,j,...,n], where the values ​​in the matrix are then normalized using formula (3) to obtain the attention weight value β. i,t The softmax function is used to process a vector e of length n. i After normalization, the final state c of the attention layer output is obtained by formula (4). t ; Then the output state c of the attention layer t As a decoder GRU decoder The input to the neural network is the state s of the hidden layer at the previous time step, which is then processed by the decoder. t-1 With input state c t The predicted value is output recursively using the following expression: y t =GRU decoder (c t ,s t-1 )(5); In step 7, the procedure is as follows: ① The first layer is the permute layer: the output of the Bi-GRU model is used as the input sequence inputs. The first and second dimensions of the input are permuted by Permute((2,1)), that is, the rows and columns are interchanged; the input dimension is input_dim=5, and the time step is time_steps=1000, which is adjusted from (1000 rows, 5 columns) to (5 rows, 1000 columns); ② The second layer is the dense layer: the softmax activation function is used to calculate the weight of each feature, and the calculation process is based on formula (3); ③ The third layer is the Lambda layer: the multidimensional attention weights obtained from the second layer are averaged using the formula Lambda(lambda x:K.mean(x,axis=1)), where K.mean is the main function that can take the mean of the weight vector; ④ The fourth layer is the RepeatVector layer: the obtained average weights are copied according to the input dimensions, which is achieved by the command RepeatVector(input_dim) to make the weights of each feature dimension consistent; ⑤ The fifth layer is still the permutation layer, i.e., the Permute layer: Based on the weights obtained in ④, in order to multiply with the corresponding elements of the input data, the transpose dimension needs to be changed before multiplication. This is done by using the command Permute((2,1)), which transposes the (5 rows, 1000 columns) weight matrix into a (1000 rows, 5 columns) data format. ⑥ The sixth layer is the multiplication layer: the transposed attention weight data is multiplied with the corresponding elements of the input data, which is achieved by the command Multiply().

2. The multi-attribute population risk prediction method based on bidirectional GRU and complex networks according to claim 1, characterized in that: In step 1, the procedure is as follows: Obtain multi-attribute time-series contact data from relevant research and websites that specialize in collecting contact data. The dataset includes valid contacts collected over a certain time interval, specifically including the individual's anonymous ID and the individual's corresponding type / attribute. Each row in the time-series data is in the form of: t ij C i C j Where i and j are the anonymous IDs of the contacts, and t ij C represents the moment of contact between two individuals. i and C j These represent the attributes of each individual, and the effective contact time interval is [t-20s, t], where t is expressed in seconds.

3. The multi-attribute population risk prediction method based on bidirectional GRU and complex networks according to claim 1, characterized in that: In step 2, the following steps are taken: Data mining is performed on the time-series contact data, considering the behavioral characteristics of different attribute groups, and the data is subdivided into contact relationships in different time periods, i.e., divided into n contact relationship networks; statistical preprocessing is performed on each group of data, and based on agent-based modeling, the number of contacts N for each ID(i) is counted. Ci The duration of contact T with each contact Cij And the total duration of contact T Ci T Ci =∑ j T Cij We combine the number of contacts and the duration of contact to measure the weights of the edges, thereby constructing a weighted interpersonal contact network. Based on the constructed contact network, we extract the feature indicators of each ID in the network, including the degree, degree centrality, proximity centrality, and clustering coefficient of the node, and label each node ID.

4. The multi-attribute population risk prediction method based on bidirectional GRU and complex networks according to claim 1, characterized in that: In step 3, the specific steps are as follows: For the constructed temporal contact network, the transmission rate in the transmission model is improved by combining weights to simulate the epidemic transmission process. Based on the transmission results, the risk value of each attribute population under the epidemic transmission is quantitatively assessed, including the risk of infection and the risk of being infected.

5. The multi-attribute population risk prediction method based on bidirectional GRU and complex networks according to claim 1, characterized in that: In step 4, the procedure is as follows: Based on the individual risk indicators calculated for each time period, data processing is performed according to individual attribute characteristics to obtain the risk indicators for each group and their characteristics in the contact network. Then, these are integrated according to time to obtain a time-series dataset with a unified format under different attributes. For the time-series dataset of teacher risk: t l Risk(in) l Risk(out) l D l DC l CC l ..., where l∈[1,n] represents a temporal contact network relationship, Risk(in) l This represents the average risk of infection for teachers and similar groups. l This represents the average risk of this group spreading outwards, D. l DC represents the average degree of this type of population within the contact network. l CC represents the average degree centrality of this type of population in the contact network l. l This indicates the average proximity centrality of this type of population within the contact network l.

6. The multi-attribute population risk prediction method based on bidirectional GRU and complex networks according to claim 1, characterized in that: In step 6, the procedure is as follows: Based on the constructed time-series risk prediction model, first, set the parameters of the input layer: input dimension input_dims, and input time step size input_steps; for the GRU neural network model of the encoding and decoding layers, the number of neurons gru_units is given; the formula for forward propagation of the GRU neural network model is: r t =σ(U r x t +W r h t-1 +b r ) z t =σ(U z x t +W z h t-1 +b z ) Where, x t h is the i-th element in the input time series sequence; t-1 This represents the hidden layer state at the previous time step; r t and z t These represent the reset gate and the update gate, respectively. U r W r U z W z W c W c Both represent training weights, b r ,b z ,b c The offset is σ(·), which is a non-linear activation function that restricts the gate value to a specific interval [0,1]. ⊙ is the multiplication operator; the gate is reset. t h is used to control the hidden layer state at the previous time step. t-1 To what extent is the current hidden layer state updated? Update Gate Z t h is used to control the hidden layer state at the previous time step. t-1 To what extent is the current hidden layer state h updated? t .

7. The multi-attribute population risk prediction method based on bidirectional GRU and complex networks according to claim 5, characterized in that: In step 8, the procedure is as follows: Based on the obtained feature vector sample set, i.e., the time-series risk dataset: t l Risk(in) l Risk(out) l D l BC l ..., where l∈[1,n] represents one of the temporal contact networks; The training, validation, and test data ratios are set to 8:1:

1. The sample set is divided into training, validation, and test sets. With n = 10000, the training set has 8000 samples, the validation set has 1000 samples, and the test set has 1000 samples. Next, the batch size (bach) is set for the three datasets. The datasets are divided into 8 batches, resulting in a training batch dataset with 1000 samples per batch, a validation batch dataset, and a test batch dataset, with each batch containing 125 samples.

8. The multi-attribute population risk prediction method based on bidirectional GRU and complex networks according to claim 1, characterized in that: In step 9, the procedure is as follows: The learning epochs N_epochs of the time-series risk prediction model are set. The proposed model is trained through multiple epochs using pre-defined training and validation datasets. After multiple epochs, the accuracy of short-term risk prediction for multi-attribute populations during epidemic transmission is validated based on the test dataset. The test dataset is used as input, and the trained model yields the predicted risk results, which are then compared with the actual results to verify the model's predictive effectiveness. Furthermore, the root mean square error (RMSE) and mean absolute error (MSE) are used as model error evaluation metrics, calculated using the following formulas: Where, y′ t Represents the predicted value, y t This represents the true value, and N represents the total number of samples in the test batch dataset.

Citation Information

Patent Citations

  • Promotion prediction method and system based on depth model

    CN111126674A

  • Infectious disease transmission prediction system and device fusing spatio-temporal information

    CN113314231A