Data classification method and device based on multi-head self-attention hypergraph neural network

The hypergraph structure is generated through the multi-head self-attention mechanism and the hypergraph neural network is optimized, which solves the problem of poor adaptability of traditional hypergraph neural networks in complex data processing, and improves the data label prediction performance.

CN115130544BActive Publication Date: 2025-01-03TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210480422.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-05
Publication Date
2025-01-03
Estimated Expiration
2042-05-05

AI Technical Summary

Technical Problem

Traditional hypergraph neural networks are difficult to adapt and optimize hypergraph structures when processing complex data, resulting in inaccurate modeling of data association relationships and reducing the prediction performance of data labels.

Method used

Using a hypergraph construction module based on the multi-head self-attention mechanism, the connection probability of vertices and hyper-edges can be calculated by learning parameters, generating hypergraph structures, and inputting them into hypergraph neural networks to optimize hypergraph structures and improve data label prediction performance .

Benefits of technology

Adaptive hypergraph modeling of complex data and downstream tasks is realized, and data association relationships are more accurately modeled, improving data label prediction performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115130544B_ABST
    Figure CN115130544B_ABST
Patent Text Reader

Abstract

The present application relates to the field of data label processing technology, and in particular to a data classification method and device based on a multi-head self-attention hypergraph neural network, wherein the method comprises: extracting data features of at least one sample data; inputting the data features into a preset hypergraph construction module based on a multi-head self-attention mechanism to generate a hypergraph structure; inputting the hypergraph structure and data features into a preset hypergraph neural network, outputting a data label prediction value, and training a model based on the data label prediction value to obtain a data classification model for data classification. Thus, the problems in the related art that it is difficult to adaptively model hypergraphs for complex data and downstream tasks, and that it is not conducive to optimizing the hypergraph structure, and that it is impossible to accurately model data associations, thereby reducing the prediction performance of data labels, are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data label processing, and in particular to a data classification method and device based on a multi-head self-attention hypergraph neural network. Background Art

[0002] Among related technologies, hypergraph has received widespread attention in recent years due to its powerful high-order association modeling capabilities. Researchers have found that by introducing hypergraph structures into machine learning models, hypergraph neural networks combine the advantages of hypergraph modeling and neural networks, and have demonstrated superior performance in tasks such as classification and clustering.

[0003] However, due to the influence of data noise and data missing, the hypergraph structure constructed in the related technology has a large number of redundant and erroneous connections, which makes it difficult to adaptively model the hypergraph for complex data and downstream tasks, and is not conducive to optimizing the hypergraph structure. It is impossible to accurately model data associations, thereby reducing the predictability of data labels, which needs to be solved urgently. Summary of the invention

[0004] This application is based on the inventor's understanding and discovery of the following problems:

[0005] Hypergraph is a commonly used method for modeling high-order associations between data. It consists of a set of nodes and a set of hyperedges. A hyperedge can connect multiple vertices. For example, in a recommendation system, a product will be pushed to multiple users who are interested in it. In this case, a user can be regarded as a vertex and a product as a hyperedge. If a user is interested in the product, the corresponding node will be included in the hyperedge, otherwise it will not be included in the hyperedge. Hypergraphs have received widespread attention in recent years due to their powerful high-order association modeling capabilities. Researchers have found that introducing hypergraph structures into machine learning models and considering high-order association information between multiple samples during the learning process can achieve better downstream task performance. Among them, hypergraph neural networks combine the advantages of hypergraph modeling and neural networks, and have demonstrated superior performance in tasks such as classification and clustering.

[0006] However, the traditional hypergraph neural network is built on the basis of static hypergraph structure. When the data itself does not have an explicit hypergraph structure, it is necessary to first construct a hypergraph structure through methods such as k-nearest neighbors based on node attributes, features and other information, so as to introduce the static hypergraph structure into the hypergraph neural network. The performance of the hypergraph neural network is affected by the hypergraph structure. If the hypergraph structure cannot accurately model the data association, then the performance of the hypergraph neural network will also be greatly reduced. Therefore, it is of great significance to accurately model the high-order associations between data. However, in actual tasks, the relevant technology is affected by data noise and data missing. The hypergraph structure constructed by the existing method has a large number of redundant and erroneous connections, and once the hypergraph structure is established, it is fixed in the entire learning process, making it difficult to adapt to complex data.

[0007] The present application provides a data classification method and device based on a multi-head self-attention hypergraph neural network to solve the problems in the related technology that it is difficult to adaptively model the hypergraph for complex data and downstream tasks, is not conducive to optimizing the hypergraph structure, and cannot accurately model data associations, thereby reducing the prediction performance of data labels.

[0008] The first aspect of the present application provides a data classification method based on a multi-head self-attention hypergraph neural network, comprising the following steps: extracting data features of at least one sample data; inputting the data features into a preset hypergraph construction module based on a multi-head self-attention mechanism to generate a hypergraph structure; inputting the hypergraph structure and the data features into a preset hypergraph neural network, outputting a data label prediction value, and training a model based on the data label prediction value to obtain a data classification model for data classification.

[0009] Optionally, in one embodiment of the present application, the data features are input into a preset hypergraph construction module based on a multi-head self-attention mechanism to generate a hypergraph structure, including: based on the preset hypergraph construction module based on a multi-head self-attention mechanism, calculating the attention score of each head; obtaining an association matrix based on the attention score of each head, and using the association matrix to represent the hypergraph structure.

[0010] Optionally, in one embodiment of the present application, the hypergraph structure and the data features are input into a preset hypergraph neural network, and a data label prediction value is output, including: calculating a label vector of the at least one sample data to obtain a set of label vectors for all sample data; based on the set of label vectors, calculating a hyperedge weight diagonal matrix and a node degree diagonal matrix of the hypergraph in the hypergraph structure; and using the preset hypergraph neural network according to the hyperedge weight diagonal matrix and the node degree diagonal matrix to obtain a data label prediction value for the at least one sample data.

[0011] Optionally, in one embodiment of the present application, the calculation formula of the data tag prediction value is:

[0012]

[0013] in, Represents the label prediction value of the sample data, Z (2) Represents the output of the second hidden layer, W out and b out Represents the bias parameter of the output layer.

[0014] Optionally, in one embodiment of the present application, the data classification model for data classification is obtained based on the data label prediction value training model, including: calculating the smoothness constraint penalty term and the prediction error term of the hypergraph structure according to the data label prediction value of at least one sample data, the initial value, the data feature and the association matrix; adding the smoothness constraint penalty term and the prediction error term to obtain a loss function value, and calculating the learnable parameters through the back propagation algorithm based on the loss function value, updating the parameter values ​​until the convergence conditions are met, and obtaining the data classification model.

[0015] The second aspect of the present application provides a data classification device based on a multi-head self-attention hypergraph neural network, including: an extraction module for extracting data features of at least one sample data; a generation module for inputting the data features into a preset hypergraph construction module based on a multi-head self-attention mechanism to generate a hypergraph structure; a classification module for inputting the hypergraph structure and the data features into a preset hypergraph neural network, outputting a data label prediction value, and training a model based on the data label prediction value to obtain a data classification model for data classification.

[0016] Optionally, in one embodiment of the present application, the generation module includes: a first calculation unit, used to calculate the attention score of each head based on the preset hypergraph construction module based on the multi-head self-attention mechanism; a second calculation unit, used to obtain a correlation matrix according to the attention score of each head, and use the correlation matrix to represent the hypergraph structure.

[0017] Optionally, in one embodiment of the present application, the classification module includes: a third calculation unit, used to calculate the label vector of the at least one sample data to obtain a set of label vectors for all sample data; a fourth calculation unit, used to calculate the hyperedge weight diagonal matrix and the node degree diagonal matrix of the hypergraph in the hypergraph structure based on the label vector set; an acquisition unit, used to obtain the data label prediction value of the at least one sample data using the preset hypergraph neural network according to the hyperedge weight diagonal matrix and the node degree diagonal matrix.

[0018] Optionally, in one embodiment of the present application, the calculation formula of the data tag prediction value is:

[0019]

[0020] in, Represents the label prediction value of the sample data, Z (2) Represents the output of the second hidden layer, W out and b out Represents the bias parameter of the output layer.

[0021] Optionally, in one embodiment of the present application, the classification module also includes: a fifth calculation unit, used to calculate the smoothness constraint penalty term and the prediction error term of the hypergraph structure based on the data label prediction value of the at least one sample data, the initial value, the data features and the association matrix; an updating unit, used to add the smoothness constraint penalty term and the prediction error term to obtain a loss function value, and calculate the learnable parameters based on the loss function value through a back propagation algorithm, update the parameter values ​​until the convergence conditions are met, and obtain the data classification model.

[0022] The third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the data classification method based on the multi-head self-attention hypergraph neural network as described in the above embodiment.

[0023] The fourth aspect of the present application provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable the computer to execute the data classification method based on the multi-head self-attention hypergraph neural network as described in the above embodiment.

[0024] The embodiment of the present application inputs data features into a preset hypergraph construction module based on a multi-head self-attention mechanism, which calculates the connection probability of vertices and hyperedges through learnable parameters, and generates a hypergraph structure through threshold segmentation, thereby inputting the hypergraph structure and data features into a preset hypergraph neural network, and outputting data label prediction values, thereby obtaining a data classification model for data classification, and adaptive hypergraph modeling for complex data and downstream tasks. By optimizing the hypergraph structure, data association relationships can be modeled more accurately, thereby effectively improving the data label prediction performance. Thus, the problems in the related art that it is difficult to adaptively model hypergraphs for complex data and downstream tasks, and that it is not conducive to optimizing the hypergraph structure, and that data association relationships cannot be accurately modeled, thereby reducing the prediction performance of data labels, are solved.

[0025] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0027] Figure 1 A flowchart of a data classification method based on a multi-head self-attention hypergraph neural network provided according to an embodiment of the present application;

[0028] Figure 2 It is a schematic diagram of the principle of a data classification method based on a multi-head self-attention hypergraph neural network according to an embodiment of the present application;

[0029] Figure 3 A flowchart of a data classification method based on a multi-head self-attention hypergraph neural network provided according to a specific embodiment of the present application;

[0030] Figure 4 It is a structural schematic diagram of a data classification device based on a multi-head self-attention hypergraph neural network according to an embodiment of the present application;

[0031] Figure 5 It is a schematic diagram of the structure of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION

[0032] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0033] The following describes the data classification method and device based on the multi-head self-attention hypergraph neural network of the embodiment of the present application with reference to the accompanying drawings. In view of the problem that it is difficult to adaptively model the hypergraph of complex data and downstream tasks in the related technology mentioned in the background technology center, and it is not conducive to optimizing the hypergraph structure, and it is impossible to accurately model the data association relationship, thereby reducing the prediction performance of the data label, the present application provides a data classification method based on the multi-head self-attention hypergraph neural network, in which the embodiment of the present application inputs the data features into the preset hypergraph construction module based on the multi-head self-attention mechanism, and calculates the connection probability of vertices and hyperedges through learnable parameters, and generates a hypergraph structure through threshold segmentation, thereby inputting the hypergraph structure and data features into the preset hypergraph neural network, and outputting the data label prediction value, thereby obtaining a data classification model for data classification, and adaptive hypergraph modeling for complex data and downstream tasks, by optimizing the hypergraph structure, the data association relationship can be more accurately modeled, thereby effectively improving the data label prediction performance. Thus, the problems that it is difficult to adaptively model the hypergraph of complex data and downstream tasks in the related technology, and it is not conducive to optimizing the hypergraph structure, and it is impossible to accurately model the data association relationship, thereby reducing the prediction performance of the data label, etc.

[0034] Specifically, Figure 1 A flow chart of a data classification method based on a multi-head self-attention hypergraph neural network provided in an embodiment of the present application.

[0035] like Figure 1 As shown, the data classification method based on the multi-head self-attention hypergraph neural network includes the following steps:

[0036] In step S101, extracting data features of at least one sample data;

[0037] It can be understood that the embodiments of the present application can extract data features of at least one sample data, wherein the sample data can be labeled data and unlabeled data. For example, for unlabeled data, the embodiments of the present application can first extract the data features of the sample data, and initialize the hypergraph construction module based on the multi-head self-attention mechanism and the learnable parameters in the hypergraph neural network, so as to perform adaptive hypergraph modeling of complex data and downstream tasks, and effectively improve the accuracy of data label classification tasks.

[0038] As a possible implementation method, the method of the embodiment of the present application can be applied to gesture recognition, three-dimensional object recognition, such as Figure 2 As shown, the embodiment of the present application may include the following steps:

[0039] Step S1011: extracting feature vectors of N sample data in the database, wherein the sample data includes labeled data and unlabeled data.

[0040] Specifically, this embodiment uses the classification of three-dimensional object feature description data as an example for explanation. The database uses the Princeton ModelNet40 dataset, a public benchmark dataset for three-dimensional object recognition and retrieval. The dataset contains a total of 12,311 three-dimensional CAD models of 40 common object categories, including vases, pianos, chairs, etc., of which 9,348 three-dimensional objects have label information and 2,468 three-dimensional objects do not have label information. A group view convolutional neural network is used to extract the feature vector of the three-dimensional object. After the three-dimensional object is input into the group view convolutional neural network, a 2048-dimensional feature vector can be output.

[0041] Step S1012: Initialize the hypergraph construction module based on the multi-head self-attention mechanism and the learnable parameters in the hypergraph neural network. The learnable parameters of the hypergraph construction module based on the multi-head self-attention mechanism include the multi-head w h (h=1,2,…,H), the learnable parameters of the hypergraph neural network include the weights of the two hypergraph convolutional layers and the bias parameter Θ of the output layer (1) , Θ (2) , W out 、b out .

[0042] In step S102, the data features are input into a preset hypergraph construction module based on a multi-head self-attention mechanism to generate a hypergraph structure;

[0043] It can be understood that the embodiments of the present application can input data features into a preset hypergraph construction module based on a multi-head self-attention mechanism, calculate the connection probability of vertices and hyperedges through learnable parameters, and generate a hypergraph structure through threshold segmentation, which is conducive to considering high-order correlation information between multiple samples during the learning process, thereby obtaining better downstream task performance.

[0044] It should be noted that the preset hypergraph construction module based on the multi-head self-attention mechanism will be elaborated in detail below.

[0045] Furthermore, in one embodiment of the present application, data features are input into a preset hypergraph construction module based on a multi-head self-attention mechanism to generate a hypergraph structure, including: calculating the attention score of each head based on the preset hypergraph construction module based on a multi-head self-attention mechanism; obtaining an association matrix based on the attention score of each head, and using the association matrix to represent the hypergraph structure.

[0046] For example, the embodiment of the present application can input the data feature vector of the sample data into a hypergraph construction module based on the multi-head self-attention mechanism, which uses weighted cosine similarity as the metric for each head, and the hypergraph structure is represented by an association matrix, that is:

[0047] H∈R |V|×|E|

[0048] in, is the vertex set of the hypergraph structure, ε is the hyperedge set, H ij represents the association weight between the ith vertex and the jth hyperedge in the hypergraph. If the ith vertex does not belong to the jth hyperedge, then H ij is equal to 0, otherwise H ij is a real number greater than 0 and less than or equal to 1.

[0049] In the embodiment of the present application, the association matrix of the hypergraph structure can be calculated by merging the attention scores of M heads, that is, for each head, N hyperedges are generated based on the attention score, and finally MN hyperedges are obtained.

[0050] Specifically, the embodiment of the present application can set x i represents the feature vector of the i-th sample data, and the feature vector set of all sample data is X = {x1, x2, ..., x N}. The calculation formula of the attention score of the mth head is as follows:

[0051]

[0052] in, is the attention score of the mth head, x i The feature vector representing the i-th sample data

[0053] Get H 1 ,H 2 ,…,H M After that, the embodiment of the present application can merge these M matrices to obtain

[0054]

[0055] It should be noted that the embodiment of the present application may a priori assume that the correlation matrix H is sparse and set a threshold ∈, All elements less than ∈ in are 0, and H is obtained, so that the hypergraph construction module generates a hypergraph structure containing MN hyperedges, and its association matrix can be expressed as H.

[0056] It should be noted that the specific value of the threshold is set by those skilled in the art according to actual conditions and is not specifically limited here.

[0057] In step S103, the hypergraph structure and data features are input into a preset hypergraph neural network, data label prediction values ​​are output, and a model is trained based on the data label prediction values ​​to obtain a data classification model for data classification.

[0058] Specifically, the embodiments of the present application can input the generated hypergraph structure and data features into a preset hypergraph neural network, output data label prediction values, and train the model based on the data label prediction values, thereby optimizing and updating the hypergraph structure according to downstream tasks, and can more flexibly model high-order associations of complex data and achieve more accurate data label classification tasks.

[0059] In one embodiment of the present application, a hypergraph structure and data features are input into a preset hypergraph neural network, and a data label prediction value is output, including: calculating a label vector of at least one sample data to obtain a set of label vectors for all sample data; based on the set of label vectors, calculating a hyperedge weight diagonal matrix and a node degree diagonal matrix of the hypergraph in the hypergraph structure; and obtaining a data label prediction value of at least one sample data using a preset hypergraph neural network according to the hyperedge weight diagonal matrix and the node degree diagonal matrix.

[0060] In the actual implementation process, Figure 2 As shown, the embodiment of the present application can introduce the hypergraph structure association matrix H and sample features X generated above into the hypergraph neural network to calculate the label vector of the data.

[0061] Specifically, i represents the label vector of the i-th sample data. The label vector set of all sample data can be Y = {y1, y2, ..., y N}, where for the label vector y i The initial value of can be defined as follows:

[0062] For labeled data, if it belongs to the jth category, the embodiment of the present application can let y ij =1, and the rest of the elements are equal to 0. If it is unlabeled data, all elements are set to 0.5.

[0063] Let 1 represent a vector whose elements are all 1. First, calculate the hyperedge weight diagonal matrix D of the hypergraph by the following formula: e and the node degree diagonal matrix D v :

[0064] D e =diag(1 T H)

[0065] D v =diag(HW1)

[0066] Among them, D e is the hyperedge weight diagonal matrix, D v is the node degree diagonal matrix, and H is the hypergraph structure association matrix.

[0067] Among them, the hypergraph neural network can include two hypergraph convolutional layers and one output layer.

[0068] The first layer of hypergraph convolutional layer inputs sample features and outputs the first layer of hidden layer representation. The calculation formula can be:

[0069]

[0070] Among them, Z (1) represents the output of the first hidden layer, Θ (1) is the parameter of the first hypergraph convolutional layer, and X is the sample feature.

[0071] The second layer of hypergraph convolutional layer inputs the first layer of hidden layer representation, and outputs the second layer of hidden layer representation. The calculation formula can be:

[0072]

[0073] Among them, Z (2) represents the output of the second hidden layer, Θ (2) are the parameters of the second hypergraph convolutional layer.

[0074] In the embodiment of the present application, the output layer can be input into the second hidden layer to represent the output label prediction value of the sample data:

[0075] In one embodiment of the present application, the calculation formula of the data tag prediction value is:

[0076]

[0077] in, Represents the label prediction value of the sample data, Z (2) Represents the output of the second hidden layer, W out and b out Represents the bias parameter of the output layer.

[0078] Optionally, in one embodiment of the present application, a data classification model for data classification is obtained based on a data label prediction value training model, including: calculating a smoothness constraint penalty term and a prediction error term of a hypergraph structure based on a data label prediction value, an initial value, data features and an association matrix of at least one sample data; adding the smoothness constraint penalty term and the prediction error term to obtain a loss function value, and calculating a learnable parameter based on the loss function value through a back propagation algorithm, updating the parameter value until the convergence condition is met, and obtaining a data classification model.

[0079] It can be understood that the embodiments of the present application can obtain a data classification model for data classification based on a data label prediction value training model. That is to say, during the training process, the embodiments of the present application can calculate the loss function value based on the data features and the generated hypergraph structure, thereby synchronously updating the learnable parameters of the hypergraph construction module and the hypergraph neural network through the back propagation algorithm, and updating the parameter values ​​until the iteration converges, and then optimizing and updating the hypergraph structure according to the downstream tasks, thereby more flexibly constructing high-order associations of complex data and effectively improving the accuracy of data label classification tasks.

[0080] In some embodiments, Figure 2 As shown, the embodiment of the present application may include the following steps:

[0081] Step S1031: Predicting the label value based on the sample data And the initial value Y, sample feature X and the generated hypergraph structure association matrix H, the embodiment of the present application can introduce a hypergraph structure smoothness constraint penalty term and a prediction error term, and the two terms are added to obtain the loss function value.

[0082] Specifically, the hypergraph structure smoothness constraint term is used to constrain the generation of the hypergraph structure. In the embodiment of the present application, by reducing the value of this term, vertices with similar features can be closer in the hypergraph manifold space. The calculation formula can be:

[0083]

[0084] Among them, L reg is the penalty term for the smoothness constraint of the hypergraph structure, and X is the sample feature.

[0085] The prediction error term can make the predicted value of the sample data label as close to its initial value as possible. The calculation formula can be:

[0086]

[0087] Among them, L emp To calculate the prediction error, is the label prediction value, Y is the initial value

[0088] The loss function value is obtained by adding the two items, and the calculation formula is:

[0089] L=L emp +L reg

[0090] Among them, L is the total loss function value, L reg is the penalty term for the hypergraph structure smoothness constraint, L emp To calculate the prediction error.

[0091] Step S1032: Based on The learnable parameters w are calculated by back-propagation algorithm h (h=1,2,…,H), Θ (1) , Θ (2) , W out and b out The Adam algorithm is used to update the parameter value.

[0092] Step S1033: Repeat the above steps until the iteration converges.

[0093] Specifically, after solving, the embodiment of the present application can obtain the optimal label vector set The label vector of the i-th sample data is Further, the embodiments of the present application can be found The subscript of the largest element in , if yes The largest element in , then the i-th sample data is classified into the j-th category. Through the above method, the 2468 unlabeled data without label information in the sample data can be classified.

[0094] like Figure 3 As shown, the working principle of the method of the embodiment of the present application is described in detail with a specific embodiment.

[0095] Step S301: extracting feature vectors of N sample data in a database, wherein the sample data includes labeled data and unlabeled data.

[0096] Step S302: Initialize the hypergraph construction module based on the multi-head self-attention mechanism and the learnable parameters in the hypergraph neural network. The learnable parameters of the hypergraph construction module based on the multi-head self-attention mechanism include the multi-head w h (h= 1,2,…,H), the learnable parameters of the hypergraph neural network include the weights of the two hypergraph convolutional layers and the bias parameter Θ of the output layer (1) , Θ (2) , W out , b out .

[0097] Step S303: Input the data feature vector of the sample data into the hypergraph construction module based on the multi-head self-attention mechanism, which uses weighted cosine similarity as the metric for each head, and the hypergraph structure is represented by the association matrix, namely:

[0098] H∈R |V|×|E|

[0099] in, is the vertex set of the hypergraph structure, ε is the hyperedge set, H ijrepresents the association weight between the ith vertex and the jth hyperedge in the hypergraph. If the ith vertex does not belong to the jth hyperedge, then H ij is equal to 0, otherwise H ij is a real number greater than 0 and less than or equal to 1.

[0100] Step S304: Introduce the hypergraph structure association matrix H and sample features X generated above into the hypergraph neural network to calculate the label vector of the data.

[0101] Step S305: Predicting the label value based on the sample data And the initial value Y, sample feature X and the generated hypergraph structure association matrix H, introduce the hypergraph structure smoothness constraint penalty term and prediction error term, and add the two items to get the loss function value.

[0102] Step S306: Based on The learnable parameters w are calculated by back-propagation algorithm h (h=1,2,…,H), Θ (1) , Θ (2) , W out and b out The Adam algorithm is used to update the parameter value.

[0103] Step S307: Repeat steps S303 to S306 until the iteration converges.

[0104] According to the data classification method based on a multi-head self-attention hypergraph neural network proposed in the embodiment of the present application, the embodiment of the present application inputs data features into a preset hypergraph construction module based on a multi-head self-attention mechanism, which calculates the connection probability of vertices and hyperedges through learnable parameters, and generates a hypergraph structure through threshold segmentation, thereby inputting the hypergraph structure and data features into the preset hypergraph neural network, and outputting data label prediction values, thereby obtaining a data classification model for data classification, and adaptive hypergraph modeling for complex data and downstream tasks. By optimizing the hypergraph structure, data association relationships can be modeled more accurately, thereby effectively improving the data label prediction performance.

[0105] Secondly, refer to the accompanying drawings to describe the data classification device based on the multi-head self-attention hypergraph neural network proposed according to the embodiment of the present application.

[0106] Figure 4 It is a block diagram of a data classification device based on a multi-head self-attention hypergraph neural network according to an embodiment of the present application.

[0107] like Figure 4 As shown, the data classification device 10 based on the multi-head self-attention hypergraph neural network includes: an extraction module 100, a generation module 200 and a classification module 300.

[0108] Specifically, the extraction module 100 is used to extract data features of at least one sample data.

[0109] The generation module 200 is used to input data features into a preset hypergraph construction module based on a multi-head self-attention mechanism to generate a hypergraph structure.

[0110] The classification module 300 is used to input the hypergraph structure and data features into a preset hypergraph neural network, output data label prediction values, and train a model based on the data label prediction values ​​to obtain a data classification model for data classification.

[0111] Optionally, in one embodiment of the present application, the generation module 200 includes: a first calculation unit and a second calculation unit.

[0112] Among them, the first computing unit is used to calculate the attention score of each head based on a preset hypergraph construction module based on the multi-head self-attention mechanism.

[0113] The second computing unit is used to obtain a correlation matrix according to the attention score of each head, and use the correlation matrix to represent the hypergraph structure.

[0114] Optionally, in one embodiment of the present application, the classification module 300 includes: a third calculation unit, a fourth calculation unit and an acquisition unit.

[0115] The third calculation unit is used to calculate the label vector of at least one sample data to obtain a set of label vectors of all sample data.

[0116] The fourth computing unit is used to compute the hyperedge weight diagonal matrix and the node degree diagonal matrix of the hypergraph in the hypergraph structure based on the label vector set.

[0117] An acquisition unit is used to obtain a data label prediction value of at least one sample data using a preset hypergraph neural network according to a hyperedge weight diagonal matrix and a node degree diagonal matrix.

[0118] Optionally, in one embodiment of the present application, the calculation formula of the data tag prediction value is:

[0119]

[0120] in, Represents the label prediction value of the sample data, Z (2) Represents the output of the second hidden layer, W out and b out Represents the bias parameter of the output layer.

[0121] Optionally, in one embodiment of the present application, the classification module 300 further includes: a fifth calculation unit and an updating unit.

[0122] Among them, the fifth calculation unit is used to calculate the smoothness constraint penalty term and prediction error term of the hypergraph structure according to the data label prediction value, initial value, data feature and association matrix of at least one sample data.

[0123] The updating unit is used to add the smoothness constraint penalty term and the prediction error term to obtain the loss function value, and calculate the learnable parameters through the back propagation algorithm based on the loss function value, update the parameter value until the convergence condition is met, and obtain the data classification model.

[0124] It should be noted that the aforementioned explanation of the embodiment of the data classification method based on the multi-head self-attention hypergraph neural network is also applicable to the data classification device based on the multi-head self-attention hypergraph neural network of this embodiment, and will not be repeated here.

[0125] According to the data classification device based on a multi-head self-attention hypergraph neural network proposed in the embodiment of the present application, the embodiment of the present application inputs data features into a preset hypergraph construction module based on a multi-head self-attention mechanism, which calculates the connection probability of vertices and hyperedges through learnable parameters, and generates a hypergraph structure through threshold segmentation, thereby inputting the hypergraph structure and data features into the preset hypergraph neural network, and outputting data label prediction values, thereby obtaining a data classification model for data classification, and adaptive hypergraph modeling for complex data and downstream tasks. By optimizing the hypergraph structure, data association relationships can be modeled more accurately, thereby effectively improving the data label prediction performance.

[0126] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:

[0127] A memory 501 , a processor 502 , and a computer program stored in the memory 501 and executable on the processor 502 .

[0128] When the processor 502 executes the program, the data classification method based on the multi-head self-attention hypergraph neural network provided in the above embodiment is implemented.

[0129] Furthermore, the electronic device further comprises:

[0130] The communication interface 503 is used for communication between the memory 501 and the processor 502 .

[0131] The memory 501 is used to store computer programs that can be executed on the processor 502 .

[0132] The memory 501 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0133] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0134] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.

[0135] The processor 502 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0136] This embodiment also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-mentioned data classification method based on a multi-head self-attention hypergraph neural network.

[0137] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "some examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0138] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, "a" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0139] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0140] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.

[0141] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0142] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0143] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0144] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A three-dimensional object data classification method based on a multi-head self-attention hypergraph neural network, characterized in that: The following steps are involved: Extracting data features of at least one sample data, wherein the sample data comes from Princeton ModelNet40, a public benchmark data set for 3D object recognition and retrieval, and contains 12,311 3D CAD models of 40 common object categories, including vases, pianos, and chairs, some of which have label information and some of which do not; extracting feature vectors of the 3D objects using a group view convolutional neural network, and outputting corresponding feature vectors after inputting the 3D objects into the group view convolutional neural network; Inputting the data features into a preset hypergraph construction module based on a multi-head self-attention mechanism to generate a hypergraph structure; as well as Inputting the hypergraph structure and the data features into a preset hypergraph neural network, outputting a data label prediction value, and training a model based on the data label prediction value to obtain a data classification model for data classification; The step of inputting the data features into a preset hypergraph construction module based on a multi-head self-attention mechanism to generate a hypergraph structure includes: calculating the attention score of each head based on the preset hypergraph construction module based on a multi-head self-attention mechanism; obtaining an association matrix according to the attention score of each head, and using the association matrix to represent the hypergraph structure; Set x i represents the feature vector of the i-th sample data, and the feature vector set of all sample data is X = {x1, x2, ..., x N }, where the calculation formula for the attention score of the mth head is as follows: in, is the attention score of the mth head, x i Represents the eigenvector of the i-th sample data; get H 1 ,H 2 ,…,H M After that, these M matrices can be combined to obtain Assume a priori that the correlation matrix H is sparse, and set a threshold ∈, let All elements less than ∈ in are 0, and H is obtained, so that the hypergraph construction module generates a hypergraph structure containing MN hyperedges, and its association matrix can be expressed as H; The hypergraph structure is represented by an association matrix, namely: H∈R |V|×|E| in, is the vertex set of the hypergraph structure, ε is the hyperedge set, H ij represents the association weight between the ith vertex and the jth hyperedge in the hypergraph. If the ith vertex does not belong to the jth hyperedge, then H ij is equal to 0, otherwise H ij is a real number greater than 0 and less than or equal to 1; The method of inputting the hypergraph structure and the data features into a preset hypergraph neural network and outputting a data label prediction value includes: calculating a label vector of at least one sample data to obtain a label vector set of all sample data; based on the label vector set, calculating a hyperedge weight diagonal matrix and a node degree diagonal matrix of the hypergraph in the hypergraph structure; and obtaining a data label prediction value of at least one sample data using the preset hypergraph neural network according to the hyperedge weight diagonal matrix and the node degree diagonal matrix.

2. The method according to claim 1, characterized in that The calculation formula of the data label prediction value is: in, Represents the label prediction value of the sample data, Z (2) Represents the output of the second hidden layer, W out and b out Represents the bias parameter of the output layer.

3. The method according to claim 1 or 2, characterized in that: The training model based on the data label prediction value to obtain a data classification model for data classification includes: Calculate the smoothness constraint penalty term and the prediction error term of the hypergraph structure according to the data label prediction value, the initial value, the data feature and the association matrix of the at least one sample data; The smoothness constraint penalty term and the prediction error term are added to obtain a loss function value, and based on the loss function value, the learnable parameters are calculated through a back propagation algorithm, and the parameter values ​​are updated until the convergence conditions are met to obtain the data classification model.

4. A three-dimensional object data classification device based on a multi-head self-attention hypergraph neural network, characterized in that: include: An extraction module is used to extract data features of at least one sample data, wherein the sample data comes from Princeton ModelNet40, a public benchmark data set for 3D object recognition and retrieval, and contains 12,311 3D CAD models of 40 common object categories, including vases, pianos, and chairs, some of which have label information and some of which do not; a group view convolutional neural network is used to extract a feature vector of the 3D object, and after the 3D object is input into the group view convolutional neural network, a corresponding feature vector can be output; A generation module, used for inputting the data features into a preset hypergraph construction module based on a multi-head self-attention mechanism to generate a hypergraph structure; as well as A classification module, used for inputting the hypergraph structure and the data features into a preset hypergraph neural network, outputting a data label prediction value, and training a model based on the data label prediction value to obtain a data classification model for data classification; The step of inputting the data features into a preset hypergraph construction module based on a multi-head self-attention mechanism to generate a hypergraph structure includes: calculating the attention score of each head based on the preset hypergraph construction module based on a multi-head self-attention mechanism; obtaining an association matrix according to the attention score of each head, and using the association matrix to represent the hypergraph structure; Set x i represents the feature vector of the i-th sample data, and the feature vector set of all sample data is X = {x1, x2, ..., x N }, where the calculation formula for the attention score of the mth head is as follows: in, is the attention score of the mth head, x i Represents the eigenvector of the i-th sample data; get H 1 ,H 2 ,…,H M After that, these M matrices can be combined to obtain Assume a priori that the correlation matrix H is sparse, and set a threshold ∈, let All elements less than ∈ in are 0, and H is obtained, so that the hypergraph construction module generates a hypergraph structure containing MN hyperedges, and its association matrix can be expressed as H; The hypergraph structure is represented by an association matrix, namely: H∈R |V|×|E| in, is the vertex set of the hypergraph structure, ε is the hyperedge set, H ij represents the association weight between the ith vertex and the jth hyperedge in the hypergraph. If the ith vertex does not belong to the jth hyperedge, then H ij is equal to 0, otherwise H ij is a real number greater than 0 and less than or equal to 1; The method of inputting the hypergraph structure and the data features into a preset hypergraph neural network and outputting a data label prediction value includes: calculating a label vector of at least one sample data to obtain a label vector set of all sample data; based on the label vector set, calculating a hyperedge weight diagonal matrix and a node degree diagonal matrix of the hypergraph in the hypergraph structure; and obtaining a data label prediction value of at least one sample data using the preset hypergraph neural network according to the hyperedge weight diagonal matrix and the node degree diagonal matrix.

5. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the three-dimensional object data classification method based on a multi-head self-attention hypergraph neural network as described in any one of claims 1 to 3.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement a three-dimensional object data classification method based on a multi-head self-attention hypergraph neural network as described in any one of claims 1 to 3.