Method and device for carrying out hyperedge classification on hypergraph and storage medium
Through dynamic attention mechanism and multi-layer graph convolution network, the problem of node correlation and importance differences in hyper-edge classification is solved, and efficient hyper-edge classification and robustness improvement are achieved.
Patent Information
- Application Number
- CN202510575356.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-06
- Publication Date
- 2025-08-12
AI Technical Summary
In the prior art, the hyper-edge classification method relies on manual design features or simple graph transformation, ignoring the high-order correlation and importance differences between nodes within the hyper-edge, resulting in inefficient training of graph neural networks and inability to effectively capture the nonlinear relationship in hyper-edge classification.
Through the dynamic attention mechanism, the node features in the super edge are aggregated, the feature vector is generated, and the hypergraph is converted into a line graph structure. The hyper-edge classification is performed using a multi-layer graph convolution network and the Hamming distance matrix to automatically learn the importance of nodes, reduce the number of redundant edges, and improve classification robustness.
Effectively capture the nonlinear relationships within the hyper-edge, improve the accuracy and robustness of hyper-edge classification, and reduce the training complexity of graph neural networks.
Smart Images

Figure CN120472222A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of hyperedge analysis, and in particular relates to a method, device and storage medium for performing hyperedge classification on a hypergraph. Background Art
[0002] A hypergraph is a generalized graph structure whose edges (hyperedges) can contain multiple nodes. It is suitable for modeling high-order interactions between multiple nodes in complex systems, such as group interactions in social networks and multi-body interactions between biological molecules. However, traditional graph neural networks (GNNs) can only process ordinary graphs (edges only connect two nodes) and cannot directly process hypergraph structures.
[0003] Existing hyperedge classification methods mostly rely on manually designed features or simple graph transformations (such as expanding hyperedges into ordinary edges), ignoring the high-order correlations and importance differences between nodes within the hyperedge. The ordinary graphs generated by existing graph transformation methods (such as the star expansion method) have complex structures and redundant information, resulting in low efficiency in graph neural network training. At the same time, traditional methods mostly use cosine similarity or Euclidean distance to measure node similarity, which cannot effectively capture the nonlinear relationships in the hyperedge classification task. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a method, device and storage medium for hyperedge classification of hypergraphs, so as to solve the problem in the existing technology that relies on manually designed features or simple graph conversion, ignores the high-order correlation and importance differences between nodes within the hyperedge, and the ordinary graph structure generated by the existing graph conversion method is complex and the information is redundant, resulting in low efficiency of graph neural network training. The use of cosine similarity or Euclidean distance to measure node similarity cannot effectively capture the nonlinear relationship in the hyperedge classification task.
[0005] According to a first aspect of an embodiment of the present invention, a method for performing hyperedge classification on a hypergraph is provided, the method comprising:
[0006] For each hyperedge in the hypergraph, the features of the internal nodes are aggregated through the dynamic attention mechanism to generate the feature vector of each hyperedge;
[0007] Converting the hypergraph into a line graph structure, obtaining an adjacency matrix of the line graph based on a mapping relationship between hyperedges of the hypergraph and line graph nodes in the line graph structure; obtaining a eigenvector of a corresponding line graph node based on the eigenvector of each hyperedge;
[0008] Inputting the adjacency matrix of the line graph and the feature vector of each line graph node into a preset multi-layer graph convolutional network, respectively, and the multi-layer graph convolutional network outputs an embedding vector of each line graph node;
[0009] A Hamming distance matrix between any two line graph nodes is obtained according to the embedding vectors of any two line graph nodes; and a hyperedge category is determined by a minimum distance classifier according to the Hamming distance matrix to obtain a hyperedge classification result.
[0010] Preferably,
[0011] For each hyperedge in the hypergraph, the features of the internal nodes are aggregated through the dynamic attention mechanism to generate a feature vector for each hyperedge, including:
[0012] Define a learnable parameter matrix and obtain the eigenvectors of all nodes in each hyperedge;
[0013] Based on the learnable parameter matrix and the feature vectors of any two nodes in the hyperedge, obtaining the attention coefficient of any node in the hyperedge to another node;
[0014] Normalizing the attention coefficient of any node in the hyperedge to another node to obtain a normalized attention weight;
[0015] The feature vector of each hyperedge is obtained according to the normalized attention weight, the learnable parameter matrix and the preset activation function.
[0016] Preferably,
[0017] The step of converting the hypergraph into a line graph structure and obtaining an adjacency matrix of the line graph according to a mapping relationship between hyperedges of the hypergraph and line graph nodes in the line graph structure includes:
[0018] Get the hyperedge set E of the hypergraph = {e1, e2, ..., e m}, define the set of line graph nodes in the line graph structure V′={v1′, v2′, …, v′ M}, each hyperedge e p Corresponding to the only line graph node v p ';
[0019] If any two hyperedges e p and e q contains at least one common node, then any two hyperedges e p and e q The adjacency matrix A pq =1, otherwise A pq =0; obtain the adjacency matrix of the line graph based on the adjacency matrix of all arbitrary two hyperedges.
[0020] Preferably, it also includes:
[0021] Adding an auto-connection identity matrix to the adjacency matrix of the line graph to obtain a self-connection adjacency matrix;
[0022] Performing degree matrix calculation on the self-connected adjacency matrix to obtain a degree matrix of the self-connected adjacency matrix;
[0023] The self-connected adjacency matrix, the degree matrix of the self-connected adjacency matrix, and the feature vector of each line graph node are respectively input into a preset multi-layer graph convolutional network.
[0024] Preferably,
[0025] The multi-layer graph convolutional network outputs the embedding vector of each line graph node including:
[0026] Obtaining a node feature matrix at layer 0 according to the feature vector of each line graph node;
[0027] The preset multi-layer graph convolutional network includes at least two graph convolutional layers, and the node feature matrix of the first layer is obtained according to the node feature matrix of the 0th layer, the self-connected adjacency matrix, and the degree matrix of the self-connected adjacency matrix. The node feature matrix of the second layer is obtained according to the node feature matrix of the first layer, the self-connected adjacency matrix, and the degree matrix of the self-connected adjacency matrix, until the node feature matrix output by the last graph convolutional layer of the multi-layer graph convolutional network is obtained;
[0028] The node feature matrix output by the last graph convolution layer of the multi-layer graph convolutional network is the embedding vector of the line graph node corresponding to the input feature vector.
[0029] Preferably,
[0030] The method of obtaining a Hamming distance matrix between any two line graph nodes according to the embedding vectors of any two line graph nodes and determining the hyperedge category by a minimum distance classifier according to the Hamming distance matrix to obtain a hyperedge classification result includes:
[0031] Get the embedding vectors of any two line graph nodes u and υ and According to the embedding vectors of any two line graph nodes u and υ and Construct the Hamming distance matrix of line graph nodes u and v Represents the embedding vector and The number of different elements in corresponding positions after binarization;
[0032] According to the Hamming distance matrix The hyperedge category is determined by the minimum distance classifier. When the node belongs to the specified category, the value is 1, otherwise it is 0, and the hyperedge classification result corresponding to the node is obtained.
[0033] Preferably, it also includes:
[0034] Preprocessing of hyperedges, including:
[0035] If the number of nodes in any hyperedge exceeds the preset node number threshold, a random sampling strategy is used to select some nodes for feature aggregation;
[0036] Each node feature within the obtained hyperedge is standardized based on the mean and standard deviation of all node features within the hyperedge.
[0037] Preferably, it also includes:
[0038] Optimizing the adjacency matrix of the line graph into a weighted adjacency matrix, comprising:
[0039] Obtaining the intersection of all nodes in any two hyperedges and the union of all nodes in any two hyperedges, and obtaining an initial weighted adjacency matrix of the any two hyperedges according to the intersection of all nodes in the any two hyperedges and the union of all nodes in the any two hyperedges;
[0040] Respectively obtaining the number of neighbors of the line graph nodes corresponding to any two hyperedges, and normalizing the initial weighted adjacency matrices of the arbitrary two hyperedges according to the number of neighbors of the line graph nodes corresponding to the arbitrary two hyperedges to obtain the weighted adjacency matrices of the arbitrary two hyperedges;
[0041] Get the weighted adjacency matrix of the line graph based on the weighted adjacency matrix of all arbitrary two hyperedges.
[0042] According to a second aspect of an embodiment of the present invention, there is provided an apparatus for performing hyperedge classification on a hypergraph, the apparatus comprising:
[0043] Feature vector acquisition module: used to aggregate the features of internal nodes of each hyperedge in the hypergraph through the dynamic attention mechanism to generate the feature vector of each hyperedge;
[0044] Adjacency matrix acquisition module: used to convert the hypergraph into a line graph structure, obtain the adjacency matrix of the line graph based on the mapping relationship between the hyperedges of the hypergraph and the line graph nodes in the line graph structure; obtain the eigenvector of the corresponding line graph node based on the eigenvector of each hyperedge;
[0045] Embedding vector acquisition module: used to input the adjacency matrix of the line graph and the feature vector of each line graph node into a preset multi-layer graph convolutional network, and the multi-layer graph convolutional network outputs the embedding vector of each line graph node;
[0046] Classification output module: used to obtain the Hamming distance matrix between any two line graph nodes based on the embedding vectors of any two line graph nodes; based on the Hamming distance matrix, the hyperedge category is determined by the minimum distance classifier to obtain the hyperedge classification result.
[0047] According to a third aspect of an embodiment of the present invention, a storage medium is provided, wherein the storage medium stores a computer program, and when the computer program is executed by a host controller, each step in the above method is implemented.
[0048] The technical solutions provided by the embodiments of the present invention may have the following beneficial effects:
[0049] This application aggregates the features of internal nodes of each hyperedge in the hypergraph through a dynamic attention mechanism to generate a feature vector for each hyperedge, dynamically aggregates the features of nodes within the hyperedge, automatically learns the importance weights of different nodes, and avoids the deviation caused by relying on manually designed features; converts the hypergraph into a line graph structure, and obtains the adjacency matrix of the line graph based on the mapping relationship between the hyperedges of the hypergraph and the line graph nodes in the line graph structure; by converting the hypergraph into a line graph structure, the number of redundant edges is reduced by reconstructing the adjacency relationship, thereby reducing the training complexity of the graph neural network; obtains the Hamming distance matrix between any two line graph nodes based on the embedding vectors of any two line graph nodes; based on the Hamming distance matrix, the hyperedge category is determined by a minimum distance classifier to obtain the hyperedge classification result; measuring the node similarity by the Hamming distance matrix can effectively capture nonlinear relationships and improve classification robustness.
[0050] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0052] Figure 1 is a flow chart illustrating a method for performing hyperedge classification on a hypergraph according to an exemplary embodiment;
[0053] Figure 2 is a system schematic diagram of an apparatus for performing hyperedge classification on a hypergraph according to another exemplary embodiment;
[0054] In the accompanying figure: 1-feature vector acquisition module, 2-adjacency matrix acquisition module, 3-embedding vector acquisition module, 4-classification output module. DETAILED DESCRIPTION
[0055] Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. In the following description, when referring to the drawings, like numbers in different figures represent like or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all possible embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present invention, as detailed in the appended claims.
[0056] Example 1
[0057] Figure 1 FIG. 1 is a flow chart showing a method for performing hyperedge classification on a hypergraph according to an exemplary embodiment. Figure 1 As shown, the method includes:
[0058] S1, for each hyperedge in the hypergraph, aggregates the features of the internal nodes through the dynamic attention mechanism to generate the feature vector of each hyperedge;
[0059] S2, converting the hypergraph into a line graph structure, obtaining an adjacency matrix of the line graph based on a mapping relationship between hyperedges of the hypergraph and line graph nodes in the line graph structure; obtaining a eigenvector of a corresponding line graph node based on the eigenvector of each hyperedge;
[0060] S3, inputting the adjacency matrix of the line graph and the feature vector of each line graph node into a preset multi-layer graph convolutional network, and the multi-layer graph convolutional network outputs an embedding vector of each line graph node;
[0061] S4, obtaining a Hamming distance matrix between any two line graph nodes according to the embedding vectors of any two line graph nodes; determining the hyperedge category using a minimum distance classifier according to the Hamming distance matrix to obtain a hyperedge classification result;
[0062] It is understandable that in step S1, the specific implementation of the dynamic attention mechanism includes:
[0063] Define the learnable parameter matrix Where d is the input node feature dimension, d q , d q , d q are the dimensions of query, key, and value vectors respectively, W Q , W K , W V They are used to generate the query vector, key vector and value vector of the node respectively;
[0064] Get the feature vectors of all nodes in the hyperedge;
[0065] Calculate the node pairs within the hyperedge (x i , x j )’s attention coefficient:
[0066]
[0067] Among them, x i , x j is the eigenvector of the i-th and j-th nodes in the hyperedge, e ijis the attention coefficient of node i to node j, a scalar value, reflecting the importance of the two nodes in the hyperedge;
[0068] Normalize the attention coefficient to generate the weight distribution:
[0069]
[0070] Among them, α ij The normalized attention weights satisfy Used for weighted aggregation of node features, k is the total number of nodes included in the current hyperedge;
[0071] Calculate the hyperedge feature vector through the activation function:
[0072]
[0073] Among them, d i is the feature vector of the i-th hyperedge, which is generated by weighted aggregation of node features and activation function. tanh(·) is the hyperbolic tangent function, which is used for nonlinear transformation and has an output range of [-1, 1].
[0074] In step S2, the construction of the line graph and the acquisition of the adjacency matrix specifically include:
[0075] For the hyperedge set E in the original hypergraph, m}, define the set of line graph nodes in the line graph structure V′={v′1,v′2,……,v′ M}, each hyperedge e p Corresponding to the only line graph node v′ p ; The rule for defining the line graph adjacency matrix A is: if the original hyperedge e p and e q Share at least one node, then A pq =1, otherwise A pq =0;
[0076] The automatic connection unit matrix I is introduced into the line graph adjacency matrix A to enhance the node feature transfer, and we get To add a self-connected adjacency matrix, Add self-connected adjacency matrix Degree Matrix Calculate, where
[0077] In step S3, the structure of the multi-layer graph convolutional network specifically includes:
[0078] There are at least two layers of graph convolutional layers, and the node feature update formula for each layer is:
[0079]
[0080] Where, To add a self-connected adjacency matrix, To add the self-connected adjacency matrix, A is the original adjacency matrix of the line graph, and I is the unit matrix, which is used to retain the node's own characteristics. for The degree matrix, H (l) is the node feature matrix of the lth layer (wherein the node features of the 0th layer are obtained by aggregating the feature vectors of each line graph node obtained in step S2 above), Θ l is the trainable parameter matrix of the lth layer, σ(·) is the nonlinear activation function used to enhance the expressiveness of the model. The activation function uses the ReLU function or the hyperbolic tangent function. The output dimension of the last layer is consistent with the preset number of categories. In short, the node feature matrix of the 0th layer is obtained by aggregating the known feature vectors of each line graph node. The node feature matrix of the next layer (that is, the 1st layer) is obtained based on the node feature matrix of the 0th layer using the node feature update formula of the graph convolution layer. Each layer undergoes an update until the node feature matrix of the last layer is obtained. The node feature matrix output by the last graph convolution layer is the embedding vector of the line graph node corresponding to the input feature vector.
[0081] In step S4, the calculation and classification rules of the Hamming distance matrix specifically include:
[0082] Get the embedding vectors of any two line graph nodes u and υ and According to the embedding vectors of any two line graph nodes u and υ and Construct the Hamming distance matrix of line graph nodes u and v Represents the embedding vector and The number of different elements in corresponding positions after binarization;
[0083] According to the Hamming distance matrix, the hyperedge category is determined by the minimum distance classifier:
[0084]
[0085] in and is the embedding vector of nodes u and υ, is an indicator function, which is 1 when the node υ belongs to category l, otherwise it is 0. is the neighbor set of node u;
[0086] This embodiment also includes the pre-processing operation on the nodes within the hyperedge in step S1:
[0087] If the number of nodes within the hyperedge exceeds the preset threshold, a random sampling strategy is used to select some nodes for feature aggregation;
[0088] Node features are standardized:
[0089]
[0090] Among them, μ and σ are the mean and standard deviation of node features;
[0091] This embodiment also includes further optimizing the adjacency matrix A of the line graph into a weighted adjacency matrix:
[0092] Define two hyperedges e p and e q The weight of is a function of the number of shared nodes:
[0093]
[0094] Among them, e p and e q are two hyperedges in the original hypergraph, e p ∩e q is the set of common nodes of the two hyperedges, e p ∪e q is the union, |·| is the number of elements in the set, A pq is the initial weighted adjacency matrix, with a value range of [0,1], reflecting the strength of the association between hyperedges;
[0095] Perform symmetric normalization on the initial weighted adjacency matrix:
[0096]
[0097] Among them, A′ pq is the final weighted adjacency matrix, D pp and D qq is the degree of the line graph nodes p and q, that is, the number of neighbors of nodes p and q;
[0098] This embodiment also discloses a training process of a graph convolutional network, which specifically includes:
[0099] The cross entropy loss function is used to optimize the model parameters:
[0100]
[0101] in, is the true category label of node u, To predict the probability, output through the softmax function;
[0102] Introduce L2 regularization term to prevent overfitting:
[0103]
[0104] in, is the L2 norm square of the trainable parameters, which serves as a regularization term;
[0105] The above solution of this application is applicable to the classification task of dynamic hypergraphs:
[0106] For time series hypergraph data, we use a sliding window to capture hypergraph snapshots, generate line graphs, and input them into the graph neural network.
[0107] The nodes at each time step are embedded and concatenated and then input into the long short-term memory network (LSTM) to capture the temporal dependency;
[0108] The above-mentioned solution of the present application is also applicable to applications in biomolecular interaction networks including:
[0109] Biomolecules (proteins, genes) are defined as hypergraph nodes, and intermolecular interactions are defined as hyperedges;
[0110] Identify key molecular interaction patterns based on the Hamming distance matrix and output hyperedge classification results to predict biological functions;
[0111] (1) This embodiment also discloses a specific example of hyperedge classification in a biomolecular interaction network:
[0112] Application scenarios: Accurately predict the functional categories of protein complexes (such as enzyme activity, signal transduction, structural support).
[0113] Implementation steps:
[0114] Data construction and preprocessing:
[0115] Node source: 10,000 protein nodes were extracted from the STRING database, with features including sequence similarity (via BLAST alignment), gene co-expression level (RNA-seq data), and subcellular localization (GO annotation).
[0116] Hyperedge definition: 3,000 protein complexes with known functions were obtained from the CORUM database as hyperedges, for example:
[0117] Hyperedge 1: The “ATP synthase complex” contains 15 proteins (such as ATP5A1, ATP5B, ATP5C1, etc.);
[0118] Super edge 2: The "nuclear pore complex" contains 30 proteins (such as NUP153, NUP62, etc.).
[0119] Label setting: Functional categories are divided into 6 categories (enzyme catalysis, structural protein, transport protein, signal transduction, DNA repair, unknown function)
[0120] Dynamic Attention Feature Aggregation:
[0121] Parameter initialization: define the learnable parameter matrix W Q ∈R 128×64 , W K ∈R 128×64 , W2∈R 128×32 Initialized to Xavier normal distribution.
[0122] Weight calculation example:
[0123] In the “ATP synthase complex” hyperedge, the attention weight of ATP5A1 (catalytic core subunit) is 0.32, the weight of ATP5B (auxiliary subunit) is 0.18, and the weights of other subunits are all below 0.05.
[0124] Feature generation: Output the hyperedge feature vector d through the tanh activation function i ∈R 32 .
[0125] Hypergraph to line graph conversion:
[0126] Adjacency matrix rule: If two complexes share ≥2 proteins, a connection is established between the line graph nodes; for example, the "ATP synthase complex" and the "mitochondrial inner membrane complex" share 3 proteins, and the weight is set to 1.
[0127] Symmetric normalization: normalize the adjacency matrix A by the degree matrix Avoid high-degree nodes (such as common structural proteins) dominating feature propagation.
[0128] Graph Neural Network Training:
[0129] Model structure: two-layer GCN, hidden layer dimension 64, output layer dimension 6 (corresponding to the number of functional categories), activation function is ReLU.
[0130] Loss function: cross entropy loss + L2 regularization (λ = 0.001), optimizer is Adam (learning rate 0.001).
[0131] Test results:
[0132] On 500 complexes that were not trained, the classification accuracy reached 89.7% (compared to 72.3% for traditional GCN);
[0133] Key Metrics:
[0134] The recall rate of the enzyme catalysis category was improved to 91.2% (compared to 78.5% for the traditional method).
[0135] (2) This embodiment also discloses a specific example of social network group classification:
[0136] Application scenario: Identifying fake groups on social platforms (such as advertising groups and zombie fan groups).
[0137] Implementation steps:
[0138] Data construction and noise reduction:
[0139] Node characteristics: 1 million users are extracted from platform logs. Characteristics include:
[0140] Behavioral characteristics: average daily number of posts, like rate, and friend growth rate;
[0141] Content features: keyword matching (such as advertising word frequency) and text sentiment analysis score.
[0142] Hyperedge definition: 10,000 groups are used as hyperedges, each group contains 50-200 user nodes, and the labels are divided into real group (60%), advertising group (30%), and zombie group (10%).
[0143] Dynamic aggregation and sampling:
[0144] Standardization: Z-score standardization of user features Eliminate dimensional differences.
[0145] Random sampling: For groups with more than 100 members, 80 core user nodes are randomly retained to avoid wasting computing resources.
[0146] Attention weight example:
[0147] In the ad group, users who frequently post product links have a weight of 0.4-0.6, while silent users have a weight of less than 0.05;
[0148] In real groups, the weights of interactive and active users are evenly distributed (0.1-0.3).
[0149] Weighted Line Chart Optimization:
[0150] Adjacency matrix definition: If the user overlap rate of two groups is ≥30%, then the line graph nodes are connected, and the weight calculation formula is:
[0151]
[0152] Normalization: Symmetric normalization of the weight matrix Balance the impact of large and small groups.
[0153] Classification model training:
[0154] Model configuration: three-layer GCN (64-32-3), Dropout rate 0.3, Batch Normalization accelerated convergence;
[0155] Classifier: Support vector machine (SVM) is used to classify the embeddings, and the kernel function is RBF (γ = 0.1).
[0156] Effect verification:
[0157] Performance comparison:
[0158] method Accuracy F1 value (ad group) False positive rate Traditional GCN 82.3% 0.76 12.5% The present invention 93.5% 0.91 4.2%
[0159] Interpretability: Attention weight visualization shows that 90% of high-weight users in the advertising group are marked as "suspicious accounts" by the platform.
[0160] (3) This embodiment also discloses a specific case of dynamic traffic network congestion pattern recognition:
[0161] Application scenarios: Real-time identification of congestion types in urban traffic networks (such as morning and evening rush hours, accident congestion, and construction congestion) to support dynamic traffic scheduling.
[0162] Implementation steps:
[0163] Dynamic hypergraph construction and data source:
[0164] Node definition: Obtain 5,000 road segment sensor data from the city traffic management system. Features include:
[0165] Real-time traffic volume (vehicles / minute), average speed (km / h), congestion index (0-1 normalized);
[0166] Historical congestion frequency (number of congestion events during the same period in the past 7 days).
[0167] Superedge generation rules: A superedge is generated every 5 minutes, including all currently congested road sections (vehicle speed < 20 km / h and congestion index > 0.7), and 288 dynamic superedges are generated every day.
[0168] Label setting: Congestion types are divided into 4 categories (morning rush hour, evening rush hour, accident, and construction).
[0169] Time series modeling and feature fusion:
[0170] Sliding window design: Using a 30-minute window, we capture six consecutive hyperedge snapshots to construct a temporal hypergraph sequence.
[0171] Graph Neural Network Architecture:
[0172] Spatial feature extraction: Generate a line graph for each hyperedge snapshot, input a two-layer GCN (hidden layer dimension 64, ReLU activation), and output a road segment embedding;
[0173] Temporal dependency modeling: The embedded sequence within 24 hours is input into a bidirectional LSTM (hidden unit 128) to capture the congestion propagation pattern.
[0174] Dynamic weight adjustment: Fusion of temporal features based on the time decay factor (e.g., the weight of the latest hyperedge is 0.9, and the weight of the previous hyperedge decays exponentially at 0.8).
[0175] Classification rules and effect verification:
[0176] Hamming distance matrix optimization: Dynamically adjust the distance threshold based on the real-time traffic flow rate (e.g., the response threshold for accident congestion is reduced by 20%).
[0177] Real-time classification results
[0178] Congestion type Accuracy False alarm rate Response time morning rush hour 0.942 0.031 2s ACCIDENT 0.885 0.053 1s
[0179] Application effect: In pilot cities, the dispatch response speed for accident congestion increased by 40%, and the traffic efficiency of the road network during peak hours increased by 18%.
[0180] (4) This embodiment also discloses a specific case of e-commerce user-product interactive recommendation:
[0181] Application scenario: Predict product category preferences (such as maternity and baby, digital products, and home furnishings) based on user group behavior to improve cross-category recommendation effectiveness.
[0182] Implementation steps:
[0183] Heterogeneous hypergraph construction:
[0184] Node Type:
[0185] User nodes: 1 million users, with features including historical click-through rate, purchase frequency, and average order value;
[0186] Product node: 500,000 products, with features including category (one-hot encoding), price range, and inventory turnover rate.
[0187] Hyperedge definition: Each hyperedge represents a group purchase event, including participating users (≥10 people) and related products (≥5 items).
[0188] Tag setting: Recommended categories are divided into 8 categories (mother and baby, digital, beauty, home, clothing, food, books, and others).
[0189] Heterogeneous feature aggregation:
[0190] Dual-channel attention mechanism:
[0191] User channel: calculate user node weight Focus on users with high purchasing power (e.g., the weight of users with average order value greater than RMB 1,000 will be increased by 30%).
[0192] Product channel: calculate product node weight The weight of popular products (top 10% click-through rate) is reduced by 15% to avoid overfitting.
[0193] Feature fusion: The user and product embeddings are concatenated and input into the fully connected layer (dimension 128→64) to generate a hyperedge feature vector.
[0194] Line chart optimization and classification:
[0195] Weighted adjacency matrix: The weights of two hyperedges are determined by the user overlap rate and the similarity of product categories:
[0196] (Product feature vector p , product feature vector q )
[0197] Classifier design: A hierarchical K-nearest neighbor classifier is used, which prioritizes matching the first-level categories (such as maternal and infant) and then refines the second-level subcategories (such as infant formula and children's clothing).
[0198] Recommended effect verification:
[0199] A / B test results:
[0200] index Traditional collaborative filtering Method of the present invention Click-through rate (CTR) 0.123 0.187 Conversion Rate (CVR) 0.021 0.038 Long-tail product coverage 0.15 0.27
[0201] Case description: In the maternal and infant product category recommendation, the Hamming distance similarity threshold for the user group purchasing children's clothing was set to 0.85, which increased the accurate recommendation rate by 22%.
[0202] Example 2:
[0203] Figure 2 2 is a system diagram illustrating an apparatus for performing hyperedge classification on a hypergraph according to another exemplary embodiment, the apparatus comprising:
[0204] Feature vector acquisition module 1: It is used to aggregate the features of internal nodes of each hyperedge in the hypergraph through the dynamic attention mechanism to generate the feature vector of each hyperedge;
[0205] Adjacency Matrix Acquisition Module 2: used to convert the hypergraph into a line graph structure, obtain the adjacency matrix of the line graph based on the mapping relationship between the hyperedges of the hypergraph and the line graph nodes in the line graph structure; obtain the eigenvector of the corresponding line graph node based on the eigenvector of each hyperedge;
[0206] Embedding vector acquisition module 3: used to input the adjacency matrix of the line graph and the feature vector of each line graph node into a preset multi-layer graph convolutional network, and the multi-layer graph convolutional network outputs the embedding vector of each line graph node;
[0207] Classification output module 4: used to obtain the Hamming distance matrix between any two line graph nodes based on the embedding vectors of any two line graph nodes; based on the Hamming distance matrix, the hyperedge category is determined by the minimum distance classifier to obtain the hyperedge classification result.
[0208] Example 3:
[0209] This embodiment provides a storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a host controller, each step in the above method is implemented;
[0210] It is understandable that the storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0211] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.
[0212] It should be noted that, in the description of the present invention, the terms "first," "second," etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, "a small number of sparsely distributed" means at least two.
[0213] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or less sparsely distributed executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may be performed out of the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention pertain.
[0214] It should be understood that various parts of the present invention can be implemented using hardware, software, firmware, or a combination thereof. In the above-described embodiment, a small number of sparsely distributed steps or methods can be implemented using software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented using hardware, as in another embodiment, any one of the following technologies known in the art or a combination thereof can be used to implement it: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application-specific integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0215] Those skilled in the art will understand that all or part of the steps in the method of the above embodiment can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiment.
[0216] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing module, or each unit may exist physically separately, or two or more units may be integrated into a single module. The aforementioned integrated modules may be implemented in the form of hardware or in the form of software functional modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may also be stored in a computer-readable storage medium.
[0217] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0218] Throughout this specification, references to terms such as "one embodiment," "some embodiments," "examples," "specific examples," or "some examples" indicate that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or a small number of sparsely distributed embodiments or examples.
[0219] Although the embodiments of the present invention have been shown and described above, it will be understood that the above embodiments are illustrative and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A method for hyperedge classification of a hypergraph, characterized in that: The method comprises: For each hyperedge in the hypergraph, the features of the internal nodes are aggregated through the dynamic attention mechanism to generate the feature vector of each hyperedge; Converting the hypergraph into a line graph structure, obtaining an adjacency matrix of the line graph based on a mapping relationship between hyperedges of the hypergraph and line graph nodes in the line graph structure; obtaining a eigenvector of a corresponding line graph node based on the eigenvector of each hyperedge; Inputting the adjacency matrix of the line graph and the feature vector of each line graph node into a preset multi-layer graph convolutional network, respectively, and the multi-layer graph convolutional network outputs an embedding vector of each line graph node; A Hamming distance matrix between any two line graph nodes is obtained according to the embedding vectors of any two line graph nodes; and a hyperedge category is determined by a minimum distance classifier according to the Hamming distance matrix to obtain a hyperedge classification result.
2. The method according to claim 1, characterized in that For each hyperedge in the hypergraph, the features of the internal nodes are aggregated through the dynamic attention mechanism to generate a feature vector for each hyperedge, including: Define a learnable parameter matrix and obtain the eigenvectors of all nodes in each hyperedge; Based on the learnable parameter matrix and the feature vectors of any two nodes in the hyperedge, obtaining the attention coefficient of any node in the hyperedge to another node; Normalizing the attention coefficient of any node in the hyperedge to another node to obtain a normalized attention weight; The feature vector of each hyperedge is obtained according to the normalized attention weight, the learnable parameter matrix and the preset activation function.
3. The method according to claim 2, characterized in that The step of converting the hypergraph into a line graph structure and obtaining an adjacency matrix of the line graph according to a mapping relationship between hyperedges of the hypergraph and line graph nodes in the line graph structure includes: Get the hyperedge set E of the hypergraph = {e1, e2, ..., e m }, defines the set V of line graph nodes in the line graph structure ′ ={v1 ′ , v2 ′ ,……,v ′ M }, each hyperedge e p Corresponding to the only line graph node v p ′ ; If any two hyperedges e p and e q contains at least one common node, then any two hyperedges e p and e q The adjacency matrix A pq =1, otherwise A pq =0; obtain the adjacency matrix of the line graph based on the adjacency matrix of all arbitrary two hyperedges.
4. The method according to claim 3, characterized in that Also includes: Adding an auto-connection identity matrix to the adjacency matrix of the line graph to obtain a self-connection adjacency matrix; Performing degree matrix calculation on the self-connected adjacency matrix to obtain a degree matrix of the self-connected adjacency matrix; The self-connected adjacency matrix, the degree matrix of the self-connected adjacency matrix, and the feature vector of each line graph node are respectively input into a preset multi-layer graph convolutional network.
5. The method according to claim 4, characterized in that The multi-layer graph convolutional network outputs the embedding vector of each line graph node including: Obtaining a node feature matrix at layer 0 according to the feature vector of each line graph node; The preset multi-layer graph convolutional network includes at least two graph convolutional layers, and the node feature matrix of the first layer is obtained according to the node feature matrix of the 0th layer, the self-connected adjacency matrix, and the degree matrix of the self-connected adjacency matrix. The node feature matrix of the second layer is obtained according to the node feature matrix of the first layer, the self-connected adjacency matrix, and the degree matrix of the self-connected adjacency matrix, until the node feature matrix output by the last graph convolutional layer of the multi-layer graph convolutional network is obtained; The node feature matrix output by the last graph convolution layer of the multi-layer graph convolutional network is the embedding vector of the line graph node corresponding to the input feature vector.
6. The method according to claim 5, characterized in that The method of obtaining a Hamming distance matrix between any two line graph nodes according to the embedding vectors of any two line graph nodes and determining the hyperedge category by a minimum distance classifier according to the Hamming distance matrix to obtain a hyperedge classification result includes: Get the embedding vectors of any two line graph nodes u and v and According to the embedding vectors of any two line graph nodes u and v and Construct the Hamming distance matrix of line graph nodes u and υ Represents the embedding vector and The number of different elements in corresponding positions after binarization; According to the Hamming distance matrix The hyperedge category is determined by the minimum distance classifier. When the node belongs to the specified category, the value is 1, otherwise it is 0, and the hyperedge classification result corresponding to the node is obtained.
7. The method according to claim 6, characterized in that Also includes: Preprocessing of hyperedges, including: If the number of nodes in any hyperedge exceeds the preset node number threshold, a random sampling strategy is used to select some nodes for feature aggregation; Each node feature within the obtained hyperedge is standardized based on the mean and standard deviation of all node features within the hyperedge.
8. The method according to claim 7, characterized in that Also includes: Optimizing the adjacency matrix of the line graph into a weighted adjacency matrix, comprising: Obtaining the intersection of all nodes in any two hyperedges and the union of all nodes in any two hyperedges, and obtaining an initial weighted adjacency matrix of the any two hyperedges according to the intersection of all nodes in the any two hyperedges and the union of all nodes in the any two hyperedges; Respectively obtaining the number of neighbors of the line graph nodes corresponding to any two hyperedges, and normalizing the initial weighted adjacency matrices of the arbitrary two hyperedges according to the number of neighbors of the line graph nodes corresponding to the arbitrary two hyperedges to obtain the weighted adjacency matrices of the arbitrary two hyperedges; Get the weighted adjacency matrix of the line graph based on the weighted adjacency matrix of all arbitrary two hyperedges.
9. A device for performing hyperedge classification on a hypergraph, characterized in that: The device comprises: Feature vector acquisition module: used to aggregate the features of internal nodes of each hyperedge in the hypergraph through the dynamic attention mechanism to generate the feature vector of each hyperedge; Adjacency matrix acquisition module: used to convert the hypergraph into a line graph structure, obtain the adjacency matrix of the line graph based on the mapping relationship between the hyperedges of the hypergraph and the line graph nodes in the line graph structure; obtain the eigenvector of the corresponding line graph node based on the eigenvector of each hyperedge; Embedding vector acquisition module: used to input the adjacency matrix of the line graph and the feature vector of each line graph node into a preset multi-layer graph convolutional network, and the multi-layer graph convolutional network outputs the embedding vector of each line graph node; Classification output module: used to obtain the Hamming distance matrix between any two line graph nodes based on the embedding vectors of any two line graph nodes; based on the Hamming distance matrix, the hyperedge category is determined by the minimum distance classifier to obtain the hyperedge classification result.
10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the main controller, the computer program implements each step of the method for performing hyperedge classification on a hypergraph according to any one of claims 1 to 8.