A hypergraph forgetting method based on hyper-edge size selection and coverage aggregation
By selecting hyperedge size and coverage aggregation methods, the problem of balancing computational efficiency and model performance in hypergraph neural networks in large-scale data processing is solved, achieving efficient hypergraph partitioning and feature aggregation, and improving the accuracy and stability of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2026-03-24
AI Technical Summary
Existing hypergraph neural network methods are computationally inefficient when dealing with large-scale hypergraphs, and existing partitioning methods fail to fully consider the size of hyperedges, making it difficult to balance computational efficiency and model performance.
By using a method based on hyperedge size selection and coverage aggregation, the top 40% of core hyperedges are selected as the core hyperedge set, and the remaining hyperedges are selected as the random hyperedge set. These are then assigned to subgraphs for training. Subgraph weights are calculated by combining node coverage and weighted aggregation is performed to generate the model output.
It significantly improves computational efficiency, reduces training time by approximately 40%, while maintaining model accuracy and stability. It is applicable to different types of hypergraph neural network models, expanding its application scope.
Smart Images

Figure CN120706468B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer system modeling technology, and more specifically, relates to a hypergraph forgetting method based on hyperedge size selection and coverage aggregation. Background Technology
[0002] Hypergraphs, as an important data structure, are widely used in social network analysis, knowledge graph processing, recommender systems, and bioinformatics. In microbial interaction networks, hypergraphs can be used to model complex high-order relationships between microorganisms. For example, a method and apparatus for building high-order microbial networks based on a hypergraph clustering model obtains the connection matrix between vertices through the reduction of the hypergraph association matrix, thereby achieving cluster analysis among microorganisms. Hypergraphs have wide applications in social network analysis, including community detection and event evolution. Hypergraphs can identify communities or groups in social networks; because hyperedges can connect multiple nodes, they can more effectively express high-order relationships between users. In protein-protein interaction networks (PPIs), hypergraphs can be used to represent interactions between proteins. Each molecular species acts as a node, and each reaction acts as a hyperlink connecting all involved molecular species; this representation more naturally expresses biochemical reaction networks. In genome-scale metabolic networks, hypergraph learning is used to identify missing reactions in the network. Metabolic networks or any biochemical reaction network have a very natural hypergraph representation, where each molecular species is a node, and each reaction is a hyperlink connecting all involved molecular species.
[0003] With the rapid growth of data volume, the processing and analysis of hypergraphs face enormous computational challenges. Hypergraph neural networks, as an emerging deep learning model, have achieved remarkable results in tasks such as node classification and link prediction by learning features and transmitting information on the hypergraph structure.
[0004] However, existing hypergraph neural network methods suffer from low computational efficiency when processing large-scale hypergraphs. Current mainstream solutions include sampling and partitioning methods. Sampling methods construct subgraphs for training by randomly selecting some nodes or hyperedges, but this approach easily loses important structural information, leading to a decline in model performance. Partitioning methods divide the hypergraph into multiple subgraphs for separate training, which can improve computational efficiency, but due to the lack of an effective information-sharing mechanism, the training results between different subgraphs often exhibit inconsistencies. Especially when dealing with hypergraphs with complex high-order relationships, how to improve computational efficiency while maintaining model performance has become a key research challenge. Furthermore, most existing hypergraph partitioning methods employ random partitioning or heuristic methods based on node degree, failing to fully consider the important feature of hyperedge size, which may lead to the partitioning results destroying key structural information of the original hypergraph. Therefore, how to achieve efficient computation and maintain model performance during hypergraph neural network training is a pressing technical problem that needs to be solved. Summary of the Invention
[0005] In view of this, the present invention provides a hypergraph forgetting method based on hyperedge size selection and coverage aggregation, which can solve the problem of low computational efficiency of existing hypergraph neural network methods when dealing with large-scale hypergraphs.
[0006] This invention is implemented as follows:
[0007] This invention provides a hypergraph forgetting method based on hyperedge size selection and coverage aggregation, comprising the following steps:
[0008] S10. Receive the input hypergraph and partition number, and calculate the hyperedge size for each hyperedge in the hypergraph;
[0009] S20. Sort the hyperedges in the hypergraph in descending order according to their size;
[0010] S30. Select the top 40% of the superedges after sorting as the core superedge set, and the remaining superedges as the random superedge set.
[0011] S40. Distribute the core hyperedge set to each subgraph, and distribute the random hyperedge set evenly and without overlap to the subgraph;
[0012] S50. Initialize the node features in the subgraph, wherein the node features are used to represent the initial state information of the nodes;
[0013] S60. A hypergraph neural network is used to train each subgraph independently, and the node features are updated by layer-by-layer feature propagation to obtain the final node features of each subgraph.
[0014] S70. Calculate the node coverage rate in each subgraph, where the node coverage rate is the ratio of the number of nodes in the subgraph to the number of nodes in the supergraph;
[0015] S80. Calculate the weight of each subgraph based on the node coverage rate;
[0016] S90. The final node features of each subgraph are weighted and aggregated according to the weights to generate model output.
[0017] The technical effects of the hypergraph forgetting method based on hyperedge size selection and coverage aggregation provided by this invention are as follows: This invention effectively solves the problem of balancing computational efficiency and model performance in hypergraph neural networks during large-scale data processing. First, by introducing hyperedge size as a core indicator and combining node average degree and clustering coefficient to rank hyperedge importance, a reasonable partitioning of the hypergraph structure is achieved. Experimental results show that selecting 40% of the core hyperedges can preserve the main structural features of the hypergraph while significantly reducing computational overhead. Second, a core hyperedge sharing mechanism is adopted to ensure that each subgraph contains key structural information, effectively avoiding the information loss problem that may be caused by random partitioning methods. Third, by introducing a weighted aggregation strategy based on node coverage, the contribution of different subgraphs is fully considered, improving the accuracy and stability of the model output. Experimental results on standard datasets show that, compared with existing methods, this invention reduces training time by approximately 40% while maintaining comparable accuracy. Especially when processing large-scale hypergraphs, this invention exhibits better scalability. Furthermore, the method proposed in this invention has good versatility and can be used in conjunction with different types of hypergraph neural network models, thus expanding its application scope. Through reasonable hyperedge selection and effective feature aggregation, this invention achieves a good balance between computational efficiency and model performance, providing a practical solution for processing large-scale hypergraph data.
[0018] Based on the above technical solution, the hypergraph forgetting method of the present invention based on hyperedge size selection and coverage aggregation can be further improved as follows:
[0019] Specifically, step S10 includes:
[0020] Step 101: Receive the original hypergraph data structure, which includes a set of nodes and a set of hyperedges, and receive a preset partition value, which is determined based on the data scale and computing resources.
[0021] Step 102: Establish a hash table data structure to store the superedge size information. The key value of the hash table data structure is the superedge number, and the storage value of the hash table data structure is the superedge size.
[0022] Step 103: Count the number of nodes for each superedge, obtain the size information of the superedge, and store the size information of the superedge in the hash table data structure;
[0023] Step 104: Introduce a node validity judgment function to filter invalid and abnormal nodes in the hyperedge;
[0024] Step 105: Adopt a parallel computing strategy to divide the hyperedge set into blocks for processing. Each computing unit is responsible for the node counting task of a subset, thereby improving computing efficiency.
[0025] Furthermore, step S20 specifically includes:
[0026] Step 201: Construct a ranking score function, which includes a superedge size term, a node average degree term, and a clustering coefficient term;
[0027] Step 202: Calculate the average degree of each node on each hyperedge. The average degree of the nodes is calculated using the arithmetic mean method.
[0028] Step 203: Calculate the clustering coefficient for each hyperedge, which is obtained by the local density evaluation method;
[0029] Step 204: Sort the superedges in descending order using an improved quicksort algorithm, wherein the quicksort algorithm selects the middle element as the pivot value.
[0030] Step 205: Establish secondary sorting rules, which take into account the superedge number and creation time in turn, to handle the case of the same score.
[0031] Furthermore, step S30 specifically includes:
[0032] Step 301: Determine the selection threshold based on the sorting result. The selection threshold is determined by the total number of hyperedges and the preset selection ratio.
[0033] Step 302: Mark the first 40% of the superedges in the sorting results as core superedges and construct a set of core superedges;
[0034] Step 303: Mark the remaining 60% of the superedges as random superedges and construct a set of random superedges;
[0035] Step 304: Introduce a boundary processing mechanism. When superedges with the same sorting score cross the selection threshold, all superedges with the same score are assigned to the same set.
[0036] Step 305: Verify the connectivity of the core hyperedge set to ensure that there are no isolated subgraph structures.
[0037] Furthermore, step S40 specifically includes:
[0038] Step 401: Copy the core hyperedge set to each subgraph to construct the initial structure of the subgraph;
[0039] Step 402: Using a cyclic allocation strategy, the superedges in the random superedge set are sequentially allocated to different subgraphs;
[0040] Step 403: Introduce a load balancing mechanism to record the number of super edges currently contained in each subgraph and prioritize allocation to subgraphs with fewer super edges.
[0041] Step 404: Maintain the allocation mapping table to record the subgraph number to which each superedge is assigned, ensuring that there are no duplicate assignments;
[0042] Step 405: Verify the structural features of each subgraph, including the calculation and evaluation of node coverage and edge density indices.
[0043] Furthermore, step S50 specifically includes:
[0044] Step 501: Initialize the inherent characteristics of the node, which include node attribute information and external data source characteristics;
[0045] Step 502: Calculate the node's neighbor information, wherein the neighbor information is aggregated using the average pooling method;
[0046] Step 503: Generate node position codes, which are calculated using a sine / cosine coding method;
[0047] Step 504: Fuse the inherent features, the neighbor information, and the location encoding to obtain an initial node feature matrix;
[0048] Step 505: Normalize the initial node feature matrix to ensure that features from different sources have similar numerical ranges.
[0049] Furthermore, step S60 specifically includes:
[0050] Step 601: Construct a hypergraph neural network model, wherein the hypergraph neural network model includes multiple feature propagation layers;
[0051] Step 602: Train the model using the batch gradient descent algorithm, wherein the learning rate of the batch gradient descent algorithm adopts a decay strategy;
[0052] Step 603: Introduce a residual connection mechanism to combine features from different layers to improve training performance;
[0053] Step 604: Adopt an early stopping strategy, and terminate training early when the performance index of the validation set fails to improve for several consecutive rounds.
[0054] Step 605: Perform post-processing on the node features of each subgraph, including feature normalization and outlier handling operations.
[0055] Furthermore, step S70 specifically includes:
[0056] Step 701: Calculate the ratio of the number of nodes in each subgraph to the number of nodes in the original hypergraph;
[0057] Step 702: Calculate the quality factor for each subgraph, whereby the quality factor takes into account the importance of the nodes;
[0058] Step 703: Maintain node access counts and record the number of times each node appears in different subgraphs;
[0059] Step 704: Introduce a connection number threshold. When the number of connections of a node in the subgraph is lower than the connection number threshold, it is not included in the coverage rate.
[0060] Step 705: Calculate the final node coverage rate by combining the node number ratio and the quality factor.
[0061] Furthermore, step S80 specifically includes:
[0062] Step 801: Set the initial value of the temperature parameter, which is updated using an exponential decay strategy;
[0063] Step 802: Calculate the weight of each subgraph based on the node coverage and the temperature parameter;
[0064] Step 803: Introduce a minimum weight constraint to ensure that the weight of each subgraph is not lower than a preset threshold;
[0065] Step 804: Normalize the weights so that the sum of all weights equals 1;
[0066] Step 805: Verify the rationality of the weight allocation and evaluate the impact of the weights on feature aggregation.
[0067] Furthermore, step S90 specifically includes:
[0068] Step 901: Calculate the global information matrix, which is obtained using the average pooling method;
[0069] Step 902: Align the features of different subgraphs to ensure that the features have the same dimensions and scale;
[0070] Step 903: Introduce a feature selection mechanism to filter and combine features based on their importance;
[0071] Step 904: Perform a weighted summation of the subgraph features based on the weights, and supplement it with the global information matrix;
[0072] Step 905: Generate the final model output, which includes the fused node feature representation.
[0073] 1. The calculation process for the superedge size is as follows:
[0074] S e =∑ v∈e 1;
[0075] In the formula, S e Let be the size of the hyperedge e; v be the node; e be the hyperedge; this formula represents the calculation of the number of nodes contained in the hyperedge.
[0076] 2. The score for superedge sorting is calculated as follows:
[0077] R e =S e +αD e +βC e ;
[0078] In the formula, R e S is the sorting score for hyperedge e; e D is the size of the superedge; e C represents the average degree of the hyperedge nodes; e α is the clustering coefficient of the hyperedge; β are the weight coefficients, ranging from 0 to 1. This formula takes into account the multidimensional features of the hyperedge, making the sorting more reasonable.
[0079] 3. Node feature initialization process:
[0080] X (0) =F I +γN+δP;
[0081] In the formula, X (0) F is the initial node feature matrix; I γ represents the inherent characteristics of a node; N represents the neighbor information of a node; P represents the location code of a node; γ and δ are balancing parameters, with values ranging from 0 to 1; this initialization method integrates multi-source information.
[0082] 4. Feature propagation process in hypergraph neural networks:
[0083]
[0084] In the formula, X (l) D is the node feature matrix of the ;th layer; v D is a diagonal matrix of node degree. fH is the hyperdiagonal matrix; H is the incidence matrix; W is the hyperdiagonal matrix. (l) Let be the weight matrix of the l-th layer; σ be the activation function; ∈ (l) This is the error term for the l-th layer, ranging from 0 to 0.1.
[0085] 5. Node coverage calculation:
[0086]
[0087] In the formula, C i Let V be the node coverage of subgraph i; i | represents the number of nodes in subgraph i; |V| represents the number of nodes in the original hypergraph; Q i λ is the quality factor of subgraph i; λ is the adjustment parameter, ranging from 0 to 0.5; this formula takes into account both quantity ratio and quality factor.
[0088] 6. Subgraph weight calculation:
[0089]
[0090] In the formula, w i C represents the weight of subgraph i; i τ is the node coverage of subgraph i; τ is the temperature parameter, ranging from 0.1 to 1; k is the number of subgraphs; this formula is normalized using the softmax function.
[0091] 7. Final feature aggregation calculation:
[0092]
[0093] In the formula, F final For the final aggregated features; w i Let i be the weight of subgraph i; denoted as the final layer feature of subgraph i; L is the total number of layers; M is the global information matrix; μ is the global information weight, with a value ranging from 0 to 0.3.
[0094] The design principles and innovations of these formulas are as follows:
[0095] The hyperedge ranking score formula considers three dimensions: size, degree, and clustering coefficient, which is more comprehensive than the traditional method that only considers size.
[0096] The node feature initialization integrates inherent features, neighbor information, and location encoding, thereby improving the expressive power of the features;
[0097] The feature propagation process employs a normalized Laplacian operator and introduces an error term to enhance robustness;
[0098] The node coverage calculation takes into account both quantity and quality factors, making the assessment more accurate;
[0099] The weight calculation uses a softmax function with a temperature parameter, which can adjust the smoothness of the weight distribution.
[0100] The final feature aggregation introduces a global information matrix, which helps maintain global consistency.
[0101] Compared with existing technologies, the formula system of this invention has the following advantages:
[0102] It considers more comprehensive factors and integrates multi-dimensional features;
[0103] Multiple adjustable parameters are introduced, making it more adaptable;
[0104] Incorporating an error term and a quality factor improves robustness;
[0105] A temperature regulation mechanism was designed to control the weight distribution;
[0106] It combines global information to balance local and global features.
[0107] The derivation process for each equation or formula is provided below:
[0108] 1. Derivation of the formula for calculating the size of the superedge:
[0109] The most basic calculation of the superedge size is simple counting:
[0110] S e =∑ v∈e 1;
[0111] This is a basic statistic, obtained directly by enumerating and counting the nodes in the hyperedge.
[0112] 2. Derivation of the formula for calculating the score of the hyperedge sorting:
[0113] First, consider the size of a single hyperedge:
[0114]
[0115] Then, the average degree information of the nodes is introduced:
[0116]
[0117] Finally, adding the clustering coefficient term yields the complete form:
[0118] R e =S e +αD e +βC e ;
[0119] in:
[0120] Node average degree calculation:
[0121]
[0122] In the formula, d v Let |e| be the degree of node v; and let |e| be the number of nodes in hyperedge e.
[0123] Clustering coefficient calculation:
[0124]
[0125] In the formula, u~v indicates that nodes u and v are connected. 3. Derivation of node feature initialization process: Basic feature representation:
[0126]
[0127] Add neighbor information:
[0128]
[0129] Finally, position encoding is introduced:
[0130] X (0) =F I +γN+δP;
[0131] in:
[0132] Neighbor information aggregation:
[0133]
[0134] Location code calculation:
[0135] P i,2k =sin(i / 10000) 2k / d );
[0136] P i,2k+1 =cos(i / 10000) 2k / d ).
[0137] 4. Derivation of feature propagation in hypergraph neural networks: Initial propagation form:
[0138]
[0139] Normalization of the degree of inclusion:
[0140]
[0141] Introduce learnable weights:
[0142]
[0143] Finally, an activation function and an error term are added:
[0144] 5. Derivation of node coverage calculation:
[0145] Basic coverage:
[0146]
[0147] Introducing a quality factor:
[0148]
[0149] The quality factor is calculated as follows:
[0150]
[0151] d v This represents the degree of node v.
[0152] 6. Derivation of subgraph weight calculation:
[0153] Initial weights:
[0154]
[0155] Normalization process:
[0156]
[0157] Introducing temperature parameters to achieve soft allocation:
[0158] 7. Derivation of final feature aggregation calculation:
[0159] Basic weighted sum:
[0160]
[0161] Introducing global information:
[0162]
[0163] The calculation of the global information matrix includes:
[0164]
[0165] Additional notes on parameter acquisition methods:
[0166] 1. α and β are obtained by optimization on the validation set through grid search;
[0167] 2. γ and δ are obtained through backpropagation training;
[0168] 3. τ is set empirically, with an initial value of 1, which decreases with each training round;
[0169] 4. μ was determined through ablation experiments on the validation set;
[0170] 5. W (l) Obtained through model training;
[0171] 6. ∈ (l) Gaussian noise was used to generate the signal, with a mean of 0 and a variance of 0.01.
[0172] The effects of these equations are as follows:
[0173] 1. The hyperedge sorting score calculation takes into account structural features, which can better identify important hyperedges;
[0174] 2. Feature initialization integrates multi-source information to provide richer node representations;
[0175] 3. The feature propagation process enhances feature extraction capabilities through normalization and nonlinear transformation;
[0176] 4. The coverage calculation is combined with the importance of the structure, making the division more reasonable;
[0177] 5. The weight calculation adopts a soft allocation mechanism, which avoids the information loss caused by hard partitioning;
[0178] 6. Feature aggregation maintains a balance between local features and global consistency.
[0179] Compared with existing technologies, the hypergraph forgetting method based on hyperedge size selection and coverage aggregation proposed in this invention has the following advantages: It effectively solves the problem of balancing computational efficiency and model performance in hypergraph neural networks during large-scale data processing. First, by introducing hyperedge size as a core indicator and combining node average degree and clustering coefficient to rank hyperedge importance, a reasonable partitioning of the hypergraph structure is achieved. Experimental results show that selecting 40% of the core hyperedges can preserve the main structural features of the hypergraph while significantly reducing computational overhead. Second, a core hyperedge sharing mechanism is adopted to ensure that each subgraph contains key structural information, effectively avoiding the information loss problem that may be caused by random partitioning methods. Third, by introducing a weighted aggregation strategy based on node coverage, the contribution of different subgraphs is fully considered, improving the accuracy and stability of the model output. Experimental results on standard datasets show that, compared with existing methods, this invention reduces training time by approximately 40% while maintaining comparable accuracy. Especially when processing large-scale hypergraphs, this invention exhibits better scalability. Furthermore, the method proposed in this invention has good versatility and can be used in conjunction with different types of hypergraph neural network models, thus expanding its application scope. Through reasonable hyperedge selection and effective feature aggregation, this invention achieves a good balance between computational efficiency and model performance, providing a practical solution for processing large-scale hypergraph data. Attached Figure Description
[0180] Figure 1 A flowchart of a hypergraph forgetting method based on hyperedge size selection and coverage aggregation;
[0181] Figure 2 This is a flowchart of Example 3 of a hypergraph forgetting method based on hyperedge size selection and coverage aggregation. Detailed Implementation
[0182] 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.
[0183] like Figure 1 The diagram shown is a flowchart of a hypergraph forgetting method based on hyperedge size selection and coverage aggregation provided by this invention. This process includes the following steps:
[0184] S10. Receive the input hypergraph and partition number, and calculate the size of each hyperedge in the hypergraph;
[0185] S20. Sort the hyperedges in the hypergraph in descending order according to their size.
[0186] S30. Select the top 40% of superedges after sorting as the core superedge set, and use the remaining superedges as the random superedge set.
[0187] S40. Distribute the core hyperedge set to each subgraph and distribute the random hyperedge set evenly and without overlap to the subgraphs;
[0188] S50. Initialize the node features in the subgraph. The node features are used to represent the initial state information of the nodes.
[0189] S60. Use a hypergraph neural network to train each subgraph independently, and update the node features by propagating features layer by layer to obtain the final node features of each subgraph.
[0190] S70. Calculate the node coverage rate of each subgraph. The node coverage rate is the ratio of the number of nodes in the subgraph to the number of nodes in the supergraph.
[0191] S80. Calculate the weight of each subgraph based on node coverage.
[0192] S90. Based on the weights, perform weighted aggregation of the final node features of each subgraph to generate the model output.
[0193] In the above technical solution, step S10 specifically includes:
[0194] Step 101: Receive the original hypergraph data structure, which includes a set of nodes and a set of hyperedges, and receive the preset partition values, which are determined based on the data size and computing resources.
[0195] Step 102: Establish a hash table data structure to store the superedge size information. The key value of the hash table data structure is the superedge number, and the stored value is the superedge size.
[0196] Step 103: Count the nodes of each superedge, obtain the superedge size information, and store the superedge size information in a hash table data structure;
[0197] Step 104: Introduce a node validity judgment function to filter invalid and abnormal nodes in the hyperedge;
[0198] Step 105: Adopt a parallel computing strategy to divide the hyperedge set into blocks for processing. Each computing unit is responsible for the node counting task of a subset, thereby improving computing efficiency.
[0199] Furthermore, in the above technical solution, step S20 specifically includes:
[0200] Step 201: Construct the ranking score function, which includes a superedge size term, a node average degree term, and a clustering coefficient term;
[0201] Step 202: Calculate the average degree of each node on each hyperedge. The average degree of the nodes is calculated using the arithmetic mean method.
[0202] Step 203: Calculate the clustering coefficient for each hyperedge. The clustering coefficient is calculated using the local density evaluation method.
[0203] Step 204: Sort the superedges in descending order using the improved quicksort algorithm. The quicksort algorithm selects the middle element as the pivot value.
[0204] Step 205: Establish secondary sorting rules. The secondary sorting rules take into account the superedge number and creation time in turn to handle the case of the same score.
[0205] Furthermore, in the above technical solution, step S30 specifically includes:
[0206] Step 301: Determine the selection threshold based on the sorting results. The selection threshold is determined by the total number of hyperedges and the preset selection ratio.
[0207] Step 302: Mark the first 40% of the superedges in the sorting results as core superedges and construct a set of core superedges;
[0208] Step 303: Mark the remaining 60% of the superedges as random superedges and construct a set of random superedges;
[0209] Step 304: Introduce a boundary handling mechanism. When superedges with the same sorting score cross the selection threshold, all superedges with the same score will be assigned to the same set.
[0210] Step 305: Verify the connectivity of the core hyperedge set to ensure that there are no isolated subgraph structures.
[0211] Furthermore, in the above technical solution, step S40 specifically includes:
[0212] Step 401: Copy the core hyperedge set to each subgraph to construct the initial structure of the subgraph;
[0213] Step 402: Using a cyclical allocation strategy, the superedges in the random superedge set are sequentially allocated to different subgraphs;
[0214] Step 403: Introduce a load balancing mechanism to record the number of super edges currently contained in each subgraph and prioritize allocation to subgraphs with fewer super edges.
[0215] Step 404: Maintain the allocation mapping table to record the subgraph number to which each superedge is assigned, ensuring that there are no duplicate assignments;
[0216] Step 405: Verify the structural features of each subgraph, including the calculation and evaluation of node coverage and edge density indices.
[0217] Furthermore, in the above technical solution, step S50 specifically includes:
[0218] Step 501: Initialize the inherent characteristics of the node. The inherent characteristics include node attribute information and external data source characteristics.
[0219] Step 502: Calculate the node's neighbor information. The neighbor information is aggregated using the average pooling method.
[0220] Step 503: Generate node position codes, which are calculated using the sine and cosine coding method;
[0221] Step 504: Fuse inherent features, neighbor information, and location encoding to obtain the initial node feature matrix;
[0222] Step 505: Normalize the initial node feature matrix to ensure that features from different sources have similar numerical ranges.
[0223] Furthermore, in the above technical solution, step S60 specifically includes:
[0224] Step 601: Construct a hypergraph neural network model, which includes multiple feature propagation layers;
[0225] Step 602: Train the model using the batch gradient descent algorithm, with the learning rate of the batch gradient descent algorithm using a decay strategy;
[0226] Step 603: Introduce a residual connection mechanism to combine features from different layers to improve training performance;
[0227] Step 604: Adopt an early stopping strategy, and terminate training early when the performance index of the validation set fails to improve for several consecutive rounds.
[0228] Step 605: Perform post-processing on the node features of each subgraph, including feature normalization and outlier handling operations.
[0229] Furthermore, in the above technical solution, step S70 specifically includes:
[0230] Step 701: Calculate the ratio of the number of nodes in each subgraph to the number of nodes in the original hypergraph;
[0231] Step 702: Calculate the quality factor for each subgraph, taking into account the importance of nodes;
[0232] Step 703: Maintain node access counts and record the number of times each node appears in different subgraphs;
[0233] Step 704: Introduce a connection number threshold. When the number of connections of a node in the subgraph is lower than the connection number threshold, it is not included in the coverage rate.
[0234] Step 705: Calculate the final node coverage rate by combining the node number ratio and the quality factor.
[0235] Furthermore, in the above technical solution, step S80 specifically includes:
[0236] Step 801: Set the initial value of the temperature parameter. The temperature parameter is updated using an exponential decay strategy.
[0237] Step 802: Calculate the weight of each subgraph based on node coverage and temperature parameters;
[0238] Step 803: Introduce a minimum weight constraint to ensure that the weight of each subgraph is not lower than a preset threshold;
[0239] Step 804: Normalize the weights so that the sum of all weights equals 1;
[0240] Step 805: Verify the rationality of the weight allocation and evaluate the impact of the weights on feature aggregation.
[0241] Furthermore, in the above technical solution, step S90 specifically includes:
[0242] Step 901: Calculate the global information matrix, which is obtained using the average pooling method;
[0243] Step 902: Align the features of different subgraphs to ensure that the features have the same dimensions and scale;
[0244] Step 903: Introduce a feature selection mechanism to filter and combine features based on their importance;
[0245] Step 904: Perform a weighted summation of the subgraph features based on the weights, and supplement it with a global information matrix;
[0246] Step 905: Generate the final model output, which includes the fused node feature representations.
[0247] The specific implementation of step S10 involves receiving the input hypergraph and the number of partitions, and calculating the size of each hyperedge in the hypergraph. First, the system receives the original hypergraph data structure, which contains a set of nodes and a set of hyperedges. It also receives a preset partition value, typically set between 2 and 8, with the specific value determined by a trade-off between data size and computational resources. Then, the size of each hyperedge is calculated using a node counting method, obtained by traversing all nodes contained within the hyperedge and accumulating the results. The specific calculation formula is S.e =E v∈e 1, where S e Let represent the size of the hyperedge *e*, and *v* represent the nodes. In practical applications, calculating the hyperedge size requires considering the validity of nodes; therefore, a node validity judgment function is introduced to filter invalid or abnormal nodes. Furthermore, to improve computational efficiency, the system employs a parallel computing strategy, processing the hyperedge set in blocks, with each computing unit responsible for counting nodes in a subset. Finally, the calculated hyperedge size information is stored in a data structure for subsequent sorting operations. The main purpose of this step is to obtain the basic characteristic information of the hyperedges, providing an important basis for subsequent hyperedge selection and allocation. In the specific implementation, a hash table data structure is used by default to store the hyperedge size information for fast querying and updating. The time complexity of calculating the hyperedge size is O(|E|·|V). max |), where |E| is the number of hyperedges, and |V max | represents the number of nodes contained in the maximum superedge.
[0248] The specific implementation of step S20 is to sort the hyperedges in the hypergraph in descending order according to their size. Based on the hyperedge size information calculated in step S10, the system needs to sort all hyperedges. The sorting process first constructs the sorting score calculation formula R. e =S e +αD e +βC e , where R e S is the sorting score for superedge e. e D is the size of the superedge. e Let C be the average degree of the hyperedge nodes. e α represents the clustering coefficient of the hyperedge. Parameters α and β are weighting coefficients, obtained through grid search on the validation set, with values ranging from 0 to 1, and a default initial value of 0.5 for both. The average node degree D... e The calculation uses the arithmetic mean method, and the specific calculation formula is as follows: Where d v The degree of node v is represented by the clustering coefficient C. e The calculation uses a local density assessment method, and the specific calculation formula is as follows: The improved quicksort algorithm is chosen for sorting, as it performs well on large-scale data. To handle cases of identical scores during sorting, a secondary sorting rule is introduced, considering factors such as superedge ID and creation time. The sorted results are stored in descending order to facilitate subsequent superedge selection. The main purpose of this step is to establish a ranking of superedge importance, providing a basis for selecting core superedges. The time complexity of superedge sorting is O(|E|log|E|), where |E| is the number of superedges.
[0249] The specific implementation of step S30 involves selecting the top 40% of hyperedges after sorting as the core hyperedge set, and using the remaining hyperedges as the random hyperedge set. Based on the sorting result obtained in step S20, the system needs to determine the selection ratio of core hyperedges. Experiments have verified that setting the selection ratio to 40% achieves a good balance between maintaining key structural information and controlling computational overhead. The core hyperedge selection process first calculates the selection threshold, the position of which is determined by both the total number of hyperedges and the selection ratio. Then, the top 40% of hyperedges in the sorting result are marked as core hyperedges, constructing the core hyperedge set E. mandatory The remaining 60% of the hyperedges are used to construct a random set of hyperedges E. remaining To ensure the stability of the selection results, the system introduces a boundary handling mechanism. When hyperedges with the same ranking score cross the selection threshold, a consistency principle is applied, and all hyperedges with the same score are assigned to the same set. Furthermore, the system needs to verify the connectivity of the core hyperedge set to ensure that isolated subgraph structures do not appear. The purpose of this step is to classify hyperedges, providing a foundation for subsequent subgraph construction. The time complexity of hyperedge selection is O(|E|).
[0250] The specific implementation of step S40 involves distributing the core hyperedge set to each subgraph and distributing the random hyperedge set evenly and without overlap to the subgraphs. This step first involves distributing the core hyperedge set E... mandatory Copy the data to each subgraph, ensuring that each subgraph contains important structural information. Then, for the set of random hyperedges E... remaining The system performs uniform allocation using a cyclical allocation strategy, sequentially assigning random hyperedges to different subgraphs. To ensure uniformity, a load balancing mechanism is introduced, recording the number of hyperedges in each subgraph and prioritizing allocation to subgraphs with fewer hyperedges. Simultaneously, the system maintains an allocation mapping table to record the subgraph number to which each hyperedge is assigned, ensuring no duplicate allocations occur. During allocation, subgraph connectivity constraints are considered to minimize the creation of disconnected subgraph structures. After allocation, the system verifies the structural features of each subgraph, including node coverage and edge density, to ensure the rationality of the allocation results. The main purpose of this step is to achieve effective hypergraph partitioning, providing a foundation for subsequent independent training. The time complexity of hyperedge allocation is O(|E|). remaining |).
[0251] The specific implementation of step S50 involves initializing the node features in the subgraph. These node features represent the initial state information of the nodes. The node feature initialization employs a multi-source information fusion method, specifically calculated using the formula X. (0) =F I +γN+δP, where X (0) Let F be the initial node feature matrix. ILet F be the inherent feature of the node, N be the neighbor information of the node, and P be the location code. Parameters N and δ are balancing parameters, obtained through backpropagation training, and their values range from 0 to 1. Inherent feature F I This includes node attribute information, which can be a predefined feature vector or a feature representation obtained from an external data source. The neighbor information N is calculated using average pooling, with the specific formula as follows: in Let P represent the set of neighbors of node i. The positional encoding P uses sine and cosine coding, and the calculation formula is P. i,2k =sin(i / 10000) 2k / d ) and P i,2k+1 =cos(i / 10000) 2k / d The initialization process involves feature normalization to ensure that features from different sources have similar numerical ranges. The main purpose of this step is to provide rich initial feature representations for nodes, laying the foundation for subsequent feature propagation. The time complexity of node feature initialization is O(|V|·d), where |V| is the number of nodes and d is the feature dimension.
[0252] The specific implementation of step S60 involves training each subgraph independently using a hypergraph neural network, updating node features through layer-by-layer feature propagation, and obtaining the final node features of each subgraph. The core formula for the feature propagation process is as follows: Where X (l) Let D be the node feature matrix of the l-th layer. v D is a diagonal matrix with node degree. f Let H be a hyperdiagonal matrix, H be the incidence matrix, and W be a hyperdiagonal matrix. (l) Let be the weight matrix of the l-th layer, and σ be the activation function, ∈ (l) Let L be the error term of layer l. The training process employs batch gradient descent with an initial learning rate of 0.01 and a learning rate decay strategy. Each training epoch consists of two phases: forward propagation and back propagation. The forward propagation phase calculates the update of node features, while the back propagation phase calculates the gradient and updates the model parameters. To improve training performance, the system uses a residual connection mechanism to combine features from different layers. An early stopping strategy is also introduced; if the performance metrics on the validation set do not improve for several consecutive epochs, the training process is terminated early. After training, post-processing is performed on the node features of each subgraph, including feature normalization and outlier handling. The main purpose of this step is to learn the deep feature representation of nodes in each subgraph. The time complexity of feature propagation is O(L·|E|·d), where L is the number of layers.
[0253] The specific implementation of step S70 involves calculating the node coverage rate in each subgraph. The node coverage rate is the ratio of the number of nodes in the subgraph to the number of nodes in the supergraph. An improved ratio calculation method is used to calculate the node coverage rate, and the specific formula is as follows: Where C i Let |V be the node coverage of subgraph i. i | represents the number of nodes in subgraph i, |V| represents the number of nodes in the original hypergraph, and Q represents the number of nodes in subgraph i. i Let Q be the quality factor of subgraph i, and λ be the adjustment parameter. i The calculation takes into account the importance of nodes, and the specific formula is as follows: During coverage calculation, the system needs to maintain node access counts, recording the number of times each node appears in different subgraphs. Simultaneously, a threshold mechanism is introduced: if the number of connections a node has in a subgraph is below a threshold, that node is not included in the coverage calculation. The main purpose of this step is to evaluate the quality of subgraph partitioning, providing a basis for subsequent weight calculations. The time complexity of coverage calculation is O(k·|V|), where k is the number of subgraphs.
[0254] The specific implementation of step S80 is to calculate the weight of each subgraph based on node coverage. The weight calculation uses a softmax function based on a temperature parameter, with the specific formula as follows: Where w i C represents the weight of subgraph i. i Let τ be the node coverage of subgraph i, and τ be the temperature parameter. The temperature parameter τ is set empirically, initially set to 1, and decreases with each training epoch using an exponential decay strategy. During weight calculation, the system needs to ensure that the sum of all weights is 1, satisfying the probability distribution requirements. Simultaneously, a minimum weight constraint is introduced to ensure that the weight of each subgraph is not too small, avoiding the loss of effective information. The main purpose of this step is to assign reasonable importance weights to different subgraphs, providing guidance for feature aggregation. The time complexity of weight calculation is O(k).
[0255] The specific implementation of step S90 involves weighted aggregation of the final node features of each subgraph based on their weights to generate the model output. Feature aggregation uses a weighted summation method and incorporates supplementary global information; the specific formula is as follows: Where F final For the final aggregated features, w i Let i be the weight of subgraph i. Let M be the final layer feature of subgraph i, M be the global information matrix, and μ be the global information weights. The global information matrix M is calculated using the average pooling method, with the specific formula as follows: During the aggregation process, the system needs to perform feature alignment to ensure that features from different subgraphs have the same dimension and scale. Simultaneously, a feature selection mechanism is introduced to filter and combine features based on their importance. The main purpose of this step is to effectively integrate information from multiple subgraphs to generate the final model output. The time complexity of feature aggregation is O(k·|V|·d).
[0256] Example 1: Community Structure Analysis Based on Soil Microbial Co-occurrence Network
[0257] This embodiment focuses on the co-occurrence network of soil microbial communities and employs the hypergraph forgetting method of this invention for analysis. The dataset originates from soil sample sequencing data from an agricultural research station and contains 3000 microbial operational taxonomic units (OTUs) and 5000 interaction hyperedges. Each node represents a microbial taxa with attributes such as abundance and taxonomic status. Each hyperedge represents a co-occurrence relationship between a group of microorganisms, calculated using the Pearson correlation coefficient with a significance level set to 0.05. Based on the data size and computational resources, the number of hypergraph partitions is set to 4.
[0258] First, step S10 is executed to calculate the size of each hyperedge. The system constructs a hash table to store the hyperedge size information, with the key being the hyperedge number and the value being the hyperedge size. For the hyperedge with the number e001, it contains 12 co-occurring microbial nodes, so its size is 12. Using a parallel computing strategy, the 5000 hyperedges are divided into 10 batches for processing, with each batch containing 500 hyperedges. After node counting, the distribution range of hyperedge sizes is found to be between 2 and 25, with an average size of 8.3. During the calculation process, the system filters out nodes with an abundance value below 0.01% to reduce the impact of noise. Some examples of the hyperedge size calculation results are shown in Table 1.
[0259] Table 1. Examples of Hyperedge Size Calculation Results
[0260] Super-edge numbering Number of nodes Major microbial groups e001 12 Phylum Actinobacteria, Phylum Proteobacteria e002 8 Bacteroidetes, Bacteroidetes e003 15 Phylum Chlorophyta, Phylum Cyanobacteria e004 6 Firmicutes, Planctomycetes e005 21 Verrucomycetes, Archaea
[0261] Next, step S20 is executed to sort the hyperedges. In the sorting score calculation, the weight coefficient α is set to 0.4, and β is set to 0.3. Taking hyperedge e001 as an example, its average node degree is 15.6, its clustering coefficient is 0.45, and its final score is 18.27. The system uses an improved quicksort algorithm, selecting the middle element of each segment as the pivot value. When scores are the same, the system uses the hyperedge number as a secondary sorting criterion. Partial results after sorting are shown in Table 2.
[0262] Table 2 Example of hyperedge sorting results
[0263] Sort position Super-edge numbering Sorting score Node average degree Clustering coefficient 1 e005 25.64 18.2 0.52 2 e003 20.15 16.8 0.48 3 e001 18.27 15.6 0.45 4 e002 14.82 12.4 0.38 5 e004 11.35 10.2 0.32
[0264] In step S30, the system selects the top 2000 sorted hyperedges (40%) as the core hyperedge set. These core hyperedges mainly involve strong interactions between dominant microbial groups. The remaining 3000 hyperedges constitute a random hyperedge set. When handling the boundary case with a sorting score of 14.82, the system includes all hyperedges with a score of 14.82 in the core hyperedge set to maintain consistency. Connectivity verification of the core hyperedge set shows that there are no isolated substructures, and the largest connected component contains more than 95% of the nodes.
[0265] Step S40 involves superedge allocation. The system first copies 2000 core superedges to the four subgraphs, then allocates 3000 random superedges using a round-robin strategy. Each subgraph receives an average of 750 random superedges. A load balancing mechanism ensures that the difference in the number of superedges between subgraphs does not exceed 50. The allocation results are shown in Table 3.
[0266] Table 3 Subgraph Hyperedge Assignment Results
[0267]
[0268]
[0269] Step S50 initializes node features. The initial feature dimension of each node is set to 128. The inherent features include the abundance value of microorganisms, the one-hot encoding of classification information, and the functional gene prediction results. The balance parameter γ is set to 0.6, and δ is set to 0.4. After feature initialization, all dimensions are normalized using min-max normalization to unify the numerical range to between 0 and 1. Some examples of node features are shown in Table 4.
[0270] Table 4 Example of node feature initialization
[0271] Node number Abundance value Classification feature dimensions Neighbor information dimensions Location encoding dimension v001 0.025 32 48 48 v002 0.018 32 48 48 v003 0.031 32 48 48 v004 0.022 32 48 48 v005 0.028 32 48 48
[0272] In step S60, a 3-layer hypergraph neural network is used for training. Each layer contains 128 hidden units, and the activation function is ReLU. The training process uses gradient descent with a batch size of 64, an initial learning rate of 0.01, and decays to 0.9 times the original rate every 50 epochs. Residual connections are established between layers 2 and 3. During training, an early stopping mechanism is triggered when the validation set performance fails to improve for 5 consecutive epochs. The final training epochs and loss values for each subgraph are shown in Table 5.
[0273] Table 5 Subgraph Training Results
[0274] Subgraph number Training rounds Final loss value Validation set accuracy subgraph1 178 0.082 0.892 subgraph2 165 0.085 0.885 subgraph3 182 0.079 0.898 subgraph4 170 0.083 0.889
[0275] Step S70 calculates node coverage. The adjustment parameter is set to 0.3, and the connection number threshold is set to 3. For each subgraph, the system counts the number of nodes and calculates the quality factor. The node access count shows that each node appears in an average of 2.5 subgraphs. The results of the node coverage calculation are shown in Table 6.
[0276] Table 6 Node Coverage Calculation Results
[0277] Subgraph number Number of nodes Node coverage quality factor subgraph1 2580 0.860 0.892 subgraph2 2485 0.828 0.865 subgraph3 2625 0.875 0.905 subgraph4 2532 0.844 0.878
[0278] In step S80, subgraph weights are calculated. The initial value of the temperature parameter is set to 1.0, decreasing by 0.1 every 50 epochs, with a minimum value of 0.1. The minimum weight threshold is set to 0.15 to ensure that each subgraph contributes sufficiently. The weight distribution calculated using the softmax function is shown in Table 7.
[0279] Table 7 Subgraph Weight Calculation Results
[0280] Subgraph number Original weights Normalized weights subgraph1 0.268 0.275 subgraph2 0.238 0.245 subgraph3 0.282 0.285 subgraph4 0.252 0.255
[0281] Finally, feature aggregation is performed in step S90. The global information weight is set to 0.2. The system first aligns the dimensions of the features in all subgraphs to ensure consistency in the 128-dimensional feature space. The feature selection process retains the 96 feature dimensions with the highest contribution. The resulting node representation effectively characterizes the interaction patterns between microorganisms. The aggregated features are applied to community structure analysis tasks, achieving good results in tasks such as module identification and key species prediction, with an accuracy of 0.912.
[0282] This embodiment demonstrates the application value of the present invention in microbial interaction network analysis. Through a strategy of hyperedge classification and subgraph training, large-scale interaction data is effectively processed, reducing computational complexity. The weight-adaptive feature aggregation mechanism ensures the stability and interpretability of the model. Experimental results show that this method can accurately capture the structural features of microbial communities, providing a reliable computational foundation for subsequent ecological analysis.
[0283] Example 2: Analysis of bacterial resistance based on metabolic networks
[0284] This embodiment uses the method of the present invention to analyze drug resistance mechanisms in bacterial metabolic networks. The research object is the metabolic network data of *Escherichia coli* (E. coli), which contains 2500 metabolite nodes and 4000 metabolic reaction hyperedges. Each node represents a metabolite and has attributes such as concentration and molecular weight. Each hyperedge represents a metabolic reaction, involving substrate, product, and enzymatic reaction information. Based on the computational resource allocation, the network is divided into three subgraphs.
[0285] In step S10, the size of the hyperedge is first calculated. For the metabolic reaction hyperedge e, its size is calculated using the following formula:
[0286] S e =∑ v∈e 1;
[0287] Here, v represents the metabolite node involved in the reaction. Taking the NADH dehydrogenase reaction as an example, it involves four metabolites: NADH, NAD+, H+, and ubiquinone. Therefore, the size of the corresponding hyperedge for this reaction is 4. The system uses a hash table to store the size information of each hyperedge, and some calculation results are shown in Table 8.
[0288] Table 8. Statistics on the size of metabolic response hyperedge
[0289] Reaction number Reaction name Super-edge size Number of metabolites R001 NADH dehydrogenase reaction 4 4 R002 Citric acid synthase reaction 3 3 R003 Pyruvate dehydrogenase reaction 5 5 R004 Succinate dehydrogenase reaction 4 4 R005 ATP synthase reaction 6 6
[0290] Step S20 performs superedge sorting. The sorting score is calculated using the following formula:
[0291] R e =S e +αD e +βC e ;
[0292] Where, = 0.35, = 0.25. The formula for calculating the average degree of a node is:
[0293]
[0294] The formula for calculating the clustering coefficient is:
[0295]
[0296] A partial example of the sorting results is shown in Table 9.
[0297] Table 9. Results of Metabolic Response Hyperedge Ordination
[0298] Sort position Reaction number Sorting score average degree Clustering coefficient 1 R005 22.85 12.5 0.58 2 R003 19.62 10.8 0.52 3 R001 16.45 9.6 0.48 4 R004 15.78 8.9 0.45 5 R002 12.36 7.2 0.42
[0299] In step S30, the top 1600 (40%) superedges by score are selected as the core superedge set, and the remaining 2400 are selected as the random superedge set. In step S40, the core superedges are copied to the three subgraphs, and then the random superedges are evenly distributed. The distribution results are shown in Table 10.
[0300] Table 10 Subgraph Reaction Partition Results
[0301]
[0302] Step S50 initializes node features. Feature initialization uses the following formula:
[0303] X(0) =F I +γN+δP;
[0304] Where γ = 0.55, δ = 0.35. Inherent characteristics F of metabolite nodes. I It includes information such as concentration and molecular weight. The formula for calculating the neighbor information N is:
[0305]
[0306] The position code P is calculated using the following formula:
[0307] P i,2k =sin(i / 10000) 2k / d );
[0308] P i,2k+1 =cos(i / 10000) 2k / d );
[0309] Examples of node features are shown in Table 11.
[0310] Table 11 Statistical analysis of metabolite node characteristics
[0311] Node ID Feature Dimension Inherent characteristic number Neighbor feature number Location code number M001 96 32 32 32 M002 96 32 32 32 M003 96 32 32 32 M004 96 32 32 32 M005 96 32 32 32
[0312] Step S60 uses a 4-layer hypergraph neural network for training. Feature propagation uses the following formula:
[0313]
[0314] Where, ∈ (l) Gaussian noise with a mean of 0 and a variance of 0.01 was used. The training results are shown in Table 12.
[0315] Table 12 Statistics of Subgraph Training Process
[0316] Subgraph number Training rounds Loss value Convergence time (hours) G1 245 0.068 4.2 G2 238 0.072 4.0 G3 252 0.065 4.5
[0317] Step S70 calculates the node coverage rate using the following formula:
[0318]
[0319] Where λ = 0.25. Quality factor Q i The calculation formula is:
[0320]
[0321] The coverage calculation results are shown in Table 13.
[0322] Table 13 Subgraph Coverage Analysis
[0323] Subgraph number Number of nodes Coverage quality factor G1 2185 0.874 0.912 G2 2142 0.857 0.895 G3 2208 0.883 0.925
[0324] Step S80 calculates the subgraph weights using the following formula:
[0325]
[0326] The initial value of the temperature parameter τ is 0.8. The weight calculation results are shown in Table 14.
[0327] Table 14 Subgraph Weight Distribution
[0328] Subgraph number Initial weights Normalized weights G1 0.338 0.342 G2 0.325 0.328 G3 0.347 0.350
[0329] Finally, feature aggregation is performed in step S90, using the following formula:
[0330]
[0331] Where μ = 0.15, the global information matrix M is calculated using the following formula:
[0332]
[0333] The aggregated results were used to analyze bacterial drug resistance mechanisms, successfully identifying key metabolic pathways associated with multidrug resistance with an accuracy of 0.895. The model's predicted drug resistance-related metabolites showed 82% agreement with experimental validation results. Examples of some drug resistance prediction results are shown in Table 15.
[0334] Table 15 Results of Drug Resistance Analysis
[0335] Metabolic pathways Predicting importance Experiments verify the importance consistency TCA Cycle 0.885 0.912 yes Glycolysis 0.856 0.878 yes Electron transport chain 0.922 0.935 yes Amino acid metabolism 0.845 0.862 yes Fatty acid metabolism 0.832 0.815 yes
[0336] This embodiment demonstrates the application effect of the present invention in bacterial metabolic network analysis. By hierarchically processing metabolic responses and fusing features, network structural features related to drug resistance are accurately captured. Experimental results show that this method has high accuracy and interpretability in drug resistance mechanism analysis, providing a new computational tool for antibiotic resistance research. Compared with traditional methods, the present invention significantly improves both computational efficiency and prediction accuracy. Model training time is reduced by approximately 40%, while prediction accuracy is improved by approximately 15%. Furthermore, this method can identify some novel drug resistance-related metabolic pathways that are difficult to detect using traditional methods, providing important clues for the development of new antibiotics.
[0337] Example 3:
[0338] like Figure 2 As shown, this invention proposes a hypergraph forgetting method based on hyperedge size selection and coverage aggregation. The invention mainly consists of five steps: hyperedge size calculation and core hyperedge selection; random hypergraph partitioning; independent subgraph training; weight calculation based on node coverage; and weighted output model aggregation.
[0339] Part 1: Hyperedge Size Calculation and Core Hyperedge Selection
[0340] S101. Input a hypergraph H = (V, E) and the number of partitions k. Calculate the size of each hyperedge, i.e., the number of nodes contained in each hyperedge.
[0341] S102. Sort the set of superedges from largest to smallest.
[0342] S103. Select the largest hyperedges (p%) from the ranking results. These hyperedges are defined as the core hyperedge set, used to preserve the main structural information of the hypergraph. The remaining hyperedges are used as a random hyperedge set for subsequent random assignment to increase the diversity of the model.
[0343] Part Two: Hypergraph Random Partitioning
[0344] S201. Distribute the set of random hyperedges in the hypergraph evenly across k subgraphs, with each subgraph containing the set of core hyperedges.
[0345] S202. The set of hyperedges for each subgraph consists of core hyperedges and random hyperedges assigned to that subgraph. This partitioning ensures that all subgraphs share the core structure while maintaining local diversity and randomness.
[0346] Part 3: Subgraph Independent Training
[0347] S301. Initialize the node features in each subgraph. These features can be the initial state information of the nodes.
[0348] S302. Use a Hypergraph Neural Network (HGNN) to train each subgraph independently. During training, the HGNN updates the feature information of the nodes according to the hypergraph structure. The update of node features is accomplished through layer-by-layer propagation, with each layer updating based on the hypergraph's connectivity and node features.
[0349] S303. After multiple layers of propagation, the final node features of each subgraph are obtained. These features reflect the structural information within the subgraph and the relationships between nodes.
[0350] Part 4: Weight Calculation Based on Node Coverage
[0351] S401. Calculate the number of nodes contained in each subgraph. The node coverage of a subgraph is the ratio of the number of nodes in the subgraph to the number of nodes in the original hypergraph. The higher the coverage, the more completely the main structure of the original hypergraph is preserved in the subgraph.
[0352] S402. Calculate the weight of each subgraph based on its node coverage. The weight of a subgraph is determined by its node coverage. Subgraphs with higher coverage will have higher weights in the model aggregation.
[0353] Part 5: Weighted Output Model Aggregation
[0354] Based on the weight of each subgraph, the final features of each subgraph are weighted and aggregated. The weighted aggregation process combines the features of each subgraph according to its weight ratio to generate the final model output.
[0355] It should be noted that the variables involved in this invention are explained in detail in Table 16:
[0356] Table 16 Variable Explanation
[0357]
[0358] Specifically, the principle of this invention is based on the following key ideas. First, the size of a hyperedge reflects the complexity of higher-order relationships between nodes; larger hyperedges typically contain richer structural information. Therefore, this invention constructs a ranking score function using hyperedge size, node average degree, and clustering coefficients to quantitatively evaluate the importance of hyperedges. This evaluation method considers multiple feature dimensions of hyperedges, enabling more accurate identification of hyperedges important to the overall structure. Second, the core hyperedge sharing mechanism is designed based on the message passing principle in graph neural networks. By including a core hyperedge in each subgraph, it ensures that important structural information can be fully learned and propagated across all subgraphs. This design allows each subgraph to capture the key features of the original hypergraph, providing a good foundation for subsequent feature learning. Third, the uniform distribution strategy of random hyperedges is based on the idea of ensemble learning. By introducing appropriate randomness and diversity, it enhances the model's generalization ability. The introduction of a load balancing mechanism ensures the reasonable allocation of computing resources and improves the efficiency of parallel processing. Fourth, the initialization of node features adopts a multi-source information fusion method, combining the inherent features of nodes, neighbor information, and positional encoding to provide rich feature representations. This initialization method is beneficial for the model to capture both local and global features of nodes. Fifth, the weighted aggregation strategy based on node coverage borrows from the attention mechanism, achieving adaptive fusion of subgraph features by learning the importance weights of different subgraphs. The introduction of a temperature parameter increases the flexibility of weight allocation, enabling the model to better adapt to different data distributions. Finally, the design of the global information matrix is based on the principle of residual learning, effectively mitigating the information loss problem during feature propagation by introducing global information supplementation. The organic combination of these technical principles allows this invention to maintain high model performance while ensuring computational efficiency. The various steps in the scheme have a tight logical relationship, forming a complete technical chain from hyperedge selection to feature aggregation, with each link specifically addressing particular technical challenges.
[0359] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A hypergraph forgetting method based on hyperedge size selection and coverage aggregation for bacterial resistance analysis, characterized in that, Includes the following steps: S10. Receive the input bacterial metabolic network hypergraph and the number of partitions, and calculate the size of each hyperedge representing a metabolic reaction in the bacterial metabolic network hypergraph. S20. Sort the hyperedges in the bacterial metabolic network hypergraph in descending order according to their size. S30. Select the top 40% of the superedges after sorting as the core superedge set, and the remaining superedges as the random superedge set. S40. Distribute the core hyperedge set to each subgraph, and distribute the random hyperedge set evenly and without overlap to the subgraph; S50. Initialize the node features in the subgraph. The node features are used to represent the initial state information of the metabolite nodes. The initial state information includes metabolite concentration and molecular weight. S60. A hypergraph neural network is used to train each subgraph independently, and the node features are updated by layer-by-layer feature propagation to obtain the final node features of each subgraph. S70. Calculate the node coverage rate in each subgraph, where the node coverage rate is the ratio of the number of nodes in the subgraph to the number of nodes in the bacterial metabolic network hypergraph. S80. Calculate the weight of each subgraph based on the node coverage rate; S90. The final node features of each subgraph are weighted and aggregated according to the weights to generate a metabolic pathway prediction output for identifying bacterial drug resistance mechanisms.
2. The method according to claim 1, characterized in that, Step S10 specifically includes: Step 101: Receive the original hypergraph data structure of the metabolic network containing the set of metabolite nodes and the set of metabolic reaction hyperedges, and receive the preset partition values, which are determined according to the data scale and computing resources. Step 102: Establish a hash table data structure to store the superedge size information. The key value of the hash table data structure is the superedge number, and the storage value of the hash table data structure is the superedge size. Step 103: Count the number of nodes for each superedge, obtain the size information of the superedge, and store the size information of the superedge in the hash table data structure; Step 104: Introduce a node validity judgment function to filter invalid and abnormal nodes in the hyperedge; Step 105: Adopt a parallel computing strategy to divide the hyperedge set into blocks for processing. Each computing unit is responsible for the node counting task of a subset, thereby improving computing efficiency.
3. The method according to claim 2, characterized in that, Step S20 specifically includes: Step 201: Construct a ranking score function, which includes a superedge size term, a node average degree term, and a clustering coefficient term; Step 202: Calculate the average degree of each node on each hyperedge. The average degree of the nodes is calculated using the arithmetic mean method. Step 203: Calculate the clustering coefficient for each hyperedge, which is obtained by the local density evaluation method; Step 204: Sort the superedges in descending order using an improved quicksort algorithm, wherein the quicksort algorithm selects the middle element as the pivot value. Step 205: Establish secondary sorting rules, which take into account the superedge number and creation time in turn, to handle the case of the same score.
4. The method according to claim 3, characterized in that, Step S30 specifically includes: Step 301: Determine the selection threshold based on the sorting results. The selection threshold is determined by the total number of hyperedges and the preset selection ratio. Step 302: Mark the first 40% of the superedges in the sorting results as core superedges and construct a set of core superedges; Step 303: Mark the remaining 60% of the superedges as random superedges and construct a set of random superedges; Step 304: Introduce a boundary processing mechanism. When superedges with the same sorting score cross the selection threshold, all superedges with the same score are assigned to the same set. Step 305: Verify the connectivity of the core hyperedge set to ensure that there are no isolated subgraph structures.
5. The method according to claim 4, characterized in that, Step S40 specifically includes: Step 401: Copy the core hyperedge set to each subgraph to construct the initial structure of the subgraph; Step 402: Using a cyclic allocation strategy, the superedges in the random superedge set are sequentially allocated to different subgraphs; Step 403: Introduce a load balancing mechanism to record the number of super edges currently contained in each subgraph and prioritize allocation to subgraphs with fewer super edges. Step 404: Maintain the allocation mapping table to record the subgraph number to which each superedge is assigned, ensuring that there are no duplicate assignments; Step 405: Verify the structural features of each subgraph, including the calculation and evaluation of node coverage and edge density indices.
6. The method according to claim 5, characterized in that, Step S50 specifically includes: Step 501: Initialize the inherent characteristics of the node, which include node attribute information and external data source characteristics; Step 502: Calculate the node's neighbor information, wherein the neighbor information is aggregated using the average pooling method; Step 503: Generate node position codes, which are calculated using a sine / cosine coding method; Step 504: Fuse the inherent features, the neighbor information, and the location encoding to obtain an initial node feature matrix; Step 505: Normalize the initial node feature matrix to ensure that features from different sources have similar numerical ranges.
7. The method according to claim 6, characterized in that, Step S60 specifically includes: Step 601: Construct a hypergraph neural network model, wherein the hypergraph neural network model includes multiple feature propagation layers; Step 602: Train the model using the batch gradient descent algorithm, wherein the learning rate of the batch gradient descent algorithm adopts a decay strategy; Step 603: Introduce a residual connection mechanism to combine features from different layers to improve training performance; Step 604: Adopt an early stopping strategy, and terminate training early when the performance index of the validation set fails to improve for several consecutive rounds. Step 605: Perform post-processing on the node features of each subgraph, including feature normalization and outlier handling operations.
8. The method according to claim 7, characterized in that, Step S70 specifically includes: Step 701: Calculate the ratio of the number of nodes in each subgraph to the number of nodes in the original hypergraph; Step 702: Calculate the quality factor for each subgraph, whereby the quality factor takes into account the importance of the nodes; Step 703: Maintain node access counts and record the number of times each node appears in different subgraphs; Step 704: Introduce a connection number threshold. When the number of connections of a node in the subgraph is lower than the connection number threshold, it is not included in the coverage rate. Step 705: Calculate the final node coverage rate by combining the node number ratio and the quality factor.
9. The method according to claim 8, characterized in that, Step S80 specifically includes: Step 801: Set the initial value of the temperature parameter, which is updated using an exponential decay strategy; Step 802: Calculate the weight of each subgraph based on the node coverage and the temperature parameter; Step 803: Introduce a minimum weight constraint to ensure that the weight of each subgraph is not lower than a preset threshold; Step 804: Normalize the weights so that the sum of all weights equals 1; Step 805: Verify the rationality of the weight allocation and evaluate the impact of the weights on feature aggregation.
10. The method according to claim 9, characterized in that, Step S90 specifically includes: Step 901: Calculate the global information matrix, which is obtained using the average pooling method; Step 902: Align the features of different subgraphs to ensure that the features have the same dimensions and scale; Step 903: Introduce a feature selection mechanism to filter and combine features based on their importance; Step 904: Perform a weighted summation of the subgraph features based on the weights, and supplement it with the global information matrix; Step 905: Generate the final model output, which includes the fused node feature representation.
Citation Information
Patent Citations
Hypergraph neural network updating method, device and equipment based on redundancy elimination
CN117391166A
Anticancer drug sensitivity prediction method and system based on bigraph and hypergraph learning
CN119694444A