Multi-pathogen ecological interaction method based on dynamic environment hypergraph and counterfactual decoupling
By constructing a multi-pathogen ecological interaction method that decouples dynamic environment hypergraphs and counterfactual information, the problem of not being able to distinguish the transmission contributions of environmental and biological factors in existing technologies is solved, and accurate prediction and strategy support for multi-pathogen transmission are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG CENT FOR DISEASE CONTROL & PREVENTION
- Filing Date
- 2026-03-02
- Publication Date
- 2026-07-10
Smart Images

Figure CN122369971A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence data mining and computational epidemiology technology, specifically involving a multi-pathogen ecological interaction method based on dynamic environment hypergraph and counterfactual decoupling. Background Technology
[0002] With the development of artificial intelligence technology, using deep learning models for infectious disease prediction has become a research hotspot in the field of public health. Existing technical solutions mainly focus on single-disease transmission prediction based on spatiotemporal graphical neural networks (ST-GNNs), and multi-disease analysis based on multivariate time series analysis.
[0003] For example, Reference 1 (Cola-GNN: Cross-location Attention based Graph Neural Networks for Long-term Influenza Prediction[J], Proceedings of the 29th ACM International Conference on Information & Knowledge Management, 2020) constructs a geographic location-based graph structure, using a graph convolutional network (GCN) to capture the spatial dependencies between different cities and combining it with a recurrent neural network (RNN) to capture the temporal dependencies of influenza transmission. Similarly, Reference 2 (STAN: Spatio-Temporal Attention Network for Pandemic Prediction[J], Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, 2021) further improves the prediction accuracy for a single disease (such as COVID-19) by introducing a multi-head attention mechanism to dynamically adjust the correlation strength between different regions.
[0004] Although existing technologies have achieved good results in predicting the spread of single diseases based on physical contact or geographical proximity, they still have the following significant technical defects and limitations when facing the mining of multi-pathogen ecological interactions and group transmission scenarios in complex environments: 1. Traditional graph structures lack sufficient topological representation capabilities, making it difficult to model group transmission caused by "environmental homogeneity." Existing techniques typically employ simple graph structures, where nodes are connected only by pairs of edges. This structure is primarily suitable for describing point-to-point physical movement (such as population flow from city A to city B). However, in real-world epidemiological scenarios, infection often occurs within specific "environmental scenarios" (e.g., all individuals within the same week in an environment characterized by low temperature, high humidity, and high population mobility). This association based on shared environmental attributes exhibits "higher order" and "aggregational" characteristics. Traditional simple edges cannot effectively characterize this hypertopic structure of "multiple individuals sharing the same environment," resulting in models failing to capture the nonlinear aggregation effect of environmental factors on susceptible populations.
[0005] 2. The models confuse "environmental relevance" with "biological interaction," lacking the ability to decouple causality. In studies of coexisting multiple pathogens (such as influenza, COVID-19, and respiratory syncytial virus), existing techniques typically employ multi-task learning or multivariate time series models. These models primarily rely on statistical correlations for prediction. However, statistical correlations often contain numerous environmental confounding factors. For example, influenza and COVID-19 may both break out simultaneously in winter due to their adaptation to low temperatures (environmental relevance), but this does not imply a biological synergy between the two. Existing models cannot distinguish between such "spurious correlations" and genuine "biological antagonistic / synergistic mechanisms" (such as viral interference), resulting in seriously misleading correlation maps that fail to provide public health departments with a basis for precise intervention decisions, such as "staggered vaccination."
[0006] 3. Lack of pathogen entity modeling mechanisms for discrete individual data. Most existing models directly process aggregated time-series data (such as the total number of new cases per day in a city), ignoring micro-level individual characteristics (such as age, gender, and residential environment). In monitoring data lacking clear pathogen biological characteristics (such as gene sequences), existing technologies struggle to automatically learn the implicit niche characteristics of pathogens through data-driven methods, resulting in models being unable to dynamically extrapolate pathogen evolution trends under different population and environmental conditions.
[0007] In summary, existing technologies struggle to accurately distinguish the contributions of environmental and biological factors to the spread of multiple pathogens in the absence of contact network data, and are unable to quantify the strength of causal interactions between pathogens. Therefore, a novel prediction and data mining system capable of handling high-order environmental associations and possessing counterfactual causal reasoning capabilities is urgently needed. Summary of the Invention
[0008] To address the problems existing in the prior art, this invention proposes a multi-pathogen ecological interaction method based on dynamic environment hypergraph and counterfactual decoupling. This method is used to solve the problems in existing epidemiological prediction models, such as the inability to effectively characterize high-order group associations based on environmental homogeneity, the difficulty in distinguishing between spurious correlations caused by the environment and real biological interactions, and the lack of pathogen entity modeling mechanisms for discrete case data.
[0009] To achieve the above-mentioned objectives, this invention provides a multi-pathogen ecological interaction method based on dynamic environment hypergraph and counterfactual decoupling, comprising the following steps: Step 1: Collect samples containing demographic features, spatiotemporal environmental features, and multiple pathogen labels as the initial dataset, and perform data preprocessing and temporal feature enhancement to generate unified features for patients; Step 2: Based on unified features and preprocessed data, construct a ternary heterogeneous hypergraph containing patient nodes, environment prototype nodes, and pathogen prototype nodes; Step 3: Input the dynamic hypergraph sequence into the neural network model, learn the impact of the environment on the patient and the niche characteristics of the pathogen through the message passing mechanism, and fuse the temporal information to output the final patient state representation and pathogen feature representation. Step 4: Based on pathogen feature representation and patient status representation, construct a dual-channel inference network; the first channel calculates the true infection probability based on pathogen feature representation, and the second channel calculates the comparative infection probability by simulating a counterfactual scenario where a specific pathogen is missing; by comparing the true infection probability and the comparative infection probability, quantify and decouple the synergistic or antagonistic relationships between multiple pathogens. Step 5: Predict individual infection risk based on patient status representation, and generate a dynamic ecological map of pathogens using the decoupled pathogen interaction relationships.
[0010] Preferably, in step 1, the demographic characteristics include one or more of age, sex, and place of residence. The aforementioned spatiotemporal environmental characteristics include one or more of the following: the local population mobility index, average temperature, average humidity, and weather conditions for the week. The multi-pathogen label includes the detection results of multiple target pathogens represented by binary vectors.
[0011] Optionally, the data preprocessing described in step 1 includes: For continuous variables, Z-Score standardization is used; For discrete variables, one-hot encoding is used.
[0012] Preferably, the temporal feature enhancement in step 1 is to construct an enhanced environmental feature vector based on the pathogen incubation period logic, including: For the current moment, the preprocessed spatiotemporal environmental features are spliced with the environmental features of the past W consecutive moments, where W is the size of the lag window determined based on the incubation period of the pathogen.
[0013] This invention takes into account the "incubation period" and "environmental cumulative effect" of pathogen infection (i.e., the patient's condition in the week of diagnosis is often affected by the environment in the past 1-2 weeks), and designs a corresponding time-series lag window mechanism to index the environmental data of the patient's area in the past. By splicing the spatiotemporal environmental features (temperature, humidity, weather data) and demographic features (population mobility data) of the past, the model can capture high-risk time-series patterns such as "a sudden drop in temperature followed by a large-scale population movement".
[0014] More preferably, in step 1, the preprocessed demographic features are concatenated with the enhanced environmental feature vector to obtain uniform features for each patient.
[0015] By constructing unified features, the integrity of the input data in terms of time, space, and individual attributes is ensured.
[0016] Preferably, the construction of the ternary heterogeneous hypergraph containing patient nodes, environment prototype nodes, and pathogen prototype nodes in step 2 includes: Each patient sample is defined as a patient node, and the features of the patient nodes are uniform features; environmental prototype nodes are generated by clustering the spatiotemporal environmental features of all patients; pathogen prototype nodes are generated by initializing multiple pathogen latent vectors, where the number of pathogen prototype nodes is the number of types of target pathogens. Based on the similarity between patient nodes and environment prototype nodes in the feature space, an environment collaborative hyperedge is constructed, and each environment collaborative hyperedge connects an environment prototype node and all its corresponding similar patient nodes. Based on the multi-pathogen labels, pathogen infection attribution hyperedges are constructed, with each pathogen infection attribution hyperedge connecting a pathogen prototype node and all corresponding patient nodes infected with this pathogen. Based on the relationship between nodes and hyperedges, a hypergraph association matrix is generated and serialized by time step to form a dynamic hypergraph sequence.
[0017] More preferably, the rows of the hypergraph association matrix correspond to all nodes in the ternary heterogeneous hypergraph, which are, in order, patient nodes, environment prototype nodes, and pathogen prototype nodes; the columns of the hypergraph association matrix correspond to all hyperedges in the ternary heterogeneous hypergraph, which are, in order, all environment cooperative hyperedges and all pathogen infection attribution hyperedges. The elements in the hypergraph incidence matrix are used to indicate whether there is a connection between the corresponding node and the corresponding hyperedge.
[0018] More preferably, the filling rules for the hypergraph incidence matrix include: For each environmental collaboration hyperedge, mark the corresponding environmental prototype node and all patient nodes classified under this environmental type as connection states in the corresponding positions of the hypergraph association matrix. For each pathogen infection attribution hyperedge, mark the corresponding pathogen prototype node and all patient nodes whose test results indicate infection with this pathogen in the corresponding positions of the hypergraph association matrix as connection states. The remaining positions are marked as disconnected.
[0019] More preferably, during model training, the features of infected patient nodes are aggregated using an attention mechanism through the pathogen infection affiliation hyperedge, and the corresponding pathogen latent vectors are dynamically updated to encode the niche features of the corresponding pathogens.
[0020] Preferably, in step 3, the neural network model is a temporal-ecological dual-stream hypergraph neural network, including: an environmental risk diffusion module, a pathogen niche aggregation module, and a global temporal memory fusion module; The environmental risk diffusion module is used to aggregate the features of all patient nodes on each environmental collaborative hyperedge to generate an environmental fingerprint that represents the overall risk status of the environment; calculate the risk filtering weights through a gating function with the features of the environmental prototype nodes as input; and after weighting the environmental fingerprints with the risk filtering weights, return and update the feature representations of each patient node within this environmental collaborative hyperedge. The pathogen niche aggregation module is used to calculate attention weights for each pathogen, using the feature vector of its corresponding pathogen prototype node as the query vector and the features of all patient nodes currently infected with the pathogen as the key vector; to perform weighted aggregation of the features of the infected patient nodes based on the attention weights; and to input the weighted aggregated features and the feature state of the pathogen prototype node at the previous time step into the recurrent neural network unit, and output the updated pathogen feature representation at the current time step. The global temporal memory fusion module is used to fuse the feature representation of the patient node updated in the environmental risk diffusion module with the feature representation of the original patient node for each patient node to form a candidate state at the current moment; the candidate state and the memory state of the patient node at the previous moment are input into the recurrent neural network unit to output the final patient state representation at the current moment.
[0021] More preferably, the recurrent neural network unit is a gated recurrent unit.
[0022] Preferably, in step 4, the second channel achieves counterfactual intervention by constructing a mask vector, specifically including: for the target pathogen to be simulated as missing, generating a mask vector that sets its corresponding features to zero; The mask vector is multiplied element-wise with the complete pathogen feature matrix to obtain the counterfactual pathogen feature matrix, which is used to calculate the comparative infection probability.
[0023] Preferably, in step 4, the interaction between the two pathogens is quantified and determined in the following way: Simulate a counterfactual scenario that invalidates the characteristics of the first pathogen, and calculate the difference in the infection probability of the second pathogen under the real scenario and this counterfactual scenario respectively. Based on the comparison between the difference and a preset threshold, it is determined whether the first pathogen has a synergistic, antagonistic, or no direct biological interaction relationship with the second pathogen.
[0024] More preferably, if the difference is greater than a preset positive threshold, it is determined to be a cooperative relationship; If the difference is less than a preset negative threshold, it is determined to be an antagonistic relationship; If the absolute value of the difference is less than or equal to the preset threshold, it is determined that there is no direct biological interaction.
[0025] Preferably, a total loss function is established for training the neural network model parameters and the dual-channel inference network parameters. The total loss function is composed of a weighted sum of prediction accuracy loss, sparsity constraint loss, and orthogonality constraint loss. The sparsity constraint loss is used to make the pathogen interaction effect values output by the neural network model and the dual-channel inference network tend to be sparse; the orthogonal constraint loss is used to suppress the interaction effect estimation caused by the similarity of pathogen feature representation, so as to distinguish between environmental co-occurrence and real biological interaction.
[0026] Preferably, in step 5, the pathogen dynamic ecological map represents pathogens with nodes and interaction relationships with directed edges between nodes; wherein, red edges represent synergistic relationships, blue edges represent antagonistic relationships, and the thickness of the edges is positively correlated with the absolute value of the biological interaction gain value.
[0027] Compared with the prior art, the beneficial effects of the present invention include at least the following: (1) The multi-pathogen ecological interaction mining system based on dynamic environment hypergraph and counterfactual decoupling proposed in this invention effectively solves the technical problem that existing epidemiological models cannot handle discrete data without contact records and have difficulty distinguishing between environmental co-occurrence and biological real antagonism through the time-series-ecological dual-stream hypergraph evolution network designed at the structural level and the counterfactual mask interference decoupling module.
[0028] (2) Validated by long-term monitoring datasets from multiple disease control centers, the present invention significantly improves the infection prediction accuracy in multi-pathogen concurrent scenarios, reaching 86.2%, and achieves an F1 score of 0.85 for identifying synergistic and antagonistic relationships among pathogens. By accurately quantifying the effects of "viral interference" and "immune synergy," the system can output a visualized dynamic ecological interaction map, enabling public health departments to formulate more precise staggered prevention and control strategies based on the checks and balances mechanisms among pathogens. Attached Figure Description
[0029] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0030] Figure 1 This is a flowchart illustrating the multi-pathogen ecological interaction method based on dynamic environment hypergraph and counterfactual decoupling provided by the present invention.
[0031] Figure 2 A schematic diagram of the deep learning network structure provided by this invention. Detailed Implementation
[0032] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and given in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0033] The inventive concept of this invention is to design a multi-pathogen ecological interaction mining system based on dynamic environmental hypergraphs and counterfactual decoupling. The aim is to accurately capture environment-driven group transmission characteristics in the absence of direct social contact records by constructing a dynamic hypergraph structure capable of expressing the complex topological relationships between "patient-environment-pathogen". Furthermore, by utilizing the counterfactual interference mechanism in causal inference, environmental confounding factors are removed from multidimensional coupled data, enabling precise quantification and decoupling of synergistic and antagonistic relationships among multiple pathogens. This provides more interpretable and accurate decision support for clinical individual diagnosis and public health multi-disease prevention strategies.
[0034] like Figure 1As shown in the embodiment, the multi-pathogen ecological interaction method based on dynamic environment hypergraph and counterfactual decoupling includes the following steps: S1. Collect samples containing demographic features, spatiotemporal environmental features, and multiple pathogen labels as the initial dataset, and perform data preprocessing and temporal feature enhancement to generate unified features for patients.
[0035] The purpose of this step is to transform the raw, discrete patient case records into standardized, time-dimension-integrated numerical feature vectors that can be understood by the computer model. This forms the basis for all subsequent analyses.
[0036] S1.1 Patient surveillance data is collected weekly by the CDC and relevant medical institutions. Each data record is clearly defined as a sample. ,in , This represents the total number of samples. Each sample... It contains the following three parts of original information: 1. Demographic characteristics ( : Includes age (numerical), gender (0 / 1 category), and place of residence tags.
[0037] 2. Spatiotemporal environmental characteristics ( ): Includes the population mobility index (value), average temperature (°C), average humidity (%), and weather conditions (categorized, such as sunny / rainy) for the week.
[0038] 3. Multi-pathogen tags ( ): Contains detection results for K target pathogens (including influenza virus, SARS-CoV-2, respiratory syncytial virus, rhinovirus, etc.), denoted as a binary vector. (1 represents detected, 0 represents not detected).
[0039] S1.2 Feature Numericalization and Normalization Processing To eliminate model bias caused by different dimensions (such as temperature of 20℃ and flow index of 10000), the following standardization strategy is explicitly adopted: For continuous variables, Z-Score standardization is used for variables such as age, temperature, humidity, and mobility index. The following formula is used for conversion: , in, This is the mean of the variable across the entire dataset. The standard deviation is denoted as .
[0040] For discrete variables, One-Hot encoding is used. This encoding method is used for discrete variables such as gender and weather conditions.
[0041] Finally, the preprocessed demographic characteristics are obtained. and the spatiotemporal environmental characteristics after preprocessing .
[0042] S1.3 Enhancement of Temporal Lag Features Based on Latency Logic Based on a literature review, this invention considers the "incubation period" and "cumulative environmental effect" of pathogen infection (i.e., the patient's condition in the week of diagnosis is often influenced by the environment of the past 1-2 weeks) and designs a corresponding time-lag window mechanism. For each sample Environmental characteristics ,in( (For the current week), indexing the patient region over the past two weeks. Based on environmental data, we can clearly construct an enhanced environmental feature vector. : By stitching together temperature, humidity, weather data, and population mobility data from the past two weeks, the model is able to capture high-risk time-series patterns such as "a sudden drop in temperature followed by a large-scale population movement".
[0043] S1.4 Final unified representation of sample features The processed demographic features are concatenated with the enhanced environmental features to obtain the final input feature vector for each patient node. : This ensures the integrity of the input data in terms of time, space, and individual attributes.
[0044] S2. Based on unified features and preprocessed data, construct a ternary heterogeneous hypergraph containing patient nodes, environment prototype nodes, and pathogen prototype nodes.
[0045] This step is the core innovation of this invention. Since there are no direct social contact records between patients, traditional graphs are unusable. This invention innovatively constructs a hypergraph, using "environmental similarity" and "infection attribution" as links to connect isolated patient nodes, thereby uncovering group patterns.
[0046] Heterogeneous definition of S2.1 nodes The hypergraph constructed in this invention It contains three completely different types of nodes, which together constitute the physical basis for the spread of epidemics.
[0047] Clearly define three types of nodes: patient node set Each sample As a graph node The total number is It is the carrier of information, storing the feature vectors processed by S1. .
[0048] Environment prototype node set To categorize patients in similar environments, the enhanced environmental features of all samples were first analyzed. Clustering is performed to obtain Cluster centers (in this embodiment) ).this Each center is defined as an "environmental prototype node". ,represent A typical environment-demographic pattern (e.g., "low temperature + high mobility + elderly population" pattern). Each node represents a typical environment pattern; it is not only a cluster center but also a "hub" connecting patients.
[0049] Pathogen prototype node set Although the original data only contains binary labels (0 / 1) indicating whether the pathogen is carried or not, this invention innovatively constructs a unified high-dimensional feature space to quantify the ecological niches of different pathogens. Learnable "pathogen latent embeddings" , used to represent respectively The "biological ontological features" of pathogens are assigned to these vectors. These vectors are randomly initialized during the initial training phase using the Xavier Initialization method, and at this stage, they contain no biological information. Next, nodes are dynamically assigned semantic meanings; during the training iterations of the hypergraph neural network, these vectors act as "semantic aggregation hubs." Through hyperedge connections, features (such as age structure and environmental preferences) of all patient nodes carrying the pathogen converge onto this vector. Through this method, after training, the vector evolves from random noise into a "data-driven pathogen profile." For example, a pathogen vector might automatically capture the implicit feature of "low-temperature and high-humidity environment dependence," thus providing a mathematical basis for subsequent calculations of antagonistic / synergistic relationships between pathogens.
[0050] S2.2 Hyperedge Construction Rules To enable information to flow between these nodes, this invention designs two sets of hyperedge association rules with clear physical meaning.
[0051] The difference between a hyperedge and a regular edge is that a hyperedge can connect any number of nodes. This invention designs two types of hyperedges: Category 1 Pathway: Environmental Collaboration Beyond the Boundary
[0052] Calculate patients and The distance to each environment prototype node is used to assign it to the nearest [node name]. Within each cluster, the environment prototype node will be... and all patient nodes belonging to this cluster { } Wrapped on the same super edge The super-edge It is a connection to the environment prototype node This is the set of hypergraph connections to all patient nodes within the cluster. This hyperedge acts like a "giant virtual room." Regardless of where a patient is in the city, as long as their temperature, humidity, and mobility are similar that week, they are placed into the same room by the system. In this room, each person's risk can be referenced from another's.
[0053] This represents the rule of "grouping based on environment similarity," and is the sum of all environment class hyperedges. It is a collection of... The set of concrete hyperedges. As the first An environmental super-border is A specific edge in the set, corresponding to the first... An environmental cluster.
[0054]
[0055] Second type of channel: Hyperborder of pathogen infection attribution
[0056] Based on pathogen tags For the first Specified pathogens, including pathogen prototype nodes and all patient nodes infected with this pathogen { } Wrapped on the same super edge middle.
[0057] This hyperedge is like a "container" for a pathogen, containing a pathogen prototype node and all patient nodes infected with that pathogen. The pathogen node is the core, and all infected individuals focus on the core. Through this hyperedge, the pathogen, as the core, can observe the common characteristics of patients carrying the pathogen (such as discovering that most group members are children), thereby updating the pathogen's own profile.
[0058] As the "set" of all infected hyperedges, it is the sum of all concrete hyperedges, representing the whole of the "infection attribution" relationship in the graph: , In the subsequent model description, As a second channel, input This means that the neural network needs to process this simultaneously. Information within the superedge.
[0059] S2.3 Hypergraph Independence Matrix Construction and generation.
[0060] Hypergraph Independence Matrix The purpose of this construction is to transform the logical relationships of "which environment the patient belongs to" and "which virus the patient is infected with" into a two-dimensional numerical matrix that can be computed by a computer. This matrix explicitly defines the connection topology between all nodes and all hyperedges in the graph.
[0061] 2.3.1 Explicit Definition of Matrix Dimension First, clarify the matrix. What do the rows and columns represent? Rows represent the set of all nodes in the entire graph. : number of rows ; forward Line: Represents Patient nodes ( ); middle Line: Represents One environmental prototype node ( ); back Line: Represents One pathogen prototype node ( ); Columns represent the set of all superedges in the entire graph. : number of columns ; forward Column: Represents Environmental collaboration super-border ( ); back Column: Represents The infection belongs to the superborder ( ).
[0062] Therefore, the correlation matrix It is a dimension A sparse matrix, in which elements Represents a node Is it included in the hyperedge? middle.
[0063] 2.3.2 Block Construction Logic of Matrix To clearly illustrate the connections, the matrix will be used. It is divided into four logical blocks for filling: Part 1: Environmental Hyperedge Column (Previous) Filling rules for columns: For the Column (corresponding to the first) (One environmental cluster) Connecting environment prototype nodes: [This will connect the first] Row (i.e., the corresponding environment prototype node) Setting it to 1 means that the environment prototype itself must be inside the environment hyperedge, serving as the "anchor point" for information.
[0064] Connection of patient nodes: Traverse all One patient, if the patient The clustering labels are Then the first The row is set to 1, and all patients in this environment are "circled" into this row.
[0065] Setting all other positions to 0 means that pathogen nodes do not participate in environmental hyperedges.
[0066] Part Two: Pathogen Infection Hypermarginal Column (Post) Filling rules for columns: For the Column (corresponding to the first) (type of pathogens) Connection of pathogen prototype nodes: [The following is a continuation of the previous sentence, likely referring to a specific node or connection:] Row (i.e., the corresponding pathogen prototype node) Set to 1, the pathogen vector must be inside the infection superedge in order to aggregate patient features.
[0067] Connection of patient nodes: Traverse all One patient, if the patient Original label of whether the pathogen is carried Then the first The row is set to 1, and all patients infected with the virus are "circled" into this column.
[0068] All other positions are set to 0, and environmental nodes do not participate in the infection of superedges.
[0069] By constructing this matrix This invention successfully transforms unstructured epidemiological surveillance data into structured graph topology data, enabling the hypergraph convolutional network in subsequent steps to efficiently achieve bidirectional information transfer between "patient-environment" and "patient-pathogen" through matrix multiplication.
[0070] S2.3.3 Example of an association matrix Assume patient P1 lives in environment A and carries pathogen 1; patient P2 lives in environment A and does not carry any pathogen; patient P3 lives in environment B and carries both pathogens 1 and 2. The association matrix is shown in Table 1 below: Table 1
[0071] 2.4 Construction of Temporal Slices and Dynamic Hypergraph Sequences Before proceeding with model computation, the organization of the data over time must be clearly defined. This invention does not rely on a single static graph for data mining, but rather on a dynamic time-slicing mechanism.
[0072] Time step definition: Dividing the entire monitoring cycle into... A discrete time step, denoted as In the embodiment, each time step It represents one week.
[0073] Hypergraph Sequence: Based on the construction rules of S2.3, this invention, at each time step... Based on the patient data, environmental data, and infection labels for each week, an independent hypergraph snapshot is constructed. Therefore, the subsequent model input is no longer a single graph, but a sequence of hypergraphs. , Among them, the Supergraph It corresponds to a specific association matrix .
[0074] The time attribute of the variable: Patient characteristics Indicates the first The patient in Zhou's characteristics (age remains constant, but environmental characteristics change) change.
[0075] Pathogen vector Indicates the first The pathogen in the first The characteristic states after Zhou's evolution. Among them The initial state at time t is inherited from The results of the updates at any moment form a time chain.
[0076] S3. Input the dynamic hypergraph sequence into the neural network model, learn the impact of the environment on the patient and the niche characteristics of the pathogen through the message passing mechanism, and integrate the temporal information to output the final patient state representation and pathogen characteristic representation.
[0077] This step designs a specialized deep learning network structure that is fully adapted to the S2 hypergraph structure. The proposed TE-HGNN (Temporal-Ecological Hypergraph Neural Network) employs a two-stream message passing mechanism. The model aims to dynamically transmit and aggregate information on the hypergraph. Unlike general graph neural networks, this invention includes two parallel logical channels that simulate "unidirectional pressure from the environment on the host" and "bidirectional adaptation of the pathogen to the host," respectively, and incorporates gated recurrent units (GRUs) to capture the temporal inertia of epidemics.
[0078] The network at each time step It processes two information streams in parallel: "environmental risk diffusion" and "pathogen ecological aggregation," and passes the current state to the next moment through a temporal memory unit. The specific process is as follows: Figure 2 As shown.
[0079] S3.1 Overall Calculation Flow For each time step (from 1 to TE-HGNN performs the operations of the following three sub-modules. Input: Correlation matrix at the current time ; Node feature matrix at the current time ; The memory state passed down from the previous moment (Hidden State) .
[0080] 3.2 Module 1: Environmental Risk Stream This module simulates how "environmental risks" permeate into a group within that environment through "environmental collaborative hyperedges." This process involves only patient nodes and environment nodes.
[0081] 3.2.1 Environmental fingerprint aggregation For the An environment super-border This invention first aggregates the features of all patient nodes within the environment to calculate the current "population risk fingerprint" of that environment. : , This can be understood as checking the first By taking the average of the characteristics of all patients in a certain environment, a general profile of this population can be summarized.
[0082] 3.2.2 Environmental Risk Gating Not all environmental features are pathogenic. To filter out irrelevant noise, this invention designs a risk gating factor. : , in, This is the feature vector of the environmental prototype. This part can be considered as a smart valve. For example, if the environment is "25 degrees Celsius sunny day", the valve is closed ( ), to block transmission; if the environment is "0 degrees Celsius rainy day", the valve is opened ( ).
[0083] 3.2.3 Risk Feedback and Updates The gated and weighted group risk fingerprint is then transmitted back to each patient node in this environment. The updated features of the environmental flow are obtained. : , Here, ⨁ represents vector concatenation.
[0084] Module 2.3: Pathogen Niche Stream This module utilizes pathogen infection attribution hyperedges to allow pathogen vectors to... The system dynamically learns its host preferences (i.e., "niche"). This process involves both patient and pathogen nodes.
[0085] 3.3.1 Bidirectional Attention Query In order to update the pathogens in vector of time This invention uses this as a query to identify the characteristics of all patients infected with the virus at that time. As the key, calculate the attention score. : , in, This represents the vector state of the pathogen from the previous week (randomly initialized if it's the first week), which can be viewed as the pathogen "observing" its carrier. Attention score. The higher the value, the more representative the patient (such as a frail elderly person) is of the typical target of the virus.
[0086] 3.3.2 Ecological Niche Vector Evolution Based on the attention score, patient characteristics are weighted and aggregated to generate a new state of the pathogen at the current moment: .
[0087] GRU units are used here to update the pathogen vector. This means that the pathogen's characteristics are not mutated, but rather inherited historically. If it primarily infected children last week, it will tend to retain that characteristic this week unless the data forcibly alters it.
[0088] Pathogen variation and adaptation is a slow biological process, not mutation. Through the use of... The algorithm takes new features extracted from infected individuals this week as input and memorizes the feature vector of the pathogen from last week, merges the two, and outputs a new vector with a smooth transition. This simulates the evolution of the pathogen, rather than allowing the feature vector to jump drastically.
[0089] 3.4 Module 3: Global Temporal Memory Fusion By integrating the information from the two streams and combining it with the historical state, the final node representation at that moment is output.
[0090] Information fusion: For each patient node, its features obtained from the environmental flow are... It merges with its own original features to form a candidate state. .
[0091] Temporal Memory Update (GRU Cell): Using Gated Recurrent Units (GRUs) to capture the temporal inertia of an epidemic: , in, The patient In the The final dynamic latent vector of the week is a condensation of: personal attributes, environmental risks (from Module 1), and the latent risks of the previous week (from Module 3).
[0092] Commonly, the spread of epidemics has a "tail effect," even in the first few days... The environment suddenly improved, if the first There are pathogen carriers in a certain area of Zhou, and the risk of infection for patients remains high. The model calculates the immediate risk based on the current environment and integrates the cumulative risk status of the pathogen carrier from the previous week with the hidden state. This forces the model to review the data during prediction to ensure that the risk prediction curve is continuous and prevents misjudgments such as "extremely high risk yesterday, zero risk today" that do not conform to medical common sense.
[0093] This invention specifically employs a gated recurrent unit (GRU) as the temporal feature update operator. The reason for choosing GRU instead of traditional RNN or LSTM is that: the sample size of epidemic surveillance data is huge and the time span is long. While ensuring the capture of long-distance time dependence (i.e., capturing the temporal inertia and lag effect of epidemics), GRU has fewer parameters and a faster convergence speed, which can effectively avoid the gradient vanishing problem in the evolution of multi-pathogen features and achieve smooth tracking of pathogen niche drift.
[0094] 3.5 Output Summary go through =1 to After iterative calculations, the TE-HGNN model finally outputs: Final state matrix of all patients : Used to predict whether the patient will be infected next week.
[0095] The final evolution vector of all pathogens This set of vectors has fully "learned" their respective biological characteristics and serves as a key input for reasoning in step four, used to decouple antagonistic / synergistic relationships between pathogens.
[0096] After S3 is completed, the pathogen vector It is no longer the initial random noise, but an entity vector that has absorbed all the characteristics of infected individuals and contains rich "niche information"; at the same time, the patient's state It has also incorporated environmental risks and historical memories.
[0097] S4. Based on pathogen feature representation and patient status representation, a dual-channel inference network is constructed. The first channel calculates the true infection probability based on pathogen feature representation, and the second channel calculates the comparative infection probability by simulating a counterfactual scenario where a specific pathogen is missing. By comparing the true infection probability and the comparative infection probability, the synergistic or antagonistic relationship between multiple pathogens is quantified and decoupled.
[0098] This step is the core of the system's decision-making process. Unlike traditional models that directly use correlations for prediction, this step constructs a dual-tower inference architecture that includes both "real-world pathways" and "counterfactual world pathways." Its core logic is: utilizing the pathogen evolution vector output from step 3... Through mathematical intervention, the causal impact of "removing a certain pathogen" on the overall infection pattern is quantitatively analyzed, thereby generating a pure biological interaction map that excludes environmental interference.
[0099] 4.1 Constructing a Bilinear Interactive Inference Network First, a baseline prediction model is established to assess the probability of infection in patients given the current combination of pathogens.
[0100] Input preparation: Patient context information: retrieve the first output of S3. The patient at the final moment Dynamic latent vectors .
[0101] Pathogen panorama matrix: This represents the complete evolution of S3. A pathogen vector is stacked to form a pathogen feature matrix. , of which Action is the key. .
[0102] Network architecture design: To capture the nonlinear fit between pathogens and patients, this invention designs a bilinear matching layer: , in, It is a projection matrix that maps patient features to the interaction space. It is a learnable bilinear interaction core matrix used to capture deep matching relationships between host features and pathogen features. It outputs the patient's... Unnormalized infection scores for each pathogen.
[0103] Baseline probability calculation: The predicted probability of the "real world" is obtained by using the Sigmoid activation function: .
[0104] 4.2 Implementing counterfactual masking interference To decouple pathogens For pathogens The image, in this invention, uses the do operator to calculate and simulate an environment where pathogens do not exist. A parallel world.
[0105] Interference operation definition: For each target pathogen acting as an "influencer" ( This invention generates a hard mask vector. Its dimensions and same: .
[0106] Counterfactual feature construction: Applying a mask to the pathogen matrix yields a "partial" pathogen matrix. , In this mathematical expression, pathogen All of the pathogen's characteristics (niche, host preference) are instantly wiped out, which is equivalent to the pathogen being "extinct" in the ecosystem.
[0107] Counterfactual probability calculation: Calculate the incomplete matrix Re-inputting the data into the exact same bilinear network in S4.1 (with shared parameters) yields the predicted probability of the "counterfactual world": .
[0108] 4.3 Quantification and Decoupling of Biological Interaction Gains This step is crucial in distinguishing between "environmental synergy" and "biological antagonism," as it involves calculating the difference between the true probability and the counterfactual probability.
[0109] Calculating causal effects: for the affected pathogens (when When removed), its biological interaction gain (BIG) is defined as: , This is for all The average value of each patient is taken to obtain a general pattern.
[0110] Three-category logical judgment rule: Synergism: If (Positive threshold). In the real world... ,predict The probability is high; After being removed, The probability of this decreases significantly. This indicates... The existence of .
[0111] Antagonism: If (Negative threshold). In the real world... ,predict The probability is suppressed; After being removed, The probability of [something] actually rebounded and increased. This indicates... The existence of inhibited .
[0112] Irrelevant: If ,regardless Does it exist? The infection rates remained essentially unchanged. Even if they frequently appeared together in the raw data, it was only because they shared similar environmental characteristics (processed by the environmental stream in step 3), rather than being biologically related.
[0113] In this invention, It is 0.75.
[0114] 4.4 Global Optimization This invention corrects the entire network by using a specialized loss function. It designs a hybrid constraint loss function to ensure the model learns... and It is meaningful; the present invention constructs the following total loss: .
[0115] Loss of prediction accuracy It is the real world and real labels The binary cross-entropy loss. This is the fundamental task of the model, forcing the system to accurately learn the matching relationship between patient characteristics and pathogen characteristics, ensuring accurate prediction of "who has what disease".
[0116] sparsity constraints The physical meaning of this constraint is the assumption that strong antagonism / cooperation in ecosystems is sparse, avoiding overfitting by making the model assume "everything is relevant." Based on ecological principles, strong biological antagonism or cooperation in nature is typically sparse. This constraint forces the model to compress weak, ambiguous, noisy correlations to zero, retaining only the most significant strong interactions, thus avoiding "over-interpretation." .
[0117] Environment-biological orthogonal constraints : , To completely eliminate false positive interference caused by "environment co-occurrence," this invention innovatively designs an orthogonal penalty term. If the vector directions of two pathogens are too similar, and they are very similar in feature space (indicating a high degree of overlap in their host / environment preferences), we forcibly penalize the causal association value between them, because this is likely only caused by environmental factors. This further forces the model to retain only those deep biological interactions that cannot be explained by "similarity."
[0118] This formula implies that the more similar two viruses are (the more similar their environmental preferences), the more severely we penalize the causal interaction value between them. This forces models to look for deep biological mechanisms that still have strong correlations even when environmental preferences differ. and These are hyperparameters used to adjust the weights of different tasks.
[0119] S5. Based on patient status representation, predict individual infection risk and generate a dynamic ecological map of pathogens using decoupled pathogen interaction relationships.
[0120] This step is crucial for the system to achieve a closed loop. Based on the temporal dynamic features generated in S3 and the counterfactual reasoning architecture constructed in S4, it outputs micro-level individual infection risk predictions and macro-level pathogen ecological interaction maps.
[0121] 5.1 Generation and Output of Dual-View Prediction Results Once the training is completed and the entire process is integrated into a system, it will have two core functions: serving individual medical treatment and public health decision-making.
[0122] 5.1.1 Microscopic Perspective: Predicting Individual Infection Risk Application scenario: Clinical auxiliary diagnosis.
[0123] Input: A new patient Demographic information and environmental information for the week.
[0124] Solution: Integrate the patient as a new node into the current hypergraph, and perform a single forward propagation.
[0125] Output: one dimensional probability vector, for example .
[0126] The system prompted the doctor: "Although the patient has low mobility in his / her residence, given his / her advanced age and the high compatibility of the current 'influenza-environment', it is recommended to prioritize screening for influenza."
[0127] 5.1.2 Macro Perspective: Dynamic Ecological Map of Pathogens Application scenario: Development of multi-disease prevention and control strategies.
[0128] Generation logic: Extract the interaction matrix BIG after training convergence.
[0129] Visual representation: Generate a dynamic graph G.
[0130] Node: Represents For each pathogen, the node size represents the pathogen's current environmental fitness. Red line (collaboration): Connect Node pairs.
[0131] Policy recommendation: "A strong synergistic effect has been detected with a certain pathogen (thick red line), and it is recommended to promote vaccine prevention and control at the current time."
[0132] Blue lines (antagonistic): Connect Node pairs.
[0133] Decision recommendation: "A strong antagonism (thick blue line) was detected against a certain pathogen, indicating that the pathogen will be suppressed during its outbreak period. Medical resources can be adjusted accordingly."
[0134] Thus, this invention completes a full closed loop from discrete monitoring data to hypergraph structuring, and then to causal mechanism decoupling.
[0135] To demonstrate the effectiveness of the multi-pathogen ecological interaction method based on dynamic environment hypergraph and counterfactual decoupling provided in this invention, experimental verification was conducted. The results are shown in Table 2.
[0136] Table 2
[0137] Note: STGCN (Spatiotemporal Convolutional Network), DCRNN (Diffusion Convolutional Recurrent Neural Network), ASTGCN (Attention-Based Spatiotemporal Graph Convolutional Network), Cola-GNN (Graph Neural Network Based on Cross-Location Attention).
[0138] The present invention significantly improves the infection prediction accuracy in multi-pathogen concurrent scenarios, reaching 86.2%, and achieves a Macro-F1 score of 0.85 for identifying synergistic and antagonistic relationships among pathogens.
[0139] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A multi-pathogen ecological interaction method based on dynamic environment hypergraph and counterfactual decoupling, characterized in that, Includes the following steps: Step 1: Collect samples containing demographic features, spatiotemporal environmental features, and multiple pathogen labels as the initial dataset, and perform data preprocessing and temporal feature enhancement to generate unified features for patients; Step 2: Based on unified features and preprocessed data, construct a ternary heterogeneous hypergraph containing patient nodes, environment prototype nodes, and pathogen prototype nodes; Step 3: Input the dynamic hypergraph sequence into the neural network model, learn the impact of the environment on the patient and the niche characteristics of the pathogen through the message passing mechanism, and fuse the temporal information to output the final patient state representation and pathogen feature representation. Step 4: Based on pathogen feature representation and patient status representation, construct a dual-channel inference network; the first channel calculates the true infection probability based on pathogen feature representation, and the second channel calculates the comparative infection probability by simulating a counterfactual scenario where a specific pathogen is missing; by comparing the true infection probability and the comparative infection probability, quantify and decouple the synergistic or antagonistic relationships between multiple pathogens. Step 5: Predict individual infection risk based on patient status representation, and generate a dynamic ecological map of pathogens using the decoupled pathogen interaction relationships.
2. The multi-pathogen ecological interaction method based on dynamic environment hypergraph and counterfactual decoupling as described in claim 1, characterized in that, Step 1 involves enhancing the temporal features by constructing an enhanced environmental feature vector based on the pathogen incubation period logic, including: For the current moment, the preprocessed spatiotemporal environmental features are spliced with the environmental features of the past W consecutive moments, where W is the size of the lag window determined based on the incubation period of the pathogen.
3. The multi-pathogen ecological interaction method based on dynamic environment hypergraph and counterfactual decoupling as described in claim 1, characterized in that, The construction of the ternary heterogeneous hypergraph containing patient nodes, environment prototype nodes, and pathogen prototype nodes described in step 2 includes: Each patient sample is defined as a patient node, and the features of the patient nodes are uniform features; environmental prototype nodes are generated by clustering the spatiotemporal environmental features of all patients; pathogen prototype nodes are generated by initializing multiple pathogen latent vectors, where the number of pathogen prototype nodes is the number of types of target pathogens. Based on the similarity between patient nodes and environment prototype nodes in the feature space, an environment collaborative hyperedge is constructed, and each environment collaborative hyperedge connects an environment prototype node and all its corresponding similar patient nodes. Based on the multi-pathogen labels, pathogen infection attribution hyperedges are constructed, with each pathogen infection attribution hyperedge connecting a pathogen prototype node and all corresponding patient nodes infected with this pathogen. Based on the relationship between nodes and hyperedges, a hypergraph association matrix is generated and serialized by time step to form a dynamic hypergraph sequence.
4. The multi-pathogen ecological interaction method based on dynamic environment hypergraph and counterfactual decoupling as described in claim 3, characterized in that, The rows of the hypergraph association matrix correspond to all nodes in the ternary heterogeneous hypergraph, which are, in order, patient nodes, environment prototype nodes, and pathogen prototype nodes; the columns of the hypergraph association matrix correspond to all hyperedges in the ternary heterogeneous hypergraph, which are, in order, all environment cooperative hyperedges and all pathogen infection attribution hyperedges. The elements in the hypergraph incidence matrix are used to indicate whether there is a connection between the corresponding node and the corresponding hyperedge.
5. The multi-pathogen ecological interaction method based on dynamic environment hypergraph and counterfactual decoupling according to claim 4, characterized in that, The filling rules for the hypergraph incidence matrix include: For each environmental collaboration hyperedge, mark the corresponding environmental prototype node and all patient nodes classified under this environmental type as connection states in the corresponding positions of the hypergraph association matrix. For each pathogen infection attribution hyperedge, mark the corresponding pathogen prototype node and all patient nodes whose test results indicate infection with this pathogen in the corresponding positions of the hypergraph association matrix as connection states. The remaining positions are marked as disconnected.
6. The multi-pathogen ecological interaction method based on dynamic environment hypergraph and counterfactual decoupling according to claim 1, characterized in that, In step 3, the neural network model is a temporal-ecological dual-stream hypergraph neural network, which includes: an environmental risk diffusion module, a pathogen niche aggregation module, and a global temporal memory fusion module; The environmental risk diffusion module is used to aggregate the features of all patient nodes on each environmental collaborative hyperedge to generate an environmental fingerprint that represents the overall risk status of the environment; calculate the risk filtering weights through a gating function with the features of the environmental prototype nodes as input; and after weighting the environmental fingerprints with the risk filtering weights, return and update the feature representations of each patient node within this environmental collaborative hyperedge. The pathogen niche aggregation module is used to calculate attention weights for each pathogen, using the feature vector of its corresponding pathogen prototype node as the query vector and the features of all patient nodes currently infected with the pathogen as the key vector; to perform weighted aggregation of the features of the infected patient nodes based on the attention weights; and to input the weighted aggregated features and the feature state of the pathogen prototype node at the previous time step into the recurrent neural network unit, and output the updated pathogen feature representation at the current time step. The global temporal memory fusion module is used to fuse the feature representation of the patient node updated in the environmental risk diffusion module with the feature representation of the original patient node for each patient node to form a candidate state at the current moment; the candidate state and the memory state of the patient node at the previous moment are input into the recurrent neural network unit to output the final patient state representation at the current moment.
7. The multi-pathogen ecological interaction method based on dynamic environment hypergraph and counterfactual decoupling as described in claim 1, characterized in that, In step 4, the second channel achieves counterfactual intervention by constructing a mask vector, specifically including: for the target pathogen to be simulated as missing, generating a mask vector that sets its corresponding features to zero; The mask vector is multiplied element-wise with the complete pathogen feature matrix to obtain the counterfactual pathogen feature matrix, which is used to calculate the comparative infection probability.
8. The multi-pathogen ecological interaction method based on dynamic environment hypergraph and counterfactual decoupling according to claim 7, characterized in that, In step 4, the interaction between the two pathogens is quantified and determined using the following methods: Simulate a counterfactual scenario that invalidates the characteristics of the first pathogen, and calculate the difference in the infection probability of the second pathogen under the real scenario and this counterfactual scenario respectively. Based on the comparison between the difference and a preset threshold, it is determined whether the first pathogen has a synergistic, antagonistic, or no direct biological interaction relationship with the second pathogen.
9. The multi-pathogen ecological interaction method based on dynamic environment hypergraph and counterfactual decoupling as described in claim 8, characterized in that, If the difference is greater than a preset positive threshold, it is determined to be a collaborative relationship; If the difference is less than a preset negative threshold, it is determined to be an antagonistic relationship; If the absolute value of the difference is less than or equal to the preset threshold, it is determined that there is no direct biological interaction.
10. The multi-pathogen ecological interaction method based on dynamic environment hypergraph and counterfactual decoupling according to claim 1, characterized in that, A total loss function is established to train the parameters of the neural network model and the dual-channel inference network. The total loss function is composed of a weighted sum of prediction accuracy loss, sparsity constraint loss and orthogonality constraint loss. The sparsity constraint loss is used to make the pathogen interaction effect values output by the neural network model and the dual-channel inference network tend to be sparse; the orthogonal constraint loss is used to suppress the interaction effect estimation caused by the similarity of pathogen feature representation, so as to distinguish between environmental co-occurrence and real biological interaction.