A dynamic community discovery method and system based on member migration information contrast learning

By employing a comparative learning method based on member migration information, and utilizing graph convolutional networks and HSIC constraints, the problem of insufficient utilization of community member migration information in dynamic community discovery is solved, thus achieving high-quality dynamic community discovery.

CN119939296BActive Publication Date: 2025-12-16SOUTH CHINA NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411866408.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-12-16
Estimated Expiration
2044-12-18

AI Technical Summary

Technical Problem

Existing dynamic community discovery methods cannot effectively utilize community member migration information when dealing with sudden changes in node community affiliation, leading to local non-smoothness in the network structure and affecting community discovery performance.

Method used

By employing a contrastive learning approach based on member migration information, we utilize graph convolutional networks to obtain node embeddings, introduce GRU to capture historical information, design a community member migration detection mechanism, constrain the non-smoothness of the local network structure through HSIC, construct a contrastive learning loss function to optimize the graph convolutional network, and discover high-quality dynamic communities.

Benefits of technology

Effectively mine community member migration information to enhance the accuracy of community discovery, capture dynamic online behavior, and achieve high-quality dynamic community discovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119939296B_ABST
    Figure CN119939296B_ABST
Patent Text Reader

Abstract

The application discloses a kind of dynamic community discovery method and system based on member migration information contrast learning, method includes: according to the number of snapshot of dynamic network, formalization indicates dynamic network, the dynamic network is used to determine node set and edge set;According to the formalization of dynamic network, obtain node embedding;According to the node embedding, detect community member migration information;When detecting community member migration information, the non-smoothness of local network structure is retained to retain the local non-smooth information of snapshot;Contrast loss function training graph convolutional network is constructed to any two snapshots, and dynamic community discovery result is obtained according to the graph convolutional network obtained by training.The embodiment of the application can make full use of community member migration information, effectively find high-quality dynamic community, and can be widely applied to social network data analysis technical field.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of social network data analysis, and in particular to a dynamic community discovery method and system based on member migration information contrast learning. BACKGROUND

[0002] A dynamic network is a network in which nodes and edges increase and disappear over time, for example, in an online social network, new users will continuously join, and users will continuously establish or cancel attention relationships. Dynamic networks are more suitable for modeling various complex interaction relationships in the real world, and have become an important research direction in the field of network data analysis.

[0003] Dynamic community discovery (i.e., dynamic community discovery) is an important dynamic network analysis task, and its goal is to identify node clusters that are tightly connected within any snapshot of a dynamic network and sparsely connected outside. In recent years, with the rapid development of graph neural networks (GNN), GNN-based dynamic community discovery methods have shown strong performance and have become the mainstream technology for dynamic community discovery, including methods such as EvolveGCN, CTGCN, and DGCN based on dynamic graph convolution networks, CGC and CLDG based on graph contrast learning, and VGRNN and VGRGMM based on variational graph autoencoders. In general, although existing dynamic community discovery methods have varying degrees of effectiveness, they still face the following problems: (1) Most methods are based on the smoothness assumption, i.e., the community structure changes slowly over time. However, in real-world scenarios, the community membership of some nodes may suddenly change, i.e., community members may migrate, resulting in local non-smoothness of the network structure. (2) Although existing methods consider the local structural non-smoothness in dynamic networks, they are not able to effectively mine and utilize community member migration information to further enhance community discovery performance. SUMMARY

[0004] The main purpose of the embodiments of the present application is to propose a dynamic community discovery method and system based on member migration information contrast learning, which can fully utilize community member migration information and effectively discover high-quality dynamic communities.

[0005] To achieve the above-mentioned purpose, one aspect of the embodiments of the present application proposes a dynamic community discovery method based on member migration information contrast learning, comprising the following steps:

[0006] According to the number of snapshots of the dynamic network, the dynamic network is formalized, and the dynamic network is used to determine a node set and an edge set;

[0007] According to the formalization of the dynamic network, node embeddings are obtained;

[0008] According to the node embedding, community member migration information is detected;

[0009] In the detection of community member migration information, the non-smoothness of the local network structure is preserved to preserve the local non-smooth information of the snapshot;

[0010] A comparison loss function training graph convolutional network is constructed for any two snapshots, and a dynamic community discovery result is obtained according to the trained graph convolutional network.

[0011] In some embodiments, the dynamic network is formalized according to the number of snapshots of the dynamic network, specifically:

[0012] The dynamic network G (t) is formalized as G=(G (1) , G (2) ,..., G (T) ), where T represents the number of snapshots of the dynamic network;

[0013] For snapshot G (t) t=(V (t) , E (t) ), V (t) and E (t) represent the node set and edge set of G (t) t respectively.

[0014] In some embodiments, the node embedding is obtained according to the formalization of the dynamic network, comprising the following steps:

[0015] A multi-layer graph convolutional network GCN is used as an encoder, wherein the definition of the lth layer GCN is as follows:

[0016]

[0017] wherein, and represent the adjacency matrix and degree matrix of the input network respectively, I is the unit matrix, W l is a trainable weight matrix, and sigma is a nonlinear activation function; for snapshot t, the node embedding output by the corresponding encoder is represented as matrix H (t) ;

[0018] A projection head is added after the GCN encoder to perform nonlinear transformation on the embedding to obtain node matrix P(t): P (t) =f proj (H (t) ), wherein f proj (·) consists of two multi-layer perceptrons MLP;

[0019] The introduction of GRU fuses the historical information of dynamic network into the embedding representation of snapshot, generating the node embedding representation Z of each snapshot (t) The design of GRU is as follows:

[0020] R (t) = σ(W r [Z (t-1) , P (t) ]),

[0021] Q (t) = σ(W u [Z (t-1) , P (t) ]),

[0022]

[0023]

[0024] Where 1 is an all-1 matrix, [, ] represents the splicing operation, ⊙ represents the Hadamard product, W r , W u and W h are trainable weight matrices; Z (0) is initialized as a zero matrix; R (t) represents the reset gate, which controls the contribution of historical snapshot information to the current candidate hidden state; Q (t) is the update gate, which balances the influence degree of the current time candidate hidden state and the historical snapshot information; is the candidate hidden state, which combines the adjustment results of the current snapshot information and the historical snapshot information, representing the potential state at the current time.

[0025] In some embodiments, the detecting community member migration information according to the node embedding comprises the following steps:

[0026] The k-means clustering algorithm is applied to the snapshot node embeddings Z (t) and Z (t′) of two different time points respectively, to generate the pseudo label of the community to which each node belongs;

[0027] After one-hot encoding, the community membership matrices F (t) and F (t′) are obtained;

[0028] F (t) is multiplied by its transpose to generate the common community indication matrix O (t) ; F (t′) is multiplied by its transpose to generate the common community indication matrix O (t′) ; the common community indication matrix is used to represent the community membership relationship of the node pair in the same snapshot;

[0029] The stable node matrix S is generated from the snapshots at time t and t' by the following formula (t,t′) and unstable node matrix U (t,t′) :

[0030] S (t,t′) = (O (t) ⊙O (t′) )-I,

[0031]

[0032] where, denotes the element-wise XOR operation of matrices O (t) and O (t′) ; I represents the identity matrix.

[0033] In some embodiments, the step of preserving the non-smoothness of the local network structure when detecting community member migration information comprises:

[0034] HSIC is introduced to measure the dependence between two different snapshot embeddings Z (t) and Z (t′) , and the expression of the process is: where tr(·) denotes the trace of a matrix, K and L are the Gramian matrices of embeddings Z (t) and Z (t′) ; M is the centering matrix, which is defined as N is the number of nodes in the current snapshot;

[0035] By minimizing the HSIC, the similarity between the embeddings of different snapshots is constrained, and the respective uniqueness is preserved.

[0036] In some embodiments, the step of constructing a contrastive loss function for any two snapshots comprises:

[0037] Constructing a contrastive learning loss and a HSIC loss;

[0038] where, for the contrastive learning loss, intra-view contrastive learning and inter-view contrastive learning are designed; the intra-view contrastive learning focuses on the nodes within a single snapshot, and the node and its direct neighbors are regarded as positive samples, and the non-neighbor nodes are regarded as negative samples; the inter-view contrastive learning focuses on stable nodes and unstable nodes, which are identified through the community member migration detection mechanism in multiple snapshots;

[0039] Given a node and its stable node are regarded as positive samples, and a given node and its unstable node are regarded as negative samples, based on this, from the perspective of a given node i, the contrastive loss function of any two snapshots at time t and t' is defined as: where pos and neg are calculated by the following ways respectively:

[0040]

[0041]

[0042] where, is a temperature coefficient for controlling the concentration of distribution, represents all neighbors of the ith node in the tth snapshot; pos and neg represent the similarity measures of the given node i with its positive and negative samples respectively; and represent whether node i and node j are stable or unstable nodes at time t and t' respectively; is a similarity measure for measuring the similarity between different node embeddings;

[0043] A sliding window of size w is introduced to determine the number of snapshots for contrastive learning, and the total contrastive learning objective is designed as follows:

[0044]

[0045] The final loss function is obtained according to the contrastive learning loss and the HSIC loss.

[0046] In some embodiments, the graph convolutional network is trained, and a dynamic community discovery result is obtained according to the trained graph convolutional network, including the following steps:

[0047] The final loss function is taken as the objective function, and the sliding window, the balance parameter, the number of iterations, the number of layers of the graph convolutional network and the dimensions of each layer, and the MLP dimensions in the projection head are set;

[0048] The graph convolutional network parameters are iteratively updated, and the final embedding of each snapshot node is obtained after the training loss converges;

[0049] The communities in which the nodes in any snapshot are located are determined by clustering using k-means.

[0050] Another aspect of the embodiment of the application also provides a dynamic community discovery system based on member migration information contrastive learning, comprising:

[0051] A first module is configured to formalize a dynamic network according to the number of snapshots of the dynamic network, and the dynamic network is used to determine a node set and an edge set;

[0052] A second module is configured to obtain node embeddings according to the formalized representation of the dynamic network;

[0053] A third module is configured to detect community member migration information according to the node embeddings.

[0054] The fourth module is configured to retain the non-smoothness of the local network structure when detecting the community member migration information, so as to retain the local non-smooth information of the snapshot.

[0055] The fifth module is configured to train the graph convolutional network by constructing a comparison loss function of any two snapshots, and obtain the dynamic community discovery result according to the trained graph convolutional network.

[0056] To achieve the above object, another aspect of the embodiment of the present application provides an electronic device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the above method when executing the computer program.

[0057] To achieve the above object, another aspect of the embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the above method.

[0058] The embodiment of the present application also discloses a computer program product or a computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device can read the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device execute the above method.

[0059] The embodiment of the present application at least has the following beneficial effects: the present application provides a dynamic community discovery method and system based on member migration information comparison learning, which formalizes a dynamic network according to the number of snapshots of the dynamic network, and the dynamic network is used to determine a node set and an edge set; obtains node embedding according to the formalization of the dynamic network; detects community member migration information according to the node embedding; retains the non-smoothness of the local network structure when detecting the community member migration information, so as to retain the local non-smooth information of the snapshot; trains a graph convolutional network by constructing a comparison loss function of any two snapshots, and obtains a dynamic community discovery result according to the trained graph convolutional network. The embodiment of the present application can fully utilize the community member migration information, and effectively discover high-quality dynamic communities. BRIEF DESCRIPTION OF DRAWINGS

[0060] Figure 1 is an implementation environment schematic diagram provided by the embodiment of the present application;

[0061] Figure 2 is a flowchart of the overall steps provided by the embodiment of the present application;

[0062] Figure 3 is a flowchart of the specific implementation steps provided by the embodiment of the present application;

[0063] Figure 4 is a dynamic network example diagram provided by an embodiment of the present application;

[0064] Figure 5 is a result diagram of community discovery on the dynamic network example provided by an embodiment of the present application;

[0065] Figure 6 is a hardware structure schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0066] In order to make the objects, technical solutions and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application. When the following description relates to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementation manners described in the following exemplary embodiments do not represent all the implementation manners consistent with the embodiments of the present application, and they are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the appended claims.

[0067] It can be understood that the terms “first”, “second” and the like used in the present application can be used herein to describe various concepts, but unless specifically stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information without departing from the scope of the embodiments of the present application. Depending on the context, the word “if” as used herein can be interpreted as “when” or “upon” or “in response to determining”.

[0068] The terms “at least one”, “multiple”, “each”, “any” and the like used in the present application include one, two or more than two, multiple includes two or more than two, each refers to each of the corresponding multiple, and any refers to any one of the multiple.

[0069] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0070] The embodiment of the present application provides a dynamic community discovery method and system based on member migration information comparative learning, and relates to the technical field of social network data analysis. The dynamic community discovery method based on member migration information comparative learning provided by the embodiment of the present application can be applied to a terminal, can be applied to a server, and can also be software running in the terminal or the server. In some embodiments, the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, a vehicle-mounted terminal and the like, but is not limited thereto; the server end can be configured as a stand-alone physical server, can be configured as a server cluster or a distributed system composed of multiple physical servers, can be configured as a cloud server providing basic cloud computing services such as cloud service, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN and big data and artificial intelligence platform, and the server can also be a node server in a blockchain network; the software can be an application for implementing the dynamic community discovery method based on member migration information comparative learning, and the like, but is not limited to the above forms.

[0071] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in a distributed computing environment, in which tasks are performed by remote processing devices connected by a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

[0072] As shown in Figure 1 , it is a schematic diagram of an implementation environment provided by the embodiment of the present application. Referring to Figure 1 , the implementation environment includes at least one terminal 102 and a server 101. The terminal 102 and the server 101 can be connected by wireless or wired means to complete data transmission and exchange.

[0073] The server 101 can be a standalone physical server, a server cluster composed of multiple physical servers, or a distributed system, and can also be a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms.

[0074] In addition, the server 101 can also be a node server in a blockchain network. The blockchain is a new application mode of distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, and other computer technologies.

[0075] The terminal 102 can be a smartphone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, and the like. The terminal 102 can also be a vehicle terminal of the various device types exemplified above, but is not limited thereto. The terminal 102 and the server 101 can be directly or indirectly connected through wired or wireless communication, and the present embodiment is not limited thereto.

[0076] Exemplarily based on the implementation environment shown in the figure, the present embodiment provides a dynamic community discovery method based on member migration information contrast learning. The following takes an example of the dynamic community discovery method based on member migration information contrast learning being applied to the server 101. It can be understood that the method can also be applied to the terminal 102. Figure 1 Referring to the implementation environment shown in the figure,

[0077] The flowchart of the dynamic community discovery method based on member migration information contrast learning provided by the present embodiment and applied to the server can be executed by any one of the computer devices (including servers or terminals) described above. Referring to the implementation environment shown in the figure, Figure 2 The method can include the following steps: Figure 2 Figure 2 According to the number of snapshots of the dynamic network, the dynamic network is formalized to determine a node set and an edge set;

[0078] According to the formalized representation of the dynamic network, a node embedding is obtained;

[0079] According to the node embedding, community member migration information is detected;

[0080] When detecting the community member migration information, the local network structure is kept non-smooth to keep the local non-smooth information of the snapshot;

[0081]

[0082] ​​Construct a contrastive loss function for any two snapshots to train a graph convolutional network, and obtain dynamic community detection results based on the trained graph convolutional network.

[0083] In some embodiments, formally representing the dynamic network based on the number of snapshots of the dynamic network specifically involves:

[0084] Dynamic network G (t) Formal representation as G = (G (1) G (2) , ..., G (T) ), where T represents the number of snapshots of the dynamic network;

[0085] For a snapshot G at time t (t) =(V (t) E (t) V (t) and E (t) G (t) The set of nodes and the set of edges.

[0086] In some embodiments, obtaining node embeddings based on the formal representation of the dynamic network includes the following steps:

[0087] A multi-layer graph convolutional network (GCN) is used as the encoder, where the l-th layer of the GCN is defined as follows:

[0088]

[0089] in, and Let I and W represent the adjacency matrix and degree matrix of the input network, respectively. l Here, is a trainable weight matrix, and σ is a non-linear activation function; for a snapshot at time t, the node embedding corresponding to the encoder output is represented by matrix H. (t) ;

[0090] A projection head is added after the GCN encoder to perform a nonlinear transformation on the embedding, obtaining the node matrix P. (t) :P (t) =f proj (H (t) ), where f proj (·) It consists of two multilayer perceptrons (MLPs);

[0091] Introducing GRU incorporates historical information from dynamic networks into the embedding representation of snapshots, generating a node embedding representation Z for each snapshot. (t) The GRU is designed as follows:

[0092] R (t) =σ(W r [Z (t-1) P(t) ]),

[0093] Q (t) = σ(W u [Z (t-1) , P (t) ]),

[0094]

[0095]

[0096] where 1 is an all-ones matrix, [,,] denotes the concatenation operation, denotes the Hadamard product, W r , W u and W h are trainable weight matrices; Z (0) is initialized as an all-zeros matrix; R (t) represents the reset gate, which controls the contribution of the historical snapshot information to the current candidate hidden state; Q (t) is the update gate, which balances the influence degree of the candidate hidden state at the current moment and the historical snapshot information; is the candidate hidden state, which combines the adjustment results of the current snapshot information and the historical snapshot information, and represents the potential state at the current moment.

[0097] In some embodiments, the detecting community member migration information according to the node embedding comprises the following steps:

[0098] applying a k-means clustering algorithm to the snapshot node embeddings Z (t) and Z (t′) at two different moments respectively, to generate pseudo-labels of the communities to which each node belongs;

[0099] After one-hot encoding, community membership matrices F (t) and F (t′) are obtained;

[0100] F (t) is multiplied by its transpose to generate a common community indicator matrix O (t) ; F (t′) is multiplied by its transpose to generate a common community indicator matrix O (t′) ; the common community indicator matrix is used to represent the community membership relationship of a node pair in the same snapshot;

[0101] Stable node matrices S (t,t′) and unstable node matrices U (t,t′) are generated from the snapshots at moments t and t' respectively by the following formula:

[0102] S (t,t′) = (O (t) ⊙O (t′))-I,

[0103]

[0104] wherein, denotes the matrix O (t) and O (t′) element-wise XOR operation; I represents the identity matrix.

[0105] In some embodiments, the step of preserving the non-smoothness of the local network structure when detecting the community member migration information comprises the following steps:

[0106] HSIC is introduced to measure the dependency between two different snapshot embeddings Z (t) and Z (t′) , and the expression of the process is: wherein, tr(·) denotes the trace of the matrix, K and L are the Gramian matrices of the embeddings Z (t) and Z (t′) ; M is the centering matrix, which is defined as N is the number of nodes in the current snapshot;

[0107] By minimizing the HSIC, the embedding similarity between different snapshots is constrained, and the respective uniqueness is preserved.

[0108] In some embodiments, the step of constructing the contrastive loss function of any two snapshots comprises the following steps:

[0109] Constructing the contrastive learning loss and the HSIC loss;

[0110] wherein, for the contrastive learning loss, the intra-view contrastive learning and the inter-view contrastive learning are designed; the intra-view contrastive learning focuses on the nodes within a single snapshot, and the node and its direct neighbors are regarded as positive samples, and the non-neighbor nodes are regarded as negative samples; the inter-view contrastive learning focuses on stable nodes and unstable nodes, which are identified through the community member migration detection mechanism in multiple snapshots;

[0111] Given the node and its stable nodes are regarded as positive samples, and the given node and its unstable nodes are regarded as negative samples, based on this, from the perspective of the given node i, the contrastive loss function of any two snapshots at time t and t' is defined as: wherein, pos and neg are calculated by the following ways respectively:

[0112]

[0113]

[0114] wherein, is the temperature coefficient, which is used to control the concentration of the distribution, represents all neighbors of the ith node in the tth snapshot; pos and neg represent the similarity measure of the given node i with its positive and negative samples, respectively; and represent whether node i and node j are stable or unstable nodes to each other at time t and t', respectively; is a similarity measure used to measure the similarity between different node embeddings;

[0115] A sliding window of size w is introduced to determine the number of snapshots for contrastive learning, and the total contrastive learning objective is designed as follows:

[0116]

[0117] The final loss function is obtained according to the contrastive learning loss and the HSIC loss.

[0118] In some embodiments, the graph convolutional network is trained, and a dynamic community discovery result is obtained according to the trained graph convolutional network, including the following steps:

[0119] The final loss function is used as the objective function, and the sliding window, the balance parameter, the number of iterations, the number of layers of the graph convolutional network and the dimensions of each layer, and the MLP dimensions in the projection head are set;

[0120] The graph convolutional network parameters are iteratively updated, and the final embedding of each snapshot node is obtained after the training loss converges;

[0121] The k-means is used for clustering to determine the community in which any snapshot node is located.

[0122] The specific implementation process of the embodiments of the application will be described in detail below with specific application scenarios as examples:

[0123] The application proposes a method based on member migration information contrastive learning to solve the problems existing in the existing dynamic community discovery method. The method first obtains node embedding based on the graph convolutional network, and introduces a gated recurrent unit (GRU) to capture the historical information of node migration in the dynamic network. In order to make full use of the community member migration information, a community member migration detection mechanism is proposed, and this migration information is used as an additional contrastive learning self-supervised signal. At the same time, in order to capture the local non-smoothness of the snapshot network structure, the Hilbert-Schmidt independence criterion (HSIC) is used to constrain the similarity of different snapshot node embeddings. Finally, the graph convolutional network is optimized by the contrastive learning loss and the HSIC loss, and high-quality dynamic communities are effectively discovered. The specific operation steps are as follows:

[0124] Step 1: formalize the dynamic network. The dynamic network is formalized as G=(G (1)G (2) , ..., G (T) ), where T represents the number of snapshots of the dynamic network. For a snapshot G at time t (t) =(V (t) E (t) V (t) and E (t) G (t) The set of nodes and the set of edges.

[0125] Step 2: Obtain node embeddings. To map nodes to the latent space and effectively capture the complex relationships between nodes, a multi-layer graph convolutional network (GCN) is used as the encoder. The definition of the l-th layer GCN is as follows:

[0126]

[0127] in, and Let I and W represent the adjacency matrix and degree matrix of the input network, respectively. l H is a trainable weight matrix, and σ is a non-linear activation function (e.g., ReLU). For a snapshot at time t, the node embedding corresponding to the encoder output is represented by matrix H. (t) To further enhance the discriminability of node embeddings, a projection head is added after the GCN encoder to perform a nonlinear transformation on the embeddings, obtaining the node matrix P. (t) :

[0128] P (t) =f proj (H (t) ),

[0129] Among them, f proj (·) It consists of two multilayer perceptron (MLP) processors. Subsequently, by introducing a GRU, the historical information of the dynamic network is incorporated into the snapshot embedding representation, ultimately generating the node embedding representation Z for each snapshot. (t) The GRU is designed as follows:

[0130] R (t) =σ(W r [Z (t-1) P (t) ]),

[0131] Q (t) =σ(W u [Z (t-1) P (t) ]),

[0132]

[0133]

[0134] where 1 is an all-one matrix, [, ] denotes the concatenation operation, ⊙ denotes the Hadamard product, W r , W u , and W h are trainable weight matrices. In particular, Z (0) is initialized as a zero matrix.

[0135] Step 3: Detecting community member migration information. To identify the stable and unstable node sets in different snapshots, a community member migration detection mechanism is designed. The design motivation lies in analyzing the migration pattern of community member relationships over time. This migration information can serve as an additional supervision signal in contrastive learning, enhancing the model's ability to capture network dynamic behavior. First, the k-means clustering algorithm is applied to the node embeddings Z (t) and Z (t′) at two different time instants, respectively, to generate pseudo-labels of the community to which each node belongs. After one-hot encoding, community membership matrices F (t) and F (t′) are obtained. Subsequently, F (t) (F (t′) ) is multiplied by its transpose to generate the common community indicator matrix O (t) (O (t′) ). This matrix intuitively represents the community membership of a node pair in the same snapshot, where 1 indicates that the two nodes belong to the same community, and 0 indicates that they belong to different communities. Finally, the stable node matrix S t,t′ and the unstable node matrix U (t can be generated from the snapshots at time t and t', respectively, using the following formula: ,t′)

[0136] S (t,t′) = (O (t) ⊙O (t′) )-I,

[0137]

[0138] where denotes the element-wise XOR operation of matrices O (t) and O (t′) .

[0139] Step 4: Preserving the non-smoothness of local network structure. Community member migration behavior can cause mutations in the local network structure of snapshots, leading to non-smooth changes in node embeddings. To capture this non-smoothness, HSIC is further introduced to measure the dependence between two different snapshot embeddings Z (t) and Z (t′) :

[0140]

[0141] where tr(·) denotes the trace of a matrix, K and L are the embedding Z (t) and Z (t′) 's Gramian Matrix. M is a centering matrix, which is defined as N is the number of nodes in the current snapshot. By minimizing the HSIC, the embedding similarity between different snapshots can be constrained, preserving their respective uniqueness, thus preserving the local non-smooth information of the snapshots.

[0142] Step 5: Constructing the loss function. The loss function is mainly composed of two parts: contrastive learning loss and HSIC loss. Considering that the given dynamic graph is composed of multiple snapshots (regarded as different views), two forms of contrastive learning are designed: intra-view contrastive learning and inter-view contrastive learning. Intra-view contrastive learning focuses on nodes within a single snapshot, regarding the node and its direct neighbors as positive samples and non-neighbor nodes as negative samples. This strategy can enhance the cohesion of community structure. Inter-view contrastive learning focuses on stable and unstable nodes, which are identified through community member migration detection mechanisms in multiple snapshots. Specifically, given a node and its stable nodes are regarded as positive samples, and given a node and its unstable nodes are regarded as negative samples. Based on this, from the perspective of a given node i, the contrastive loss function of any two snapshots at time t and t' is defined as:

[0143]

[0144] where pos and neg are calculated as follows:

[0145]

[0146]

[0147] where is the temperature coefficient, used to control the concentration of the distribution, represents the set of all neighbor nodes of the ith node in the tth snapshot. To improve computational efficiency, a sliding window of size w is introduced to determine the number of snapshots for contrastive learning, and the total contrastive learning objective is designed as follows:

[0148]

[0149] In addition to the above contrastive learning loss, the HSIC loss designed earlier is combined to encourage the node embedding to preserve the local non-smoothness of the network structure:

[0150]

[0151] By combining and get the final loss function

[0152]

[0153] where α is a hyper-parameter to balance the contribution of .

[0154] Step 6: Train the graph convolutional network and obtain the dynamic community discovery result. Take as the objective function, set the sliding window w, the balance parameter α, the iteration number epochs, the number of graph convolutional network layers and the dimension of each layer, and the MLP dimension in the projection head. Update the parameters of the graph convolutional network iteratively, and obtain the final embedding of each snapshot node after the training loss converges. Then, clustering using k-means can determine the community to which any snapshot node belongs.

[0155] Compared with existing dynamic community discovery methods, the main advantage of the present method is that it can effectively mine and utilize the migration information of community members and use it as supervised information to guide the representation learning process of nodes. In addition, the introduction of the HSIC constraint effectively preserves the non-smoothness of the local network structure of snapshots caused by the migration of community members, further enhancing the embedding representation of nodes, thereby facilitating high-quality dynamic community discovery.

[0156] The implementation process will be further described below in conjunction with the accompanying drawings:

[0157] As shown in Figure 3 , in the present example, the number of snapshots is 3, the number of communities is 2, and the number of graph convolutional network layers is 2.

[0158] Step 1: Formally represent the dynamic network. Formally represent the dynamic network as G=(G (1) , G (2) , G (3) ). Where G (1) =(V (1) , E (1) ), G (2) =(V (2) , E (2) ), G (3) =(V (3) , E (3) ). The node set V (1) =V (2) =V (3) ={v1, v2, v3, v4, v5, v6, v7, v8}, and the edge set changes over time, which are E (1) ={e 14 , e 15 , e 23 , e25 , e 45 , e 47 , e 56 , e 67 , e 68 , e 78}, E (2) = {c 14 , e 23 , e 35 , e 36 , e 45 , e 57 , e 68 , e 78} and E (3) = {e 14 , e 15 , e 23 , e 36 , e 45 , e 56 , e 67 , e 68 , e 78}. Figure 4 is a dynamic network example, the topology of the graph changes over time.

[0159] Step 2: Get node embedding. Let the number of layers of the graph convolution network be l = 2, initialize the embedding H (0) = I, and get the node embedding matrix of G (t) based on the following function:

[0160]

[0161]

[0162] For the snapshot at time t, the node embedding output by the corresponding graph convolution network encoder is represented as matrix H (t) . Perform nonlinear transformation on H (t) to obtain node matrix P (t) :

[0163] P (t) = f proj (H (t) )

[0164] Finally, get the node embedding Z (1) , Z (2) and Z (3) of each snapshot through GRU:

[0165] R (t) = σ(W r [Z (t-1) , P (t) ]),

[0166] Q (t) = σ(W u ), (t-1) , P (t) ]),

[0167]

[0168]

[0169] Step 3: Detecting community member migration information. Utilize k-means algorithm on the derived node embedding and use one-hot encoding to get community membership matrix F (t) . Multiply F (t) (F (t′) ) with its transpose to get the common community indicator matrix O (t) (O (t′) ). Finally, we can get the stable node matrix S (t,t′) and unstable node matrix U (t,t′) :

[0170] S (t,t′) = (O (t) ⊙O (t′) ) - I,

[0171]

[0172] Step 4: Preserve the non-smoothness of local network structure. According to the derived node embedding, calculate the HSIC between different snapshots within the sliding window:

[0173]

[0174]

[0175] Step 5: Construct the loss function. From the perspective of a given node i, the contrastive loss function of any two snapshots at time t and t' is:

[0176]

[0177] Where pos and neg are calculated as follows:

[0178]

[0179]

[0180] The total contrastive learning loss is:

[0181]

[0182] In addition, the design of the HSIC loss is as follows:

[0183]

[0184] By combining and get the final loss

[0185]

[0186] Step 6: Train the graph convolution network and obtain the dynamic community discovery result. Set the number of iterations to 200 and the learning rate to 0.001. Train the graph convolution network to obtain the final representation Z of each snapshot (1) , Z (2) and Z (3) , and apply k-means clustering to obtain the dynamic community discovery result, where:

[0187] The stable matrix and unstable matrix of G (1) and G (2) are:

[0188]

[0189] The stable matrix and unstable matrix of G (2) and G (3) are:

[0190]

[0191] The node embedding Z (1) , Z (2) and Z (3) of the 3 snapshots are:

[0192]

[0193]

[0194]

[0195] Based on Z (1) , Z (2) and Z (3) , the community division results of each snapshot are obtained by k-means clustering: C1 (1) ={v1, v2, v3, v4, v5}, C2 (1) ={v6, v7, v8}, C1 (2) ={v1, v4, v5, v7}, C2 (2) ={v2, v3, v6, v8}, C1 (3) ={v1, v4, v5} and C2 (3) ={v2, v3, v6, v7, v8}.

[0196] As shown in Figure 5 Fig. 1, the method of the embodiment of the present application obtains the result of community discovery for the dynamic network example shown in Figure 4 Fig. 2, wherein different colors represent different communities.

[0197] Another aspect of the embodiment of the present application further provides a dynamic community discovery system based on member migration information contrast learning, comprising:

[0198] A first module is configured to formalize a dynamic network according to a number of snapshots of the dynamic network, wherein the dynamic network is used to determine a node set and an edge set;

[0199] A second module is configured to obtain node embedding according to the formalized representation of the dynamic network;

[0200] A third module is configured to detect community member migration information according to the node embedding;

[0201] A fourth module is configured to retain local network structure non-smoothness when detecting the community member migration information, so as to retain local non-smooth information of the snapshots;

[0202] A fifth module is configured to construct a contrast loss function training graph convolutional network for any two snapshots, and obtain a dynamic community discovery result according to the trained graph convolutional network.

[0203] It can be understood that the content in the above method embodiments is applicable to the present system embodiment, the present system embodiment specifically implements the same functions as the above method embodiments, and achieves the same beneficial effects as the above method embodiments.

[0204] The embodiment of the present application further provides an electronic device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the above dynamic community discovery method based on member migration information contrast learning when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.

[0205] It can be understood that the content in the above method embodiments is applicable to the present device embodiment, the present device embodiment specifically implements the same functions as the above method embodiments, and achieves the same beneficial effects as the above method embodiments.

[0206] Please refer to Figure 6 , Figure 6 Fig. 3 shows the hardware structure of the electronic device of another embodiment, which comprises:

[0207] The processor 601 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, and is configured to execute related programs to implement the technical solutions provided by the embodiments of the present application.

[0208] The memory 602 can be implemented by a ROM (Read Only Memory), a static storage device, a dynamic storage device, or a RAM (Random Access Memory), and the like. The memory 602 can store an operating system and other application programs. When the technical solutions provided by the embodiments of the present application are implemented by software or firmware, the related program codes are stored in the memory 602 and are called and executed by the processor 601 to implement the dynamic community discovery method based on member migration information comparison learning of the embodiments of the present application.

[0209] The input / output interface 603 is configured to realize information input and output.

[0210] The communication interface 604 is configured to realize the communication interaction between the device and other devices. The communication can be realized by a wired manner (for example, a USB, a network cable, or the like) or a wireless manner (for example, a mobile network, WI FI, Bluetooth, or the like).

[0211] The bus 605 is configured to transmit information between various components (for example, the processor 601, the memory 602, the input / output interface 603, and the communication interface 604) of the device.

[0212] The processor 601, the memory 602, the input / output interface 603, and the communication interface 604 are connected to each other through the bus 605 to realize the communication connection between the device.

[0213] The embodiments of the present application further provide a computer readable storage medium, which stores a computer program. The computer program is executed by a processor to implement the above-mentioned dynamic community discovery method based on member migration information comparison learning.

[0214] It can be understood that the contents in the above-mentioned method embodiments are all applicable to the present storage medium embodiments. The present storage medium embodiments specifically implement the same functions as the above-mentioned method embodiments, and achieve the same beneficial effects as the above-mentioned method embodiments.

[0215] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory can include high-speed random access memory and can also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include memory that is remotely arranged with respect to the processor, and these remote memories can be connected to the processor through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0216] It should be noted that in various specific embodiments of the present application, when it is necessary to perform relevant processing according to user information, user behavior data, user history data, and user location information and other data related to the identity or characteristics of the user, the user's permission or consent will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiments of the present application need to obtain sensitive personal information of the user, the separate permission or separate consent of the user will be obtained through a pop-up window or by jumping to a confirmation page, and after obtaining the separate permission or separate consent of the user, the necessary user-related data for enabling the embodiments of the present application to normally operate will be obtained.

[0217] The embodiments described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

[0218] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and can include more or fewer steps than those shown in the figures, or combine certain steps or different steps.

[0219] The device embodiments described above are only schematic, and the units described as separate components can or can not be physically separate, that is, they can be located in one place or distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present application.

[0220] Those skilled in the art can understand that all or some of the steps in the above disclosed method, the functions of the modules / units in the system and the device can be implemented as software, firmware, hardware and their appropriate combinations.

[0221] The terms "first", "second", "third", "fourth", and the like in the description and in the claims of this application, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of the terms so termed is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of efficient implementation irrespective of the terms of relative order employed, if any. Moreover, the terms "comprise", "have" and any variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises, has or includes a list of elements is not necessarily limited to those elements, but can include other elements not expressly listed or inherent to such process, method, article, or apparatus.

[0222] It should be understood that, in the application, "at least one" means one or more, and "multiple" means two or more. "And / or" is used to describe the relationship between associated objects, which means that there can be three relationships, for example, "A and / or B" can mean that there are three cases: only A, only B, and A and B at the same time, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c can mean a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be singular or plural.

[0223] In several embodiments provided by the application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the above-mentioned units is only a logical function division, and actual implementation can have another division manner, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed objects can be indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0224] The units described above as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e. they can be located in one place or distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment of the application.

[0225] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.

[0226] If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes multiple instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods in each embodiment of the present application. The foregoing storage medium includes various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0227] The preferred embodiments of the embodiments of the present application are described above with reference to the accompanying drawings, and are not limited to the scope of the embodiments of the present application. Any modification, equivalent replacement and improvement made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of the embodiments of the present application.

Claims

1. A dynamic community discovery method based on member migration information contrastive learning, characterized in that, The method comprises the following steps: According to the number of snapshots of the dynamic network, the dynamic network is formally represented, which is used to determine a node set and an edge set; According to the formal representation of the dynamic network, node embeddings are obtained; each node is used to represent a community member in an online social network, and the node embeddings are used to represent the community members joining the online social network; According to the node embeddings, community member migration information is detected; the community member migration information is used to represent the mutual association state between each community member and the community membership between community members; When detecting the community member migration information, the non-smoothness of the local network structure is preserved to preserve the local non-smooth information of the snapshots; A contrast loss function of any two snapshots is constructed to train a graph convolutional network, and a dynamic community discovery result is obtained according to the trained graph convolutional network; the dynamic community discovery result is used to generate a dynamic network analysis result, and the dynamic network analysis result is used to generate an analysis result of the online social network; When detecting the community member migration information, the non-smoothness of the local network structure is preserved, comprising the following steps: HSIC is introduced to measure the dependency between two different snapshot embeddings Z (t) and Z (t′) , whose expression is: where tr(·) denotes the trace of a matrix, K and L are the Gramian matrices of the embeddings Z (t) and Z (t′) ; M is a centering matrix, which is defined as N is the number of nodes in the current snapshot; Z (t) represents the node embedding representation of snapshot t; Z (t′) represents the node embedding representation of snapshot t'. By minimizing the HSIC, the embedding similarity between different snapshots is constrained to preserve their uniqueness.

2. The dynamic community discovery method based on member migration information contrastive learning of claim 1, characterized in that, According to the number of snapshots of the dynamic network, the dynamic network is formally represented, specifically: The dynamic network G (t) is formally represented as G = (G (1) , G (2) ,..., G (T) ), where T denotes the number of snapshots of the dynamic network. For a snapshot G of time t (t) = (V (t) , E (t) ), V (t) and E (t) denote the set of nodes and edges of G (t) , respectively.

3. The dynamic community discovery method based on member migration information contrastive learning of claim 1, characterized in that, According to the formal representation of the dynamic network, the node embeddings are obtained, comprising the following steps: A multi-layer graph convolutional network GCN is used as an encoder, wherein the definition of the lth layer GCN is as follows: wherein, and denote the adjacency matrix and degree matrix of the input network, respectively, I is the identity matrix, W l is a trainable weight matrix, and σ is a non-linear activation function; for a snapshot at time t, the node embeddings corresponding to the encoder output are denoted by the matrix H (t) ; A projection head is added after the GCN encoder to nonlinearly transform the embedding to obtain a node matrix P (t) : P (t) = f proj (H (t) ) where f proj (·) consists of two multi-layer perceptrons (MLPs). The introduction of GRU fuses the historical information of dynamic networks into the snapshot's embedding representation, generating the node embedding representation Z for each snapshot (t) The design of GRU is that: R (t) = σ(W r [Z (t-1) ,P (t) ]), Q (t) = σ(W u [Z (t-1) ,P (t) ]), where 1 is an all-one matrix, [,,] denotes the concatenation operation, denotes the Hadamard product, W r , W u , and W h are trainable weight matrices; Z (0) is initialized as a zero matrix; R (t) represents a reset gate, which is used to control the contribution of the historical snapshot information to the current candidate hidden state; Q (t) is an update gate, which is used to balance the influence degree of the candidate hidden state at the current moment and the historical snapshot information; is the candidate hidden state, which combines the adjustment results of the current snapshot information and the historical snapshot information, and represents the potential state at the current moment.

4. The dynamic community discovery method based on member migration information contrastive learning of claim 1, characterized in that, According to the node embeddings, the community member migration information is detected, comprising the following steps: Z for two snapshots at different time points (t) and Z (t′) Apply k-means clustering algorithm respectively to generate pseudo labels of each node belonging to community; After one-hot encoding, the community membership matrix F is obtained (t) and F (t′) ; F (t) is multiplied by its transpose to generate a common community indicator matrix O (t) ; F (t′) is multiplied by its transpose to generate a common community indicator matrix O (t′) ; the common community indicator matrix is used to represent the community membership of a node pair in the same snapshot; The stable node matrix S and unstable node matrix U are generated from the snapshots at times t and t' respectively by the following equations (t,t′) and (t,t′) : S (t,t′) = (O (t) ☉O (t′) -I, wherein denotes the matrix O (t) and O (t′) element-wise XOR operation; I denotes the identity matrix.

5. The dynamic community discovery method based on member migration information contrastive learning of claim 1, characterized in that, The contrast loss function of any two snapshots is constructed, comprising the following steps: A contrast learning loss and a HSIC loss are constructed; For the contrast learning loss, in-view contrast learning and inter-view contrast learning are designed; the in-view contrast learning focuses on the nodes in a single snapshot, and the nodes and their direct neighbors are regarded as positive samples, and the non-neighbor nodes are regarded as negative samples; the inter-view contrast learning focuses on stable nodes and unstable nodes, which are identified through a community member migration detection mechanism in multiple snapshots; The given node and its stable nodes are regarded as positive samples, and the given node and its unstable nodes are regarded as negative samples. Based on this, from the perspective of the given node i, the comparison loss function of any two snapshots at time t and t' is defined as: Wherein, pos and neg are calculated by the following methods: where τ is the temperature coefficient to control the degree of concentration, represents all neighbors of the ith node in the tth snapshot; pos and neg represent the similarity measures of the given node i with its positive and negative samples, respectively; and represent whether node i and node j are stable or unstable nodes to each other at time t and t', respectively; is a similarity measure to measure the similarity between different node embeddings; A sliding window with a size of w is introduced to determine the number of snapshots for contrast learning, and the total contrast learning target is designed as follows: The final loss function is obtained according to the contrast learning loss and the HSIC loss.

6. The dynamic community discovery method based on member migration information contrastive learning of claim 1, characterized in that, The graph convolutional network is trained, and a dynamic community discovery result is obtained according to the trained graph convolutional network, comprising the following steps: The final loss function is used as the objective function, and the sliding window, the balance parameter, the iteration number, the number of layers of the graph convolutional network and the dimensions of each layer, and the MLP dimension in the projection head are set; The graph convolutional network parameters are iteratively updated, and the final embedding of each snapshot node is obtained after the training loss converges; The k-means is used for clustering to determine the community where any snapshot node is located.

7. A system for implementing the dynamic community discovery method based on member migration information contrastive learning according to any one of claims 1-6, characterized in that, It comprises: A first module is used to formally represent a dynamic network according to the number of snapshots of the dynamic network, which is used to determine a node set and an edge set; A second module is used to obtain node embeddings according to the formal representation of the dynamic network; The third module is configured to detect community member migration information according to the node embedding. The fourth module is configured to retain the non-smoothness of the local network structure when detecting the community member migration information, so as to retain the local non-smooth information of the snapshot. The fifth module is configured to construct a comparison loss function training graph convolutional network of any two snapshots, and obtain a dynamic community discovery result according to the trained graph convolutional network.

8. An electronic device, comprising: The processor and the memory are included. The memory is configured to store a program. The processor executes the program to implement the method in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The storage medium stores a program, and the program is executed by the processor to implement the method in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Dynamic social user alignment method based on GCN

    CN112487305A

  • Media content recommendation method, system and equipment based on dynamic network representation learning

    CN117312651A