Social network user community identification method based on multi-scale graph comparative learning
The multi-scale graph contrastive learning approach improves community identification in dynamic social networks by constructing dynamic graphs and optimizing node representations using multi-view graph convolutional networks, addressing the challenge of capturing evolving user communities.
Patent Information
- Application Number
- CN202510811527.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-18
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-06-18
AI Technical Summary
The existing static community recognition method cannot effectively capture the dynamic evolution of user communities in social networks, resulting in limited accuracy of community structure recognition in dynamic graphs.
The multi-scale graph comparison learning method is adopted to construct a dynamic graph, calculate the neighbor overlap similarity and topological structure similarity matrix, and use a multi-view graph convolution network to generate local node representations and global graph representations. Combined with local comparison learning and local and global mutual information loss, the consistency of node representations is optimized, and finally the community division is performed through the clustering algorithm.
It realizes accurate identification of user groups in dynamic social networks, improves the accuracy and robustness of community structure identification, and supports precise marketing and public opinion guidance.
Smart Images

Figure CN120318003A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of artificial intelligence, and particularly relates to a method for identifying user communities in a social network based on multi-scale graph contrast learning. Background Art
[0002] Currently, social networks are usually represented as graphs, where user entities are nodes and the follow relationships between them are edges. These edges form complex structures, which are crucial for understanding the user preferences of social networks. User communities are composed of groups of users with similar interest preferences or behavior characteristics and close attention. By identifying the user community structure in a social network, a large number of users can be divided into groups with similar interest preferences or behavior characteristics, thus providing a theoretical basis for precision marketing and public opinion guidance. Specifically, in terms of precision marketing, by identifying user communities, user interests and consumption preferences can be deeply analyzed, helping brands quickly locate target customer groups, thereby formulating personalized recommendation strategies and improving the advertising reach efficiency and conversion rate; at the level of public opinion guidance, community identification can accurately capture the different attitudes of different user groups towards hot events, identify potential risk communities and predict the trend of public opinion, and achieve precise and segmented guidance of the public opinion field. Therefore, achieving the precise identification of user communities has important practical significance.
[0003] In order to achieve the precise identification of user communities, researchers have developed many methods to solve the community identification problem in static graphs. However, in social networks, the relationships between users change with the change of interests, with follow and unfollow behaviors occurring. These constantly changing follow relationships reflect the changes in user interest preferences or behavior characteristics, and thus drive the evolution of the community structure. However, traditional static community identification methods often fail to capture the dynamic evolution of dynamic graphs, resulting in limited accuracy in identifying community structures in dynamic graphs.
[0004] Therefore, there is an urgent need to propose a dynamic community identification method to achieve the dynamic and precise identification of user groups with similar interest preferences or behavior characteristics. Summary of the Invention
[0005] Based on this, in view of the above technical problems, it is necessary to provide a method for identifying user communities in a social network based on multi-scale graph contrast learning, which can accurately identify dynamic user groups with different interest preferences.
[0006] The present invention adopts the following technical solutions: The present invention provides a method for identifying user communities in a social network based on multi-scale graph contrast learning, including: Constructing a dynamic graph according to social network data; the social network data includes the number of users and the user follow relationships at each moment; At any moment, according to the dynamic graph structure at the corresponding moment, calculate the neighbor overlap similarity matrix and the topological structure similarity matrix, and obtain the node feature matrix and the topological structure feature matrix based on the neighbor overlap similarity matrix and the topological 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 structure between any two user nodes in the dynamic graph structure. Input the node feature matrix and the topological structure feature matrix into a multi-view graph convolutional network to obtain the local node representation matrix and the global graph representation under different views. Determine the local contrast loss according to the local node representation matrix under different views, and determine the local-global mutual information loss according to the local node representation and the global graph representation under different views. Train the multi-view graph convolutional network according to the local contrast loss and the local-global mutual information loss until the trained multi-view graph convolutional network meets the stopping condition, and then stop the training. Determine the consensus node representation matrix according to the local node representation matrix under different views corresponding to the multi-view graph convolutional network when the stopping condition is met. Cluster each element in the consensus node representation matrix through a clustering algorithm to obtain the user community division at the corresponding moment.
[0007] Optionally, the dynamic graph ; represents the dynamic graph structure at time t ; where ={ ,..., } represents the set of user nodes, represents the total number of user nodes, represents the follow relationship between users at time ; if there is a follow relationship between user nodes represents the total number of time instances; if at time user node and , then , otherwise .
[0008] Optionally, the calculation formula of the neighbor overlap similarity matrix is: ; where and respectively represent the neighbor sets of user node and user node in the graph structure. Node feature matrix The calculation formula is: + α ; Wherein, is the first-order neighborhood feature of the structure diagram at time t , and the elements in represent the first-order neighbor feature vector of the user node at time t ; α is the first balance parameter; Topological structure similarity matrix The calculation formula is: ; Wherein, is the first-order neighbor feature vector of the user node at time t , and is the first-order neighbor feature vector of the user node at time t ; Topological structure feature matrix The calculation formula is: + β ; Wherein, β is the second balance parameter.
[0009] Optionally, the generation formula of the local node representation matrix under different views is: ; Wherein, and are the local node representation matrices of two different views at time , and the elements in and represent the node representation of the user node, and are the activation functions independent of parameters at time , and and are the independent parameter matrices of the two views at time respectively; The generation formula of the global graph representation is: ; Wherein, and are respectively at time Global graph representations of two views at a time, and are respectively two non-linear activation functions independent of parameters at time ; and are respectively and the node representations of the user node in
[0010] Optionally, and are calculated as follows: Input the independent parameter matrices t -1 of the two views at time , into the long short-term memory network to obtain the independent parameter matrices t and of the two views at time .
[0011] Optionally, the calculation formula of the local contrast loss is: ; where represents the adjacency relationship between the user node and the user node at time . If is a neighbor of , then ; otherwise, represents the similarity between and at time , and the calculation formula is as follows: ; where , , and are respectively and the node representations of the user node in The calculation formula of the local and global mutual information loss is: ; ; where represents the probability of being similar to , Indicates random shuffling The generated negative samples Indicates And The probability of similarity; ; ; Is the similarity factor.
[0012] Optionally, according to the local contrast loss and the local and global mutual information loss, training the multi-view graph convolutional network includes: Determine the comprehensive loss according to the local contrast loss and the local and global mutual information loss; Train the multi-view graph convolutional network through the comprehensive loss.
[0013] Optionally, the comprehensive loss The calculation formula is: ; Among them, Is the third balance parameter, Is the fourth balance parameter.
[0014] Optionally, according to the local node representation matrices under different views corresponding to the multi-view graph convolutional network when the stop condition is satisfied, determining the consensus node representation matrix includes: Taking the average of the local node representation matrices under different views corresponding to the multi-view graph convolutional network when the stop condition is satisfied as the consensus node representation matrix.
[0015] The present invention provides a social network user community recognition device based on multi-scale graph contrast learning, including: A construction module for constructing a dynamic graph structure according to social network data; the social network data includes the number of users and the user attention relationships at each moment; A calculation module for calculating a neighbor overlap similarity matrix and a topological structure similarity matrix according to the dynamic graph structure at any moment, and obtaining a node feature matrix and a topological structure feature matrix according to the neighbor overlap similarity matrix and the topological 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 structure between any two user nodes in the dynamic graph structure; An input module for 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 a global graph representation under different views; A first determination module for determining a local contrast loss according to the local node representation matrices under different views, and determining a local and global mutual information loss according to the local node representations and the global graph representation under different views; A training module, configured to train a multi-view graph convolutional network according to a local contrast loss and a local-global mutual information loss until the trained multi-view graph convolutional network meets a stop condition, and then stop the training; A second determination module, configured to determine a consensus node representation matrix according to local node representation matrices under different views corresponding to the multi-view graph convolutional network when the stop condition is met; A clustering module, configured to cluster each element in the consensus node representation matrix through a clustering algorithm to obtain a user community division at a corresponding moment.
[0016] The present invention provides a computer-readable storage medium storing a computer program, which when executed by a processor, implements the above-mentioned social network user community recognition method based on multi-scale graph contrast learning.
[0017] The present invention provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, it implements the above-mentioned social network user community recognition method based on multi-scale graph contrast learning.
[0018] At least one of the above technical solutions adopted by the present invention can achieve the following beneficial effects: In the present invention, first, a dynamic social network is abstracted into a dynamic graph, and the neighbor overlap similarity and topological structure similarity of nodes are calculated to enhance features; then, based on a multi-view graph convolutional network, local node representation matrices and global graph representations are generated; next, through multi-scale contrast learning, combining local-local contrast learning and local-global contrast learning, the consistency of node representations is optimized; finally, based on a clustering algorithm, the trained local node representations are clustered to obtain an accurate division of dynamic communities. The present invention provides a new method and tool for advertising marketers and public opinion supervisors, which helps to better identify and analyze user groups in social networks and provides important support for achieving precision marketing and public opinion guidance. Description of the Drawings
[0019] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention. In the drawings: Figure 1 is a schematic flowchart of a social network user community recognition method based on multi-scale graph contrast learning provided by the present invention; Figure 2 is a schematic framework diagram of a social network user community recognition method based on multi-scale graph contrast learning provided by the present invention; Figure 3Schematic diagram of a computer device for a method of identifying user communities in a social network based on multi-scale graph contrast learning provided by the present invention. Detailed implementation manners
[0020] To make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below in conjunction with specific embodiments of the present invention and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0021] Recognizing the importance of community identification in dynamic social networks, researchers have proposed a series of dynamic community identification methods. These methods can be classified into methods based on coupled graphs, two-stage methods, and methods based on temporal smoothing. Although these methods have achieved significant improvements in dynamic graphs, there are still limitations. Specifically, 1) Methods based on coupled graphs mainly merge the graphs of all time steps into a coupled graph and then use classical static community identification methods to identify communities. However, these methods often fail to fully capture the temporal evolution of community structures, resulting in limited performance in dynamic graphs with multiple time steps. 2) Two-stage methods first identify community structures at each time step and then capture the dynamic characteristics of communities by tracking the changes of these structures over time. However, these methods often have difficulty accurately identifying the evolutionary relationships between communities in consecutive time steps. 3) Methods based on temporal smoothing usually use global or local smoothing strategies to improve the accuracy of community structure identification in dynamic graphs. Although these methods are very effective in utilizing information across time steps, they usually require a comprehensive understanding of all time steps of the dynamic graph, resulting in huge computational overhead. In addition, these methods mainly rely on single-view graph representations and cannot capture the deep relationships between different perspectives. Moreover, this dependence on a single view introduces potential noise and ambiguity, which may affect the accuracy and robustness of community identification results.
[0022] In summary, although these methods have their own advantages, they still face challenges such as single-view noise, separation of local and global features, and high computational complexity. Therefore, there is an urgent need for a social network community identification method that can fuse multi-view features, jointly optimize local and global representations, and reduce computational complexity.
[0023] The execution entity of the method provided in the present invention can be a server set up in a business platform, or a device such as a desktop computer or a laptop computer that can execute the solution of the present invention.
[0024] The following will detail the technical solutions provided by each embodiment of the present invention with reference to the drawings.
[0025] Figure 1 This is a schematic flow diagram of a method for identifying user communities in a social network based on multi-scale graph contrast learning in the present invention, which specifically includes the following steps: S101. Construct a dynamic graph according to the social network data. The social network data includes the number of users and the user following relationships at each moment.
[0026] Construct a dynamic graph based on the mutual following relationships between users as edges ; Denote the moment t The dynamic graph structure of
[0027] Among them, ={ ,..., } represents the set of user nodes, Represents the total number of users, Represents the following relationship between users at the moment , Represents the total number of moments; if at the moment , there is a following relationship between the user nodes And , then , otherwise . In addition, the adjacency matrix Is the first-order neighborhood feature of the graph at the moment , Is the first-order neighbor feature vector of the user node At the moment .
[0028] S102. For any moment, calculate the neighbor overlap similarity matrix and the topological structure similarity matrix according to the dynamic graph structure at the corresponding moment, and obtain the node feature matrix and the topological structure feature matrix based on the neighbor overlap similarity matrix and the topological structure similarity matrix.
[0029] 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 topological structure 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.
[0030] The calculation formula of the neighbor overlap similarity matrix Is: (1); Among them, And Respectively represent the neighbor sets of the user nodes And the user node In the graph structure. For example, when , }, When, among which, . At this time, and . ={ }. Therefore =6, =8 user nodes and user node 's neighbor overlap similarity .
[0031] Node feature matrix 's calculation formula is: + α (2); Among which, is the first-order neighborhood feature of the structure diagram at time t , and the elements in represent the first-order neighbor feature vector of the user node at time t ; for the target user node, through the set of first-order neighbor nodes determined at time t , extract relevant attribute features from this set and integrate them to obtain the first-order neighbor feature vector; α is the first balance parameter.
[0032] Calculate the topological structure similarity matrix at time based on the cosine similarity of the first-order neighbor features. The calculation formula of the topological structure similarity matrix is: (3); Among which, is the first-order neighbor feature vector of the user node in t at time is the first-order neighbor feature vector of the user node in t at time
[0033] Topological structure feature matrix 's calculation formula is: + β (4); Among which, β is the second balance parameter.
[0034] S103. Input the node feature matrix and the topological structure feature matrix into a multi-view graph convolutional network to obtain the local node representation matrix and the global graph representation under different views.
[0035] Among them, the local node representation matrix refers to the node feature representation learned based on 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.
[0036] The generation formula of the local node representation matrix under different views is: (5); Among them, and are the local node representation matrices at time for two different views. The elements in and represent the node representations of the user nodes. and are activation functions with independent parameters at time . and are independent parameter matrices for the two views at time .
[0037] The global graph representation is obtained by aggregating the local node representations, allowing the local representations to effectively capture the global graph features in the multi-scale contrast learning module. The generation formula of the global graph representation is: (6); Among them, and are the global graph representations of the two views at time respectively. and are two non-linear activation functions with independent parameters at time respectively. and are respectively and the node representations of the user node in. N represents the total number of user nodes in the graph structure.
[0038] Optionally, in order to further capture the time dynamics, the Long Short - Term Memory network (LSTM) and are used for the calculation method, specifically including: the independent parameter matrices of the two views at time t - 1 , Input into the long short-term memory network to obtain the independent parameter matrices of the two views at time t , specifically: and . Specifically: (7); Among them, and capture dynamic evolution features. The LSTM only depends on the parameter updates of adjacent time steps, further reducing the computational complexity.
[0039] S104. Determine the local contrast loss according to the local node representation matrices under different views, and determine the local-global mutual information loss according to the local node representations and the global graph representation under different views.
[0040] The calculation formula of the local contrast loss is: (8); Among them, represents the adjacency relationship between user nodes and user node at time . If is a neighbor of , then ; otherwise, represents the similarity between and at time . The calculation formula is as follows: (9); Among them, , , and are respectively the node representations of user node in . To enhance the integration of local and global information, the local-global mutual information loss
[0041] is proposed by maximizing the mutual information between the local node representation and the global graph representation to promote the fusion of local and global topological structures. The calculation formula of the local-global mutual information loss is: The calculation formula is: (10); (11); Among them, represents The probability of similarity with a similar probability, represents randomly shuffled generated negative samples, represents the probability of similarity with ; ; ; is the similarity factor, which is optimized through the comprehensive loss during training to maximize the mutual information between the local node representation and the global graph representation, calculate a similarity score, and then convert it into a probability by using function, and this probability is based on the learned parameters , reflecting the similarity between ; is the comprehensive global view representation at time t .
[0042] S105. Train the multi-view graph convolutional network according to the local contrast loss and the local-global mutual information loss until the trained multi-view graph convolutional network meets the stopping condition, and then stop the training; determine 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.
[0043] Optionally, training the multi-view graph convolutional network according to the local contrast loss and the local-global mutual information loss includes: determining the comprehensive loss according to the local contrast loss and the local-global mutual information loss; training the multi-view graph convolutional network through the comprehensive loss.
[0044] Among them, the comprehensive loss The calculation formula is: (12); Among them, is the third balance parameter, is the fourth balance parameter, is the local contrast loss, is the local-global mutual information loss. By integrating the local contrast loss and the local-global mutual information loss, multi-scale view contrast learning significantly improves the accuracy of node representation, thus promoting the identification of user community structures in dynamic graphs.
[0045] Update the weight parameters in the multi-view graph convolutional network through the comprehensive loss. The stopping condition can be that the comprehensive loss is less than a preset loss threshold, or the number of training times reaches a preset number threshold.
[0046] Optionally, according to the local node representation matrices under different views corresponding to the multi-view graph convolutional network when the stop condition is satisfied, a consensus node representation matrix is determined, including: taking the average of the local node representation matrices under different views corresponding to the multi-view graph convolutional network when the stop condition is satisfied as the consensus node representation matrix. Among them, the consensus node representation matrix can be: (13); Among them, is the consensus node representation matrix of the dynamic graph obtained by averaging the local node representation matrices.
[0047] S106. Cluster each element in the consensus node representation matrix through a clustering algorithm to obtain the user community division at the corresponding moment.
[0048] Through K-means for perform clustering to obtain the user community division at time , and the calculation formula is as follows: (14); Among them, K-means is the K-means algorithm.
[0049]
[0049] Based on the above steps, the user community division of the dynamic graph at T moments can be obtained , ; among them, represents the user community division at time i , , thus realizing the dynamic recognition of the user community structure of the social network.
[0050] In one embodiment, as shown in Figure 2 , Figure 2 is the framework structure diagram of the social network user community recognition method based on multi-scale graph contrast learning provided by the present invention. In (a), a similarity matrix is calculated for the graph structure to obtain a node feature matrix and a topological structure feature matrix; in (b), the node feature matrix and the topological structure feature matrix are input into a multi-view graph convolutional network (GCN1 and GCN2) to obtain local node representation matrices and global graph representations under different views; in (c), multi-scale contrast learning (generating local contrast loss and local-global mutual information loss) is performed, and then a consensus node representation matrix of the graph structure is obtained; finally, according to the K-means clustering algorithm, the user community division is obtained. Among them, the independent parameter matrices and in the multi-view graph convolutional network are obtained based on the long short-term memory network LSTM.
[0051] In one embodiment, to verify the effectiveness of the present method, this embodiment is used for illustration. Specifically, verification is carried out through a dataset composed of three real-world datasets, namely HighSchool1, CellphoneCallr, and Dblp, to evaluate the applicability and effectiveness of the present method. These datasets vary in size, ranging from 327 to 12107 nodes and 8 to 10 time steps, providing a comprehensive evaluation of the performance in different real-world scenarios. As shown in Table 1, Table 1 presents the basic information of the datasets.
[0052] Table 1
[0053] As shown in Table 2, Table 2 shows the classification accuracies of seven methods on real-world datasets, which are evaluated by three metrics, 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 Deep Draph Infomax (ODDGI), Dynamic Graph Convolutional Network (DGCN), Matrix Factorization-based Deep Graph Clustering with Topological Regularization (MFC + Topo), and the method of the present invention (MSGCL).
[0054] Table 2
[0055] As can be seen from Table 2, the MSGCL method proposed by the present invention outperforms the baseline methods on most datasets. Specifically, the analysis of the NMI value shows that MSGCL exhibits superior performance on all datasets, improving by 2.87%, 1.60%, and 2.44% compared to the second-best method on the HighSchool, CellphoneCall, and Dblp datasets, respectively. For the ARI metric, MSGCL improves by 0.47%, 1.82%, and 1.07% compared to the second-best method on the three datasets, respectively. In terms of the Q value, MSGCL improves by 3.18% and 2.10% compared to the second-best method on the HighSchool and CellphoneCall datasets, respectively. In addition, the dynamic baseline method is generally better than the static baseline method because the dynamic baseline method takes into account the dynamic laws of the user community structure and provides a more accurate dynamic graph representation, while the static method cannot capture this dynamic evolution law and thus has limited accuracy. The LSTM-based methods (such as DGCN and ODDGI) are better than the structure-regularized MFC+Topo method on most datasets, indicating that the LSTM module is more effective in maintaining temporal smoothness between adjacent time steps. Although DGCN and ODDGI have advantages compared to other methods, there is still a gap with MSGCL. This is because MSGCL eliminates the inherent noise in the single view by integrating the multi-view graph representation learning module and the multi-scale contrast learning module, achieving a more accurate node representation. These results demonstrate the effectiveness of our outstanding method in identifying user communities in social networks.
[0056] 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 intended to limit them. 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.
[0057] 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 execute according to Figure 1 the order of the steps shown. The specific execution order of each step can be determined according to needs, and the present invention does not limit this.
[0058] The above is the social network user community identification method based on multi-scale graph contrast learning provided by one or more embodiments of the present invention. Based on the same idea, the present invention also provides a corresponding social network user community identification device based on multi-scale graph contrast learning. The device includes: A construction module for constructing a dynamic graph according to social network data. The social network data includes the number of users and the user attention relationships at each moment. A computing module, configured to calculate a neighbor overlap similarity matrix and a topological structure similarity matrix according to the dynamic graph structure at any moment, and obtain a node feature matrix and a topological structure feature matrix based on the neighbor overlap similarity matrix and the topological 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 structure between any two user nodes in the dynamic graph structure; An input module, configured to input 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; A first determination module, configured to determine a local contrast loss according to the local node representation matrices under different views, and determine a local-global mutual information loss according to the local node representations and the global graph representations under different views; A training module, configured to train the multi-view graph convolutional network according to the local contrast loss and the local-global mutual information loss until the trained multi-view graph convolutional network meets a stop condition, and then stop the training; A second determination module, configured to determine a consensus node representation matrix according to the local node representation matrices under different views corresponding to the multi-view graph convolutional network when the stop condition is met; A clustering module, configured to cluster each element in the consensus node representation matrix through a clustering algorithm to obtain the user community division at the corresponding moment.
[0059] For the specific limitations of the social network user community recognition device based on multi-scale graph contrast learning, reference can be made to the limitations of the social network user community recognition method based on multi-scale graph contrast learning in the above text, which will not be elaborated here. Each module in the above social network user community recognition device based on multi-scale graph contrast learning can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to the above modules.
[0060] The present invention also provides a computer-readable storage medium, which stores a computer program, and the computer program can be used to execute the above Figure 1 Provided social network user community recognition method based on multi-scale graph contrast learning.
[0061] The present invention also provides Figure 3 The structural schematic diagram of the computer device shown in, as Figure 3As shown, 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 other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the above Figure 1 Social network user community recognition method based on multi-scale graph contrast learning provided.
[0062] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the embodiments provided by the present invention can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0063] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, 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, it should be considered as the scope recorded by the present invention.
Claims
1. A method for identifying user communities in a social network based on multi-scale graph contrastive learning, characterized in that, Including: Construct a dynamic graph according to social network data; The social network data includes the number of users and the user attention relationships at each moment; For any moment, calculate the neighbor overlap similarity matrix and the topological structure similarity matrix according to the dynamic graph structure at the corresponding moment, and obtain the node feature matrix and the topological structure feature matrix according to the neighbor overlap similarity matrix and the topological 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 structure between any two user nodes in the dynamic graph structure; Input the node feature matrix and the topological structure feature matrix into a multi-view graph convolutional network to obtain the local node representation matrix and the global graph representation under different views; Determine the local contrast loss according to the local node representation matrix under different views, and determine the local-global mutual information loss according to the local node representation and the global graph representation under different views; train the multi-view graph convolutional network according to the local contrast loss and the local-global mutual information loss until the trained multi-view graph convolutional network meets the stopping condition, and then stop the training; Determine the consensus node representation matrix according to the local node representation matrix under different views corresponding to the multi-view graph convolutional network when the stopping condition is met; Cluster the elements in the consensus node representation matrix through a clustering algorithm to obtain the user community division at the corresponding moment.
2. The method according to claim 1, wherein Dynamic diagram ; indicating the moment t dynamic diagram structure; Among them, ={ ,..., } represents the set of user nodes, represents the total number of users, represents the follow-up relationship between users at time , represents the total number of time instances; if at time , there is a follow-up relationship between user nodes and , then , otherwise .
3. The method according to claim 2, characterized in that Neighbor Overlap Similarity Matrix The calculation formula is as follows: ; Among them, and respectively represent the set of neighbor nodes of user node and user node in the graph structure; Node feature matrix The calculation formula is as follows: + α ; Among them, is the first-order neighborhood feature of the structure diagram at time t The elements in represent the first-order neighbor feature vectors of the user node at time t ; α is the first balance parameter; Topological structure similarity matrix The calculation formula is as follows: ; Among them, is the first-order neighbor feature vector of the user node at time t ; is the first-order neighbor feature vector of the user node at time t ; Topological structure feature matrix The calculation formula is as follows: + β ; Among them, β is the second balance parameter.
4. The method according to claim 3, wherein The generation formula of the local node representation matrix under different views is: ; Among them, and are the local node representation matrices of two different views at time , and the elements in and represent the node representations of user nodes. and are activation functions with independent parameters at time , and and are independent parameter matrices of the two views at time , respectively. The generation formula of the global graph representation is: ; wherein, and are respectively the global graph representations of two views at time . and are respectively two non-linear activation functions independent of parameters at time . and are respectively the node representations of the user node and in .
5. The method according to claim 4, characterized in that, and The calculation methods specifically include: The independent parameter matrices of the two views at time t -1 , are input into the long short-term memory network to obtain the independent parameter matrices of the two views at time t : and .
6. The method according to claim 4, wherein Local contrast loss The calculation formula is as follows: ; Among them, represents the time when the user node and the user node have an adjacency relationship. If is a neighbor of ; otherwise, , represents the similarity between at time and , and the calculation formula is as follows: ; Among them, , , and are respectively and the node representations of the user nodes in Local and Global Mutual Information Loss The calculation formula is as follows: ; ; Among them, represents the probability of being similar to, represents the randomly shuffled negative samples generated, represents the probability of being similar to; ; ; is the similarity factor.
7. The method according to claim 6, characterized in that Training the multi-view graph convolutional network according to the local contrast loss and the local-global mutual information loss includes: Determine the comprehensive loss according to the local contrast loss and the local-global mutual information loss; Train the multi-view graph convolutional network through the comprehensive loss.
8. The method according to claim 7, wherein The comprehensive loss The calculation formula is as follows: ; Among them, is the third balance parameter, is the fourth balance parameter.
9. The method according to claim 1, characterized in that The determining the consensus node representation matrix according to the local node representation matrix under different views corresponding to the multi-view graph convolutional network when the stopping condition is met includes: Taking 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 as the consensus node representation matrix.
Citation Information
Patent Citations
Online social network user community discovery method based on network embedding and node similarity
CN112149000A
Graph convolutional neural network social contact recommendation method and system fused with multi-channel attention mechanism
CN114677234A
Cross-social network social user alignment method
CN115080871A
Community discovery method and system based on graph convolutional neural network
CN116416079A
Community discovery method of graph convolutional neural network based on structure center diffusion
CN117150147A