Method, apparatus, and device for sample classification and computer-readable storage medium

By using graph structure information and node feature information in the graph neural network to construct a similarity probability matrix and perform label propagation, the overfitting problem caused by insufficient training samples is solved and the generalization performance of the model is improved.

WO2024217247A1PCT designated stage expired Publication Date: 2024-10-24LANGCHAO ELECTRONIC INFORMATION IND CO LTD

Patent Information

Application Number
PCT/CN2024/084547
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-19
Filing Date
2024-03-28
Publication Date
2024-10-24

AI Technical Summary

Technical Problem

In the node classification task, due to insufficient training samples, graph neural networks can easily lead to data overfitting and insufficient generalization capabilities.

Method used

By using the graph structure information and initial node feature information in the training samples, the graph neural network is trained, a similarity probability matrix is ​​constructed, the labels are propagated to similar nodes, the model weights are adjusted, and the training sample labels are added by combining the random walk label propagation technology quantity to reduce overfitting.

Benefits of technology

It effectively solves the problem of data overfitting caused by insufficient training samples, and improves the generalization performance and recognition accuracy of graph neural networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024084547_24102024_PF_FP_ABST
    Figure CN2024084547_24102024_PF_FP_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of artificial intelligence, and discloses a method, apparatus, and device for sample classification and a nonvolatile readable storage medium. The method comprises: training a graph neural network model by utilizing graph structure information and initial node feature information contained in a training sample to obtain fused node feature information and a predicted label obtained from the training; constructing a similarity probability matrix on the basis of the similarity between nodes in the node feature information; according to the similarity probability matrix and a training label contained in the training sample, determining a propagation label corresponding to each node in the training sample; and according to the propagation label, the training label, and the predicted label, adjusting the weight of the graph neural network model to obtain a trained graph neural network model, and then analyzing a to-be-processed sample to output a sample category. According to the similarity between nodes, the training label can be transmitted to nodes with similar features to increase the number of labels during training, thereby solving the problem of data overfitting.
Need to check novelty before this filing date? Find Prior Art

Description

A sample classification method, device, equipment and computer-readable storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to the Chinese patent application filed with the China Patent Office on April 19, 2023, with application number 202310417849.8, and application name “A sample classification method, device, equipment and computer-readable storage medium”, the entire contents of which are incorporated by reference into this application. Technical Field

[0003] The present application relates to the field of artificial intelligence technology, and in particular to a sample classification method, apparatus, device, and non-volatile readable storage medium. Background Art

[0004] Graph Neural Networks (GNNs) are irregular and disordered. In addition to learning structured data, they can also learn unstructured data, such as text and images, and reason within the extracted graph structure. GNNs have garnered significant attention for their ability to model unstructured data and are widely used in fields such as graph node classification, molecular interactions, social networks, recommendation systems, and program comprehension.

[0005] Many GNN methods opt for structural improvements to better model linguistic or image information, which results in poor model interpretability and inapplicability to large datasets. In graph-based node classification tasks, GNN training can easily lead to severe overfitting and insufficient generalization due to irregular dataset partitioning and a small number of training set samples. For example, a graph dataset with 2708 nodes for node classification contains only 140 training nodes, less than 10% of the total data. Current techniques typically repartition the dataset to increase the number of training set samples, significantly improving model accuracy. However, this changes the original intention of partitioning the dataset and is unsuitable for training graph neural networks.

[0006] Summary of the Invention

[0007] The purpose of some embodiments of the present application is to provide a sample classification method, apparatus, device and non-volatile readable storage medium, which can solve the problem of data overfitting caused by insufficient training samples.

[0008] To solve the above technical problems, some embodiments of the present application provide a sample classification method, including:

[0009] The graph neural network model is trained using the graph structure information and initial node feature information contained in the training samples to obtain the fused node feature information and the trained prediction labels.

[0010] Based on the similarity between nodes in the node feature information, a similarity probability matrix is ​​constructed;

[0011] According to the similarity probability matrix and the training labels contained in the training samples, the corresponding propagation labels of all nodes in the training samples are determined;

[0012] Adjust the weights of the graph neural network model based on the propagation labels, training labels, and prediction labels to obtain a trained graph neural network model.

[0013] The trained graph neural network model is used to analyze the samples to be processed to output the sample categories corresponding to the samples to be processed.

[0014] Optionally, the graph neural network model is trained using the graph structure information and initial node feature information contained in the training sample to obtain fused node feature information and trained prediction labels including:

[0015] Preprocessing the initial node feature information to obtain first node feature information;

[0016] Normalize the graph structure information to obtain the adjacency matrix;

[0017] Based on the first node feature information, the adjacency matrix, and the weight matrix corresponding to each layer of graph convolution in the graph neural network model, the fused node feature information and the predicted label obtained by training the graph neural network model are obtained.

[0018] Optionally, based on the first node feature information, the adjacency matrix, and the weight matrix corresponding to each layer of graph convolution in the graph neural network model, obtaining the fused node feature information and the predicted label obtained by training the graph neural network model includes:

[0019] The product of the first node feature information, the first weight matrix corresponding to the first layer of graph convolution in the graph neural network model, and the adjacency matrix is ​​used as the second node feature information;

[0020] The product of the second node feature information, the second weight matrix corresponding to the second layer of graph convolution in the graph neural network model, and the adjacency matrix is ​​used as the fused node feature information;

[0021] The product of the fused node feature information, the third weight matrix corresponding to the third layer of graph convolution in the graph neural network model, and the adjacency matrix is ​​used as the feature information of the node to be trained, and the feature information of the node to be trained is analyzed to determine the predicted label obtained by training the graph neural network model.

[0022] A three-layer graph convolution graph neural network model is used to train the training samples. Relying on the first two layers of graph convolution, the fused node feature information can be obtained. The fused node feature information fully retains the node characteristics and correlation; based on the third layer of graph convolution, the predicted label obtained by training the graph neural network model can be determined.

[0023] Optionally, preprocessing the initial node feature information to obtain the first node feature information includes:

[0024] The initial node feature information is randomly discarded to obtain the first node feature information.

[0025] By randomly discarding the initial node feature information, the unsaturation of samples can be guaranteed during each training, thereby reducing overfitting.

[0026] Optionally, the graph structure information is normalized to obtain an adjacency matrix including:

[0027] According to the degree matrix corresponding to the graph structure information and the diagonal transformation matrix, the adjacency matrix after normalization of the graph structure information is determined.

[0028] Optionally, determining the normalized adjacency matrix of the graph structure information based on the degree matrix and the diagonal transformation matrix corresponding to the graph structure information includes:

[0029] Call the normalization formula to process the degree matrix and diagonal transformation matrix corresponding to the graph structure information to obtain the normalized adjacency matrix; the normalization formula is:

[0030] in, Represents the degree matrix corresponding to the graph structure information, Represents a diagonal transformation matrix, which adjusts the number of diagonals in the matrix corresponding to the graph structure information from zero to one.

[0031] Optionally, determining the propagation labels corresponding to all nodes in the training sample based on the similarity probability matrix and the training labels included in the training sample includes:

[0032] Based on the distribution of training labels of each node in the training sample, an initial label propagation matrix is ​​established;

[0033] The initial label propagation matrix is ​​iteratively processed using the similarity probability matrix until a propagation label that meets the convergence condition is obtained.

[0034] Optionally, based on the distribution of training labels of each node in the training sample, establishing an initial label propagation matrix includes:

[0035] Construct a label matrix based on the training labels contained in the training samples;

[0036] Construct an empty label matrix for nodes that do not contain training labels in the training samples based on the number of label categories;

[0037] Merge the label matrix and the empty label matrix as the initial label propagation matrix.

[0038] Optionally, constructing a label matrix based on training labels contained in the training samples includes:

[0039] Construct an initial label matrix based on the number of training labels contained in the training samples and the number of label categories corresponding to the graph neural network model;

[0040] The positions matched by the training labels in the initial label matrix are set to one to obtain the label matrix.

[0041] Optionally, constructing an empty label matrix for nodes in the training samples that do not contain training labels based on the number of label categories includes:

[0042] For nodes that do not contain training labels in the training samples, zero values ​​equal to the number of label categories are set to obtain an empty label matrix.

[0043] Optionally, the initial label propagation matrix is ​​iteratively processed using the similarity probability matrix until a propagation label that meets the convergence condition is obtained.

[0044] The product of the initial label propagation matrix and the similarity probability matrix is ​​used as the target label propagation matrix;

[0045] Determine whether the target label propagation matrix meets the convergence conditions;

[0046] When the target label propagation matrix does not meet the convergence condition, the target label propagation matrix is ​​used as the initial label propagation matrix, and the product of the initial label propagation matrix and the similarity probability matrix is ​​returned to the step of using the target label propagation matrix as the product of the initial label propagation matrix and the similarity probability matrix;

[0047] When the target label propagation matrix meets the convergence condition, all labels contained in the target label propagation matrix are used as propagation labels.

[0048] Optionally, determining whether the target label propagation matrix satisfies a convergence condition includes:

[0049] Determine whether the convergence formula is valid; the convergence formula is: ∑|F t+1 -F t | 2 <ε;

[0050] Among them, F t+1 represents the target label propagation matrix obtained at the t+1th iteration, F trepresents the target label propagation matrix obtained at the tth iteration, and ε represents the set convergence parameter.

[0051] Optionally, the weights of the graph neural network model are adjusted according to the propagation label, the training label, and the prediction label to obtain a trained graph neural network model including:

[0052] Determine the first loss function based on the training labels and the predicted labels;

[0053] Determine a second loss function based on the propagated label and the predicted label;

[0054] The first loss function and the second loss function are used to adjust the weights of the graph neural network model to obtain a trained graph neural network model.

[0055] Optionally, constructing a similarity probability matrix based on the similarity between nodes in the node feature information includes:

[0056] Calculate the Euclidean distance between each node in the node feature information;

[0057] The Euclidean distances between nodes are summed up to obtain a similarity probability matrix.

[0058] Optionally, constructing a similarity probability matrix based on the similarity between nodes in the node feature information includes:

[0059] Calculate the cosine distance between each node in the node feature information;

[0060] The cosine distances between nodes are summed up to obtain a similarity probability matrix.

[0061] Optionally, after analyzing the sample to be processed using the trained graph neural network model to output the sample category corresponding to the sample to be processed, the method further includes:

[0062] Get the actual category label corresponding to the sample to be processed;

[0063] When the sample category does not match the actual category label, the sample to be processed and its corresponding actual category label are added to the training sample, and the graph structure information and initial node feature information contained in the training sample are returned to train the graph neural network model to obtain the fused node feature information and the trained predicted label.

[0064] When the recognition accuracy of the graph neural network model is not high, the training samples can be expanded by adding the samples to be processed and their corresponding actual category labels to the training samples. The graph neural network model can be trained again with the expanded training samples to further improve the accuracy of the graph neural network model in identifying sample categories.

[0065] Optionally, it also includes:

[0066] When the sample category matches the actual category label, the sample to be processed and its corresponding sample category are recorded.

[0067] Some embodiments of the present application further provide a sample classification device, comprising a training unit, a construction unit, a determination unit, an adjustment unit, and an analysis unit;

[0068] The training unit is used to train the graph neural network model using the graph structure information and initial node feature information contained in the training samples to obtain the fused node feature information and the trained prediction labels;

[0069] A construction unit, configured to construct a similarity probability matrix based on the similarity between nodes in the node feature information;

[0070] A determination unit, configured to determine the propagation labels corresponding to all nodes in the training sample based on the similarity probability matrix and the training labels contained in the training sample;

[0071] An adjustment unit is used to adjust the weights of the graph neural network model according to the propagation label, training label, and prediction label to obtain a trained graph neural network model;

[0072] The analysis unit is used to analyze the samples to be processed using the trained graph neural network model to output the sample category corresponding to the samples to be processed.

[0073] Optionally, the training unit includes a preprocessing subunit, a normalization subunit, and an obtaining subunit;

[0074] A preprocessing subunit, configured to preprocess the initial node feature information to obtain first node feature information;

[0075] Normalization subunit, used to normalize the graph structure information to obtain the adjacency matrix;

[0076] A subunit is obtained, which is used to obtain the fused node feature information and the predicted label obtained by training the graph neural network model based on the first node feature information, the adjacency matrix and the weight matrix corresponding to each layer of graph convolution in the graph neural network model.

[0077] Optionally, the subunit is used to obtain the product of the first node feature information, the first weight matrix corresponding to the first layer of graph convolution in the graph neural network model, and the adjacency matrix as the second node feature information;

[0078] The product of the second node feature information, the second weight matrix corresponding to the second layer of graph convolution in the graph neural network model, and the adjacency matrix is ​​used as the fused node feature information;

[0079] The product of the fused node feature information, the third weight matrix corresponding to the third layer of graph convolution in the graph neural network model, and the adjacency matrix is ​​used as the feature information of the node to be trained, and the feature information of the node to be trained is analyzed to determine the predicted label obtained by training the graph neural network model.

[0080] Optionally, the preprocessing subunit is configured to randomly discard initial node feature information to obtain first node feature information.

[0081] Optionally, the normalization subunit is used to determine an adjacency matrix after normalization of the graph structure information based on the degree matrix and the diagonal transformation matrix corresponding to the graph structure information.

[0082] Optionally, the normalization subunit is used to call a normalization formula to process the degree matrix and the diagonal transformation matrix corresponding to the graph structure information to obtain a normalized adjacency matrix; the normalization formula is:

[0083] in, Represents the degree matrix corresponding to the graph structure information, Represents the diagonal transformation matrix, the diagonal transformation matrix is

[0084] Adjust the number of diagonals in the matrix corresponding to the graph structure information from zero to one.

[0085] Optionally, the determination unit includes an establishment subunit and an iteration subunit;

[0086] Establish a subunit for establishing an initial label propagation matrix based on the distribution of training labels of each node in the training sample;

[0087] The iterative subunit is used to iteratively process the initial label propagation matrix using the similarity probability matrix until a propagation label that meets the convergence condition is obtained.

[0088] Optionally, a subunit is established for constructing a label matrix based on training labels included in the training samples;

[0089] Construct an empty label matrix for nodes that do not contain training labels in the training samples based on the number of label categories;

[0090] Merge the label matrix and the empty label matrix as the initial label propagation matrix.

[0091] Optionally, a subunit is established to construct an initial label matrix based on the number of training labels contained in the training samples and the number of label categories corresponding to the graph neural network model; the position matched by the training label in the initial label matrix is ​​set to one to obtain a label matrix.

[0092] Optionally, a subunit is established for setting zero values ​​equal to the number of label categories for nodes in the training samples that do not contain training labels, so as to obtain an empty label matrix.

[0093] Optionally, the iterator unit is used to take the product of the initial label propagation matrix and the similarity probability matrix as the target label propagation matrix;

[0094] Determine whether the target label propagation matrix meets the convergence conditions;

[0095] When the target label propagation matrix does not meet the convergence condition, the target label propagation matrix is ​​used as the initial label propagation matrix, and the product of the initial label propagation matrix and the similarity probability matrix is ​​returned to the step of using the target label propagation matrix as the product of the initial label propagation matrix and the similarity probability matrix;

[0096] When the target label propagation matrix meets the convergence condition, all labels contained in the target label propagation matrix are used as propagation labels.

[0097] Optionally, the iterator unit is used to determine whether the convergence formula is valid; the convergence formula is: ∑|F t+1 -F t | 2 <ε;

[0098] Among them, F t+1 represents the target label propagation matrix obtained at the t+1th iteration, F t represents the target label propagation matrix obtained at the tth iteration, and ε represents the set convergence parameter.

[0099] Optionally, the adjustment unit is used to determine a first loss function based on the training label and the predicted label; determine a second loss function based on the propagation label and the predicted label; and use the first loss function and the second loss function to adjust the weights of the graph neural network model to obtain a trained graph neural network model.

[0100] Optionally, the construction unit includes a first calculation subunit and a first aggregation subunit;

[0101] A first calculation subunit is used to calculate the Euclidean distance between each node in the node feature information;

[0102] The first summarizing subunit is used to summarize the Euclidean distances between the nodes to obtain a similarity probability matrix.

[0103] Optionally, the construction unit includes a second calculation subunit and a second aggregation subunit;

[0104] The second calculation subunit is used to calculate the cosine distance between each node in the node feature information;

[0105] The second summarizing subunit is used to summarize the cosine distances between the nodes to obtain a similarity probability matrix.

[0106] Optionally, it further includes an acquisition unit and an addition unit;

[0107] An acquisition unit, used to obtain the actual category label corresponding to the sample to be processed;

[0108] An adding unit is used to add the sample to be processed and its corresponding actual category label to the training sample when the sample category does not match the actual category label, and return to the step of training the graph neural network model using the graph structure information and initial node feature information contained in the training sample to obtain the fused node feature information and the predicted label obtained by training.

[0109] Optionally, a recording unit is further included;

[0110] The recording unit is used to record the sample to be processed and its corresponding sample category when the sample category matches the actual category label.

[0111] Some embodiments of the present application further provide an electronic device, including:

[0112] memory for storing computer programs;

[0113] A processor is used to execute a computer program to implement the steps of the above sample classification method.

[0114] Some embodiments of the present application further provide a non-volatile readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned sample classification method are implemented.

[0115] As can be seen from the above technical solution, the graph neural network model is trained using the graph structure information and initial node feature information contained in the training samples to obtain fused node feature information and trained predicted labels. A similarity probability matrix is ​​constructed based on the similarity between nodes in the node feature information. Based on the similarity probability matrix and the training labels contained in the training samples, labels can be propagated to samples in the training samples that do not have training labels, thereby determining the propagated labels corresponding to all nodes in the training samples. Based on the propagated labels, training labels, and predicted labels, the weights of the graph neural network model are adjusted to obtain a trained graph neural network model. The trained graph neural network model is then used to analyze the samples to be processed and output the sample category corresponding to the samples to be processed. In this technical solution, each sample is represented by a node. The similarity between nodes can be determined based on the node feature information. Based on this similarity, a random walk label propagation method can be used to transfer training labels to nodes with similar features, thereby increasing the number of labels used during training and increasing uncertainty in the training process. This solves the problem of data overfitting caused by insufficient training samples and improves the generalization performance of the graph neural network. BRIEF DESCRIPTION OF THE DRAWINGS

[0116] In order to more clearly illustrate some embodiments of the present application, the following will briefly introduce the drawings required for use in some embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0117] FIG1 is a flow chart of a sample classification method provided in some embodiments of the present application;

[0118] FIG2 is a flowchart of a method for determining propagation labels of all nodes in a training sample provided by some embodiments of the present application;

[0119] FIG3 is a framework diagram of a sample classification model provided in some embodiments of the present application;

[0120] FIG4 is a schematic structural diagram of a sample classification device provided in some embodiments of the present application;

[0121] FIG5 is a structural diagram of an electronic device provided in some embodiments of the present application. DETAILED DESCRIPTION

[0122] The following will be combined with the accompanying drawings of some embodiments of the present application to clearly and completely describe the technical solutions of some embodiments of the present application. Obviously, some embodiments described are only some of the embodiments of the present application, not all of the embodiments. Based on some embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of this application.

[0123] The terms "including" and "having," as well as any variations thereof, in the specification and claims of this application and the accompanying drawings, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or apparatus comprising a series of steps or elements is not limited to the listed steps or elements and may include steps or elements that are not listed.

[0124] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0125] Next, a sample classification method provided by some embodiments of the present application is described in detail. FIG1 is a flow chart of a sample classification method provided by some embodiments of the present application, the method comprising:

[0126] S101: Use the graph structure information and initial node feature information contained in the training samples to train the graph neural network model to obtain the fused node feature information and the trained prediction labels.

[0127] In some embodiments of the present application, training samples can be collected based on actual sample classification requirements. Samples can be images or articles. Publications are a common form of articles. Taking the publication (Cora) dataset as an example, its categories can include seven categories: case-based, genetic algorithm, neural network, probabilistic method, reinforcement learning, rule learning, and theory.

[0128] Taking a publication dataset as an example, the training sample can include multiple papers, each of which is a sample. Each paper has its own initial node feature information, and the initial node feature information corresponding to an article represents the key words extracted from the article.

[0129] For example, the entire training sample can include 2708 papers; after stemming and removing the word endings of each paper, and ensuring that all words with a document frequency less than 10 are deleted, 1433 unique words can be left as the initial node feature information.

[0130] Each paper cites or is cited by at least one other paper, and these citation relationships can be presented as graph structure information. Graph structure information represents the topological structure formed by connecting related papers, with two related papers forming an edge in the graph structure information.

[0131] In the specific implementation, a sample can be regarded as a node, and the graph structure information represents the correlation between different nodes; the initial node feature information represents the characteristics of the node, and each node has its corresponding initial node feature information.

[0132] In practical applications, the graph structure information and initial node feature information contained in the training samples are input into the graph neural network model. The graph neural network model will process the graph structure information and the initial node feature information to obtain the fused node feature information and the trained prediction labels.

[0133] The fused node feature information refers to the node feature information obtained by comprehensively analyzing the graph structure information and the initial node feature information. The predicted label refers to the category to which each training sample belongs after the graph neural network model analyzes the input training samples. Different categories can be represented by different labels. Taking the publication dataset as an example, the predicted label can represent the category to which each paper in the publication dataset belongs, as determined by the graph neural network model.

[0134] S102: Constructing a similarity probability matrix based on the similarity between nodes in the node feature information.

[0135] In some embodiments of the present application, a graph neural network model is used to analyze sample categories. To ensure the accuracy of the graph neural network model analysis, the graph neural network model needs to be trained. The quality of the training samples will affect the training effect of the graph neural network model. Considering that in actual applications, due to the irregular division of the dataset, the number of samples with training labels in the training samples is small, making it easy for serious training overfitting to occur during the training process.

[0136] Therefore, in some embodiments of the present application, based on the similarity between the nodes, the labels of the nodes with training labels can be transferred to the nodes without training labels, thereby increasing the number of nodes with labels in the training sample.

[0137] In a specific implementation, the similarity between nodes can be recorded in the form of a matrix. For the sake of distinction, the matrix that records the similarity between nodes can be called a similarity probability matrix.

[0138] Taking the publication dataset as an example, the element in the i-th row and j-th column of the similarity probability matrix represents the similarity probability between the i-th paper and the j-th paper.

[0139] There are various ways to evaluate the similarity between nodes. In some embodiments, the Euclidean distance between each node in the node feature information can be calculated, and the Euclidean distances between each node can be aggregated to obtain a similarity probability matrix. In other embodiments, the cosine distance between each node in the node feature information can be calculated, and the cosine distances between each node can be aggregated to obtain a similarity probability matrix.

[0140] Of course, in some embodiments of the present application, in addition to using Euclidean distance or cosine distance to evaluate the similarity between nodes, Manhattan distance, Chebyshev distance or Minkowski distance may also be used to evaluate the similarity between nodes.

[0141] S103: Determine the propagation labels corresponding to all nodes in the training sample according to the similarity probability matrix and the training labels included in the training sample.

[0142] In some embodiments of the present application, a random walk label propagation approach can be used to add weak labels to nodes in the training sample that do not have training labels. In practical applications, the similarity probability matrix can be used as the edge weights of adjacent nodes in the random walk. Label propagation is achieved through the node's K-adjacent similarity probability matrix P. The greater the probability, the more similar the two nodes are, and the easier it is for the label to propagate.

[0143] Taking the publication dataset as an example, the training labels represent the paper categories that have been determined in the publication dataset. The propagation labels contain the newly determined paper categories after label propagation.

[0144] In some embodiments of the present application, for ease of description, after label propagation is achieved through random walk label propagation, the labels corresponding to all nodes can be collectively referred to as propagation labels.

[0145] S104: Adjust the weights of the graph neural network model according to the propagation labels, training labels, and prediction labels to obtain a trained graph neural network model.

[0146] In the specific implementation, the first loss function can be determined based on the training label and the predicted label; the second loss function can be determined based on the propagation label and the predicted label; the weights of the graph neural network model are adjusted using the first loss function and the second loss function to obtain a trained graph neural network model.

[0147] S105: Analyze the sample to be processed using the trained graph neural network model to output the sample category corresponding to the sample to be processed.

[0148] Unprocessed samples refer to samples whose sample categories need to be determined. When unprocessed samples are obtained, they can be input into a trained graph neural network model to output the sample category to which they belong.

[0149] As can be seen from the above technical solution, the graph neural network model is trained using the graph structure information and initial node feature information contained in the training samples to obtain fused node feature information and trained predicted labels. A similarity probability matrix is ​​constructed based on the similarity between nodes in the node feature information. Based on the similarity probability matrix and the training labels contained in the training samples, labels can be propagated to samples in the training samples that do not have training labels, thereby determining the propagated labels corresponding to all nodes in the training samples. Based on the propagated labels, training labels, and predicted labels, the weights of the graph neural network model are adjusted to obtain a trained graph neural network model. The trained graph neural network model is then used to analyze the samples to be processed and output the sample category corresponding to the samples to be processed. In this technical solution, each sample is represented by a node. The similarity between nodes can be determined based on the node feature information. Based on this similarity, a random walk label propagation method can be used to transfer training labels to nodes with similar features, thereby increasing the number of labels used during training and increasing uncertainty in the training process. This solves the problem of data overfitting caused by insufficient training samples and improves the generalization performance of the graph neural network.

[0150] Graph neural networks are a type of semi-supervised classification based on graph neural networks. They operate directly on graphs and leverage their structural information. They address the problem of classifying nodes (e.g., documents) within graphs (e.g., citation networks), where only a small fraction of the training samples have training labels. They involve the flow and propagation of features and messages within a graph network. The most primitive form of this propagation is that the change in state is proportional to the effect of the Laplace operator on the current state.

[0151] Among them, H (l+1) represents the output of the graph neural network, H (l) represents the input of the graph neural network, σ represents the conventional parameters of the graph neural network, and A represents the matrix corresponding to the graph structure information. Represents the diagonal transformation matrix corresponding to the graph structure information, Represents the degree matrix corresponding to the graph structure information, represents the normalized adjacency matrix, W (l) Represents the weight matrix of the lth layer of the graph neural network.

[0152] In a specific implementation, after obtaining training samples, the initial node feature information contained in the training samples can be preprocessed to obtain first node feature information. The graph structure information is normalized to obtain an adjacency matrix. Based on the first node feature information, the adjacency matrix, and the weight matrices corresponding to each layer of graph convolution in the graph neural network model, the fused node feature information and the predicted labels obtained by training the graph neural network model are obtained.

[0153] The preprocessing process may include randomly discarding (dropout) the initial node feature information during each training to obtain the first node feature information.

[0154] Random dropout can ignore half of the initial node feature information during each training, thereby significantly reducing overfitting.

[0155] The normalization processing of the graph structure information may include determining an adjacency matrix after the graph structure information is normalized based on a degree matrix and a diagonal transformation matrix corresponding to the graph structure information.

[0156] In the specific implementation, a normalization formula can be pre-set. The normalization formula is called to process the degree matrix and diagonal transformation matrix corresponding to the graph structure information to obtain the normalized adjacency matrix; the normalization formula is:

[0157] in, Represents the degree matrix corresponding to the graph structure information, Represents a diagonal transformation matrix, which adjusts the number of diagonals in the matrix corresponding to the graph structure information from zero to one.

[0158] In some embodiments of the present application, a three-layer graph convolutional neural network model can be used to train training samples. Each layer of graph convolution has its corresponding weight matrix.

[0159] In a specific implementation, the first node feature information, the first weight matrix corresponding to the first layer of graph convolution in the graph neural network model, and the product of the adjacency matrix can be used as the second node feature information; the second node feature information, the second weight matrix corresponding to the second layer of graph convolution in the graph neural network model, and the product of the adjacency matrix can be used as the fused node feature information; the fused node feature information, the third weight matrix corresponding to the third layer of graph convolution in the graph neural network model, and the product of the adjacency matrix can be used as the node feature information to be trained, and the node feature information to be trained is analyzed to determine the predicted label obtained by training the graph neural network model.

[0160] For example, the first node feature information can be represented in the form of a matrix, with features representing the first node feature information in matrix form. Support is used to represent the adjacency matrix. The weight matrices corresponding to each layer of graph convolution in the graph neural network model are weights_0, weights_1, and weights_2, respectively. Multiply features and weights_0 by a sparse matrix and a dense matrix to obtain a dense matrix pre_sup. Then, using the normalized form of the adjacency matrix support and the latest pre_sup, multiply the sparse matrix and the dense matrix to obtain the second node feature information.

[0161] The second node feature information and weights_1 are multiplied by a sparse matrix and a dense matrix to obtain a dense matrix pre_sup. Then, the normalized form of the adjacency matrix support and the latest pre_sup are used to multiply the sparse matrix and the dense matrix to obtain the fused node feature information. The fused node feature information and weights_2 are multiplied by a sparse matrix and a dense matrix to obtain a dense matrix pre_sup. Then, the normalized form of the adjacency matrix support and the latest pre_sup are used to multiply the sparse matrix and the dense matrix to obtain the feature information of the node to be trained, and the feature information of the node to be trained is analyzed to determine the predicted label obtained by training the graph neural network model.

[0162] In some embodiments of the present application, by randomly discarding the initial node feature information, the sample is guaranteed to be unsaturated during each training session, thereby reducing overfitting. A three-layer graph convolutional neural network model is used to train the training samples. The first two layers of graph convolutions are used to obtain fused node feature information that fully preserves node characteristics and relevance. The third layer of graph convolutions is used to determine the predicted labels obtained by training the graph neural network model.

[0163] FIG2 is a flowchart of a method for determining propagation labels of all nodes in a training sample provided by some embodiments of the present application, the method comprising:

[0164] S201: Based on the distribution of training labels of each node in the training sample, an initial label propagation matrix is ​​established.

[0165] In some embodiments of the present application, all label categories corresponding to the samples can be used as output dimensions of the graph neural network model. For example, if there are 10 label categories corresponding to the samples, the graph neural network model can have 10 outputs, each output corresponding to a label category.

[0166] In a specific implementation, a label matrix can be constructed based on the training labels contained in the training samples; an empty label matrix can be constructed for the nodes in the training samples that do not contain training labels based on the number of label categories; and the label matrix and the empty label matrix can be merged as the initial label propagation matrix.

[0167] For the construction of the label matrix, an initial label matrix can be constructed based on the number of training labels contained in the training samples and the number of label categories corresponding to the graph neural network model; the position matched by the training label in the initial label matrix is ​​set to one to obtain the label matrix.

[0168] For example, the number of label categories is C, and the training sample contains N samples, of which L samples have training labels. Then an L×C initial label matrix can be established. The i-th row indicates that the i-th sample has a training label. If the category of the i-th row is j, the j-th element of the row can be set to 1, and the remaining elements of the row can be set to 0, thereby constructing a label matrix.

[0169] For the construction of the empty label matrix, the nodes that do not contain training labels in the training samples can be set to zero values ​​that are the same as the number of label categories to obtain the empty label matrix.

[0170] For example, the number of label categories is C, the training sample contains N samples, of which L samples have training labels, and the number of samples without training labels is NL. An empty label matrix of (NL)×C can be established, and each element in the empty label matrix is ​​set to 0.

[0171] By merging the label matrix and the empty label matrix, we can get the initial label propagation matrix. In combination with the above example, by merging the L×C label matrix and the (NL)×C empty label matrix, we can get the N×C initial label propagation matrix.

[0172] When constructing the matrix, the probability of the training sample belonging to each category is retained, rather than being mutually exclusive. This sample belongs to only one category with probability 1. Of course, when the category of this sample is finally determined, the category with the maximum probability is taken as its category.

[0173] After the initial label propagation matrix is ​​established, the similarity probability matrix can be used to iteratively process the initial label propagation matrix until a propagation label that meets the convergence condition is obtained. The specific implementation process can be found in the introduction of S202 to S205.

[0174] S202: The product of the initial label propagation matrix and the similarity probability matrix is ​​used as the target label propagation matrix.

[0175] In some embodiments of the present application, it is necessary to continuously iterate the initial label propagation matrix using a similarity probability matrix to determine propagation labels that meet convergence conditions.

[0176] For ease of introduction, Ft may be used to represent the target label propagation matrix determined at the tth iteration, and P may be used to represent the similarity probability matrix. Ft+1=Ft×P, where Ft+1 represents the target label propagation matrix determined at the t+1th iteration.

[0177] Each node propagates its own training label to other nodes with a probability determined by P. The more similar two nodes are, the more likely the other node's label is to be assigned by its own label.

[0178] In the initial state, F0 represents the initial label propagation matrix.

[0179] S203: Determine whether the target label propagation matrix meets the convergence condition.

[0180] If the target label propagation matrix does not meet the convergence conditions, it means that iterative processing is still required, and S204 can be executed at this time; if the target label propagation matrix meets the convergence conditions, it means that the currently determined target label propagation matrix has met the requirements, and S205 can be executed at this time.

[0181] In the specific implementation, a convergence formula can be established in advance. After determining the target label propagation matrix, it can be judged whether the convergence formula is valid; the convergence formula is: ∑|F t+1 -F t | 2 <ε;

[0182] Among them, F t+1 represents the target label propagation matrix obtained at the t+1th iteration, F t represents the target label propagation matrix obtained at the tth iteration, and ε represents the set convergence parameter.

[0183] When the convergence formula holds, it indicates that the label propagation has achieved a good effect. In this case, S205 can be executed, that is, all labels included in the target label propagation matrix are directly used as propagation labels.

[0184] When the convergence formula does not hold, it means that the label propagation has not yet achieved a good effect. In this case, the target label propagation matrix can be iteratively processed, that is, S204 is executed.

[0185] Because the training labels of training samples are predetermined and cannot be carried away, they must return to their original labels after each propagation. As labeled samples continue to propagate their labels, the final class boundary will pass through high-density areas and remain in low-density intervals, effectively dividing the sphere of influence of samples of different classes.

[0186] S204: Using the target label propagation matrix as the initial label propagation matrix, and returning to the step of using the product of the initial label propagation matrix and the similarity probability matrix as the target label propagation matrix.

[0187] The target label propagation matrix determined in the current iteration cycle can be regarded as the initial label propagation matrix of the next iteration cycle. Returning to step S202, the target label propagation matrix determined in the current iteration cycle can be iterated on for the next round.

[0188] S205: All labels included in the target label propagation matrix are used as propagation labels.

[0189] After determining the target label propagation matrix that meets the convergence conditions, the target label propagation matrix not only includes the training labels, but also includes the labels matched by the nodes that originally did not have the training labels after label propagation.

[0190] Figure 3 is a framework diagram of a sample classification model provided by some embodiments of the present application. The sample classification model is based on the graph neural network model and introduces random walk label propagation technology. Based on the functions that the sample classification model needs to implement, the sample classification model may include a graph neural network module, a feature similarity probability matrix module, and a random walk label propagation module. Among them, the graph neural network module may include three graph convolution submodules, namely the first layer graph convolution submodule (Hidden_layer1), the second layer graph convolution submodule (Hidden_layer2) and the third layer graph convolution submodule (Linear_layer). These three graph convolution submodules have their own corresponding weight matrices.

[0191] In practical applications, the graph structure information and initial node feature information contained in the training sample can be input into the first-layer graph convolution submodule, and the first-layer graph convolution submodule can use the output node feature information as the input of the second-layer graph convolution. For ease of distinction, the node feature information output by the first-layer graph convolution submodule can be referred to as the second node feature information. In some embodiments of the present application, the node feature information output by the second-layer graph convolution submodule is used as the fused node feature information. The third-layer graph convolution submodule is used to predict the labels corresponding to each sample in the training sample, and these labels can be referred to as predicted labels.

[0192] The second-layer graph convolution submodule uses the fused node feature information it outputs as input to the feature similarity probability matrix module. This module analyzes the similarities between nodes based on the node feature information and outputs a similarity probability matrix. The random walk label propagation module uses the similarity probability matrix transmitted by the feature similarity probability matrix module and the training labels contained in the training samples to propagate labels between nodes. This allows the training labels of nodes to spread to neighboring nodes, thereby increasing the number of labeled samples in the training sample.

[0193] In some embodiments of the present application, the propagation label collection module can be used to count the propagation labels contained in the target label propagation matrix output by the random walk label propagation module. A first loss function can be calculated based on the predicted label and the training label; a second loss function can be calculated based on the propagation label and the predicted label. The first loss function and the second loss function are added together as the final loss function, and the weight matrix of each sub-module in the graph neural network module can be adjusted based on the final loss function to obtain a trained graph neural network model. Subsequently, the trained graph neural network model can be directly called to analyze the samples to be processed without repeating the above training process each time.

[0194] In some embodiments of the present application, a graph neural network with three layers of graph convolution and a label propagation algorithm are used to change the full graph structure of the graph neural network involved in a training to the K-order neighbors of the node; and the similarity probability matrix between the nodes is calculated, and the label propagation algorithm is incorporated so that the training label of the node can be propagated within the neighboring nodes, thereby increasing the number of labeled samples in the training samples. Since the propagated labels are not the true labels of the samples, the correctness of the labels cannot be guaranteed, thereby increasing the uncertainty of the samples, achieving the purpose of slowing down the overfitting phenomenon during training and enhancing the generalization performance of the graph neural network. In addition, because the data of the K-order neighbor nodes is calculated each time, the quantity is controllable, which solves the problem that the model cannot be applied to large data sets.

[0195] In some embodiments of the present application, after analyzing a sample to be processed using a trained graph neural network model to output a sample category corresponding to the sample to be processed, the actual category label corresponding to the sample to be processed can be obtained and compared with the sample category determined by the model.

[0196] When the sample category does not match the actual category label, it means that the accuracy of the graph neural network model needs to be improved. At this time, the samples to be processed and their corresponding actual category labels can be added to the training samples, and the graph structure information and initial node feature information contained in the training samples can be used to train the graph neural network model to obtain the fused node feature information and the predicted labels obtained through training.

[0197] If the sample category matches the actual category label, the graph neural network model can accurately analyze the sample category. Considering that in actual applications, users may need to view the sample category to which the sample to be processed belongs within a short period of time, the sample to be processed and its corresponding sample category can be recorded to facilitate user query.

[0198] In some embodiments of the present application, when the recognition accuracy of the graph neural network model is not high, the training samples can be expanded by adding the samples to be processed and their corresponding actual category labels to the training samples. The graph neural network model can be trained again using the expanded training samples to further improve the accuracy of the graph neural network model in identifying sample categories.

[0199] FIG4 is a schematic structural diagram of a sample classification device provided in some embodiments of the present application, including a training unit 41, a construction unit 42, a determination unit 43, an adjustment unit 44, and an analysis unit 45;

[0200] A training unit 41 is configured to train the graph neural network model using the graph structure information and initial node feature information contained in the training samples to obtain fused node feature information and trained prediction labels;

[0201] A construction unit 42 is used to construct a similarity probability matrix based on the similarity between each node in the node feature information;

[0202] A determination unit 43 is configured to determine the propagation labels corresponding to all nodes in the training sample based on the similarity probability matrix and the training labels included in the training sample;

[0203] An adjustment unit 44 is configured to adjust the weights of the graph neural network model according to the propagation label, the training label, and the prediction label to obtain a trained graph neural network model;

[0204] The analysis unit 45 is used to analyze the samples to be processed using the trained graph neural network model to output the sample category corresponding to the samples to be processed.

[0205] Optionally, the training unit includes a preprocessing subunit, a normalization subunit, and an obtaining subunit;

[0206] A preprocessing subunit, configured to preprocess the initial node feature information to obtain first node feature information;

[0207] Normalization subunit, used to normalize the graph structure information to obtain the adjacency matrix;

[0208] A subunit is obtained, which is used to obtain the fused node feature information and the predicted label obtained by training the graph neural network model based on the first node feature information, the adjacency matrix and the weight matrix corresponding to each layer of graph convolution in the graph neural network model.

[0209] Optionally, the subunit is used to obtain the product of the first node feature information, the first weight matrix corresponding to the first layer of graph convolution in the graph neural network model, and the adjacency matrix as the second node feature information;

[0210] The product of the second node feature information, the second weight matrix corresponding to the second layer of graph convolution in the graph neural network model, and the adjacency matrix is ​​used as the fused node feature information;

[0211] The product of the fused node feature information, the third weight matrix corresponding to the third layer of graph convolution in the graph neural network model, and the adjacency matrix is ​​used as the feature information of the node to be trained, and the feature information of the node to be trained is analyzed to determine the predicted label obtained by training the graph neural network model.

[0212] Optionally, the preprocessing subunit is configured to randomly discard initial node feature information to obtain first node feature information.

[0213] Optionally, the normalization subunit is used to determine an adjacency matrix after normalization of the graph structure information based on the degree matrix and the diagonal transformation matrix corresponding to the graph structure information.

[0214] Optionally, the normalization subunit is used to call a normalization formula to process the degree matrix and the diagonal transformation matrix corresponding to the graph structure information to obtain a normalized adjacency matrix; the normalization formula is:

[0215] in, Represents the degree matrix corresponding to the graph structure information, Represents a diagonal transformation matrix, which adjusts the number of diagonals in the matrix corresponding to the graph structure information from zero to one.

[0216] Optionally, the determination unit includes an establishment subunit and an iteration subunit;

[0217] Establish a subunit for establishing an initial label propagation matrix based on the distribution of training labels of each node in the training sample;

[0218] The iterative subunit is used to iteratively process the initial label propagation matrix using the similarity probability matrix until a propagation label that meets the convergence condition is obtained.

[0219] Optionally, a subunit is established for constructing a label matrix based on training labels included in the training samples;

[0220] Construct an empty label matrix for nodes that do not contain training labels in the training samples based on the number of label categories;

[0221] Merge the label matrix and the empty label matrix as the initial label propagation matrix.

[0222] Optionally, a subunit is established to construct an initial label matrix based on the number of training labels contained in the training samples and the number of label categories corresponding to the graph neural network model; the position matched by the training label in the initial label matrix is ​​set to one to obtain a label matrix.

[0223] Optionally, a subunit is established for setting zero values ​​equal to the number of label categories for nodes in the training samples that do not contain training labels, so as to obtain an empty label matrix.

[0224] Optionally, the iterator unit is used to take the product of the initial label propagation matrix and the similarity probability matrix as the target label propagation matrix;

[0225] Determine whether the target label propagation matrix meets the convergence conditions;

[0226] When the target label propagation matrix does not meet the convergence condition, the target label propagation matrix is ​​used as the initial label propagation matrix, and the product of the initial label propagation matrix and the similarity probability matrix is ​​returned to the step of using the target label propagation matrix as the product of the initial label propagation matrix and the similarity probability matrix;

[0227] When the target label propagation matrix meets the convergence condition, all labels contained in the target label propagation matrix are used as propagation labels.

[0228] Optionally, the iterator unit is used to determine whether the convergence formula is valid; the convergence formula is: ∑|F t+1 -F t | 2 <ε;

[0229] Among them, F t+1 represents the target label propagation matrix obtained at the t+1th iteration, F t represents the target label propagation matrix obtained at the tth iteration, and ε represents the set convergence parameter.

[0230] Optionally, the adjustment unit is used to determine a first loss function based on the training label and the predicted label; determine a second loss function based on the propagation label and the predicted label; and use the first loss function and the second loss function to adjust the weights of the graph neural network model to obtain a trained graph neural network model.

[0231] Optionally, the construction unit includes a first calculation subunit and a first aggregation subunit;

[0232] A first calculation subunit is used to calculate the Euclidean distance between each node in the node feature information;

[0233] The first summarizing subunit is used to summarize the Euclidean distances between the nodes to obtain a similarity probability matrix.

[0234] Optionally, the construction unit includes a second calculation subunit and a second aggregation subunit;

[0235] The second calculation subunit is used to calculate the cosine distance between each node in the node feature information;

[0236] The second summarizing subunit is used to summarize the cosine distances between the nodes to obtain a similarity probability matrix.

[0237] Optionally, it further includes an acquisition unit and an addition unit;

[0238] An acquisition unit, used to obtain the actual category label corresponding to the sample to be processed;

[0239] An adding unit is used to add the sample to be processed and its corresponding actual category label to the training sample when the sample category does not match the actual category label, and return to the step of training the graph neural network model using the graph structure information and initial node feature information contained in the training sample to obtain the fused node feature information and the predicted label obtained by training.

[0240] Optionally, a recording unit is further included;

[0241] The recording unit is used to record the sample to be processed and its corresponding sample category when the sample category matches the actual category label.

[0242] For the description of features in some embodiments corresponding to FIG4 , reference can be made to the relevant description of some embodiments corresponding to FIG1 to FIG3 , and they will not be detailed here.

[0243] As can be seen from the above technical solution, the graph neural network model is trained using the graph structure information and initial node feature information contained in the training samples to obtain fused node feature information and trained predicted labels. A similarity probability matrix is ​​constructed based on the similarity between nodes in the node feature information. Based on the similarity probability matrix and the training labels contained in the training samples, labels can be propagated to samples in the training samples that do not have training labels, thereby determining the propagated labels corresponding to all nodes in the training samples. Based on the propagated labels, training labels, and predicted labels, the weights of the graph neural network model are adjusted to obtain a trained graph neural network model. The trained graph neural network model is then used to analyze the samples to be processed and output the sample category corresponding to the samples to be processed. In this technical solution, each sample is represented by a node. The similarity between nodes can be determined based on the node feature information. Based on this similarity, a random walk label propagation method can be used to transfer training labels to nodes with similar features, thereby increasing the number of labels used during training and increasing uncertainty in the training process. This solves the problem of data overfitting caused by insufficient training samples and improves the generalization performance of the graph neural network.

[0244] FIG5 is a structural diagram of an electronic device provided by some embodiments of the present application. As shown in FIG5 , the electronic device includes: a memory 50 for storing computer programs;

[0245] The processor 51 is configured to implement the steps of the sample classification method in some of the above embodiments when executing a computer program.

[0246] The electronic devices provided in some embodiments may include but are not limited to smart phones, tablet computers, laptop computers, or desktop computers.

[0247] The processor 51 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 51 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 51 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 51 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 51 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0248] The memory 50 may include one or more non-volatile readable storage media, which may be non-transitory. The memory 50 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the memory 50 is at least used to store the following computer program 501, wherein, after the computer program is loaded and executed by the processor 51, it can implement the relevant steps of the sample classification method disclosed in some of the aforementioned embodiments. In addition, the resources stored in the memory 50 may also include an operating system 502 and data 503, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 502 may include Windows, Unix, Linux, etc. The data 503 may include but is not limited to the graph structure information and initial node feature information, training labels, etc. contained in the training sample.

[0249] In some embodiments, the electronic device may further include a display screen 52 , an input / output interface 53 , a communication interface 54 , a power supply 55 , and a communication bus 56 .

[0250] Those skilled in the art will appreciate that the structure shown in FIG5 does not limit the electronic device and may include more or fewer components than shown in the figure.

[0251] It is understandable that if the sample classification method in some of the above embodiments is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium and executes all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk, etc. Various media that can store program codes.

[0252] Based on this, some embodiments of the present application further provide a non-volatile readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned sample classification method are implemented.

[0253] The above describes in detail a sample classification method, apparatus, device, and non-volatile readable storage medium provided by some embodiments of the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the devices disclosed in some embodiments, since they correspond to the methods disclosed in some embodiments, the description is relatively simple, and the relevant parts can be referred to the method section.

[0254] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with some of the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0255] The above is a detailed introduction to a sample classification method, device, equipment and non-volatile readable storage medium provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of some of the above embodiments is only used to help understand the method of the present application and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

Claims

1. A sample classification method, characterized in that: include: The graph neural network model is trained using the graph structure information and initial node feature information contained in the training samples to obtain the fused node feature information and the trained prediction labels; Based on the similarity between the nodes in the node feature information, construct a similarity probability matrix; Determine the propagation labels corresponding to all nodes in the training sample according to the similarity probability matrix and the training labels included in the training sample; According to the propagation label, the training label, and the prediction label, the weight of the graph neural network model is adjusted to obtain a trained graph neural network model; The trained graph neural network model is used to analyze the samples to be processed to output the sample categories corresponding to the samples to be processed.

2. The sample classification method according to claim 1, characterized in that: The graph neural network model is trained using the graph structure information and initial node feature information contained in the training sample to obtain the fused node feature information and the predicted labels obtained through training, including: Preprocessing the initial node feature information to obtain first node feature information; Normalizing the graph structure information to obtain an adjacency matrix; Based on the first node feature information, the adjacency matrix and the weight matrix corresponding to each layer of graph convolution in the graph neural network model, the fused node feature information and the predicted label obtained by training the graph neural network model are obtained.

3. The sample classification method according to claim 2, characterized in that: The step of obtaining the fused node feature information and the predicted label obtained by training the graph neural network model based on the first node feature information, the adjacency matrix, and the weight matrix corresponding to each layer of graph convolution in the graph neural network model includes: The product of the first node feature information, the first weight matrix corresponding to the first layer of graph convolution in the graph neural network model, and the adjacency matrix is ​​used as the second node feature information; The product of the second node feature information, the second weight matrix corresponding to the second layer of graph convolution in the graph neural network model, and the adjacency matrix is ​​used as the fused node feature information; The fused node feature information, the third weight matrix corresponding to the third layer of graph convolution in the graph neural network model, and the product of the adjacency matrix are used as the node feature information to be trained, and the node feature information to be trained is analyzed to determine the predicted label obtained by training the graph neural network model.

4. The sample classification method according to claim 2, characterized in that: The preprocessing of the initial node feature information to obtain the first node feature information includes: The initial node characteristic information is randomly discarded to obtain the first node characteristic information.

5. The sample classification method according to claim 2, characterized in that: The normalizing the graph structure information to obtain an adjacency matrix includes: A normalized adjacency matrix of the graph structure information is determined according to the degree matrix and the diagonal transformation matrix corresponding to the graph structure information.

6. The sample classification method according to claim 5, characterized in that: Determining the normalized adjacency matrix of the graph structure information according to the degree matrix and the diagonal transformation matrix corresponding to the graph structure information includes: The normalization formula is called to process the degree matrix and the diagonal transformation matrix corresponding to the graph structure information to obtain a normalized adjacency matrix; the normalization formula is: in, Represents the degree matrix corresponding to the graph structure information, represents a diagonal transformation matrix, and the diagonal transformation matrix is ​​to adjust the number of diagonals in the matrix corresponding to the graph structure information from zero to one.

7. The sample classification method according to claim 1, characterized in that: Determining the propagation labels corresponding to all nodes in the training sample according to the similarity probability matrix and the training labels included in the training sample includes: Based on the distribution of training labels of each node in the training sample, an initial label propagation matrix is ​​established; The initial label propagation matrix is ​​iteratively processed using the similarity probability matrix until a propagation label that meets a convergence condition is obtained.

8. The sample classification method according to claim 7, characterized in that: The step of establishing an initial label propagation matrix based on the distribution of training labels of each node in the training sample includes: Constructing a label matrix according to the training labels contained in the training samples; Constructing an empty label matrix for nodes in the training samples that do not contain training labels based on the number of label categories; The label matrix and the empty label matrix are combined as an initial label propagation matrix.

9. The sample classification method according to claim 8, characterized in that: The step of constructing a label matrix based on the training labels included in the training samples includes: Constructing an initial label matrix according to the number of training labels contained in the training samples and the number of label categories corresponding to the graph neural network model; The positions matched by the training labels in the initial label matrix are set to one to obtain a label matrix.

10. The sample classification method according to claim 9, characterized in that: The step of constructing an empty label matrix for nodes in the training samples that do not contain training labels based on the number of label categories includes: The nodes in the training samples that do not contain training labels are respectively set with zero values ​​equal to the number of label categories to obtain an empty label matrix.

11. The sample classification method according to claim 7, characterized in that: The iterative processing of the initial label propagation matrix by using the similarity probability matrix until a propagation label satisfying a convergence condition is obtained comprises: The product of the initial label propagation matrix and the similarity probability matrix is ​​used as the target label propagation matrix; Determining whether the target label propagation matrix satisfies a convergence condition; In the case that the target label propagation matrix does not meet the convergence condition, the target label propagation matrix is ​​used as the initial label propagation matrix, and the step of using the product of the initial label propagation matrix and the similarity probability matrix as the target label propagation matrix is ​​returned; When the target label propagation matrix satisfies a convergence condition, all labels included in the target label propagation matrix are used as propagation labels.

12. The sample classification method according to claim 11, characterized in that: The determining whether the target label propagation matrix satisfies the convergence condition includes: Determine whether the convergence formula is valid; the convergence formula is: ∑|F t+1 -F t | 2 <e; Among them, F t+1 represents the target label propagation matrix obtained at the t+1th iteration, F t represents the target label propagation matrix obtained at the tth iteration, and ε represents the set convergence parameter.

13. The sample classification method according to claim 1, characterized in that: The step of adjusting the weight of the graph neural network model according to the propagation label, the training label, and the prediction label to obtain a trained graph neural network model includes: Determining a first loss function based on the training label and the predicted label; Determining a second loss function based on the propagated label and the predicted label; The weights of the graph neural network model are adjusted using the first loss function and the second loss function to obtain a trained graph neural network model.

14. The sample classification method according to claim 1, characterized in that: The constructing a similarity probability matrix based on the similarity between the nodes in the node feature information includes: Calculating the Euclidean distance between each node in the node feature information; The Euclidean distances between nodes are summed up to obtain a similarity probability matrix.

15. The sample classification method according to claim 1, characterized in that: The constructing a similarity probability matrix based on the similarity between the nodes in the node feature information includes: Calculating the cosine distance between each node in the node feature information; The cosine distances between nodes are summed up to obtain a similarity probability matrix.

16. The sample classification method according to any one of claims 1 to 15, characterized in that: After analyzing the sample to be processed by using the trained graph neural network model to output the sample category corresponding to the sample to be processed, the method further includes: Obtaining the actual category label corresponding to the sample to be processed; In the case that the sample category does not match the actual category label, the sample to be processed and its corresponding actual category label are added to the training sample, and the graph structure information and initial node feature information contained in the training sample are returned to train the graph neural network model to obtain the fused node feature information and the predicted label obtained by training.

17. The sample classification method according to claim 16, characterized in that: Also includes: In the case where the sample category matches the actual category label, the sample to be processed and its corresponding sample category are recorded.

18. A sample classification device, characterized in that: It includes training unit, construction unit, determination unit, adjustment unit and analysis unit; The training unit is used to train the graph neural network model using the graph structure information and initial node feature information contained in the training samples to obtain fused node feature information and trained prediction labels; The construction unit is used to construct a similarity probability matrix based on the similarity between the nodes in the node feature information; The determining unit is used to determine the propagation labels corresponding to all nodes in the training sample according to the similarity probability matrix and the training labels included in the training sample; The adjustment unit is used to adjust the The weights of the graph neural network model are adjusted to obtain a trained graph neural network model; The analysis unit is used to analyze the samples to be processed by using the trained graph neural network model to output the sample categories corresponding to the samples to be processed.

19. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the sample classification method according to any one of claims 1 to 17.

20. A non-volatile readable storage medium, characterized in that: The non-volatile readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the sample classification method according to any one of claims 1 to 17 are implemented.

Citation Information

Patent Citations

  • Multi-class image semi-supervised classifying method and system

    CN104463202A

  • Semi-supervised classification method and device based on deep learning, and storage medium

    CN112699960A

  • Paper text classification method and system based on graph neural network

    CN115309931A

  • Sample classification method, apparatus and device, and computer readable storage medium

    CN116127386A

Cited By

  • Multi-level analysis method and device for text sentiment classification

    CN119149674A

  • Method and device for judging active state of storage link of host machine based on characteristic relaxation regression

    CN119166076A

  • Gene interaction relation prediction method and device based on graph neural network

    CN119626324A

  • Target detection method and system based on data fusion

    CN119888190A

  • Non-standard cable design parameter intelligent optimization method

    CN120145883A