Community comment classification method based on hybrid quantum classical graph convolutional neural network

By mixing quantum classical graph convolution neural networks to process graph review network data, the shortcomings of non-European spatial data processing in the existing technology are solved, and the effective classification of graph review networks is realized, which is suitable for current NISQ devices.

CN118245876BActive Publication Date: 2025-05-02BEIJING ZHONGKE ARCLIGHT QUANTUM SOFTWARE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410357246.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-27
Publication Date
2025-05-02
Estimated Expiration
2044-03-27

AI Technical Summary

Technical Problem

The prior art is difficult to effectively process data in non-European spaces, especially in the classification learning of graph comment networks, there are few researches on hybrid quantum classical graph convolution neural networks.

Method used

A hybrid quantum classical graph convolution neural network is used to obtain the adjacency matrix of node connection relationships in the graph comment network dataset, standardize and aggregate node information, combine the classic full connection layer and quantum neural network for processing, and finally use the cross entropy loss function to update the model parameters for classification.

Benefits of technology

It realizes the effective classification of community graph comment network data, which is suitable for current NISQ devices, and is better than classic neural networks in terms of global feature extraction of graph comment network information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118245876B_ABST
    Figure CN118245876B_ABST
Patent Text Reader

Abstract

The present invention discloses a community comment classification method based on a hybrid quantum classical graph convolutional neural network, and relates to the technical field of community comment classification based on quantum computing. The present invention obtains classical information with fewer dimensions of each node by processing the feature vector of each node. The present invention can be implemented using the current classical machine learning model and training framework as well as the current quantum computer, and is more suitable for the current NISQ equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] In the era of rapid development of the Internet, commenting on posts on a certain topic has become one of the important ways of online communication with its unique charm. It allows people to express their views and opinions on a certain topic, and it has built a bridge of communication between people around the world. The Internet provides netizens with a free and open platform, allowing them to speak freely and express their views and opinions. This not only promotes communication and interaction between people, but also provides opportunities for the collision of various ideas and cultures.

[0003] However, due to the lack of an effective supervision mechanism, a type of posts containing bad information may be widely spread on the Internet, such as posts related to false information, malicious attacks, rumors, etc., which will have a negative impact on the network environment. Moreover, in some cases, people may have conflicts and quarrels due to different positions, which will also have a negative impact on the network environment.

[0004] The same person comments on two posts, which indicates that there is a certain connection between the two posts. By connecting the two posts, the two posts can be connected with other posts through online comments, thus forming a graph comment network. Through this comment network, the communities to which the posts belong can be classified, so that some bad comments on the Internet can be detected.

[0005] Currently, unstructured data, such as citation networks, are mainly processed through classical machine learning, such as graph convolutional neural networks. However, there are some quantum graph convolutional neural networks for processing image data. This method mainly expresses the topological structure of the input graph data directly using quantum circuits.

[0006] Existing quantum neural network models mainly process structured data in Euclidean space, but there is less research on how hybrid quantum classical graph convolutional neural networks process data in non-Euclidean space.

[0007] The existing quantum graph convolutional neural network work is mainly used to process image data. It mainly expresses the topological structure of the input graph data directly with quantum circuits, and uses amplitude coding. Amplitude coding requires a large number of quantum gates, which is difficult to apply to current NISQ devices. At present, the graph comment network is processed by classical machine learning, and the hybrid quantum classical graph convolutional neural network has not yet involved in the learning of the graph comment network. Summary of the invention

[0008] The technical problem to be solved by the present invention is to address the deficiencies of the prior art and specifically provide a community comment classification method based on a hybrid quantum classical graph convolutional neural network, which can effectively predict the category of comment posts in the network, as follows:

[0009] 1) In the first aspect, the present invention provides a community comment classification method based on a hybrid quantum classical graph convolutional neural network, and the specific technical solution is as follows:

[0010] S1. Obtain an adjacency matrix of connection relationships between multiple nodes in a graph comment network dataset used to characterize a community;

[0011] S2. Obtain the degree matrix based on the graph comment network dataset, and use the degree matrix to standardize the adjacency matrix;

[0012] S3, applying the standardized adjacency matrix to the feature vector of each node to aggregate the information of the neighboring nodes of each node to obtain the first feature vector of each node;

[0013] S4, processing the first feature vector of each node through a single-layer first classical fully connected layer to obtain a second feature vector of each node;

[0014] S5, applying the standardized adjacency matrix to the second eigenvector of each node to aggregate information of neighboring nodes of each node to obtain a third eigenvector of each node;

[0015] S6, encoding the third eigenvector of each node into a quantum state;

[0016] S7. Processing the quantum state corresponding to each node using the quantum neural network to measure the quantum bits of the quantum system corresponding to the quantum neural network and obtain the classical information of each node;

[0017] S8, taking the classical information of each node as the feature vector of the corresponding node, and returning to execute S3 until the end condition is met;

[0018] S9, input the latest classical information of each node into the second classical fully connected layer of the single layer, output different categories of data corresponding to each training node in the graph comment network data set, obtain the cross entropy loss function of the different categories of data corresponding to each training node and the true label of the training node, and update the parameters of the quantum neural network, the parameters of the first classical fully connected layer, and the parameters of the second classical fully connected layer according to the cross entropy loss function to minimize the cross entropy loss function until the cross entropy loss function reaches the minimum value, thereby obtaining a hybrid quantum classical graph convolutional neural network model for classifying community graph comment network data;

[0019] S10. Use the hybrid quantum classical graph convolutional neural network model to classify the preset community graph comment network data.

[0020] The beneficial effects of the community comment classification method based on the hybrid quantum classical graph convolutional neural network provided by the present invention are as follows:

[0021] By processing the feature vector of each node, we can obtain classical information with fewer dimensions for each node. This can be implemented using the relatively well-developed classical machine learning models and training frameworks as well as current quantum computers, and is more suitable for current NISQ devices.

[0022] Based on the above scheme, the community comment classification method based on a hybrid quantum classical graph convolutional neural network of the present invention can also be improved as follows.

[0023] Furthermore, based on the graph comment network dataset, the degree matrix is ​​obtained, including:

[0024] The degree matrix is ​​obtained based on the graph information of the edges connected to each node in the graph comment network dataset.

[0025] Further, encoding the third eigenvector of each node into a quantum state includes: encoding the third eigenvector of each node into a quantum state by angle encoding.

[0026] Furthermore, the termination condition is: the feature information of the node reaches the farthest distance, or each node aggregates the order of the neighboring nodes of each node.

[0027] 2) In the second aspect, the present invention also provides a community comment classification system based on a hybrid quantum classical graph convolutional neural network, and the specific technical solution is as follows:

[0028] It includes a data preprocessing module, a feature vector data encoding module, a calling module, a training module and a classification module;

[0029] The data preprocessing module is used to: obtain the adjacency matrix of the connection relationship between multiple nodes in the graph comment network dataset used to characterize the community; obtain the degree matrix according to the graph comment network dataset, and use the degree matrix to standardize the adjacency matrix;

[0030] The feature vector data encoding module is used to: apply the standardized adjacency matrix to the feature vector of each node to aggregate the information of the neighboring nodes of each node to obtain the first feature vector of each node; process the first feature vector of each node through a single-layer first classical fully connected layer to obtain the second feature vector of each node; apply the standardized adjacency matrix to the second feature vector of each node to aggregate the information of the neighboring nodes of each node to obtain the third feature vector of each node; encode the third feature vector of each node into a quantum state; use a quantum neural network to process the quantum state corresponding to each node to measure the quantum bit of the quantum system corresponding to the quantum neural network to obtain the classical information of each node;

[0031] The calling module is used to: use the classical information of each node as the feature vector of the corresponding node, and re-call the feature vector data encoding module until the end condition is met;

[0032] The training module is used to: input the latest classical information of each node into the second classical fully connected layer of the single layer, output different categories of data corresponding to each training node in the graph comment network data set, obtain the cross entropy loss function of the different categories of data corresponding to each training node and the true label of the training node, and update the parameters of the quantum neural network, the parameters of the first classical fully connected layer and the parameters of the second classical fully connected layer according to the cross entropy loss function to minimize the cross entropy loss function until the cross entropy loss function reaches the minimum value, thereby obtaining a hybrid quantum classical graph convolutional neural network model for classifying community graph comment network data;

[0033] The classification module is used to classify the preset community graph comment network data using a hybrid quantum classical graph convolutional neural network model.

[0034] Based on the above scheme, the community comment classification system based on the hybrid quantum classical graph convolutional neural network of the present invention can also be improved as follows.

[0035] The data preprocessing module is also specifically used to obtain a degree matrix according to the graph information of the edges connected to each node in the graph comment network data set.

[0036] Furthermore, the characteristic vector data encoding module is also specifically used to encode the third characteristic vector of each node into a quantum state by means of angle encoding.

[0037] Furthermore, the termination condition is: the feature information of the node reaches the farthest distance, or each node aggregates the order of the neighboring nodes of each node.

[0038] 3) In a third aspect, the present invention also provides a computer device, comprising a processor, the processor being coupled to a memory, the memory storing at least one computer program, and the at least one computer program being loaded and executed by the processor, so that the computer device implements any of the above-mentioned community comment classification methods based on the hybrid quantum classical graph convolutional neural network.

[0039] 4) In a fourth aspect, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored, and at least one computer program is loaded and executed by a processor so that the computer implements any of the above-mentioned community comment classification methods based on the hybrid quantum classical graph convolutional neural network.

[0040] It should be noted that the beneficial effects achieved by the technical solutions of the second to fourth aspects of the present invention and the corresponding possible implementation methods can be found in the above-mentioned technical effects of the first aspect and its corresponding possible implementation methods, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:

[0042] Figure 1 A schematic diagram of a process of a community comment classification method based on a hybrid quantum classical graph convolutional neural network according to an embodiment of the present invention;

[0043] Figure 2 is an undirected and unweighted graph;

[0044] Figure 3 This is the network structure of the first classic fully connected layer;

[0045] Figure 4 A quantum circuit for encoding the third eigenvector of each node as a quantum state;

[0046] Figure 5 The network structure of the quantum graph convolutional neural network and the network structure of the second classical fully connected layer;

[0047] Figure 6 is the specific form of the unitary operation U;

[0048] Figure 7 Schematic diagram of the structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0050] like Figure 1As shown, a community comment classification method based on a hybrid quantum classical graph convolutional neural network in an embodiment of the present invention includes the following steps:

[0051] S1. Obtain an adjacency matrix of connection relationships between multiple nodes in a graph comment network dataset used to characterize a community;

[0052] Download the community graph comment network dataset Reddit, use 90% of the community graph comment network data in the graph comment network dataset as the training set, and 10% of the community graph comment network data as the test set.

[0053] Among them, nodes refer to the post topics in the graph comment network dataset. The post topics can be specifically understood as the title of the post posted in Tieba, or the news title or news content listed on the website, or the short video or photo posted on the social networking site, etc.

[0054] Among them, community graph comment network data refers to: comment data under the node such as text data, image data and audio, for example, data evaluating a post title, data evaluating a news title or news content, data evaluating a short video or photo, etc.

[0055] Take four post topics (i.e., four nodes, respectively labeled as x1, x2, x3, and x4) as an example to construct an undirected unweighted graph representing the connection relationship between the four post topics, such as Figure 2 As shown, Figure 2 In the figure, the connecting lines represent edges. According to the undirected unweighted graph, the initial adjacency matrix A can be obtained.

[0056] The initial adjacency matrix A can be obtained from the graph object of the graph comment network dataset. The graph object represents the correlation between the nearest neighbor post nodes in the graph comment network dataset. In the present invention, the correlation between each node and itself is added to obtain the adjacency matrix Where I represents: an identity matrix of the same dimension as the initial adjacency matrix A.

[0057] S2. Obtain the degree matrix based on the graph comment network dataset, and use the degree matrix to standardize the adjacency matrix;

[0058] Wherein, obtaining a degree matrix according to the graph comment network dataset includes: obtaining a degree matrix according to graph information of edges connected to each node in the graph comment network dataset.

[0059] Among them, the process of using the degree matrix to standardize the adjacency matrix is ​​described as follows:

[0060] For example, according to the adjacency matrix containing graph information above The corresponding degree matrix can be obtained for: The final pass degree matrix Adjacency Matrix Standardize and get the standardized adjacency matrix

[0061] S3. Apply the standardized adjacency matrix to the feature vector of each node to aggregate the information of the neighboring nodes of each node to obtain the first feature vector of each node. Specifically:

[0062] For example, the normalized adjacency matrix Acting on the feature vector of each node, the information of the neighboring nodes of each node is aggregated to obtain a new node feature vector of each node, namely, the first feature vector, and the dimension of the first feature vector is 602 dimensions.

[0063] S4. The first feature vector of each node is processed by a single-layer first classical fully connected layer to obtain a second feature vector of each node. Specifically:

[0064] For example, the 602-dimensional first feature vector of each node is processed by a single-layer first classical fully connected layer. The first classical fully connected layer is a classical fully connected neural network with a network structure such as Figure 3 As shown, the input dimension of the first classic fully connected layer is set to 602, the output dimension is set to 20, and finally the second feature vector of each node obtained by processing the first classic fully connected layer is obtained. The specific implementation method is: Among them, X 1 represents the second feature vector of all nodes, s is the Sigmoid activation function, X 0 is the feature vector of all nodes in S3, W 0 Characterize the parameters in the first classical fully connected layer, Represents the first eigenvector of all nodes.

[0065] S5, applying the standardized adjacency matrix to the second eigenvector of each node to aggregate information of neighboring nodes of each node to obtain a third eigenvector of each node;

[0066] It should be noted that the information of the neighboring nodes of each node in S3 is different from the information of the neighboring nodes of each node in S5.

[0067] S6, encoding the third eigenvector of each node into a quantum state, encoding the third eigenvector of each node into a quantum state by angle encoding;

[0068] The third eigenvector of each node Taking the inverse sine of each element is done by the formula θ i =arcsin(x i ), and obtain the rotation angle θ of the quantum gate i , x i Represents the i-th characteristic attribute of the third characteristic vector of the node, i is a positive integer ranging from 1 to 20, θ i Represents x i The corresponding rotation angle of the quantum gate. After obtaining the rotation angle of the quantum gate, the rotation angle of the quantum gate is obtained by R y (θ) and R x (θ) Rotate the angle encoding method of the quantum gate to encode the third eigenvector of each node into a quantum state. The corresponding quantum circuit is implemented as follows Figure 4 As shown, for a node whose third eigenvector is 20-dimensional, 10 quantum bits are required.

[0069] S7. Processing the quantum state corresponding to each node using the quantum neural network to measure the quantum bits of the quantum system corresponding to the quantum neural network and obtain the classical information of each node;

[0070] The quantum neural network is a quantum graph convolutional neural network. The classical information of each node output by the quantum graph convolutional neural network is: Among them, X 2 is the classical information of all nodes, W 1 represents the parameters of the quantum graph convolutional neural network, s is the Sigmoid activation function, Represents the third eigenvector of all nodes. The overall network structure of the quantum graph convolutional neural network is as follows: Figure 5 As shown, 10 qubits are used here. This is mainly achieved by the unitary operation U composed of basic quantum gates acting alternately on two qubits. The specific form of the unitary operation U is as follows: Figure 6 As shown, including R x Rotary quantum gate, Rotary quantum gate R y and R z Rotating quantum gates, Figure 5 The dotted part in can increase the trainable parameters of the quantum graph convolutional neural network according to the limited number of repetitions of the actual computing equipment used. In this embodiment, it is repeated twice.

[0071] By measuring the quantum bits of the quantum system corresponding to the quantum neural network, we can obtain the PAULI-Z expected value of all quantum bits, that is, the classical information of each node.

[0072] S8. Use the classical information of each node as the feature vector of the corresponding node, and return to execute S3 until the end condition is met. The end condition is: the feature information of the node reaches the farthest distance, or each node aggregates the order of the neighboring nodes of each node.

[0073] S9. Input the latest classical information of each node into the second classical fully connected layer of the single layer, output the different categories of data corresponding to each training node in the graph comment network dataset, and obtain the cross entropy loss function of the different categories of data corresponding to each training node and the true label of the training node. According to the cross entropy loss function, update the parameters of the quantum neural network, the parameters of the first classical fully connected layer, and the parameters of the second classical fully connected layer to minimize the cross entropy loss function until the cross entropy loss function reaches the minimum value, and obtain a hybrid quantum classical graph convolutional neural network model for classifying community graph comment network data.

[0074] Among them, the latest classical information of each node is input into the second classical fully connected layer of the single layer, and the different categories of data corresponding to each node are output, from which the different categories of data corresponding to the training nodes are selected.

[0075] Among them, the latest classical information of each node is input into the second classical fully connected layer of a single layer, such as Figure 5 As shown in the figure, since the number of categories of nodes in the graph comment network graph dataset is 41, the output dimension of the second classic fully connected layer is selected to be 41, and the second classic fully connected layer is a fully connected neural network. 41 category data corresponding to each node are output, and 41 category data corresponding to the training node are selected from them.

[0076] The 41 category data corresponding to each training node and the real label of the one-hot encoding corresponding to the training node are subjected to the cross entropy loss function loss. The cross entropy loss function loss is:

[0077]

[0078] Among them, j represents the category to which any training node belongs, and the average value of the above cross entropy loss function of all nodes in the training set is calculated as the loss function of the entire model.

[0079] According to the cross entropy loss function, the parameters of the quantum neural network, the parameters of the first classical fully connected layer, and the parameters of the second classical fully connected layer are updated to minimize the cross entropy loss function until the cross entropy loss function reaches a minimum value, thereby obtaining a hybrid quantum classical graph convolutional neural network model for classifying community comments.

[0080] Among them, the implementation method of updating the quantum neural network is: based on the parameterized circuit movement law, the quantum neural network is updated, and the parameterized circuit movement law is as follows:

[0081] A measurement operator In the parameterized quantum circuit U(θ i ) under the expected value function f(θ i ) can be expressed as Then the expected value function f(θ i ) About the parameterized quantum circuit parameter θ i The gradient of θi f(θ i ) can be expressed as The expected value function f(θ i ) in U(θ i )like Figure 6 As shown, θ i The method represents the parameters in the quantum neural network that operates on the node feature vector that integrates the graph information. The method is called the parameterized circuit movement law for the parameterized quantum circuit parameter analysis gradient of the operator expectation value constructed by the parameterized quantum circuit.

[0082] Based on the parameterized circuit movement rule, the cross entropy loss function can be obtained with respect to Figure 5 The analytical gradient of each parameter of the quantum neural network is obtained, and then the parameters of the quantum circuit are updated using a classical computer and the parameters of the quantum neural network are updated using the classical back-propagation algorithm. Finally, based on the graph comment network dataset, multiple epochs are trained to stop after the cross entropy loss function converges, that is, to minimize the cross entropy loss function until the cross entropy loss function reaches its minimum value.

[0083] Among them, the process of updating the parameters of the first classic fully connected layer and the parameters of the second classic fully connected layer is: training and updating the parameters of the first classic fully connected layer and the parameters of the second classic fully connected layer based on the training set and the verification set in the graph comment network dataset.

[0084] Optionally, all node feature vectors in the graph comment network dataset are input into the trained hybrid quantum classical graph convolutional neural network model, and the numerical information part corresponding to the 41 categories of the test set is taken out from the output results of the hybrid quantum classical graph convolutional neural network model, and then compared with the true category label of each node corresponding to the test set, and finally the prediction accuracy of the hybrid quantum classical graph convolutional neural network model is obtained.

[0085] S10. Classify the preset community graph comment network data using the hybrid quantum classical graph convolutional neural network model, wherein the preset community graph comment network data can be set according to actual conditions.

[0086] The hybrid quantum-classical graph convolutional neural network model includes a trained quantum neural network, a trained first classical fully connected layer, and a trained second classical fully connected layer.

[0087] Existing quantum neural network models mainly process structured data in Euclidean space, but there is little research on how quantum neural networks process data in non-Euclidean space. In addition, graph comment networks are currently processed through classical machine learning, and hybrid quantum classical graph convolutional neural networks have not yet been involved in learning graph comment networks.

[0088] The present invention adopts a self-designed hybrid quantum classical graph convolutional neural network, namely a hybrid quantum classical graph convolutional neural network model. First, the adjacency matrix between nodes is obtained according to the graph comment network data set, and then the adjacency matrix is ​​standardized using the degree matrix. The standardized adjacency matrix is ​​applied to the node feature vector of the graph comment network graph to aggregate the node adjacent node information to obtain a new node feature vector. Then, the obtained new node feature vector is first processed by a layer of classical fully connected layer, and then the classical information of the processed node feature vector is encoded into a quantum state through angle encoding. The quantum state encoded with the node feature vector information is processed by a quantum neural network, and then the quantum bits of the quantum system are measured to obtain classical information. The above steps can be repeated multiple times, indicating the farthest distance that the node feature in the graph can reach or the order of the corresponding node in the graph aggregating its neighbor nodes. Then, after a single-layer fully connected neural network with an output dimension equal to the number of node categories, the different categories of outputs corresponding to the input nodes of the graph comment network are obtained, and the cross-entropy loss function between the output result and the true label of the training node is calculated. Then, the parameters of the quantum circuit and the classical neural network are updated to minimize the cross-entropy loss function until the loss function reaches the minimum value. Finally, a hybrid quantum classical graph convolutional neural network model for the graph comment network is obtained, and then the trained model is used on the test set to test the model performance.

[0089] In the present invention, the classical graph convolutional neural network is initially used to process the node feature vectors of the graph comment network graph, and a new node feature vector with lower dimension that aggregates the feature information of neighbor nodes is obtained, so that we can not only utilize the relatively good classical machine learning models and training frameworks that have been developed, but also utilize the currently developed quantum computers, so that the subsequent node feature vector data angle encoding method and quantum graph convolution module are more suitable for the current NISQ (noisy intermediate-scale quantum) equipment, and are used for classification learning of graph comment networks, without waiting for the future large-scale fault-tolerant quantum computers, so that we can make better use of the currently developed quantum computers in the real field to solve some problems in this field that classical computers cannot or are difficult to solve.

[0090] The hybrid quantum classical graph convolutional neural network model proposed in this patent utilizes a new computing model based on the basic principles of quantum mechanics, namely quantum computing. Due to the strong parallelism and non-local characteristics of quantum neural networks, the hybrid quantum classical graph convolutional neural network model in this invention is superior to classical neural networks in extracting global features of graph comment network information.

[0091] In the above embodiments, although the steps are numbered S1, S2, etc., these are only specific embodiments given by the present invention. Those skilled in the art may adjust the execution order of S1, S2, etc. according to actual conditions, which is also within the protection scope of the present invention. It can be understood that in some embodiments, some or all of the above embodiments may be included.

[0092] A community comment classification system based on a hybrid quantum classical graph convolutional neural network according to an embodiment of the present invention comprises a data preprocessing module, a feature vector data encoding module, a calling module, a training module and a classification module;

[0093] The data preprocessing module is used to: obtain the adjacency matrix of the connection relationship between multiple nodes in the graph comment network dataset used to characterize the community; obtain the degree matrix according to the graph comment network dataset, and use the degree matrix to standardize the adjacency matrix;

[0094] The feature vector data encoding module is used to: apply the standardized adjacency matrix to the feature vector of each node to aggregate the information of the neighboring nodes of each node to obtain the first feature vector of each node; process the first feature vector of each node through a single-layer first classical fully connected layer to obtain the second feature vector of each node; apply the standardized adjacency matrix to the second feature vector of each node to aggregate the information of the neighboring nodes of each node to obtain the third feature vector of each node; encode the third feature vector of each node into a quantum state; use a quantum neural network to process the quantum state corresponding to each node to measure the quantum bit of the quantum system corresponding to the quantum neural network to obtain the classical information of each node;

[0095] The calling module is used to: use the classical information of each node as the feature vector of the corresponding node, and re-call the feature vector data encoding module until the end condition is met;

[0096] The training module is used to: input the latest classical information of each node into the second classical fully connected layer of the single layer, output different categories of data corresponding to each training node in the graph comment network data set, obtain the cross entropy loss function of the different categories of data corresponding to each training node and the true label of the training node, and update the parameters of the quantum neural network, the parameters of the first classical fully connected layer and the parameters of the second classical fully connected layer according to the cross entropy loss function to minimize the cross entropy loss function until the cross entropy loss function reaches the minimum value, thereby obtaining a hybrid quantum classical graph convolutional neural network model for classifying community graph comment network data;

[0097] The classification module is used to classify the preset community graph comment network data using a hybrid quantum classical graph convolutional neural network model.

[0098] Optionally, in the above technical solution, the data preprocessing module is further specifically used to: obtain a degree matrix according to graph information of edges connected to each node in the graph comment network data set.

[0099] Optionally, in the above technical solution, the characteristic vector data encoding module is further specifically used to: encode the third characteristic vector of each node into a quantum state by angle encoding.

[0100] Optionally, in the above technical solution, the termination condition is: the feature information of the node reaches the farthest distance, or each node aggregates the order of the neighboring nodes of each node.

[0101] It should be noted that the beneficial effects of the community comment classification system based on the hybrid quantum classical graph convolutional neural network provided in the above embodiment are the same as the beneficial effects of the community comment classification method based on the hybrid quantum classical graph convolutional neural network, which will not be repeated here. In addition, when the system provided in the above embodiment realizes its functions, it only takes the division of the above-mentioned functional modules as an example. In practical applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the system can be divided into different functional modules according to actual conditions to complete all or part of the functions described above. In addition, the system and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0102] In another embodiment, it includes a data preprocessing module, a module for normalizing the adjacency matrix according to the graph comment network graph information, a classical graph convolution module, a feature vector data encoding module, a quantum graph convolution module, a loss function construction module, a model parameter updating module, and a model verification module.

[0103] The data preprocessing module is used to: first download the graph comment network dataset, then divide the graph comment network dataset into training set and test set. Then obtain the adjacency matrix according to the graph information of the edges connecting the graph comment network and the nodes, and then obtain the degree matrix from the adjacency matrix, and then use the degree matrix to standardize the adjacency matrix of the graph.

[0104] The classic graph convolution module is used to: apply the standardized adjacency matrix to the node feature vector of the graph comment network graph to aggregate the node neighboring node information to obtain a new node feature vector. The obtained new node feature vector is processed by the classic fully connected neural network to obtain the graph comment network node feature vector processed by the classic graph convolution neural network.

[0105] The feature vector data encoding module is used to: first, apply the standardized adjacency matrix to the node feature vector information after the previous classical graph convolution module operation, aggregate the node neighboring node information to obtain a new node feature vector. Then, take the arc sine of the new node feature vector to obtain the rotation angle of the quantum gate, and then use the angle encoding method to pass R y (θ) and R x (θ) The rotation quantum gate acts on the quantum bit to encode the node characteristic data into a quantum state.

[0106] The quantum graph convolution module is used to: include R through parameterized quantum gates x (θ), R y (θ), R z (θ) rotation quantum gate, as well as the basic quantum gate CNOT gate supported by quantum computers, are used to build a quantum neural network to process feature vector data. The encoding module encodes the quantum state of the node feature data, and finally measures the quantum bits to obtain classical information, thereby obtaining the node feature vector of this layer that collects the feature information of neighboring nodes. Finally, according to the number of categories that need to be classified in the data set, the node feature vector that collects the feature information of neighboring nodes is input into a layer of classical fully connected neural network to obtain the output value corresponding to each category label.

[0107] The loss function module is constructed to: after all nodes of the entire graph comment network graph undergo classical quantum graph convolution operations, the output dimension of each node is the number of categories of the graph comment network dataset, and the predicted value output by each node is subjected to a cross entropy loss function with the corresponding label of the node in the graph comment network dataset to obtain a loss function used to characterize the model performance.

[0108] The model parameter update module is used to: based on the existing parameterized circuit movement rules, calculate the analytical gradient of the loss function of the previous module with respect to the various parameters of the quantum circuit, and then use a classical computer to update the parameters of the quantum circuit and the classical neural network. Finally, the graph comment network dataset is used to train multiple epochs so that the community prediction method based on a hybrid quantum-classical graph convolutional neural network proposed in this patent stops after the model loss function converges.

[0109] The model verification module is used to: input the feature vectors of all nodes in the graph comment network graph into the hybrid quantum classical graph convolutional neural network model trained by the previous module, extract the category prediction output part corresponding to the test set in the model output, and then compare it with the true category label of each node corresponding to the test set, and finally output the accuracy of the model prediction.

[0110] The following content is elaborated in detail:

[0111] Data preprocessing module: First, download the graph comment network dataset Reddit, use 90% of the graph comment network dataset as the training set and 10% as the test set. Here we take the graph comment network graph of four posts as an example, Figure 2 As shown, this is an undirected unweighted graph. The undirected unweighted graph composed of these four post nodes has the corresponding initial adjacency matrix: The initial adjacency matrix A can be obtained from the graph object of the graph comment network dataset. The graph object represents the correlation between the nearest neighbor post nodes in the graph comment network dataset. In the present invention, the correlation between each node and itself is added to obtain the adjacency matrix Where I represents: an identity matrix of the same dimension as the initial adjacency matrix A.

[0112] According to the above adjacency matrix containing graph information The corresponding degree matrix can be obtained for: The final pass degree matrix Adjacency Matrix Standardize and get the standardized adjacency matrix

[0113] Classic graph convolution module: The standardized adjacency matrix obtained in the previous module, i.e., the data preprocessing module, is The node feature vector of the graph comment network graph is acted on to aggregate the node neighboring node information to obtain a new node feature vector of 602 dimensions.

[0114] Then the new 602-dimensional node feature vector is processed by a classic fully connected neural network as follows Figure 3As shown, here the input dimension of the classic fully connected neural network is set to 602, the output dimension is set to 20, and finally the node feature vector of the graph comment network processed by the classic graph convolutional neural network is obtained. Among them, X 0 is the initial node feature vector representation obtained from the training set, s is the Sigmoid activation function, W 0 It is a classic neural network that operates on node feature vectors that incorporate graph information.

[0115] Feature vector data encoding module: First, the standardized adjacency matrix is ​​applied to the node feature vector information after the previous classic graph convolution module operation to aggregate the node neighboring node information to obtain a new node feature vector. Then, the new node feature vector The rotation angle of the quantum gate is obtained by taking the inverse sine of each element, that is, through the formula θ i =arcsin(x i ) to obtain the rotation angle of the quantum gate, where x i Represents the i-th characteristic attribute of the node, where i represents the i-th characteristic attribute of the node accepted by the i-th rotation quantum gate. After obtaining the rotation angle of the quantum gate, through R y (θ) and R x (θ) The angle encoding method of rotating quantum gates encodes node features into quantum states. The corresponding quantum circuit is implemented as follows: Figure 4 As shown, for a node with 20 dimensions, 10 qubits are required.

[0116] Quantum graph convolution module: The quantum graph convolution neural network can generate a new node representation based on the edge information between posts provided in the graph comment network dataset by aggregating the node information of the posts, thereby obtaining the hidden feature representation of each node. The specific node feature vector output by the graph convolution module is Where X 1 is the node feature vector representation after processing by the classic graph convolution module, s is the Sigmoid activation function, and W 1 It is a quantum neural network that operates on node feature vectors that integrate graph information. Its overall structure is as follows Figure 5 As shown, 10 qubits are used here. It is mainly realized by the unitary operation U composed of basic quantum gates acting alternately on two qubits. The specific form of U is as follows Figure 6 As shown, including R x , R y , R z Rotating quantum gates, Figure 5 The dotted part in the figure can be repeated multiple times according to the limitations of the computing device used to increase the trainable parameters of the model. Here, it is repeated twice.

[0117] After passing through the quantum graph convolutional neural network, the node feature vector that aggregates the features of neighboring nodes is obtained. Finally, the PAULI-Z expected values ​​of all quantum bits are measured, and the obtained results are passed into a single-layer fully connected neural network, such as Figure 5 As shown on the far right, based on the number of categories of the dataset nodes being 41, the fully connected neural network output dimension is selected as 41, and numerical information of different sizes for each category to which the graph comment network nodes belong is obtained.

[0118] Construct loss function module: After the features of all nodes in the graph comment network dataset are processed through the above steps, the numerical information of different sizes of 41 categories of each node is obtained. Then, according to the divided training set index, the numerical information of the 41 categories of all nodes is obtained, and the numerical information of the 41 categories of each training set node output through the above steps is obtained. The numerical information of the 41 categories and the one-hot encoded label information of the training set node are subjected to the cross entropy loss function loss:

[0119]

[0120] Among them, i represents the category to which the node belongs, that is, the i-th category, and the average value of the cross entropy loss function of all nodes in the training set is calculated as the loss function of the entire model.

[0121] Update model parameter module: First, a measurement operator In the parameterized quantum circuit U(θ i ) can be expressed as: Then the expected value function f(θ i ) About the parameterized quantum circuit parameter θ i The gradient of can be expressed as Above U(θ i )like Figure 6 As shown, θ i Represents the parameters in a quantum neural network that operates on node feature vectors that incorporate graph information.

[0122] The above method is called the parameter transfer rule for the expected value of the operator constructed by the parameterized quantum circuit with respect to the parameter analysis gradient of the parameterized quantum circuit. Based on the parameter transfer rule, the cross entropy loss function obtained in the previous module can be calculated with respect to Figure 5 The analytical gradients of each parameter of the quantum neural network are obtained, and then the parameters of the quantum circuit are updated using a classical computer and the parameters of the classical neural network are updated using a classical back-propagation algorithm. Finally, the graph comment network dataset is used to train multiple epochs so that the community prediction method based on a hybrid quantum-classical graph convolutional neural network proposed in this patent stops after the model loss function converges.

[0123] Model verification module: Input the feature vectors of all nodes in the graph comment network graph into the hybrid quantum classical graph convolutional neural network model trained in the previous module, extract the numerical information part of the model output corresponding to the 41 categories of the test set, and then compare it with the true category label of each node corresponding to the test set, and finally output the accuracy of the model prediction.

[0124] like Figure 7 As shown, a computer device 300 of an embodiment of the present invention includes a processor 320, the processor 320 is coupled to a memory 310, and the memory 310 stores at least one computer program 330, and the at least one computer program 330 is loaded and executed by the processor 320, so that the computer device 300 implements any of the above-mentioned community comment classification methods based on hybrid quantum classical graph convolutional neural networks, specifically:

[0125] The computer device 300 may have relatively large differences due to different configurations or performances, and may include one or more processors 320 (Central Processing Units, CPU) and one or more memories 310, wherein the one or more memories 310 store at least one computer program 330, and the at least one computer program 330 is loaded and executed by the one or more processors 320, so that the computer device 300 implements any of the community comment classification methods based on hybrid quantum classical graph convolutional neural networks provided in the above embodiments. Of course, the computer device 300 may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output, and the computer device 300 may also include other components for implementing device functions, which will not be repeated here.

[0126] A computer-readable storage medium according to an embodiment of the present invention stores at least one computer program, and the at least one computer program is loaded and executed by a processor so that the computer implements any of the above-mentioned community comment classification methods based on a hybrid quantum classical graph convolutional neural network.

[0127] Optionally, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0128] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs any of the above-mentioned community comment classification methods based on a hybrid quantum classical graph convolutional neural network.

[0129] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects and represent the definition of a specific order or sequence. The order of use of similar objects can be interchanged where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than the order shown or described.

[0130] Those skilled in the art know that the present invention can be implemented as a system, method or computer program product. Therefore, the present disclosure can be specifically implemented in the following forms, namely: it can be complete hardware, it can be complete software (including firmware, resident software, microcode, etc.), or it can be a combination of hardware and software, which is generally referred to as "circuit", "module" or "system" herein. In addition, in some embodiments, the present invention can also be implemented in the form of a computer program product in one or more computer-readable media, and the computer-readable medium contains computer-readable program code.

[0131] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.

[0132] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.

Claims

1. A community comment classification method based on a hybrid quantum classical graph convolutional neural network, characterized in that: include: S1. Obtain the adjacency matrix of the connection relationship between multiple nodes in the graph comment network dataset used to characterize the community; S2. obtaining a degree matrix according to the graph comment network dataset, and using the degree matrix to standardize the adjacency matrix; S3, applying the standardized adjacency matrix to the feature vector of each node to aggregate the information of the neighboring nodes of each node to obtain the first feature vector of each node; S4, processing the first feature vector of each node through a single-layer first classical fully connected layer to obtain a second feature vector of each node; S5, applying the standardized adjacency matrix to the second eigenvector of each node to aggregate information of neighboring nodes of each node to obtain a third eigenvector of each node; S6, encoding the third eigenvector of each node into a quantum state; S7, using a quantum neural network to process the quantum state corresponding to each node, so as to measure the quantum bits of the quantum system corresponding to the quantum neural network, and obtain the classical information of each node; S8, taking the classical information of each node as the feature vector of the corresponding node, and returning to execute S3 until the end condition is met; S9, input the latest classical information of each node into the second classical fully connected layer of the single layer, output different categories of data corresponding to each training node in the graph comment network data set, obtain the cross entropy loss function of the different categories of data corresponding to each training node and the true label of the training node, and update the parameters of the quantum neural network, the parameters of the first classical fully connected layer, and the parameters of the second classical fully connected layer according to the cross entropy loss function to minimize the cross entropy loss function until the cross entropy loss function reaches the minimum value, thereby obtaining a hybrid quantum classical graph convolutional neural network model for classifying community graph comment network data; S10, using the hybrid quantum classical graph convolutional neural network model to classify the preset community graph comment network data; The quantum neural network is a quantum graph convolutional neural network. The quantum graph convolutional neural network uses 10 quantum bits and is implemented by a unitary operation U composed of basic quantum gates acting alternately on two quantum bits. The unitary operation U includes R x Rotation quantum gate, R y Rotational quantum gates and R z Rotating quantum gate.

2. According to claim 1, a community comment classification method based on a hybrid quantum classical graph convolutional neural network is characterized in that: According to the graph comment network dataset, the degree matrix is ​​obtained, including: The degree matrix is ​​obtained based on the graph information of the edges connected to each node in the graph comment network dataset.

3. According to claim 1, a community comment classification method based on a hybrid quantum classical graph convolutional neural network is characterized in that: Encoding the third eigenvector of each node into a quantum state includes: encoding the third eigenvector of each node into a quantum state by angle encoding.

4. According to claim 1, a community comment classification method based on a hybrid quantum classical graph convolutional neural network is characterized in that: The end condition is: the feature information of the node reaches the farthest distance, or each node aggregates the order of the neighboring nodes of each node.

5. A community comment classification system based on a hybrid quantum classical graph convolutional neural network, characterized in that: It includes a data preprocessing module, a feature vector data encoding module, a calling module, a training module and a classification module; The data preprocessing module is used to: obtain an adjacency matrix of connection relationships between multiple nodes in a graph comment network dataset used to characterize a community; According to the graph comment network dataset, a degree matrix is ​​obtained, and the adjacency matrix is ​​normalized using the degree matrix; The feature vector data encoding module is used to: apply the standardized adjacency matrix to the feature vector of each node to aggregate the information of the neighboring nodes of each node to obtain the first feature vector of each node; The first eigenvector of each node is processed by a single-layer first classical fully connected layer to obtain a second eigenvector of each node; the standardized adjacency matrix is ​​applied to the second eigenvector of each node to aggregate information of neighboring nodes of each node to obtain a third eigenvector of each node; the third eigenvector of each node is encoded as a quantum state; Processing the quantum state corresponding to each node using a quantum neural network to measure the quantum bits of the quantum system corresponding to the quantum neural network and obtain classical information of each node; The calling module is used to: use the classical information of each node as the feature vector of the corresponding node, and re-call the feature vector data encoding module until the end condition is met; The training module is used to: input the latest classical information of each node into the second classical fully connected layer of the single layer, output different categories of data corresponding to each training node in the graph comment network data set, obtain the cross entropy loss function of the different categories of data corresponding to each training node and the real label of the training node, and update the parameters of the quantum neural network, the parameters of the first classical fully connected layer and the parameters of the second classical fully connected layer according to the cross entropy loss function to minimize the cross entropy loss function until the cross entropy loss function reaches the minimum value, thereby obtaining a hybrid quantum classical graph convolutional neural network model for classifying community graph comment network data; The classification module is used to: classify the preset community graph comment network data using the hybrid quantum classical graph convolutional neural network model; The quantum neural network is a quantum graph convolutional neural network. The quantum graph convolutional neural network uses 10 quantum bits and is implemented by a unitary operation U composed of basic quantum gates acting alternately on two quantum bits. The unitary operation U includes R x Rotation quantum gate, R y Rotational quantum gates and R z Rotating quantum gate.

6. A community comment classification system based on a hybrid quantum classical graph convolutional neural network according to claim 5, characterized in that: The data preprocessing module is also specifically used to obtain a degree matrix according to the graph information of the edges connected to each node in the graph comment network data set.

7. According to claim 5, a community comment classification system based on a hybrid quantum classical graph convolutional neural network is characterized in that: The characteristic vector data encoding module is also specifically used to encode the third characteristic vector of each node into a quantum state by means of angle encoding.

8. According to claim 5, a community comment classification system based on a hybrid quantum classical graph convolutional neural network is characterized in that: The end condition is: the feature information of the node reaches the farthest distance, or each node aggregates the order of the neighboring nodes of each node.

9. A computer device, characterized in that: The computer device includes a processor, the processor is coupled to a memory, and at least one computer program is stored in the memory. The at least one computer program is loaded and executed by the processor, so that the computer device implements a community comment classification method based on a hybrid quantum classical graph convolutional neural network as described in any one of claims 1 to 4.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the at least one computer program is loaded and executed by the processor so that the computer implements a community comment classification method based on a hybrid quantum-classical graph convolutional neural network as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Community discovery method, system and equipment based on graph dual auto-encoders, and medium

    CN116595479A