Contrastive learning based dynamic temporal network clustering method and device

By using a variational autoencoder based on contrastive learning for deep feature extraction and cluster analysis, the problem of traditional methods being unable to effectively extract features in dynamic temporal networks is solved, and more efficient clustering results are achieved.

CN117763386BActive Publication Date: 2025-10-24XIDIAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311789425.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-22
Publication Date
2025-10-24
Estimated Expiration
2043-12-22

AI Technical Summary

Technical Problem

In existing technologies, traditional deep feature extraction methods are usually applied to static networks without considering the changes in dynamic temporal networks. This results in the inability to effectively extract the main features of dynamic temporal networks, affecting the effectiveness of cluster analysis.

Method used

A variational autoencoder based on contrastive learning is used for deep feature extraction. The parameters of the variational autoencoder are adjusted using a loss function set by contrastive learning, and clustering analysis is performed on the dimensionality-reduced features using a clustering method.

Benefits of technology

Effective extraction of the nonlinear features of dynamic temporal networks enables better cluster analysis, taking into account the changes in dynamic temporal networks and improving cluster accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117763386B_ABST
    Figure CN117763386B_ABST
Patent Text Reader

Abstract

The application relates to a dynamic time sequence network clustering method and device based on contrast learning, electronic equipment and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: obtaining to-be-processed data; inputting the to-be-processed data into a pre-trained variational autoencoder to obtain dimension-reduced features corresponding to the to-be-processed data; wherein the pre-trained variational autoencoder is obtained according to a training method based on contrast learning; the training method based on contrast learning adjusts parameters of the variational autoencoder by using a loss function set based on contrast learning; and a clustering method is used for clustering analysis of the dimension-reduced features corresponding to the to-be-processed data. The pre-trained variational autoencoder is used for dimension reduction processing of the to-be-processed data, and then clustering analysis is performed. A variational autoencoder capable of considering changes in a dynamic time sequence network is proposed, the variational autoencoder can perform dimension reduction processing on data, effectively extract main features of the dynamic time sequence network, and perform clustering analysis.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of computers, and particularly relates to a dynamic time series network clustering method and device based on contrast learning, an electronic device, and a storage medium. BACKGROUND

[0002] Networks are ubiquitous in nature and human society, especially in today's rapidly developing technology. Networks can be analogized to graphs, where individuals and their relationships in the network can be compared to vertices and edges in the graph. In the past decade, with the rise of big data and cloud computing, there have been major changes and developments in the field of time series clustering. Improving the efficiency, quality, and complexity of time series clustering methods has become a major trend. In time series networks, due to high dimensionality and large amounts of data, it is crucial to reduce the dimensionality of the network representation. Clustering the embedded network to achieve the best representation of the original data is an important goal. Solving these problems can effectively address the challenges posed by emerging time series network application areas such as finance, medicine, and weather. In time series network clustering methods, one important problem is community detection, which classifies vertices into tight groups with more internal edges and fewer external edges. The community detection problem corresponds to the graph clustering problem.

[0003] However, most algorithms perform community detection in static networks, ignoring the temporal nature of the network. Compared to static networks, the analysis of dynamic time series networks is much more complex, and traditional deep feature extraction methods in the prior art are typically applied to static networks without considering changes in dynamic time series networks, which results in the inability to effectively extract the main features of dynamic time networks, affecting the effectiveness of clustering analysis. SUMMARY

[0004] To solve the above problems existing in the prior art, the present application provides a dynamic time series network clustering method and device based on contrast learning, an electronic device, and a storage medium.

[0005] According to a first aspect of an embodiment of the present application, a dynamic time series network clustering method based on contrast learning is provided, the method comprising:

[0006] Obtaining data to be processed;

[0007] Inputting the data to be processed into a pre-trained variational autoencoder to obtain a dimension-reduced feature corresponding to the data to be processed; wherein the pre-trained variational autoencoder is obtained according to a training method based on contrast learning; the training method based on contrast learning adjusts the parameters of the variational autoencoder using a loss function set based on contrast learning;

[0008] Performing clustering analysis on the dimension-reduced feature corresponding to the data to be processed using a clustering method.

[0009] Optionally, before the inputting the to-be-processed data into the pre-trained variational autoencoder to obtain the dimension-reduced features corresponding to the to-be-processed data, the method further comprises:

[0010] obtaining a sample data set;

[0011] training an initial variational autoencoder according to the sample data set;

[0012] determining whether the initial variational autoencoder trained in the current training round reaches a convergence condition according to the sample data set and a set loss function.

[0013] Optionally, the method further comprises:

[0014] when the convergence condition is not reached, adjusting parameters in the initial variational autoencoder and training again according to the sample data set;

[0015] when the convergence condition is reached, taking the initial variational autoencoder trained in the current training round as the pre-trained variational autoencoder; or,

[0016] when the training round reaches an upper limit of training rounds, taking the initial variational autoencoder trained in the current training round as the pre-trained variational autoencoder.

[0017] Optionally, the set loss function L all is as follows:

[0018]

[0019] wherein, W t represents original data, represents reconstructed data obtained after the original data W t passes through the variational autoencoder, represents a reconstruction error between the original data W t and the reconstructed data , q φ (z|x (i) ) represents a probability distribution of a latent variable z output by the variational autoencoder based on input data x, i represents a time point, D KL (q φ (z|x (i) )||p(z)) represents a difference between q φ (z|x (i) ) output by the variational autoencoder and a preset p(z), L q is a loss function set based on contrastive learning.

[0020] Optionally, the loss function L set based on the contrastive learning q As shown below:

[0021]

[0022] wherein q is a preset query vector, k + represents a positive sample matched with the query vector q, tau is a temperature parameter, K is a sample vector set, k n is a key vector, the key vector k n contains a positive sample k + and a plurality of negative samples that do not match the query vector q.

[0023] Optionally, the dynamic time sequence network includes a plurality of nodes; the positive sample represents a node in the same cluster of static nodes in the dynamic time sequence network at the current time and the previous time; and the negative sample represents a node in different clusters of static nodes in the dynamic time sequence network at the current time and the previous time.

[0024] Optionally, the method further includes:

[0025] obtaining the reconstructed data corresponding to the original data by using a pre-trained variational autoencoder;

[0026] calculating a plurality of similarities between nodes of the original data at the current time and the reconstructed data at the previous time;

[0027] sorting the plurality of similarities in a certain order, and selecting a certain number of nodes corresponding to the plurality of similarities as static nodes; or,

[0028] selecting nodes corresponding to a plurality of similarities greater than a set threshold value in the plurality of similarities as the static nodes.

[0029] According to a second aspect of an embodiment of the present application, a dynamic time sequence network clustering device based on contrastive learning is provided, and the device includes:

[0030] a data acquisition module configured to acquire to-be-processed data;

[0031] a feature acquisition module configured to input the to-be-processed data into a pre-trained variational autoencoder to obtain reduced dimension features corresponding to the to-be-processed data; wherein the pre-trained variational autoencoder is obtained according to a training method based on contrastive learning; and the training method based on contrastive learning adjusts parameters of the variational autoencoder by using a loss function set based on contrastive learning;

[0032] a clustering analysis module configured to perform clustering analysis on the reduced dimension features corresponding to the to-be-processed data by using a clustering method.

[0033] According to a third aspect of the embodiments of the present disclosure, a dynamic time series network clustering device based on contrastive learning is provided, comprising: a processor; a memory for storing processor-executable instructions;

[0034] The processor is configured to execute the executable instructions to implement the steps of the dynamic time series network clustering method based on contrastive learning according to any of the embodiments of the first aspect.

[0035] According to a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, which stores computer program instructions, and the program instructions are executed by a processor to implement the steps of the dynamic time series network clustering method based on contrastive learning according to the first aspect of the present disclosure.

[0036] The technical solutions provided by the embodiments of the present disclosure can include the following beneficial effects:

[0037] In the above technical solution, the data to be processed is obtained; the data to be processed is input into a pre-trained variational autoencoder to obtain the dimension-reduced features corresponding to the data to be processed; wherein the pre-trained variational autoencoder is obtained according to a training method based on contrastive learning; the training method based on contrastive learning adjusts the parameters of the variational autoencoder by using a loss function based on contrastive learning; and a clustering method is used to analyze the dimension-reduced features corresponding to the data to be processed. Through the above technical solution, the data to be processed is dimension-reduced by using the pre-trained variational autoencoder, and then clustering analysis is performed. A variational autoencoder that can consider changes in dynamic time series networks is proposed, which can dimension-reduce data and effectively extract main features of dynamic time series networks for clustering analysis. BRIEF DESCRIPTION OF DRAWINGS

[0038] Figure 1 is a flowchart of a dynamic time series network clustering method based on contrastive learning according to an example embodiment.

[0039] Figure 2 is a flowchart of another dynamic time series network clustering method based on contrastive learning according to an example embodiment.

[0040] Figure 3 is a block diagram of a dynamic time series network clustering device based on contrastive learning according to an example embodiment.

[0041] Figure 4 is a block diagram of an electronic device for dynamic time series network clustering based on contrastive learning according to an example embodiment. DETAILED DESCRIPTION

[0042] For the convenience of understanding the scheme of the present application, first, the related circumstances of the prior art and the inventive concept of the present application are briefly described.

[0043] In the prior art, many algorithms have been developed for the processing of dynamic temporal networks, which can be broadly divided into three categories: coupling graph-based methods, two-stage methods, and time-smoothness-based methods.

[0044] 1. The coupling graph-based method converts the dynamic temporal network into a static network, and then applies a graph clustering algorithm, ignoring the clustering drift. The clustering drift quantifies the difference between the current snapshot and the historical snapshot. Therefore, the coupling graph-based method is criticized for destroying the structure of the dynamic temporal network.

[0045] 2. To solve the above problem, the two-stage method first extracts the dynamic temporal network from each snapshot as a static network independently, and then matches them to track the evolution. However, their clustering accuracy and independence of drift often result in lower accuracy of the two-stage method. Despite significant efforts, there are still some unresolved challenges.

[0046] 3. Many current time-smoothness-based methods mainly rely on traditional feature extraction methods, however, these traditional feature extraction methods can only capture linear features, which cannot well reflect the original data. While deep feature extraction methods are more robust and can better capture complex and nonlinear features in dynamic temporal networks. However, traditional deep feature extraction methods are usually applied to static networks without considering community changes in dynamic temporal networks, which leads to ineffective extraction of main features of dynamic temporal networks. In addition, traditional dynamic temporal networks are mainly described from the feature level, ignoring the information at the node level.

[0047] Therefore, the present application proposes a dynamic temporal network clustering method based on contrast learning to solve this technical problem.

[0048] Figure 1 is a flow chart of a dynamic temporal network clustering method based on contrast learning according to an exemplary embodiment, as Figure 1 shown, the method comprises the following steps.

[0049] In S101, the data to be processed is obtained.

[0050] It can be understood that the to-be-processed data includes a plurality of adjacency matrices of moments, and the dynamic temporal network is aggregated by a plurality of networks of moments. The adjacency matrix is used to represent the change of the connection relationship between nodes over time. It is a two-dimensional matrix, in which the rows and columns represent the nodes in the network, and the elements in the matrix represent the connection state between the nodes. In the dynamic temporal network, the size of the adjacency matrix is usually N x N, where N is the number of nodes in the network. The adjacency matrix of each moment describes the connection between the nodes at that moment. The elements in the matrix can be binary values (0 or 1) or weight values, depending on the definition of the network and the application scenario. For dynamic nodes, their connection state may change over time, so the connection relationship between the corresponding nodes in the adjacency matrix will be different at different moments. By recording these changes, the dynamic temporal network can be analyzed and modeled to obtain information such as the relationship between nodes, behavior patterns, etc.

[0051] It is worth mentioning that the dynamic temporal network is a special type of network in which the structure of the network and the relationship between nodes change over time. For example, in a social network, nodes usually represent users, and the friendship or interaction between users forms an edge, and the specific behavior will change according to the problem to be solved in the social network. It is usually divided into time windows, such as a day or a week, etc. Each time window corresponds to a snapshot of the network, and each snapshot is an independent network graph. Each snapshot of each time window can construct an adjacency matrix, in which the elements of the adjacency matrix represent whether there is an edge between the nodes. In general, the dynamic temporal network represents the dynamic change process through the time window in the network graph at each moment. Then, each network graph is constructed into a corresponding adjacency matrix, which takes the relationship between nodes as the elements of the adjacency matrix.

[0052] In S102, the to-be-processed data is input into the pre-trained variational autoencoder to obtain the dimension-reduced features corresponding to the to-be-processed data; wherein the pre-trained variational autoencoder is obtained according to a training method based on contrastive learning; the training method based on contrastive learning adjusts the parameters of the variational autoencoder by using a loss function set based on contrastive learning.

[0053] It can be understood that, since the non-linear feature can better describe the complexity of the dynamic time series network, in order to extract the non-linear feature of the to-be-processed data, the application introduces a self-encoder for deep feature extraction. In particular, the application uses a variational auto-encoder (VAE) for deep feature extraction, which is a generative model that learns the latent representation of data. Unlike traditional auto-encoders, variational auto-encoders do not aim to learn a perfect copy of the data, but rather describe the data through a probability distribution. In order to let the variational auto-encoder learn the latent representation of the data, it needs to maximize the likelihood of the data, which is equivalent to minimizing the reconstruction error between the original data and the reconstructed data. It is worth mentioning that the pre-trained variational auto-encoder includes an encoder and a decoder, and the pre-trained encoder is used to obtain the dimension-reduced feature corresponding to the to-be-processed data. Specifically, the to-be-processed data is input into the pre-trained encoder, and the pre-trained encoder outputs the dimension-reduced feature corresponding to the to-be-processed data. Moreover, the loss function based on the contrast learning is used to continuously adjust the parameters of the variational auto-encoder to train the variational auto-encoder to the required degree.

[0054] In S103, the dimension-reduced feature corresponding to the to-be-processed data is analyzed by using a clustering method.

[0055] It can be understood that, since the to-be-processed data is usually high-dimensional data, in order to improve the efficiency of the clustering method during clustering analysis, a pre-trained variational auto-encoder can be used for dimension reduction. After the to-be-processed data is input into the pre-trained variational auto-encoder, the dimension-reduced feature corresponding to the to-be-processed data is obtained, which can be used for clustering analysis. The method used in clustering analysis can be a clustering algorithm such as K-Means clustering algorithm.

[0056] In the above technical solution, the to-be-processed data is obtained; the to-be-processed data is input into a pre-trained variational auto-encoder to obtain a dimension-reduced feature corresponding to the to-be-processed data; wherein the pre-trained variational auto-encoder is obtained according to a training method based on contrast learning; the training method based on contrast learning adjusts the parameters of the variational auto-encoder using a loss function based on contrast learning; and a clustering method is used to analyze the dimension-reduced feature corresponding to the to-be-processed data. Through the above technical solution, the pre-trained variational auto-encoder is used to perform dimension reduction on the to-be-processed data, and then clustering analysis is performed. A variational auto-encoder that can consider changes in the dynamic time series network is proposed, which can perform dimension reduction on data and effectively extract the main features of the dynamic time series network for clustering analysis.

[0057] Optionally, before S102, the dynamic time series network clustering method based on contrastive learning can further include:

[0058] a. obtaining a sample data set.

[0059] b. training an initial variational autoencoder according to the sample data set.

[0060] c. determining whether the initial variational autoencoder trained in the current training round reaches a convergence condition according to the sample data set and a set loss function.

[0061] Optionally, the dynamic time series network clustering method based on contrastive learning can further include:

[0062] d. when the convergence condition is not reached, adjusting the parameters in the initial variational autoencoder and training again according to the sample data set;

[0063] e. when the convergence condition is reached, taking the initial variational autoencoder trained in the current training round as a pre-trained variational autoencoder; or,

[0064] f. when the training round reaches an upper limit of the training round, taking the initial variational autoencoder trained in the current training round as a pre-trained variational autoencoder.

[0065] It can be understood that steps a to f are the process of training the initial variational autoencoder and adjusting it with the set loss function until the pre-trained variational autoencoder is obtained. The sample data set, like the data to be processed, also includes a plurality of adjacent matrices at different time points, so the initial variational autoencoder can also be directly trained with the data to be processed. The variational encoder includes an encoder and a decoder, wherein the sample data set is input into the encoder to output the reduced dimension features, and the reduced dimension features corresponding to the sample data set are input into the decoder to obtain the reconstructed data set. The initial variational autoencoder is iteratively trained with the sample data set. In each iteration, the loss value of the current training round is calculated using the loss function, the sample data set and the reconstructed data set, and the variational autoencoder of the current training round is adjusted according to the loss value, until the variational autoencoder of the current training round is taken as the pre-trained variational autoencoder when the convergence condition is reached. The convergence condition can be that the loss value of the current training round is less than a set threshold or the training round reaches a maximum iteration number.

[0066] It is worth mentioning that the set loss function used in training the initial variational autoencoder in the present application combines the method of contrastive learning.

[0067] Optionally, the set loss function L all is as follows:

[0068]

[0069] wherein W t represents the original data, represents the original data W t reconstruction data obtained after the variational autoencoder, represents the original data W t and the reconstruction data , q φ (z|x (i) ) represents a probability distribution of the latent variable z output by the variational autoencoder based on the input data x, i represents a time point, D KL (q φ (z|x (i) )||p(z)) represents a difference between the q φ (z|x (i) ) output by the variational autoencoder and a preset p(z), L q is a loss function set based on contrast learning. It is worth mentioning that the KL divergence term D KL (q φ (z|x (i) )||p(z)) plays a role of a regularization term, which can help the probability distribution learned by the variational autoencoder not deviate too far from the predefined distribution, wherein the predefined distribution can adopt a standard Gaussian distribution or the like.

[0070] Optionally, the loss function L q set based on contrast learning is as follows:

[0071]

[0072] wherein q is a preset query vector, k + represents a positive sample matched with the query vector q, τ is a temperature parameter, K is a sample vector set, k n is a key vector, the key vector k n contains one positive sample k + and multiple negative samples that do not match the query vector q. The temperature parameter τ is used to control the smoothness of the activation function. A smaller τ will make the output distribution more sharp, so that the output distribution is more concentrated on certain samples, while a larger τ will make the output distribution more smooth, so that the output distribution is more dispersed.

[0073] Optionally, the dynamic time sequence network includes multiple nodes; the positive sample represents a node in the dynamic time sequence network at the current time point and the last time point that is in the same cluster as a static node; and the negative sample represents a node in the dynamic time sequence network at the current time point and the last time point that is in a different cluster from the static node.

[0074] Optionally, Figure 2is a flowchart of still another contrastive learning based dynamic temporal network clustering method according to an exemplary embodiment, as shown in Figure 2 The contrastive learning based dynamic temporal network clustering method can further include:

[0075] In S104, the pre-trained variational autoencoder is used to obtain the reconstructed data corresponding to the original data.

[0076] In S105, a plurality of similarities between the nodes of the original data at the current time and the reconstructed data at the previous time are calculated.

[0077] In S106, the plurality of similarities are sorted in a certain order, and a certain number of nodes corresponding to the plurality of similarities are selected as static nodes.

[0078] Or,

[0079] In S107, the nodes corresponding to the plurality of similarities greater than the set threshold value in the plurality of similarities are selected as static nodes.

[0080] It can be understood that, since the idea of clustering is to pull the nodes in the same cluster closer and pull the nodes in different clusters farther apart, in contrast learning, the positive and negative sample pairs are used to make the samples closer to the positive samples and farther away from the negative samples. Therefore, the static nodes are integrated into the clustering analysis in the present application. In the dynamic temporal network, the clusters to which the nodes in the adjacent time network belong can change. The nodes that change are dynamic nodes, and vice versa, the nodes that do not change are static nodes. Therefore, in the present application, the characteristics of dynamic nodes and static nodes are used, and the static nodes in the network at the previous time are considered as positive samples at the current time, and the static nodes in the network at the previous time are considered as negative samples at the current time. Therefore, the loss function L q based on contrastive learning can be obtained. n .

[0081] It is worth mentioning that the pre-set query vector q represents the process of obtaining positive samples and negative samples, that is, by obtaining static nodes, positive samples are obtained according to the static nodes in the network at the previous time and the nodes in the same cluster thereof, and negative samples are obtained according to the static nodes in the network at the previous time and the nodes in different clusters thereof.

[0082] It is worth mentioning that the role of the static node can be characterized by the above content, and S104 to S107 are steps of obtaining the static node. The original data is input into the pre-trained variational autoencoder to obtain the dimensionality reduction features corresponding to the original data, and then the reconstructed data corresponding to the original data is obtained. The cosine similarity, Pearson correlation coefficient and other similarity calculation methods can be used to obtain multiple similarities of the node between the reconstructed data at the previous moment and the original data at the current moment. It can be understood that the higher the similarity, the more similar the node between the reconstructed data at the previous moment and the original data at the current moment. Therefore, the similarities are sorted in a certain order, for example, the multiple similarities are sorted from large to small or from small to large, and a certain number of nodes corresponding to the multiple similarities are selected as the static nodes. For example, after sorting the multiple similarities from large to small, a certain number of nodes with large similarities are selected as the static nodes. The nodes corresponding to the similarities greater than a set threshold can also be selected as the static nodes, for example, the threshold is set to 0.8, and the nodes corresponding to the similarities greater than 0.8 are selected as the static nodes.

[0083] Through the above technical solution, the variational autoencoder is used to extract nonlinear features. Compared with the traditional matrix decomposition method, the redundant information deviating from the clustering result has a good filtering effect, and the complexity of describing the dynamic time series network has a better effect. The feature level is refined to the node level, thereby containing more information to represent the dynamic time series network. When training the initial variational autoencoder, the loss function based on the contrast learning setting is introduced, so that the pre-trained variational autoencoder enhances the influence of dynamic and static nodes on clustering analysis.

[0084] Figure 3 is a block diagram of a dynamic time series network clustering device based on contrast learning according to an example embodiment. Referring to Figure 3 The dynamic time series network clustering device 300 based on contrast learning can include.

[0085] The data acquisition module 301 is configured to acquire the to-be-processed data.

[0086] The feature acquisition module 302 is configured to input the to-be-processed data into a pre-trained variational autoencoder to obtain dimensionality reduction features corresponding to the to-be-processed data. The pre-trained variational autoencoder is obtained according to a training method based on contrast learning. The training method based on contrast learning adjusts the parameters of the variational autoencoder by using a loss function based on contrast learning setting.

[0087] The clustering analysis module 303 is configured to perform clustering analysis on the dimensionality reduction features corresponding to the to-be-processed data by using a clustering method.

[0088] In the technical solution, the data to be processed is obtained, and the data to be processed is input into a pre-trained variational autoencoder to obtain the dimension-reduced features corresponding to the data to be processed. The pre-trained variational autoencoder is obtained according to a training method based on contrast learning. The training method based on contrast learning adjusts the parameters of the variational autoencoder by using a loss function based on contrast learning. The dimension-reduced features corresponding to the data to be processed are analyzed by using a clustering method. Through the technical solution, the data to be processed is processed by dimension reduction by using the pre-trained variational autoencoder, and then is analyzed by clustering. A variational autoencoder considering changes in a dynamic time series network is proposed, which can process the data by dimension reduction and effectively extract main features of the dynamic time series network for clustering analysis.

[0089] For specific processing procedures of each module of the device, please refer to the related content of the first aspect, which will not be repeated here.

[0090] Figure 4 is a block diagram of an electronic device for a dynamic time series network clustering method based on contrast learning according to an exemplary embodiment, as shown in Figure 4 The processor 401, the communication interface 402, and the memory 403 can communicate with each other through the communication bus 404.

[0091] The memory is used to store computer programs.

[0092] The processor is used to execute the programs stored on the memory to implement any of the steps of the dynamic time series network clustering method based on contrast learning described in the embodiments of the application.

[0093] The communication bus mentioned in the above electronic device can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.

[0094] The communication interface is used for communication between the above electronic device and other devices.

[0095] The memory can include a random access memory (RAM) and can also include a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.

[0096] The processor described above can be a general processor, including a central processing unit (CPU), a network processor (NP), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0097] The method provided by the embodiment of the application can be applied to an electronic device. Specifically, the electronic device can be a desktop computer, a portable computer, a smart mobile terminal, a server, etc. Herein, no limitation is made, and any electronic device that can implement the application belongs to the protection scope of the application.

[0098] In another exemplary embodiment, the embodiment of the application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement any step of the dynamic time series network clustering method based on contrast learning described above.

[0099] For the device / electronic device / storage medium embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the related parts refer to the part of the method embodiment.

[0100] It should be noted that the device, electronic device and storage medium of the embodiment of the application are respectively the device, electronic device and storage medium applying the dynamic time series network clustering method based on contrast learning described above, and all the embodiments of the dynamic time series network clustering method based on contrast learning are applicable to the device, electronic device and storage medium, and can achieve the same or similar beneficial effects.

[0101] It can be understood that, in the present application, "multiple" refers to two or more, and other quantifiers are similar. The "and / or" describes the association between the associated objects, which means that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist together, and B exists alone. The character " / " generally represents that the associated objects before and after it are in an "or" relationship. The singular forms "a", "said" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise.

[0102] It can be further understood that the terms "first", "second" and the like are used to describe various information, but these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other, and do not indicate a particular order or importance. In fact, the expressions "first", "second" and the like can be used interchangeably.

[0103] It can be further understood that, although the operations are described in a specific order in the drawings in the embodiments of the present application, it should not be understood as requiring the operations to be performed in the specific order or in a serial order, or requiring all the shown operations to be performed to obtain the desired results. In a specific environment, multi-tasking and parallel processing can be advantageous.

[0104] It should be noted that all actions of obtaining signals, information or data in the present application are performed in accordance with the corresponding data protection regulations and policies of the country where the device is located, and with the authorization of the owner of the corresponding device.

[0105] The above only describes the preferred embodiments of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application is included in the protection scope of the present application.

Claims

1. A dynamic temporal network clustering method based on contrastive learning, characterized in that, The method comprises: acquiring to-be-processed data; wherein the to-be-processed data comprises adjacency matrices of multiple time points of a social network; the social network is a dynamic time series network; nodes in the social network represent users, and edges in the social network represent friend relationships or interactions between users; the adjacency matrices are constructed according to the nodes and edges in the social network; inputting the to-be-processed data into a pre-trained variational autoencoder to obtain reduced dimension features corresponding to the to-be-processed data; wherein the pre-trained variational autoencoder is obtained according to a training method based on contrastive learning; the training method based on contrastive learning adjusts parameters of the variational autoencoder by using a loss function set based on contrastive learning; performing cluster analysis on the reduced dimension features corresponding to the to-be-processed data by using a clustering method; wherein the training method based on contrastive learning comprises: acquiring a sample data set; training an initial variational autoencoder according to the sample data set; determining whether the initial variational autoencoder trained in the current training round reaches a convergence condition according to the sample data set and a set loss function; the training method based on contrastive learning further comprises: when the convergence condition is not reached, adjusting parameters in the initial variational autoencoder and training again according to the sample data set; when the convergence condition is reached, taking the initial variational autoencoder trained in the current training round as the pre-trained variational autoencoder; or, when the training round reaches an upper limit of training rounds, taking the initial variational autoencoder trained in the current training round as the pre-trained variational autoencoder; The set loss function As shown below: wherein, represents original data, represents the original data reconstruction data obtained after a variational autoencoder, represents the original data reconstruction error between the reconstruction data , represents a probability distribution of a latent variable output by the variational autoencoder based on input data , represents a time point, represents a difference between the variational autoencoder output and a preset , is a loss function set based on contrastive learning.

2. The dynamic temporal network clustering method based on contrastive learning according to claim 1, wherein, the loss function based on the contrastive learning setting As shown below: wherein, is a preset query vector, represents a positive sample matching the query vector , is a temperature parameter, is a set of sample vectors, is a key vector, the key vector contains one positive sample and a plurality of negative samples not matching the query vector .

3. The dynamic temporal network clustering method based on contrastive learning according to claim 2, wherein, The dynamic time series network comprises multiple nodes; the positive sample represents nodes of the same cluster of static nodes in the dynamic time series network at the current time point and the previous time point; and the negative sample represents nodes of different clusters of static nodes in the dynamic time series network at the current time point and the previous time point.

4. The dynamic temporal network clustering method based on contrastive learning according to claim 1, wherein, The method further comprises: acquiring reconstructed data corresponding to the original data by using the pre-trained variational autoencoder; calculating multiple similarities between nodes of the original data at the current time point and the reconstructed data at the previous time point; sorting the multiple similarities in a certain order, and selecting nodes corresponding to a certain number of the multiple similarities as static nodes; or, taking nodes corresponding to multiple similarities greater than a set threshold value in the multiple similarities as the static nodes.

5. A dynamic temporal network clustering apparatus based on contrastive learning, characterized in that, The device comprises: a data acquisition module configured to acquire to-be-processed data; wherein the to-be-processed data comprises adjacency matrices of multiple time points of a social network; the social network is a dynamic time series network; nodes in the social network represent users, and edges in the social network represent friend relationships or interactions between users; the adjacency matrices are constructed according to the nodes and edges in the social network; The feature acquisition module is configured to input the to-be-processed data into a pre-trained variational autoencoder to obtain reduced dimension features corresponding to the to-be-processed data; wherein the pre-trained variational autoencoder is obtained according to a training method based on contrastive learning; the training method based on contrastive learning adjusts parameters of the variational autoencoder by using a loss function set based on contrastive learning; The clustering analysis module is configured to perform clustering analysis on the reduced dimension features corresponding to the to-be-processed data by using a clustering method; The training method based on contrastive learning comprises: obtaining a sample data set; training an initial variational autoencoder according to the sample data set; determining whether the initial variational autoencoder trained in the current training round reaches a convergence condition according to the sample data set and a set loss function; The training method based on contrastive learning further comprises: when the convergence condition is not reached, adjusting parameters in the initial variational autoencoder and training again according to the sample data set; when the convergence condition is reached, taking the initial variational autoencoder trained in the current training round as the pre-trained variational autoencoder; or when the training round reaches an upper limit of training rounds, taking the initial variational autoencoder trained in the current training round as the pre-trained variational autoencoder. The set loss function As shown below: wherein, represents the original data, represents the original data reconstruction data obtained after a variational autoencoder, represents the original data reconstruction error between the reconstruction data , represents a probability distribution of a latent variable output by the variational autoencoder based on input data , represents a time point, represents a difference between the variational autoencoder output and a preset , is a loss function set based on contrastive learning.

6. An electronic device, comprising: comprise: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the executable instructions to implement the steps of the dynamic temporal network clustering method based on contrastive learning according to any one of claims 1-4.

7. A computer-readable storage medium having stored thereon computer program instructions, wherein, The program instructions, when executed by the processor, implement the steps of the dynamic temporal network clustering method based on contrastive learning according to any one of claims 1-4.

Citation Information

Patent Citations

  • Multi-view clustering model implementation method based on graph contrast learning

    CN117036760A

  • Academic paper clustering method and system based on cluster feature learning

    CN117216261A