A short video recommendation method based on multi-class and multi-relation heterogeneous graph in complex networks

By constructing a multi-class and multi-relationship heterogeneous graph model MMHGNN and adopting the four-color theorem and feature fusion technology, the shortcomings of a single interactive relationship in short video recommendation are solved, a more efficient integration of user and short video interactive relationships is achieved, the accuracy and personalization of recommendations are improved, and the problem of feature over-smoothing is solved.

CN120316358BActive Publication Date: 2025-09-12SHANDONG UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510822128.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-19
Publication Date
2025-09-12
Estimated Expiration
2045-06-19

AI Technical Summary

Technical Problem

Existing heterogeneous graph neural networks only consider the single interaction relationship between users and short videos in short video recommendation, ignoring the rich meanings of multiple interaction relationships, resulting in the inability to fully explore the importance of entities, and are prone to feature over-smoothing problems when processing large-scale data.

Method used

A multi-class and multi-relation heterogeneous graph model MMHGNN is constructed, and the four-color theorem is used to color the graph. Through structural feature encoding, weighted multi-relation path aggregation and feature fusion, various interactive relationships between users and short videos are captured, the distinguishability of nodes is enhanced, and the information of multiple meta-paths is integrated.

Benefits of technology

It improves the accuracy and personalization of short video recommendations, avoids the problem of feature over-smoothing, enhances the robustness and computational efficiency of the model, and provides more accurate and rich recommendation services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120316358B_ABST
    Figure CN120316358B_ABST
Patent Text Reader

Abstract

The present invention discloses a short video recommendation method based on a multi-class, multi-relationship heterogeneous graph in a complex network, belonging to the field of short video recommendation technology. The method comprises the following steps: Step 1: constructing a complex neural network model for the multi-class, multi-relationship heterogeneous graph, the model comprising a structural feature encoding module, a weighted multi-relationship path aggregation module, and a feature fusion module; Step 2: constructing a loss function to optimize the training of the complex neural network model for the multi-class, multi-relationship heterogeneous graph; Step 3: obtaining the short video data of the current user, inputting the trained complex neural network model for the multi-class, multi-relationship heterogeneous graph, and generating a personalized short video recommendation list. The present invention provides users with a more personalized and accurate short video recommendation service, helps to deeply understand the diversity and uniqueness of videos, and provides users with a better viewing experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of short video recommendation, and specifically relates to a short video recommendation method based on a multi-category and multi-relationship heterogeneous graph in a complex network. Background Art

[0002] Short video recommendation methods are a typical example of a heterogeneous information network (HIN). HINs consist of multiple types of nodes, including users, short video content, and the interactions between them, represented by edges. Heterogeneous graph neural networks (HGNNs) have gained increasing attention in the field of short video recommendation due to their ability to effectively handle this complex heterogeneity. In this recommendation system, users and short video content serve as nodes, while the interactions between users and content constitute edges. This heterogeneous structure effectively captures user preferences and the characteristics of short video content, thereby providing more accurate recommendations.

[0003] Heterogeneous graph neural networks are widely used in short video recommendation. Paths in heterogeneous graphs can be viewed as specific user-video interaction sequences, which contain specific information about user preferences and video features. By analyzing these paths, researchers can identify users and short video content with similar viewing histories or genre preferences in short video recommendations, effectively capturing the final representation. However, while aggregation methods for heterogeneous graph neural networks have demonstrated advantages in short video recommendation, they still have some limitations. Existing heterogeneous graph neural networks only extract a single interaction relationship between users and short videos, while users and short videos may have multiple interactions such as browsing, liking, adding to favorites, and forwarding. This ignores these rich and meaningful relationships and hinders the mining of the importance of entities. Although some studies have proposed dual-class multi-relationship heterogeneous graph neural network models to address this issue, the node types are limited to users and short videos. However, attributes such as the release time of the short video and the user's age can also be considered as nodes in the short video recommendation process to improve the accuracy of short video recommendation methods. Therefore, some studies suggest that in short video recommendation methods, a single meta-path or two types of nodes cannot aggregate sufficient semantic information. Instead, information from multiple meta-paths should be aggregated to ensure more comprehensive characterization of users or short video content. In summary, heterogeneous graph neural network methods have the following shortcomings in short video recommendation analysis: given the large scale of short video recommendations, it is almost impossible for a single meta-path to exist between users and short videos. Although a two-class multi-relationship heterogeneous graph has been proposed to account for the complexity of multiple meta-paths between users and short videos, the node types are limited to two. In contrast, in the datasets of some short video recommendation methods, multiple node types may exist, such as users, user ages, short videos, and short video release times.

[0004] In summary, heterogeneous graph neural networks hold great promise for short video recommendation applications. While the two-class multi-relation heterogeneous graph neural network effectively handles the presence of multiple meta-paths in recommendation systems, it limits the number of node types to just two and fails to consider the presence of multiple node types in heterogeneous graphs. Future research could further explore how to combine multiple node types and meta-paths in heterogeneous graphs to better handle the heterogeneity of short video recommendations and enrich node features. Summary of the Invention

[0005] To address these issues, this paper proposes a short video recommendation method based on a multi-class, multi-relationship heterogeneous graph model in complex networks. This method constructs a complex neural network model, the MMHGNN, for this multi-class, multi-relationship heterogeneous graph. This method constructs a multi-class, multi-relationship heterogeneous graph with multiple node types and multiple relationships between nodes. It uses the four-color theorem to color the graph to improve node distinguishability, focusing on capturing the multi-relationship characteristics between nodes. This method demonstrates greater effectiveness in modeling and predicting short video recommendations.

[0006] The technical solutions of the present invention are as follows:

[0007] A short video recommendation method based on a multi-class and multi-relationship heterogeneous graph in a complex network includes the following steps:

[0008] Step 1: Construct a complex neural network model for multi-class and multi-relation heterogeneous graphs. The model includes a structural feature encoding module, a weighted multi-relation path aggregation module, and a feature fusion module.

[0009] Step 2: Construct a loss function to optimize the training of complex neural network models for multi-class and multi-relation heterogeneous graphs;

[0010] Step 3: Obtain the short video data of the current user, input the trained complex neural network model for multi-class and multi-relation heterogeneous graphs, and generate a personalized short video recommendation list.

[0011] Furthermore, in step 1, the working process of the complex neural network model for multi-class multi-relation heterogeneous graphs is as follows:

[0012] Step 1.1: Construct a heterogeneous graph and obtain the structural feature encoding of each path through the structural feature encoding module;

[0013] Step 1.2: Aggregate path neighbors through the weighted multi-relational path aggregation module to generate a feature embedding matrix for each path;

[0014] Step 1.3: Combine the path’s structural feature encoding with the feature embedding matrix through the feature fusion module to form the path’s structural embedding. Then, use the graph-level attention mechanism to fuse the node features under different paths to generate the final feature embedding representation.

[0015] Furthermore, the specific process of step 1.1 is as follows:

[0016] Step 1.1.1. Combine the graph coloring process, the four-color theorem, and one-hot encoding to generate a color feature encoding for each path in the heterogeneous graph.

[0017] Step 1.1.2, generate sequence feature code;

[0018] Step 1.1.3: Combine the color feature coding with the sequence feature coding to obtain the structural feature coding.

[0019] Furthermore, the specific process of step 1.1.1 is as follows:

[0020] Step 1.1.1.1. Color-code each node in the heterogeneous graph based on the graph coloring process. The graph coloring process is:

[0021] (1);

[0022] in, For heterogeneous graphs Color coding; is the shading function;

[0023] Step 1.1.1.2: Assign color features to nodes according to the Four Color Theorem. Specifically: If ,but , For the nodes and The edges between nodes; is the set of paths connecting nodes in a heterogeneous graph; and They are nodes Hedi nodes Color characteristics after coloring;

[0024] Step 1.1.1.3: Generate color feature code; the specific process is as follows:

[0025] First, color-code each path:

[0026] (2);

[0027] in, For the Path Color coding of the first node yes The head node, nodes yes The tail node of It is a splicing operation;

[0028] Since there are colors, so use one-hot encoding to generate color codes for different colors of each path, and get , ;

[0029] Then, the color feature encoding of each path is captured in the form of convolution:

[0030] (3);

[0031] in, It is Path Color feature coding; yes The adjacency matrix of yes Expanded color coding matrix; is a learnable parameter matrix; is the number of target type nodes.

[0032] Furthermore, the specific process of step 1.1.2 is as follows:

[0033] First, each path is sequence-encoded:

[0034] (4);

[0035] in, For the Path Sequence code of It is nodes type The encoding; is the total number of nodes in the heterogeneous graph;

[0036] Then, according to the sequence encoding, the sequence feature encoding of each path is obtained:

[0037] (5);

[0038] in, It is Path Sequence feature encoding;

[0039] The formula for step 1.1.3 is:

[0040] (6);

[0041] in, It is Path Structural feature encoding.

[0042] Furthermore, the specific process of step 1.2 is as follows:

[0043] Step 1.2.1: Assume Path The starting nodes are and , the difference in the number of edges is retained through a balancing strategy; the edge weight calculation is expressed as:

[0044] (7);

[0045] in, Indicates the nodes and The edge weights between all neighbor nodes under ; Indicates Next nodes With the nodes The number of edges between them;

[0046] definition For the Path The edge weight matrix between all nodes under the path set There is a set of edge weight matrices below ,in represents the number of paths, For the paths; For the The edge weight matrix between all nodes under a path;

[0047] Step 1.2.2: Set the edge weight of each node to the maximum edge weight of the connected nodes, and normalize the edge weights by path length. The formula is:

[0048] (8);

[0049] (9);

[0050] in, is the edge weight matrix diagonal elements of ; is the maximum value function; For the Path Down-normalized edge weight matrix; Calculate the function for path length; Is to use the length Normalized results;

[0051] Step 1.2.3: After obtaining the edge weight matrix, aggregate the edge weights Path The node features on the , get the feature embedding matrix:

[0052] (10);

[0053] (11);

[0054] in, is the initial feature matrix of the node, is the initial feature dimension; is the feature matrix after feature projection, is the feature dimension after dimensionality reduction; is the feature transformation matrix; is a learnable parameter matrix; It is Path The feature embedding matrix of is the activation function.

[0055] Furthermore, the specific process of step 1.3 is as follows:

[0056] Step 1.3.1: Obtaining the structural feature coding set under different paths and the feature embedding matrix set Then, merge the two:

[0057] (12);

[0058] in, For the Path structural embedding of For the Path Structural feature coding; For the Path The feature embedding matrix of

[0059] Step 1.3.2: Align different features:

[0060] (13);

[0061] in, After alignment Path structural embedding of It is Path The feature transformation matrix of

[0062] Step 1.3.3: Use the path-level attention mechanism to fuse different paths:

[0063] (14);

[0064] (15);

[0065] (16);

[0066] in, For the The importance of each path; Represents a collection of nodes; is a node; is the graph-level attention vector; is the tanh activation function; is the weight matrix; express midpoint The corresponding structural embedding; is the bias vector; For the The contribution of each path to the task; is an exponential function with base e; is the final feature embedding representation.

[0067] Furthermore, the specific process of step 2 is as follows:

[0068] By minimizing losses To optimize the model parameters:

[0069] (17);

[0070] in, is the projection matrix; is a set of labeled nodes; and Mark nodes The label vector and the final feature embedding representation.

[0071] Furthermore, the specific process of step 3 is as follows:

[0072] Step 3.1, determine the node feature matrix, including the short video feature matrix and the user feature matrix; the short video feature matrix contains all short video information, and the user feature matrix consists of user information;

[0073] Step 3.2: Node feature extraction based on a complex neural network model for multi-class and multi-relation heterogeneous graphs;

[0074] The collected short video data is processed into a heterogeneous graph. The nodes in the heterogeneous graph represent different entities, including short videos, users, and creators; the edges represent the relationships between entities, including viewing relationships and creation relationships; for each node, color coding is performed according to formula (1) and the four-color theorem, and the node color features are given; according to formula (2), each path is color-coded, and the color feature coding of each path is captured using formula (3); according to formula (4), each path is sequence-coded and the sequence feature coding of each path is obtained using formula (5); according to formula (6), the color feature coding and sequence feature coding are combined. The encoding is combined to obtain the structural feature encoding; then, the edge weights between all neighbor nodes of each node in each path are calculated according to formula (7), the edge weight matrix is ​​constructed, and the edge weight matrix is ​​normalized according to formula (8) and formula (9). The feature embedding matrix is ​​calculated for the short video feature matrix and the user feature matrix according to formula (10) and formula (11). The structural feature encoding and the feature embedding matrix are fused according to formula (12) to obtain the structural embedding. The aligned structural embedding is obtained according to formula (13). Finally, the final feature embedding representation is calculated according to formulas (14) to (16);

[0075] Step 3.3: Continuously update and back-propagate the model parameters according to formula (17);

[0076] Step 3.4: For short video nodes, use formula (16) to calculate the short video node embedding representation. All short video node embedding representations constitute the short video node embedding matrix. Calculate the similarity between short video nodes in the short video node embedding matrix. Sort the calculated similarity values ​​in descending order and select the top The short videos with the highest similarity are selected to generate a personalized short video recommendation list.

[0077] The beneficial technical effects brought about by the present invention are as follows.

[0078] Traditional short video recommendations often only consider the single association between videos and users. However, users and short videos may have multiple interactive relationships, such as browsing, liking, collecting, and forwarding. Ignoring these rich relationships is not conducive to exploring the importance of entities. However, this invention integrates multiple interactive relationships between users and short videos, such as browsing, liking, collecting, and forwarding, through structural feature encoding, weighted multi-relationship path aggregation, and feature fusion, to provide users with more accurate short video recommendations.

[0079] Integration of Heterogeneous Meta-Paths: In a vast short video library, multiple types of meta-paths exist between short videos and users. To fully preserve these meta-paths, this paper focuses on integrating heterogeneous meta-paths, enabling the model to fully understand the diversity and uniqueness of videos, thereby providing users with more personalized recommendations.

[0080] Preventing oversmoothing: Traditional short video recommendation algorithms are prone to oversmoothing features when processing large-scale video data, leading to information loss. This invention effectively avoids this problem by fusing node color features with path encoding as a structural representation of specific paths. This enhances the graph's topology and improves node distinguishability. This not only enhances the model's robustness but also provides users with a richer viewing experience.

[0081] Efficient data processing: This invention utilizes advanced algorithms and data processing methods to efficiently process large amounts of short video data. This processing method not only improves the model's computational efficiency but also enhances its generalization capabilities across large datasets, providing users with a more streamlined short video recommendation service.

[0082] This invention is a novel short video recommendation method that avoids the limitations of traditional techniques on video data, enabling the model to more accurately understand the intrinsic characteristics of videos. Through structural feature encoding, weighted multi-relational path aggregation, and feature fusion, this invention provides users with a more personalized and accurate short video recommendation service, helping to deeply understand the diversity and uniqueness of videos and providing users with a better viewing experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0083] Figure 1 This is a flow chart of the short video recommendation method based on multi-category and multi-relationship heterogeneous graphs in complex networks.

[0084] Figure 2 Schematic diagram of the visualization results of the existing ie-HGCN model.

[0085] Figure 3 Schematic diagram for visualizing the results of existing HPN models.

[0086] Figure 4Schematic diagram for visualizing the results of the existing HAN model.

[0087] Figure 5 Schematic diagram for visualizing the results of the existing HGNN-BRFE model.

[0088] Figure 6 Schematic diagram for visualizing the results of the existing OSGNN model.

[0089] Figure 7 Schematic diagram of the visualization results of the MMHGNN model proposed in this invention. DETAILED DESCRIPTION

[0090] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:

[0091] This paper proposes a new MMHGNN model for recommending short videos to users. This model constructs a multi-class, multi-relationship heterogeneous graph with multiple node types and relationships. It fully considers the various interactive relationships between users and short videos, uses the four-color theorem to color the graph, improves node distinguishability, and focuses on capturing the multi-relationship characteristics between users and short videos, demonstrating greater effectiveness in modeling and predicting short video recommendations.

[0092] The MMHGNN model primarily consists of three modules: structural feature encoding, weighted multi-relational path aggregation, and feature fusion. The MMHGNN model first colors the graph according to the four-color theorem, assigning color features to each node to reflect the graph's topology. Furthermore, the MMHGNN generates a type code for each edge relationship between a user and a short video. These edge type codes are combined to construct an encoded representation of the selected path. The node color features are fused with the path code to form a structural representation of the specific path. This enhances the graph's topology, helping to improve the distinguishability of short videos and reduce the risk of oversmoothing.

[0093] Because the number of interactions between users and short videos can vary, MMHGNN aggregates user neighbors along short video paths based on the number of connections. It pays special attention to the difference in the number of edges between long and short paths (e.g., 2-hop vs. 5-hop paths) to avoid overweighting long paths and causing feature imbalance. MMHGNN uses a balancing strategy to offset this imbalance.

[0094] MMHGNN combines the path structure features encoded by the structural feature with the feature embeddings under the corresponding path to form a structural embedding for a specific path. Through the graph-level attention mechanism, the short video node features under different paths are integrated to generate the final node embedding representation of the short video.

[0095] The method of the present invention provides a new idea and tool for the field of short video recommendation, fully capturing the diversity and richness of short video content, helping to more deeply understand the characteristics of short videos and user preferences, and thus providing strong support for the further development of short video recommendation systems.

[0096] like Figure 1 As shown in FIG, a short video recommendation method based on a multi-class and multi-relation heterogeneous graph in a complex network includes the following steps:

[0097] Step 1: Construct a complex neural network model MMHGNN for multi-class and multi-relation heterogeneous graphs. MMHGNN mainly consists of a structural feature encoding module, a weighted multi-relation path aggregation module, and a feature fusion module.

[0098] Complex networks contain a wide variety of node types and complex connections between node pairs. To achieve refined distinction and prevent node specificity from being overwritten during aggregation, which could lead to severe oversmoothing, the MMHGNN employs three methods to finely distinguish different nodes. First, a path sequence encoding is generated for each node, representing its path sequence, to distinguish nodes along different paths. Nodes are then colored using the four-color theorem, and the path sequence encoding is combined with the node color encoding within each path to distinguish different nodes along the same path. Furthermore, to further improve node distinguishability, an edge weight aggregation strategy is employed, aggregating node features based on the edge weights between node pairs.

[0099] The working process of the complex neural network model MMHGNN for multi-class and multi-relation heterogeneous graphs is as follows:

[0100] Step 1.1: Construct a heterogeneous graph. Use the structural feature encoding module to assign color features to each node in the heterogeneous graph, generate color codes for different color features, and generate color feature codes based on the color codes. At the same time, generate node type codes for each edge relationship, and construct sequence feature codes by combining these codes. Finally, the node color feature codes and sequence feature codes are merged to obtain the structural feature codes of each path. The specific working process of the structural feature encoding module is as follows:

[0101] Step 1.1.1: Combine the graph coloring process, the four-color theorem, and one-hot encoding to generate a color feature encoding for each path in the heterogeneous graph. The specific process is:

[0102] Step 1.1.1.1. Color-code each node in the heterogeneous graph based on the graph coloring process. The graph coloring process can be expressed as follows:

[0103] (1);

[0104] in, For heterogeneous graphs Color coding; Is a coloring function used to color heterogeneous graphs Color the nodes in the graph. Nodes of the same type are colored the same way.

[0105] Step 1.1.1.2: Assign color features to nodes according to the Four Color Theorem. Specifically: If ,but , For the nodes and The edges between nodes; is the set of paths connecting nodes in a heterogeneous graph; and They are nodes Hedi nodes Color characteristics after coloring.

[0106] Step 1.1.1.3: Generate color feature code; the specific process is as follows:

[0107] First, each path is color-coded, which can be represented as:

[0108] (2);

[0109] in, For the Path Color coding of the first node yes The head node, nodes yes The tail node of It is a splicing operation.

[0110] Since there are colors, so MMHGNN uses one-hot encoding to generate color codes for different colors of each path, and we get , .

[0111] Then, in order to capture the coloring information between nodes under each path, MMHGNN captures the color feature encoding of each path in the form of convolution:

[0112] (3);

[0113] in, It is Path Color feature coding; yes The adjacency matrix of yes Expanded color coding matrix; is a learnable parameter matrix; is the number of target type nodes.

[0114] Step 1.1.2: Generate sequence feature code; the specific process is as follows:

[0115] First, each path is sequence-encoded, which can be expressed as follows:

[0116] (4);

[0117] in, For the Path Sequence code of It is nodes type The encoding; is the total number of nodes in the heterogeneous graph;

[0118] Then, according to the sequence encoding, the sequence feature encoding of each path can be obtained:

[0119] (5);

[0120] in, It is Path Sequence feature encoding.

[0121] Step 1.1.3: Combine the color feature coding with the sequence feature coding to obtain the structural feature coding:

[0122] (6);

[0123] in, It is Path Structural feature encoding.

[0124] Step 1.2: The weighted multi-relationship path aggregation module aggregates path neighbors based on the number of edge connections to generate a feature embedding matrix for each path. The weighted multi-relationship path aggregation module uses a balancing strategy to adjust the weights to address the problem of different numbers of edges in long and short paths, and avoids the problem of feature imbalance caused by excessively high weights in long paths. The specific working process of the weighted multi-relationship path aggregation module is as follows:

[0125] Step 1.2.1: Assume Path The starting nodes are and Since there may be different relationship types between adjacent node pairs, even in the same path, nodes on paths with different relationship types may have different relationship types. and The importance of nodes may also be different because the number of edges between them may also be different. The number of edges shows the importance of the nodes, so we cannot simply aggregate the neighbors on the path and ignore the difference in the number of edges. A balancing strategy is used to preserve the difference in the number of edges. The edge weight calculation can be expressed as:

[0126] (7);

[0127] in, Indicates the nodes and The edge weights between all neighbor nodes under ; Indicates Next nodes With the nodes The number of edges between .

[0128] definition For the Path The edge weight matrix between all nodes under the path set There is a set of edge weight matrices below ,in represents the number of paths, For the paths; For the The edge weight matrix between all nodes in a path.

[0129] Step 1.2.2: To avoid oversmoothing and the problem of node features with lower edge weights being overwritten by node features with higher edge weights, and to balance the edge weights of long and short paths, set the edge weight of each node to the maximum edge weight of the connected nodes and normalize the edge weights by path length. The formula is:

[0130] (8);

[0131] (9);

[0132] in, is the edge weight matrix diagonal elements of ; is a maximum function, which sets the edge weight of the node itself to the maximum value of the node; For the Path Down-normalized edge weight matrix; is the path length calculation function, through which the first Path length; Is to use the length The result is normalized to balance the edge weights between long paths and short paths.

[0133] Step 1.2.3: After obtaining the edge weight matrix, aggregate the edge weights Path The node features on the node are obtained to obtain the feature embedding matrix; considering that the initial dimension of the node may be in the height space, the initial feature of the node is first reduced in dimension:

[0134] (10);

[0135] (11);

[0136] in, is the initial feature matrix of the node, is the initial feature dimension; is the feature matrix after feature projection, is the feature dimension after dimensionality reduction; is the feature transformation matrix; is a learnable parameter matrix; It is Path The feature embedding matrix of is the activation function.

[0137] Step 1.3: The feature fusion module combines the path's structural feature encoding with the corresponding path's feature embedding matrix to form the path's structural embedding. Then, the graph-level attention mechanism is used to fuse the node features under different paths to generate the final feature embedding representation. The specific process of the feature fusion module is as follows:

[0138] Step 1.3.1: Obtaining the structural feature coding set under different paths and the feature embedding matrix set Finally, MHGNN fuses the two to enhance the distinguishability of nodes:

[0139] (12);

[0140] in, For the Path structural embedding of For the Path Structural feature coding; For the Path The feature embedding matrix of

[0141] Step 1.3.2: Since the feature encoding lengths under different paths are different, the different features under different paths are aligned before aggregating them:

[0142] (13);

[0143] in, After alignment Path structural embedding of It is Path The feature conversion matrix can be a transformation matrix or a mapping matrix, which is used to convert the structure embedding under different paths into a unified representation space.

[0144] Step 1.3.3: Use the path-level attention mechanism to fuse different paths:

[0145] (14);

[0146] (15);

[0147] (16);

[0148] in, For the The importance of each path; Represents a collection of nodes; is a node; is the graph-level attention vector; is the tanh activation function; is the weight matrix; express midpoint The corresponding structural embedding; is the bias vector; For the The contribution of each path to the task; is an exponential with base e; is the final feature embedding representation.

[0149] Step 2: Construct a loss function to optimize the training of the complex neural network model MMHGNN for multi-class and multi-relation heterogeneous graphs.

[0150] By minimizing the following loss To optimize the model parameters:

[0151] (17);

[0152] in, is the projection matrix, which projects the node embedding into the node label vector; is a set of labeled nodes; and Mark nodes The label vector and the final feature embedding representation.

[0153] Step 3: Obtain the current user's short video data and input it into the trained complex neural network model MMHGNN for multi-class multi-relation heterogeneous graphs to generate a personalized short video recommendation list. The specific process is as follows:

[0154] Step 3.1: Determine the node feature matrix, including the short video feature matrix and the user feature matrix. The short video feature matrix contains all short video information, and the user feature matrix consists of user information.

[0155] Step 3.2: Node feature extraction is performed based on the complex neural network model MMHGNN for multi-class and multi-relation heterogeneous graphs;

[0156] The collected short video data is processed into a heterogeneous graph. The nodes in the heterogeneous graph represent different entities, including short videos, users, and creators; the edges represent the relationships between entities, including viewing relationships and creation relationships. For each node, color coding is performed according to formula (1) and the four-color theorem to assign color features to the node; each path is color-coded according to formula (2), and the color feature coding of each path is captured using formula (3); each path is sequence-coded according to formula (4) and the sequence feature coding of each path is obtained using formula (5); the color feature coding and sequence feature coding are combined to obtain the structural feature coding according to formula (6); then, the edge weights between all neighbor nodes of each node under each path are calculated according to formula (7), the edge weight matrix is ​​constructed, and the edge weight matrix is ​​normalized according to formulas (8) and (9); the feature embedding matrix is ​​calculated for the short video feature matrix and the user feature matrix according to formulas (10) and (11); the structural feature coding and the feature embedding matrix are fused according to formula (12) to obtain the structural embedding; the aligned structural embedding is obtained according to formula (13), and finally the final feature embedding representation is calculated according to formulas (14) to (16). For user nodes, the user node embedding representation calculated by formula (16) is obtained, and all user node embedding representations constitute the user node embedding matrix; similarly, for short video nodes, the short video node embedding representation calculated by formula (16) is obtained, and all short video node embedding representations constitute the short video node embedding matrix;

[0157] Step 3.3: Parameter update and back propagation. In the short video recommendation calculation, the model parameters are continuously updated and back propagated according to formula (17) to optimize the model performance.

[0158] Step 3.4, short video recommendation. Calculate the similarity between short video nodes in the short video node embedding matrix. Common methods such as cosine similarity can be used for similarity calculation. Sort the calculated similarity values ​​in descending order and select the top The short videos with the highest similarity are selected to generate a personalized short video recommendation list, thereby ensuring that the recommended videos best meet the user's viewing preferences.

[0159] In online applications, the node embedding matrix can be updated regularly or in real time to reflect the latest data changes and dynamic updates of user behavior on the short video platform. This approach can provide users with more accurate and personalized short video recommendation services.

[0160] To demonstrate the feasibility and superiority of the present invention, the following comparative experiments were conducted. The proposed MMHGNN model was compared with seven baseline models: the Graph Convolutional Network (GCN), the Heterogeneous Graph Attention Network (HAN), the Graph Attention Network (GAT), the Interpretable Efficient Heterogeneous Graph Convolutional Network (ie-HGCN), the Semantic and Relation-Aware Heterogeneous Graph Neural Network (SR-HGN), the Original Graph and Subgraph Aggregation Graph Neural Network (OSGNN), and the Heterogeneous Graph Propagation Network (HPN). For graph coloring in the MMHGNN, a color value of 4 was set, allowing a maximum of four colors. The number of colors may be lower depending on graph characteristics. The GCN and GAT models were set to a depth of 1, and a homogeneous graph was constructed based on the node relationships connected along all paths. The HAN model transforms a heterogeneous graph into multiple homogeneous graphs using meta-paths and then integrates node representations with different semantics using semantic attention. The ie-HGCN model facilitates meta-path discovery in heterogeneous graphs through a specific type-level attention mechanism.

[0161] For fair comparison, all model methods were set to the same embedding dimension and learning rate: 64, and 0.005. In the TM-Shopping dataset, the paths were set to IUAUP, IUPUI, and IUI, while in the AL-Music dataset, the paths were set to MUM, MLM, and MPM. For models using different feature processing methods (i.e., HGCN), the initial features were processed using linear transformations and then used as model input. For the HAN model with an attention mechanism, the number of attention heads was set to 8.

[0162] The model was evaluated on a multi-classification task using a support vector machine (SVM) as the classifier, and Macro-F1 (Ma-F1) and Micro-F1 (Mi-F1) were used as evaluation metrics. The results are shown in Table 1:

[0163] Table 1 Classification results of different models on two datasets (%)

[0164] .

[0165] Table 1 shows the performance of different models on the AL-Music and TM-Shopping datasets using the Macro-F1 and Micro-F1 evaluation metrics. Specifically, each row in the table represents a specific training / test data split (split), ranging from 80% to 20%, while each column corresponds to a different model or method. On the AL-Music dataset, our method performs best at all splits, both in Macro-F1 and Micro-F1, outperforming other models. For example, at an 80% split, our method achieves a Macro-F1 score of 96.61% and a Micro-F1 score of 97.19%. On the TM-Shopping dataset, our method maintains a lead. For example, at a 20% split, OSGNN achieves a Macro-F1 score of 34.27%, while our method scores 61.45%. Overall, our method demonstrates superior performance on both datasets. The main reason is that the present invention fully considers the various interactive relationships between users and short videos, improves the distinguishability of nodes, and focuses on capturing the multi-relationship characteristics between users and short videos.

[0166] Due to the complexity of the network structure, low time and memory consumption are extremely important. To examine the time and memory consumption of the model, we analyzed the evaluation time and average memory usage per epoch of different models on the TM-Shopping dataset on an NVIDIA i5-12600KF CPU. The experimental results are shown in Table 2:

[0167] Table 2 Comparison of evaluation time and memory usage of different models

[0168] .

[0169] Table 2 shows that the two homogeneous graph models (GCN and GAT) achieve lower evaluation time and memory usage than heterogeneous graph models. This is because the model architectures shared by GCN and GAT contain fewer parameters, resulting in lower evaluation time and memory consumption. However, due to the more complex computational process of the attention mechanism, GAT has higher evaluation time and memory usage than GCN. Other heterogeneous graph neural network models, however, have higher memory and time consumption due to their complex internal structures. ie-HGCN, a lightweight model primarily based on convolutional aggregation, achieves lower evaluation time and memory usage.

[0170] Compared to other models with complex structures and large number of parameters, MMHGNN achieves significant advantages in memory usage and evaluation time, even surpassing the homogeneous graph model GAT and the lightweight model ie-HGCN. This is because MMHGNN uses only the simplest convolutional aggregation method to capture path weights and neighbor features. While it employs a coloring mechanism and path encoding, the size of these mechanisms depends on the number of colors and path length. According to the Four Color Theorem, complex networks use no more than four colors, and path lengths are generally within a small range. Therefore, the coloring mechanism and path encoding do not increase MMHGNN's evaluation time and memory usage.

[0171] To provide a more intuitive evaluation, t-SNE is used to project the node embeddings into a two-dimensional space and color them according to their labels. Figure 2-Figure 7 The visualization results of the node distribution of the existing ie-HGCN, HPN, HAN, HGNN-BRFE, OSGNN models and the proposed MMHGNN model on the MUSIC dataset are shown. Different colors represent different node types, and the horizontal and vertical coordinates represent the position in two-dimensional space. Compared with other models, the node type gaps in the proposed MMHGNN model are larger, indicating that the proposed model distinguishes more clearly between types.

[0172] Experimental results demonstrate that the proposed model is effective in short video recommendation and outperforms existing recommendation methods. This achievement provides a new approach and method for short video recommendation, helping to better understand and predict users' short video preferences and behavior patterns.

[0173] Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the essential scope of the present invention should also fall within the scope of protection of the present invention.

Claims

1. A short video recommendation method based on a multi-class and multi-relation heterogeneous graph in a complex network, characterized by: The steps include: Step 1: Construct a complex neural network model for multi-class and multi-relation heterogeneous graphs. The model includes a structural feature encoding module, a weighted multi-relation path aggregation module, and a feature fusion module. Step 2: Construct a loss function to optimize the training of complex neural network models for multi-class and multi-relation heterogeneous graphs; Step 3: Obtain the current user's short video data, input it into the trained complex neural network model for multi-class and multi-relation heterogeneous graphs, and generate a personalized short video recommendation list; In step 1, the working process of the complex neural network model for multi-class and multi-relation heterogeneous graphs is as follows: Step 1.1: Construct a heterogeneous graph and obtain the structural feature encoding of each path through the structural feature encoding module; Step 1.2: Aggregate path neighbors through the weighted multi-relational path aggregation module to generate a feature embedding matrix for each path; Step 1.3: The structural feature encoding of the path is combined with the feature embedding matrix through the feature fusion module to form the structural embedding of the path. Then, the node features under different paths are fused using the graph-level attention mechanism to generate the final feature embedding representation. The specific process of step 1.1 is as follows: Step 1.1.

1. Combine the graph coloring process, the four-color theorem, and one-hot encoding to generate a color feature encoding for each path in the heterogeneous graph. Step 1.1.2, generate sequence feature code; Step 1.1.3, combine the color feature code with the sequence feature code to obtain the structural feature code; The specific process of step 1.1.1 is as follows: Step 1.1.1.

1. Color-code each node in the heterogeneous graph based on the graph coloring process. The graph coloring process is: (1); in, For heterogeneous graphs Color coding; is the shading function; Step 1.1.1.2: Assign color features to nodes according to the Four Color Theorem. Specifically: If ,but , For the nodes and The edges between nodes; is the set of paths connecting nodes in a heterogeneous graph; and They are nodes Hedi nodes Color characteristics after coloring; Step 1.1.1.3: Generate color feature code; the specific process is as follows: First, color-code each path: (2); in, For the Path Color coding of the first node yes The head node, nodes yes The tail node of It is a splicing operation; Since there are colors, so use one-hot encoding to generate color codes for different colors of each path, and get , ; Then, the color feature encoding of each path is captured in the form of convolution: (3); in, It is Path Color feature coding; yes The adjacency matrix of yes Expanded color coding matrix; is a learnable parameter matrix; is the number of target type nodes; The specific process of step 1.1.2 is as follows: First, each path is sequence-encoded: (4); in, For the Path Sequence code of It is nodes type The encoding; is the total number of nodes in the heterogeneous graph; Then, according to the sequence encoding, the sequence feature encoding of each path is obtained: (5); in, It is Path Sequence feature encoding; The formula for step 1.1.3 is: (6); in, It is Path Structural feature coding; The specific process of step 1.2 is as follows: Step 1.2.1: Assume Path The starting nodes are and , the difference in the number of edges is retained through a balancing strategy; the edge weight calculation is expressed as: (7); in, Indicates the nodes and The edge weights between all neighbor nodes under ; Indicates Next nodes With the nodes The number of edges between them; definition For the Path The edge weight matrix between all nodes under the path set There is a set of edge weight matrices below ,in represents the number of paths, For the paths; For the The edge weight matrix between all nodes under a path; Step 1.2.2: Set the edge weight of each node to the maximum edge weight of the connected nodes, and normalize the edge weights by path length. The formula is: (8); (9); in, is the edge weight matrix diagonal elements of ; is the maximum value function; For the Path Down-normalized edge weight matrix; Calculate the function for path length; Is to use the length Normalized results; Step 1.2.3: After obtaining the edge weight matrix, aggregate the edge weights Path The node features on the , get the feature embedding matrix: (10); (11); in, is the initial feature matrix of the node, is the initial feature dimension; is the feature matrix after feature projection, is the feature dimension after dimensionality reduction; is the feature transformation matrix; is a learnable parameter matrix; It is Path The feature embedding matrix of is the activation function.

2. The short video recommendation method based on a multi-class and multi-relationship heterogeneous graph in a complex network according to claim 1, characterized in that: The specific process of step 1.3 is as follows: Step 1.3.1: Obtaining the structural feature coding set under different paths and the feature embedding matrix set Then, merge the two: (12); in, For the Path structural embedding of For the Path Structural feature coding; For the Path The feature embedding matrix of Step 1.3.2: Align different features: (13); in, After alignment Path structural embedding of It is Path The feature transformation matrix of Step 1.3.3: Use the path-level attention mechanism to fuse different paths: (14); (15); (16); in, For the The importance of each path; Represents a collection of nodes; is a node; is the graph-level attention vector; is the tanh activation function; is the weight matrix; express midpoint The corresponding structural embedding; is the bias vector; For the The contribution of each path to the task; is an exponential function with base e; is the final feature embedding representation.

3. The short video recommendation method based on a multi-class and multi-relationship heterogeneous graph in a complex network according to claim 2, characterized in that: The specific process of step 2 is: By minimizing losses To optimize the model parameters: (17); in, is the projection matrix; is a set of labeled nodes; and Mark nodes The label vector and the final feature embedding representation.

4. The short video recommendation method based on a multi-class and multi-relationship heterogeneous graph in a complex network according to claim 3, characterized in that: The specific process of step 3 is: Step 3.1, determine the node feature matrix, including the short video feature matrix and the user feature matrix; the short video feature matrix contains all short video information, and the user feature matrix consists of user information; Step 3.2: Node feature extraction based on a complex neural network model for multi-class and multi-relation heterogeneous graphs; The collected short video data is processed into a heterogeneous graph. The nodes in the heterogeneous graph represent different entities, including short videos, users, and creators; the edges represent the relationships between entities, including viewing relationships and creation relationships; each node is color-coded according to formula (1) and the four-color theorem to give the node color characteristics; Color-code each path according to formula (2), capture the color feature coding of each path using formula (3), sequence-code each path according to formula (4) and obtain the sequence feature coding of each path using formula (5); According to formula (6), the color feature coding and sequence feature coding are combined to obtain the structural feature coding; Subsequently, the edge weights between all neighboring nodes of each node in each path are calculated according to formula (7), and the edge weight matrix is ​​constructed. The edge weight matrix is ​​normalized according to formulas (8) and (9). The feature embedding matrix is ​​calculated for the short video feature matrix and the user feature matrix according to formulas (10) and (11). The structural feature encoding and the feature embedding matrix are fused according to formula (12) to obtain the structural embedding. The aligned structural embedding is obtained according to formula (13). Finally, the final feature embedding representation is calculated according to formulas (14) to (16). Step 3.3: Continuously update and back-propagate the model parameters according to formula (17); Step 3.4: For the short video node, the short video node embedding representation is calculated using formula (16). All the short video node embedding representations constitute the short video node embedding matrix. Calculate the similarity between short video nodes in the short video node embedding matrix; sort the calculated similarity values ​​in descending order and select the top The short videos with the highest similarity are selected to generate a personalized short video recommendation list.

Citation Information

Patent Citations

  • Malicious encrypted traffic detection method based on heterogeneous graph attention network and random walk

    CN118869360A

  • Package service recommendation method and device, equipment, storage medium and product

    CN119089013A