A method for identifying user communities in social networks based on multi-scale graph contrastive learning

Through the multi-scale graph comparative learning method, a multi-view graph convolutional network for dynamic social networks is constructed. By combining local and global information, the node representation is optimized, which solves the accuracy problem of community structure identification in dynamic social networks and realizes the accurate identification and analysis of user communities.

CN120318003BActive Publication Date: 2025-09-30NORTHWESTERN POLYTECHNICAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510811527.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-18
Publication Date
2025-09-30
Estimated Expiration
2045-06-18

AI Technical Summary

Technical Problem

Existing static community identification methods cannot effectively capture the dynamic evolution of community structure caused by changes in user interest preferences or behavioral characteristics in social networks, resulting in limited accuracy in community structure identification in dynamic graphs.

Method used

A multi-scale graph contrastive learning method is adopted to construct a dynamic graph, calculate the neighbor overlap similarity and topological structure similarity matrix, use a multi-view graph convolutional network to generate local node representation and global graph representation, and optimize the node representation through local contrast loss and local and global mutual information loss. Finally, community division is performed through a clustering algorithm.

Benefits of technology

It achieves accurate identification of user communities in dynamic social networks, improves the accuracy and robustness of community identification, and supports precision marketing and public opinion guidance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120318003B_ABST
    Figure CN120318003B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for identifying user communities in social networks based on multi-scale graph contrast learning, which relates to the field of artificial intelligence technology. According to social network data, a dynamic graph is constructed; for any moment, according to the dynamic graph structure at the corresponding moment, the local node representation matrix and the global graph representation under different views are obtained; according to the local node representation and the global graph representation under different views, the local contrast loss and the local and global mutual information loss are determined to train the multi-view graph convolutional network until the trained multi-view graph convolutional network meets the stopping condition; according to the local node representation matrix under different views corresponding to the multi-view graph convolutional network when the stopping condition is met, the consensus node representation matrix is ​​determined; the elements in the consensus node representation matrix are clustered by a clustering algorithm to obtain the user community division at the corresponding moment. This method can accurately identify dynamic user groups with different interest preferences.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method for identifying user communities in social networks based on multi-scale graph contrast learning. Background Art

[0002] Currently, social networks are typically represented as graphs, with user entities as nodes and their following relationships as edges. These edges form a complex structure that is crucial for understanding user preferences within social networks. User communities are composed of closely connected groups of users with similar interests, preferences, or behavioral characteristics. By identifying the structure of user communities within social networks, it is possible to segment large numbers of users into groups with similar interests, preferences, or behavioral characteristics, thus providing theoretical support for precision marketing and public opinion guidance. Specifically, in precision marketing, identifying user communities can provide in-depth analysis of user interests and consumption preferences, helping brands quickly identify target audiences, develop personalized recommendation strategies, and improve advertising reach and conversion rates. In terms of public opinion guidance, community identification can accurately capture the differentiated attitudes of different user groups towards hot topics, identify potential risk groups, and predict public opinion trends, thereby achieving precise and segmented guidance of public opinion. Therefore, the accurate identification of user communities is of great practical significance.

[0003] To accurately identify user communities, researchers have developed numerous methods to address the problem of community identification in static graphs. However, in social networks, relationships between users evolve as interests change, with users following and unfollowing each other. These shifting follow relationships reflect changes in user interests or behavioral traits, driving the evolution of community structure. However, traditional static community identification methods often fail to capture the dynamic evolution of dynamic graphs, limiting the accuracy of identifying community structures in these graphs.

[0004] Therefore, it is urgent to propose a dynamic community identification method to achieve dynamic and accurate identification of user groups with similar interest preferences or behavioral characteristics. Summary of the Invention

[0005] Based on this, it is necessary to provide a social network user community identification method based on multi-scale graph contrast learning to address the above technical problems. This method can accurately identify dynamic user groups with different interest preferences.

[0006] The present invention adopts the following technical solutions:

[0007] The present invention provides a method for identifying user communities in social networks based on multi-scale graph contrast learning, comprising:

[0008] Build dynamic graphs based on social network data; social network data includes the number of users and the user attention relationships at each moment;

[0009] At any moment, based on the dynamic graph structure at the corresponding moment, the neighbor overlap similarity matrix and the topology similarity matrix are calculated, and the node feature matrix and the topology feature matrix are obtained based on the neighbor overlap similarity matrix and the topology similarity matrix. The neighbor overlap similarity matrix is ​​used to measure the neighbor similarity between any two user nodes in the dynamic graph structure; the topology similarity matrix is ​​used to measure the topology similarity between any two user nodes in the dynamic graph structure.

[0010] Input the node feature matrix and topology feature matrix into the multi-view graph convolutional network to obtain the local node representation matrix and global graph representation under different views;

[0011] Determine the local contrast loss based on the local node representation matrix under different views, and determine the local and global mutual information loss based on the local node representation and global graph representation under different views;

[0012] The multi-view graph convolutional network is trained according to the local contrast loss and the local and global mutual information loss until the trained multi-view graph convolutional network meets the stopping condition and the training is stopped;

[0013] Determine the consensus node representation matrix based on the local node representation matrices under different views corresponding to the multi-view graph convolutional network when the stopping condition is met;

[0014] The elements in the consensus node representation matrix are clustered using a clustering algorithm to obtain the user community division at the corresponding moment.

[0015] Optionally, a dynamic graph ; Indicates time t Dynamic graph structure;

[0016] in, ={ ,..., } represents the user node set, Indicates the total number of user nodes, Indicates the time between users The attention relationship Indicates the total number of moments; if at moment When the user node and If there is a follow relationship between ,otherwise .

[0017] Optionally, a neighbor overlap similarity matrix The calculation formula is:

[0018] ;

[0019] in, and Represents the user nodes in the graph structure and user nodes The set of neighbors of

[0020] Node feature matrix The calculation formula is:

[0021] + α ;

[0022] in, It's time t The first-order neighborhood characteristics of the time structure graph, The elements in represent the user node at time t The first-order neighbor eigenvector when ; α is the first balance parameter;

[0023] Topological similarity matrix The calculation formula is:

[0024] ;

[0025] in, for Middle user node At the moment t The first-order neighbor eigenvector when , for Middle user node At the moment t The first-order neighbor eigenvector when ;

[0026] Topological structure characteristic matrix The calculation formula is:

[0027] + β ;

[0028] in, β is the second equilibrium parameter.

[0029] Optionally, the generation formula of the local node representation matrix under different views is:

[0030] ;

[0031] in, and There are two different views at the moment The local node representation matrix when , and The elements in represent the node representation of the user node. and For the moment , which is a parameter-independent activation function. and Two views at time The independent parameter matrix when ;

[0032] The formula for generating the global graph representation is:

[0033] ;

[0034] in, and At the time The global graph representation of the two views is and Separate moments Two nonlinear activation functions with independent parameters, and They are and Middle user node Node representation.

[0035] Optionally, and The calculation method includes:

[0036] Put the two views at the moment t Independent parameter matrix at -1 、 Input into the long short-term memory network, and get two views at time t The independent parameter matrix and .

[0037] Optionally, local contrast loss The calculation formula is:

[0038] ;

[0039] in, Indicates time User Node and user nodes If the adjacency relationship between yes A neighbor of ;otherwise, , Indicates at time hour and The similarity between them is calculated as follows:

[0040] ;

[0041] in, , , and They are and Middle user node Node representation of;

[0042] Local and global mutual information loss The calculation formula is:

[0043] ;

[0044] ;

[0045] in, express and Similar probability, Indicates random shuffle The generated negative samples, express and Similar probabilities; ; ; is the similarity factor.

[0046] Optionally, a multi-view graph convolutional network is trained based on a local contrastive loss and a local and global mutual information loss, including:

[0047] Determine the comprehensive loss based on the local contrast loss and the local and global mutual information loss;

[0048] Training multi-view graph convolutional networks via comprehensive losses.

[0049] Optionally, comprehensive loss The calculation formula is:

[0050] ;

[0051] in, is the third equilibrium parameter, is the fourth balance parameter.

[0052] Optionally, determining a consensus node representation matrix according to local node representation matrices under different views corresponding to the multi-view graph convolutional network when the stopping condition is satisfied includes:

[0053] The average of the local node representation matrices under different views corresponding to the multi-view graph convolutional network when the stopping condition is met is determined as the consensus node representation matrix.

[0054] The present invention provides a device for identifying user communities in social networks based on multi-scale graph contrast learning, comprising:

[0055] A construction module is used to construct a dynamic graph structure based on social network data; the social network data includes the number of users and the user attention relationship at each moment;

[0056] The calculation module is used to calculate the neighbor overlap similarity matrix and the topology structure similarity matrix at any moment based on the dynamic graph structure at the corresponding moment, and obtain the node feature matrix and the topology structure feature matrix based on the neighbor overlap similarity matrix and the topology structure similarity matrix; the neighbor overlap similarity matrix is ​​used to measure the neighbor similarity between any two user nodes in the dynamic graph structure; the topology structure similarity matrix is ​​used to measure the topology structure similarity between any two user nodes in the dynamic graph structure;

[0057] The input module is used to input the node feature matrix and the topology structure feature matrix into the multi-view graph convolutional network to obtain the local node representation matrix and the global graph representation under different views;

[0058] A first determination module is configured to determine a local contrast loss based on local node representation matrices under different views, and to determine local and global mutual information losses based on local node representations and global graph representations under different views;

[0059] A training module is used to train the multi-view graph convolutional network based on the local contrast loss and the local and global mutual information loss until the trained multi-view graph convolutional network meets the stopping condition and stops training;

[0060] A second determination module is used to determine a consensus node representation matrix based on the local node representation matrices under different views corresponding to the multi-view graph convolutional network when the stopping condition is met;

[0061] The clustering module is used to cluster the elements in the consensus node representation matrix through a clustering algorithm to obtain the user community division at the corresponding moment.

[0062] The present invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the computer program implements the above-mentioned social network user community identification method based on multi-scale graph contrast learning.

[0063] The present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the method for identifying user communities in a social network based on multi-scale graph contrast learning is implemented.

[0064] At least one of the above technical solutions adopted by the present invention can achieve the following beneficial effects:

[0065] In the present invention, first, the dynamic social network is abstracted into a dynamic graph, and the neighbor overlap similarity and topological structure similarity of the nodes are calculated to enhance the features; then, the local node representation matrix and the global graph representation are generated based on the multi-view graph convolutional network; then, multi-scale contrastive learning is used to combine local-local contrastive learning and local-global contrastive learning to optimize the consistency of the node representation; finally, the trained local node representation is clustered based on the clustering algorithm to obtain the accurate division of the dynamic community. The present invention provides a new method and tool for advertising marketing and public opinion regulators, which helps to better identify and analyze user groups in social networks, and provides important support for achieving precision marketing and public opinion guidance. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0067] Figure 1 A flowchart of a method for identifying user communities in social networks based on multi-scale graph contrast learning provided by the present invention;

[0068] Figure 2 A schematic diagram of the framework structure of a social network user community identification method based on multi-scale graph contrast learning provided by the present invention;

[0069] Figure 3 A schematic diagram of a computer device for implementing a method for identifying user communities in social networks based on multi-scale graph comparative learning, provided by the present invention. DETAILED DESCRIPTION

[0070] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with specific embodiments of the present invention and corresponding drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0071] Recognizing the importance of community identification in dynamic social networks, researchers have proposed a series of dynamic community identification methods. These methods can be categorized as coupled-graph-based methods, two-stage methods, and temporal smoothing-based methods. While these methods have achieved significant improvements in dynamic graphs, they still have limitations. Specifically, 1) coupled-graph-based methods primarily merge graphs from all time steps into a coupled graph and then use classic static community identification methods to identify communities. However, these methods often fail to fully capture the temporal evolution of community structure, resulting in limited performance in dynamic graphs with multiple time steps. 2) Two-stage methods first identify community structures at individual time steps and then track the evolution of these structures over time to capture the dynamic characteristics of communities. However, these methods often struggle to accurately identify the evolving relationships between communities across consecutive time steps. 3) Temporal smoothing-based methods typically use global or local smoothing strategies to improve the accuracy of community structure identification in dynamic graphs. Although these methods are very effective in leveraging information across time steps, they typically require a comprehensive understanding of all time steps of the dynamic graph, resulting in significant computational overhead. Furthermore, these methods primarily rely on single-view graph representations and fail to capture deep relationships between different viewpoints. Moreover, this reliance on a single view introduces potential noise and ambiguity, which may affect the accuracy and robustness of community identification results.

[0072] In summary, although these methods each have their own advantages, they still face challenges such as single-view noise, separation of local and global features, and high computational complexity. Therefore, a social network community identification method is urgently needed that can integrate multi-view features, collaboratively optimize local and global representations, and reduce computational complexity.

[0073] The execution subject of the method provided in the present invention may be a server set up on a business platform, or a device such as a desktop computer, a laptop computer, etc. that can execute the solution of the present invention.

[0074] The technical solutions provided by various embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0075] Figure 1 The flowchart of the method for identifying user communities in social networks based on multi-scale graph contrastive learning in the present invention is as follows:

[0076] S101, constructing a dynamic graph based on social network data; the social network data includes the number of users and the user attention relationship at each moment.

[0077] Build a dynamic graph based on the attention relationship between users. ; Indicates time t Dynamic graph structure.

[0078] in, ={ ,..., } represents the user node set, Indicates the total number of users, Indicates the time between users The attention relationship Indicates the total number of moments; if at moment When the user node and If there is a follow relationship between ,otherwise In addition, the adjacency matrix It's time The first-order neighborhood characteristics of the time graph, For user nodes At the moment The first-order neighbor eigenvector when .

[0079] S102 , for any moment, according to the dynamic graph structure at the corresponding moment, calculate the neighbor overlap similarity matrix and the topology structure similarity matrix, and obtain the node feature matrix and the topology structure feature matrix according to the neighbor overlap similarity matrix and the topology structure similarity matrix.

[0080] Among them, the neighbor overlap similarity matrix is ​​used to measure the neighbor similarity between any two user nodes in the dynamic graph structure; the topology similarity matrix is ​​used to measure the similarity of the topological structures between any two user nodes in the dynamic graph structure. Two users with similar topological structures are more likely to belong to the same community.

[0081] Neighbor overlap similarity matrix The calculation formula is:

[0082] (1);

[0083] in, and Represents the user nodes in the graph structure and user nodes For example, when , }, When, among them, .at this time, and . ={ }.therefore =6, =8 user nodes and user nodes Neighbor overlap similarity .

[0084] Node feature matrix The calculation formula is:

[0085] + α (2);

[0086] in, It's time t The first-order neighborhood characteristics of the time structure graph, The elements in represent the user node at time t The first-order neighbor feature vector at time ; For the target user node, through time t The first-order neighbor node set is determined at the time, and the relevant attribute features of this set are extracted and integrated to obtain the first-order neighbor feature vector; α is the first equilibrium parameter.

[0087] Cosine similarity calculation time based on first-order neighbor features The topological structure similarity matrix , topological structure similarity matrix The calculation formula is:

[0088] (3);

[0089] in, for Middle user node At the moment t The first-order neighbor eigenvector when , for Middle user node At the moment t The first-order neighbor eigenvector when .

[0090] Topological structure characteristic matrix The calculation formula is:

[0091] + β (4);

[0092] in, β is the second equilibrium parameter.

[0093] S103: Input the node feature matrix and the topology structure feature matrix into the multi-view graph convolutional network to obtain the local node representation matrix and the global graph representation under different views.

[0094] Among them, the local node representation matrix refers to the node feature representation obtained by learning the neighbor information of each user node in the dynamic graph; the global graph representation is the feature representation of the entire graph obtained by aggregating the features of the nodes and edges of the entire dynamic graph.

[0095] The generation formula of the local node representation matrix under different views is:

[0096] (5);

[0097] in, and There are two different views at the moment The local node representation matrix when , and The elements in represent the node representation of the user node. and For the moment , which is a parameter-independent activation function. and Two views at time The independent parameter matrix when .

[0098] The global graph representation is obtained by aggregating local node representations, allowing local representations to effectively capture global graph features in the multi-scale contrastive learning module. The generation formula of the global graph representation is:

[0099] (6);

[0100] in, and At the time The global graph representation of the two views is and Separate moments Two nonlinear activation functions with independent parameters, and They are and Middle user node The node representation is, N Indicates the total number of user nodes in the graph structure.

[0101] Optionally, to further capture temporal dynamics, a Long Short-Term Memory network (LSTM) is used. and The calculation method specifically includes: t Independent parameter matrix at -1 、 Input into the long short-term memory network, and get two views at time t The independent parameter matrix and , specifically:

[0102] (7);

[0103] in, and To capture dynamic evolution features, LSTM only relies on parameter updates of adjacent time steps, further reducing computational complexity.

[0104] S104: determining a local contrast loss based on the local node representation matrices under different views, and determining a local and global mutual information loss based on the local node representations and the global graph representation under different views.

[0105] Local contrast loss The calculation formula is:

[0106] (8);

[0107] in, Indicates time User Node and user nodes If the adjacency relationship between yes A neighbor of ;otherwise, , Indicates at time hour and The similarity between them is calculated as follows:

[0108] (9);

[0109] in, , , and They are and Middle user node Node representation.

[0110] In order to enhance the integration of local and global information, a local and global mutual information loss is proposed to promote the fusion of local and global topological structures by maximizing the mutual information between local node representation and global graph representation. , local and global mutual information loss The calculation formula is:

[0111] (10);

[0112] (11);

[0113] in, express and Similar probability, Indicates random shuffle The generated negative samples, express and Similar probabilities; ; ; is the similarity factor, which is optimized by the comprehensive loss during training to maximize the mutual information between the local node representation and the global graph representation. A similarity score is calculated and then used The function converts it into a probability based on the learned parameters ,reflect and The similarities between For the moment t A comprehensive global view representation of the time.

[0114] S105, training the multi-view graph convolutional network according to the local contrast loss and the local and global mutual information loss until the trained multi-view graph convolutional network meets the stopping condition, and stopping the training; determining the consensus node representation matrix according to the local node representation matrices under different views corresponding to the multi-view graph convolutional network when the stopping condition is met.

[0115] Optionally, the multi-view graph convolutional network is trained according to the local contrast loss and the local and global mutual information loss, including: determining a comprehensive loss according to the local contrast loss and the local and global mutual information loss; and training the multi-view graph convolutional network by the comprehensive loss.

[0116] Among them, the comprehensive loss The calculation formula is:

[0117] (12);

[0118] in, is the third equilibrium parameter, is the fourth balance parameter, is the local contrast loss, By integrating local contrast loss and local and global mutual information loss, multi-scale view contrastive learning significantly improves the accuracy of node representation, thereby facilitating the identification of user community structures in dynamic graphs.

[0119] The weight parameters in the multi-view graph convolutional network are updated using the comprehensive loss. The stopping condition can be when the comprehensive loss is less than a preset loss threshold or when the number of training times reaches a preset threshold.

[0120] Optionally, determining the consensus node representation matrix based on the local node representation matrices under different views corresponding to the multi-view graph convolutional network when the stopping condition is satisfied includes: averaging the local node representation matrices under different views corresponding to the multi-view graph convolutional network when the stopping condition is satisfied to determine the consensus node representation matrix. It can be:

[0121] (13);

[0122] in, It is the consensus node representation matrix of the dynamic graph obtained by averaging the local node representation matrices.

[0123] S106: Clustering the elements in the consensus node representation matrix using a clustering algorithm to obtain the user community division at the corresponding moment.

[0124] Through K-means Clustering to get the moment User community division at the time , the calculation formula is as follows:

[0125] (14);

[0126] Among them, K-means is the K-means algorithm.

[0127] Based on the above steps, the dynamic graph can be obtained T User community division at a certain moment , ;in, Indicates at time i User community division, , thus realizing the dynamic identification of social network user community structure.

[0128] In one embodiment, Figure 2 As shown, Figure 2This is a schematic diagram of the framework structure of the social network user community identification method based on multi-scale graph contrast learning provided by the present invention. In (a), the similarity matrix of the graph structure is calculated to obtain the node feature matrix and the topological structure feature matrix; in (b), the node feature matrix and the topological structure feature matrix are input into the multi-view graph convolutional network (GCN1 and GCN2) to obtain the local node representation matrix and the global graph representation under different views; in (c), multi-scale contrast learning is performed (generating local contrast loss and local and global mutual information loss), and then the consensus node representation matrix of the graph structure is obtained; finally, the user community division is obtained according to the K-means clustering algorithm. Among them, the independent parameter matrix in the multi-view graph convolutional network is and , which is obtained based on the long short-term memory network LSTM.

[0129] To demonstrate the effectiveness of this method, this example is used to illustrate the method. Specifically, it is validated using three real-world datasets: HighSchool1, CellphoneCallr, and Dblp. These datasets vary in size, ranging from 327 to 12,107 nodes and 8 to 10 time steps, providing a comprehensive evaluation of performance across various real-world scenarios. Table 1 provides basic information about the datasets.

[0130] Table 1

[0131]

[0132] As shown in Table 2, Table 2 shows the classification accuracy of seven methods on real-world datasets, which are evaluated by three indicators, namely normalized mutual information (NMI), adjusted Rand Index (ARI) and modularity (Q). The seven methods are: Graph Embedding Clustering (GEC), Deep Attentional Embedded Graph Clustering (DAEGC), Structural Deep Clustering Network (SDCN), Optimized Dynamic DeepDraph Infomax (ODDGI), Dynamic Graph Convolutional Network (DGCN), Matrix Factorization-based DeepGraph Clustering with Topological Regularization (MFC + Topo) and the method of the present invention (MSGCL).

[0133] Table 2

[0134]

[0135] As can be seen from Table 2, the MSGCL method proposed in this invention outperforms the baseline methods on most datasets. Specifically, the analysis of the NMI values ​​shows that MSGCL performs superiorly on all datasets, and improves by 2.87%, 1.60%, and 2.44% on the HighSchool, CellphoneCall, and Dblp datasets, respectively, compared to the suboptimal methods. For the ARI indicator, MSGCL improves by 0.47%, 1.82%, and 1.07% on the three datasets, respectively. In terms of Q value, MSGCL improves by 3.18% and 2.10% on the HighSchool and CellphoneCall datasets, respectively, compared to the suboptimal methods. In addition, dynamic baseline methods are generally better than static baseline methods. This is because dynamic baseline methods take into account the dynamic laws of user community structure and provide a more accurate dynamic graph representation, while static methods cannot capture this dynamic evolution law, and therefore have limited accuracy. LSTM-based methods such as DGCN and ODDGI outperform the structurally regularized MFC+Topo method on most datasets, demonstrating that LSTM modules are more effective at maintaining temporal smoothness between adjacent time steps. While DGCN and ODDGI outperform other methods, MSGCL lags behind. This is because MSGCL, by integrating a multi-view graph representation learning module and a multi-scale contrastive learning module, eliminates the inherent noise present in a single view and achieves more accurate node representations. These results demonstrate the effectiveness of our leading approach in identifying user communities on social networks.

[0136] Finally, it should be noted that the above preferred embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail through the above preferred embodiments, those skilled in the art should understand that various changes can be made in form and details without departing from the scope defined by the claims of the present invention.

[0137] When applying the social network user community identification method based on multi-scale graph contrast learning provided by the present invention, it is not necessary to Figure 1 The steps are executed in the order shown. The specific execution order of the steps can be determined according to needs, and the present invention does not limit this.

[0138] The above is a method for identifying user communities on a social network based on multi-scale graph contrastive learning provided by one or more embodiments of the present invention. Based on the same idea, the present invention also provides a corresponding device for identifying user communities on a social network based on multi-scale graph contrastive learning, which includes:

[0139] A construction module is used to construct a dynamic graph based on social network data; the social network data includes the number of users and the user attention relationship at each moment;

[0140] The calculation module is used to calculate the neighbor overlap similarity matrix and the topology structure similarity matrix at any moment based on the dynamic graph structure at the corresponding moment, and obtain the node feature matrix and the topology structure feature matrix based on the neighbor overlap similarity matrix and the topology structure similarity matrix; the neighbor overlap similarity matrix is ​​used to measure the neighbor similarity between any two user nodes in the dynamic graph structure; the topology structure similarity matrix is ​​used to measure the topology structure similarity between any two user nodes in the dynamic graph structure;

[0141] The input module is used to input the node feature matrix and the topology structure feature matrix into the multi-view graph convolutional network to obtain the local node representation matrix and the global graph representation under different views;

[0142] A first determination module is configured to determine a local contrast loss based on local node representation matrices under different views, and to determine local and global mutual information losses based on local node representations and global graph representations under different views;

[0143] A training module is used to train the multi-view graph convolutional network based on the local contrast loss and the local and global mutual information loss until the trained multi-view graph convolutional network meets the stopping condition and stops training;

[0144] A second determination module is used to determine a consensus node representation matrix based on the local node representation matrices under different views corresponding to the multi-view graph convolutional network when the stopping condition is met;

[0145] The clustering module is used to cluster the elements in the consensus node representation matrix through a clustering algorithm to obtain the user community division at the corresponding moment.

[0146] Regarding the specific limitations of the social network user community identification device based on multi-scale graph contrastive learning, please refer to the limitations of the social network user community identification method based on multi-scale graph contrastive learning above, and will not be repeated here. The various modules in the above-mentioned social network user community identification device based on multi-scale graph contrastive learning can be implemented in whole or in part through software, hardware, or a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of the above-mentioned modules.

[0147] The present invention also provides a computer-readable storage medium, which stores a computer program, which can be used to execute the above Figure 1 This paper proposes a method for identifying user communities in social networks based on multi-scale graph contrastive learning.

[0148] The present invention also provides Figure 3 The structural diagram of the computer equipment shown in FIG. Figure 3 As shown in the figure, at the hardware level, the computer device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory. Of course, it may also include other hardware required for the business. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to achieve the above Figure 1 This paper proposes a method for identifying user communities in social networks based on multi-scale graph contrastive learning.

[0149] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware using a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes in the above-described method embodiments. Any reference to memory, storage, database, or other media used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0150] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present invention.

Claims

1. A method for identifying user communities in social networks based on multi-scale graph contrastive learning, characterized by: include: Build dynamic graphs based on social network data; The social network data includes the number of users and the user attention relationship at each moment; At any moment, according to the dynamic graph structure at the corresponding moment, the neighbor overlap similarity matrix and the topology structure similarity matrix are calculated, and the node feature matrix and the topology structure feature matrix are obtained based on the neighbor overlap similarity matrix and the topology structure similarity matrix; The neighbor overlap similarity matrix is ​​used to measure the neighbor similarity between any two user nodes in the dynamic graph structure; The topological structure similarity matrix is ​​used to measure the similarity of the topological structures between any two user nodes in the dynamic graph structure; Inputting the node feature matrix and the topological structure feature matrix into a multi-view graph convolutional network to obtain local node representation matrices and global graph representations under different views; Determine the local contrast loss based on the local node representation matrix under different views, and determine the local and global mutual information loss based on the local node representation and global graph representation under different views; train the multi-view graph convolutional network based on the local contrast loss and the local and global mutual information loss until the trained multi-view graph convolutional network meets the stopping condition, and stop training; Determine the consensus node representation matrix based on the local node representation matrices under different views corresponding to the multi-view graph convolutional network when the stopping condition is met; Clustering algorithms are used to cluster the elements in the consensus node representation matrix to obtain the user community division at the corresponding time; Dynamic graph G=[G (1) ,G (2) ,...,G (T) ]; G (t) =(V,E (t) ) represents the dynamic graph structure at time t; Where V={v1,v2,...,v N } represents the user node set, N represents the total number of users, E (t) represents the attention relationship between users at time t, T represents the total number of time; E (t) At time t, user node v i and v j Follow relationship Indicates that if at time t, user node v i and v j If there is a follow relationship between otherwise Neighbor overlap similarity matrix The calculation formula is: Among them, N(v i ) and N(v j ) represent the user nodes v in the graph structure i and user node v j The set of neighbors of Node feature matrix X t The calculation formula is: in, is the first-order neighborhood feature of the structure graph at time t, A t The elements in represent the first-order neighbor feature vectors of the user node at time t; α is the first balancing parameter; Topological similarity matrix The calculation formula is: in, A t User node v i The first-order neighbor eigenvector at time t, A t User node v j The first-order neighbor eigenvector at time t; Topological structure characteristic matrix Y t The calculation formula is: Where β is the second equilibrium parameter; The generation formula of the local node representation matrix under different views is: Among them, H t(1) and H t(2) is the local node representation matrix of two different views at time t, H t(1) and H t(2) The elements in represent the node representation of the user node, ReLU1 and ReLU2 are activation functions with independent parameters at time t, W t(1) and W t(2) are the independent parameter matrices of the two views at time t; The formula for generating the global graph representation is: Among them, g t(1) and g t(2) They are the global graph representations of the two views at time t, Sigmoid1 and Sigmoid2 are two nonlinear activation functions with independent parameters at time t, and H t(1) and H t(2) User node v i Node representation.

2. The method according to claim 1, characterized in that W t(1) and W t(2) The calculation method includes: The independent parameter matrices W of the two views at time t-1 are t-1(1) 、W t-1(2) Input into the long short-term memory network to obtain the independent parameter matrix W of the two views at time t t(1) and W t(2) .

3. The method according to claim 1, characterized in that Local contrast loss L tc The calculation formula is: in, Represents user node v at time t i and user node v j The adjacency relationship between them, if v j It is v i A neighbor of otherwise, At time t, v j and v i The similarity between them is calculated as follows: in, and H t(1) and H t (2) User node v j Node representation of; Local and global mutual information loss L mi The calculation formula is: in, express With g t Similar probability, Indicates random shuffle The generated negative samples, express With g t Similar probabilities; B t is the similarity factor.

4. The method according to claim 3, characterized in that The multi-view graph convolutional network is trained based on the local contrast loss and the local and global mutual information loss, including: Determine the comprehensive loss based on the local contrast loss and the local and global mutual information loss; Training multi-view graph convolutional networks via comprehensive losses.

5. The method according to claim 4, characterized in that The calculation formula of the comprehensive loss L is: L=λL tc +μL mi ; Wherein, λ is the third balance parameter, and μ is the fourth balance parameter.

6. The method according to claim 1, characterized in that The determining of the consensus node representation matrix according to the local node representation matrices under different views corresponding to the multi-view graph convolutional network when the stopping condition is satisfied includes: The average of the local node representation matrices under different views corresponding to the multi-view graph convolutional network when the stopping condition is met is determined as the consensus node representation matrix.