Heterogeneous distillation method based on graph neural network
By acquiring heterogeneous teacher models and student models, integrating diverse complementary knowledge and optimizing the training loss function, it solves the neglect of heterogeneous teacher diversity knowledge extraction in the existing technology and significantly improves the performance of the GNN student model.
Patent Information
- Application Number
- CN202410815941.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-09-20
AI Technical Summary
Existing graph distillation methods mainly focus on distillation from the same teacher model to the same student model, ignoring the student model's need for diverse knowledge from heterogeneous teachers, resulting in the inability to train a satisfactory GNN student model. .
By obtaining at least two heterogeneous teacher models and student models, the training set is used to guide student model training, and the weighted sum of the classification cross-entropy loss function, the intermediate-level distillation loss function and the output-level distillation loss function is used to integrate the diversity of heterogeneous teachers. Complementary knowledge to optimize parameters of student models.
It achieves more sufficient and comprehensive knowledge extraction, significantly improves the learning ability and performance of student models, and fills in the neglect and shortcomings of heterogeneous teachers' diverse complementary knowledge extraction.
Smart Images

Figure CN118673329A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of graph data computing technology, specifically to the field of graph neural networks, and more specifically to a heterogeneous distillation method based on graph neural networks. Background Art
[0002] Graph data is ubiquitous in the real world, and Graph Neural Networks (GNNs) provide efficient representation of graph data and have shown significant progress in fields such as bioinformatics, social networks, and recommender systems. In order to improve the node representation capabilities of graph data, various GNNs variants have emerged. Knowledge Distillation (KD), as a general model enhancement technique, shows great potential in improving the performance of GNNs. Therefore, designing KD methods (graph distillation methods) for GNNs has aroused widespread research interest and has become a hot research direction in this field.
[0003] KD has achieved some success in GNNs. For example, LSP explicitly distills the topological structure knowledge embedded in the teacher model to the student. Inspired by LSP, CPF proposed to extract structural and feature knowledge from the teacher model to improve the performance of the student model. HIRE designed a plug-and-play high-order relational knowledge distillation framework, which extended graph distillation to any heterogeneous graph neural network for the first time. LinkDist uses a self-distillation method to extract knowledge from the edges of the graph and distills it to a multi-layer perceptron (MLP) based student model. However, existing graph distillation methods ignore the student model's need for knowledge diversity. That is, existing methods mainly focus on distillation from the same teacher to the same student model, resulting in similar knowledge being obtained, which is insufficient to train a satisfactory GNN student model.
[0004] It should be noted that this background technology is only used to introduce the relevant information of the present invention to help understand the technical solution of the present invention, but it does not mean that the relevant information is necessarily the prior art. The relevant information is submitted and disclosed together with the present invention solution. If there is no evidence that the relevant information has been disclosed before the application date of the present invention, the relevant information shall not be regarded as the prior art. Summary of the invention
[0005] Therefore, the purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a heterogeneous distillation method based on graph neural network.
[0006] The objective of the present invention is achieved through the following technical solutions:
[0007] According to a first aspect of the present invention, a heterogeneous distillation method based on a graph neural network is provided, comprising: obtaining at least two heterogeneous teacher models and a student model, all of which are graph data networks provided with intermediate layers and output layers, and the teacher model is a trained model; obtaining a training set, which includes one or more samples and labels indicating the categories to which objects related to the samples belong, and the samples are graph data including nodes and edges; using the training set and at least two teacher models to guide the student model for training, and the training includes: inputting the samples into each teacher model and the student model to obtain intermediate node representations generated by each intermediate layer and predicted values generated by each output layer; guiding the parameter update of the student model based on a preset total loss function, and the total loss function is configured as a weighted sum of a classification cross entropy loss function, an intermediate-level distillation loss function, and an output-level distillation loss function, wherein the intermediate-level distillation loss is determined according to the difference between the intermediate node representations generated by each teacher model and the student model, and the output-level distillation loss is determined according to the difference between the predicted values generated by each teacher model and the student model.
[0008] Optionally, the total loss function is:
[0009] L S =αL CE +γL mOKD +βL mMKD
[0010] Among them, L CE represents the classification cross entropy loss function, L mOKD represents the output level distillation loss function, L mMKD represents the intermediate distillation loss function, α, γ and β represent L CE , L mOKD and L mMKD The weight coefficient of .
[0011] Optionally, the intermediate distillation loss function is:
[0012]
[0013] Where M is the total number of heterogeneous teacher models, m represents the number of the teacher model, Represents the intermediate node representation of the sample generated by the intermediate layer l of the mth teacher model, The intermediate node representation of the sample generated by the intermediate layer l of the student model, For the same sample and Compute the L2 distance function of the difference.
[0014] Optionally, the output level distillation loss function is:
[0015]
[0016] Where M is the total number of heterogeneous teacher models, m represents the number of teacher models, τ represents the temperature scaling factor, represents the predicted value generated by the m-th teacher model for the sample, represents the predicted value generated by the student model for the sample, For the same sample and Compute the KL divergence function of the discrepancy.
[0017] Optionally, all teacher models and student models are heterogeneous models with different structures from each other, but all teacher models and student models are provided with a designated intermediate layer that produces intermediate node representations of the same size, and the intermediate node representations output by the designated intermediate layer are used to calculate the intermediate-level distillation loss function.
[0018] Optionally, the at least two teacher models include a GAT-based teacher model and another SAGE-based teacher model, and the student model is a GCN-based model.
[0019] Optionally, the sample is graph data recording the co-purchasing relationship of goods, wherein the nodes represent goods, the edges represent that the connected goods are frequently purchased together by consumers, the labels represent the categories to which the goods belong, and the objects are goods.
[0020] Optionally, the sample is graph data that records the citation relationship of papers, where the nodes represent papers, the edges represent the citation relationship between papers, the labels represent the fields to which the papers belong, and the objects are papers.
[0021] According to a second aspect of the present invention, a classification method based on graph data is provided, comprising: obtaining a trained student model, which is trained according to the method described in the first aspect; obtaining graph data to be predicted, and using the trained student model to determine the category to which an object related to the graph data to be predicted belongs.
[0022] According to a third aspect of the present invention, there is provided an electronic device comprising: one or more processors; and a memory, wherein the memory is used to store executable instructions; the one or more processors are configured to implement the first aspect and / or the steps of the method by executing the executable instructions.
[0023] Compared with the prior art, the advantages of the present invention are:
[0024] The method of the present invention deeply explores the guidance of heterogeneous teachers to GNN student models to achieve more adequate and comprehensive knowledge extraction. First, the learning ability of the student model is enhanced by extracting the diverse and complementary graph structure knowledge contained in at least two heterogeneous teacher models; second, the knowledge of different levels of heterogeneous teachers (intermediate node representations and predicted values) is integrated and distilled into the student model to obtain a comprehensive student model; finally, the total loss function is configured as a weighted sum of the classification cross entropy loss function, the intermediate level distillation loss function, and the output level distillation loss function, so as to better guide the student model training to optimize the parameters and improve the performance of the student model. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The embodiments of the present invention are further described below with reference to the accompanying drawings, in which:
[0026] Figure 1 A schematic diagram of a process of a heterogeneous distillation method based on a graph neural network according to an embodiment of the present invention;
[0027] Figure 2 It is another schematic diagram of an implementation process of a heterogeneous distillation method based on a graph neural network according to an embodiment of the present invention;
[0028] Figure 3 The present invention is a schematic diagram of an implementation process of a heterogeneous distillation method based on a graph neural network according to an example of the present invention. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below through specific embodiments in conjunction with the accompanying drawings. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0030] As mentioned in the background technology section, existing methods mainly focus on distillation from the same teacher to the same student model, resulting in similar knowledge, which is insufficient to train a satisfactory GNN student model. Through research, the limitations of existing graph distillation technology methods are that they do not take into account the student model's need for complementary diversity knowledge from heterogeneous teachers, but focus on distillation from the same teacher to the student model, resulting in single and similar knowledge, which is insufficient to train a satisfactory student GNN model. In order to fill this gap, the present invention deeply explores the guidance of heterogeneous teachers to GNN student models to achieve more adequate and comprehensive knowledge extraction. Firstly, the learning ability of the student model is enhanced by extracting the diverse and complementary graph structure knowledge contained in at least two heterogeneous teacher models; secondly, the knowledge of different levels of heterogeneous teachers (intermediate node representation and predicted value) is integrated and distilled into the student model to solve the neglect and deficiency of the existing graph distillation technology in extracting diverse and complementary knowledge of heterogeneous teachers, and to make up for the student model's need for complementary diversity knowledge, thereby obtaining a comprehensive student model; finally, the total loss function is configured as the weighted sum of the classification cross entropy loss function, the intermediate-level distillation loss function and the output-level distillation loss function, so as to better guide the student model training to optimize the parameters and improve the performance of the student model.
[0031] According to one embodiment of the present invention, see Figure 1 , providing a heterogeneous distillation method based on graph neural network, comprising steps A1, A2 and A3. In order to better understand the present invention, each step is described in detail below in conjunction with specific embodiments.
[0032] Step A1: Obtain at least two heterogeneous teacher models and student models, all of which are graph data networks with intermediate layers and output layers, and the teacher model is a trained model.
[0033] According to one embodiment of the present invention, the teacher model and the student model both include multiple intermediate layers and prediction layers, the multiple intermediate layers are used to extract intermediate node representations from graph data, and the prediction layer is used to predict the category to which the object belongs based on the intermediate node representation extracted by the last intermediate layer. The first intermediate layer extracts the intermediate node representation from the graph data based on graph convolution and outputs it as the input of the next intermediate layer. The prediction layer extracts the Logit value for classification based on the intermediate node table output by the last intermediate layer, and performs classification prediction based on the Logit value to obtain the predicted value. All teacher models and student models are heterogeneous models with different structures from each other, but all teacher models and student models are provided with a designated intermediate layer that produces intermediate node representations of the same size. The intermediate node representation output by the designated intermediate layer is used to calculate the intermediate-level distillation loss function.
[0034] According to one embodiment of the present invention, at least two teacher models include a teacher model based on GAT (Graph Attention Network) (hereinafter referred to as Teacher GAT) and another teacher model based on SAGE (Graph Sample and Aggregate) (hereinafter referred to as Teacher SAGE), and the student model is a model based on GCN (Graph Convolutional Network) (hereinafter referred to as Student GCN). The teacher models are all models pre-trained using data sets of relevant graph data, so as to guide the training of the student model through the rich instructions pre-learned by the teacher model.
[0035] Step A2: Obtain a training set, which includes one or more samples and labels indicating the category to which the sample-related objects belong, wherein the samples are graph data including nodes and edges.
[0036] According to one embodiment of the present invention, the training set can be obtained by extracting a subset from an existing data set. The data set can be of different types, such as:
[0037] The samples in the dataset are graph data that record the co-purchase relationship of commodities, where nodes represent commodities, edges represent the connected commodities that are frequently purchased together by consumers, labels represent the categories to which commodities belong, and objects are commodities. For example, the Amazon-Photo (AP) dataset has 8 categories, including books, music, electronics, food, toys, consumer goods, books, and home furnishings.
[0038] Alternatively, the samples in the dataset are graph data that record the citation relationships of papers, where the nodes represent papers, the edges represent the citation relationships between papers, the labels represent the fields to which the papers belong, and the objects are papers. For example, in the Citeseer dataset, papers are divided into six categories according to their fields.
[0039] Alternatively, the samples in the dataset are data sets that record the co-authorship relationships of authors, where the nodes represent authors, the edges represent co-authorship relationships, the labels represent the authors’ research fields, and the objects are authors. For example, in the Coauthor-Physics data, authors are divided into five categories according to their research fields.
[0040] Of course, the data set may also be other types of data sets, and the present invention does not impose any limitation on this.
[0041] Step A3: Use the training set and at least two teacher models to guide the student model for training.
[0042] According to an embodiment of the present invention, step A3 includes the following steps A31 and A32. In addition, step A3 can be performed multiple times to iteratively train the student model until a preset requirement is met, such as the student model is trained to convergence or a preset number of training times is reached.
[0043] Step A31: Input the sample into each teacher model and student model to obtain the intermediate node representation generated by the intermediate layer and the predicted value generated by the output layer.
[0044] Schematically, the samples are input into two heterogeneous teacher GAT and teacher SAGE, and knowledge is extracted from the student GCN with different architectures. The pre-trained teacher GAT and SAGE are denoted as T1-GAT and T2-SAGE respectively, and the student is denoted as S-GCN. T and z S is the Logit value output by the teacher and the student (or the logical value output by the model), p T =softmax(z T ) and p S =softmax(z S ) represent the predicted values of the teacher and student models respectively (the final predicted probability, usually a vector composed of the confidence scores of multiple categories). Similarly, h T and h S Represents the intermediate node representations of the intermediate layers (intermediate convolutional layers) of the teacher and student models, respectively. Schematically, when the training set is a subset of the Amazon-Photo (AP) dataset, the teacher model and the student model extract the intermediate node representations and Logit values of the nodes corresponding to the products from the graph data, and perform classification prediction based on the Logit values to obtain the predicted values of the categories to which the products belong (including the confidence of each category).
[0045] Step A32: Guiding the parameter update of the student model based on a preset total loss function, wherein the total loss function is configured as a weighted sum of a classification cross entropy loss function, an intermediate-level distillation loss function, and an output-level distillation loss function, wherein the intermediate-level distillation loss is determined according to the difference between the intermediate node representations generated by each teacher model and the student model, and the output-level distillation loss is determined according to the difference between the predicted values generated by each teacher model and the student model.
[0046] According to one embodiment of the present invention, the total loss function is:
[0047] L S =αL CE +γL mOKD +βL mMKD
[0048] Among them, L CE represents the classification cross entropy loss function, LmOKD represents the output level distillation loss function, L mMKD represents the intermediate distillation loss function, α, γ and β represent L CE , L mOKD and L mMKD The technical solution of this embodiment can at least achieve the following beneficial technical effects: integrating the output level knowledge and the intermediate level knowledge based on the total loss function, and integrating the cross entropy loss of the student model under the guidance of the true label, to obtain the final student overall distillation loss, combining multi-level knowledge to comprehensively guide and train the student model, to obtain a student model with better performance, and significantly enhance the student's performance in downstream tasks.
[0049] It should be understood that the total loss function can also be expressed in other forms, such as:
[0050] L S =(1-λ)L CE +λL mOKD +βL mMKD Among them, λ and β represent L mOKD and L mMKD λ and β are hyperparameters that weigh the output-level distillation loss function, the intermediate-level distillation loss function, and the cross-entropy loss function, and can be customized and adjusted by the implementer.
[0051] According to one embodiment of the present invention, the classification cross entropy loss function is:
[0052]
[0053] Among them, C represents the total number of classification categories, y c Represents the value of the cth category recorded in the label and Represents the predicted output value under the cth category in the predicted value of the student model.
[0054] According to one embodiment of the present invention, the intermediate distillation loss function is:
[0055]
[0056] Where M is the total number of heterogeneous teacher models, m represents the number of the teacher model, Represents the intermediate node representation of the sample generated by the intermediate layer l of the mth teacher model, The intermediate node representation of the sample generated by the intermediate layer l of the student model, For the same sample and Calculate the L2 distance function of the difference. The intermediate layer l is a designated intermediate layer, and the designated intermediate layers of different models may not be the same layer, so as to increase the autonomy of the two heterogeneous models and facilitate the implementer to construct a more personalized teacher model or student model. The technical solution of this embodiment can at least achieve the following beneficial technical effects: the graph structure knowledge of the pre-trained teacher model is transferred to the student model by using the intermediate-level knowledge distillation, thereby improving the performance of the student model.
[0057] According to one embodiment of the present invention, the output level distillation loss function is:
[0058]
[0059] Where M is the total number of heterogeneous teacher models, m represents the number of teacher models, τ represents the temperature scaling factor, represents the predicted value generated by the m-th teacher model for the sample, represents the predicted value generated by the student model for the sample, For the same sample and The KL (Kullback-Leibler) divergence function of the calculated difference. The technical solution of this embodiment can at least achieve the following beneficial technical effects: using the output-level knowledge distillation method to extract the soft label knowledge in the pre-trained heterogeneous teacher model into the student model and obtain the output-level distillation loss, thereby improving the performance of the student model.
[0060] It should be noted that the above L CE , L mOKD and L mMKD The calculation formula is the expression of the loss of a single sample. In this field, it should be understood that if multiple samples are used in one training, the above L CE The calculation formula is to calculate the loss for each sample of multiple samples and then average it to obtain the classification cross entropy loss corresponding to multiple samples. mOKD The calculation formula is to calculate the loss for each sample of multiple samples and then average it to obtain the output level distillation loss corresponding to multiple samples; using the above L mMKD The calculation formula is to calculate the loss for each sample of multiple samples respectively and then find the average to obtain the intermediate-level distillation loss corresponding to the multiple samples, and then take the weighted sum of the classification cross entropy loss, intermediate-level distillation loss and output-level distillation loss corresponding to the multiple samples as the total loss calculated by the total loss function.
[0061] According to one embodiment of the present invention, another implementation process of a heterogeneous distillation method based on a graph neural network is shown in Figure 2 As shown, the steps include:
[0062] S1. Build heterogeneous teacher models and student models based on graph neural networks respectively, and obtain output values of the output layer and the intermediate layer of the teacher model and the student model; preferably, the heterogeneous teacher model can have 2, 3, 4, 5, 6 or 8 heterogeneous teacher models;
[0063] S2, based on the prediction values output by the output layers of the heterogeneous teacher model and the student model, the soft label knowledge represented by the prediction values output by the pre-trained teacher model is transferred to the student model using the output-level knowledge distillation loss function;
[0064] S3, based on the intermediate node representation of the intermediate layer output of the heterogeneous teacher model and the student model, the graph structure knowledge of the pre-trained teacher model is transferred to the student model using the intermediate level knowledge distillation loss function;
[0065] S4. Guide the student model training based on the intermediate-level knowledge distillation loss function and the output-level knowledge distillation loss function to obtain a trained student model. Comprehensively guide and train the student model based on the multi-level knowledge obtained above to obtain a comprehensive student model, which significantly enhances the student's performance in downstream tasks.
[0066] According to an example of the present invention, see Figure 3 , a heterogeneous distillation method based on graph neural network, comprising:
[0067] Input graph dataset D, teacher and student graph models T m ,S (corresponding to teacher model and student model);
[0068] Calculate the output layer model predictions for the teacher and student ,p S and the middle layer nodes represent ,h S (corresponding to the intermediate node representation);
[0069] according to ,p S Using output-level knowledge distillation, we get the output-level distillation loss L mOKD , and according to ,h S Using the intermediate knowledge distillation, we get the intermediate distillation loss L mMKD ;
[0070] Integration L mOKD and L mMKD The loss is used to obtain the overall distillation loss L, and the student model S is trained until convergence to obtain a comprehensive student model for downstream tasks.
[0071] In order to illustrate the effect of the method described in the embodiment of the present invention, the inventors also conducted a comparative experiment, which is described below in combination with the experimental results.
[0072] 1. Dataset
[0073] The experiments were conducted on several classic graph datasets, using three benchmark graph datasets, including Citeseer, Amazon-Photo (AP), and Coauthor-Physics (Physics) datasets. The statistics of the relevant datasets are shown in Table 1:
[0074] Table 1 Three graph datasets used in this experiment
[0075] Dataset Number of nodes Number of edges Number of features Number of categories Citeseer 3327 4552 3703 6 AP 7650 119043 745 8 Physics 34493 247962 8415 5
[0076] 2. Benchmark Model
[0077] In order to verify the effectiveness of the heterogeneous distillation scheme of the present invention, this experiment will be tested on classic benchmark graph neural network models, namely GCN, GAT and SAGE graph models.
[0078] 3. Experimental Results
[0079] The present invention applies the designed heterogeneous distillation algorithm to different benchmark graph neural network models, and performs node classification tasks on the three different graph datasets in Table 1, where the classification indicator used is Micro-F1. Among them, GCN represents the benchmark teacher graph model before pre-training, and the student model represents the performance of the student GCN under the guidance of the two heterogeneous teachers GAT and SAGE. The improvement ratio represents the performance improvement of the benchmark graph model under the guidance of the heterogeneous distillation method compared with its pre-training benchmark graph model. The specific experimental results are shown in Table 2:
[0080] Table 2 Classification effect of this scheme based on three graph neural networks on three different graph datasets
[0081]
[0082] It can be found from Table 2 that by using the heterogeneous distillation scheme proposed in the present invention, the performance of the graph neural network is significantly and consistently improved as a whole, with an improvement range of 1.05% to 32.81%.
[0083] In general, the embodiment of the present invention provides a heterogeneous distillation method based on graph neural network, which applies knowledge distillation to the heterogeneous teacher-student distillation framework for the first time, filling the gap in extracting diverse and complementary knowledge from heterogeneous teachers. This scheme extracts the diverse and complementary graph structure knowledge contained in heterogeneous teachers to comprehensively guide the training of student models, and can be applied to any GNNs model. Through this scheme, the student model can fully explore and utilize the rich and diverse complementary knowledge hidden in GNNs. Therefore, the node representation ability of the student model is significantly improved, and the performance is greatly improved.
[0084] It should be noted that although the above describes the various steps in a specific order, it does not mean that the various steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently or even in a different order as long as the required functions can be achieved.
[0085] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.
[0086] Computer readable storage medium can be a tangible device that holds and stores instructions used by an instruction execution device. Computer readable storage medium can include, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a protruding structure in a groove on which instructions are stored, and any suitable combination thereof.
[0087] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A heterogeneous distillation method based on graph neural network, comprising: Obtain at least two heterogeneous teacher models and student models, all of which are graph data networks with intermediate layers and output layers, and the teacher model is a trained model; Obtaining a training set, which includes one or more samples and labels indicating the categories to which objects related to the samples belong, wherein the samples are graph data including nodes and edges; The student model is trained using a training set and at least two teacher models, wherein the training includes: Input the samples into each teacher model and student model to obtain the intermediate node representations generated by each intermediate layer and the predicted values generated by each output layer; The parameter update of the student model is guided based on a preset total loss function, and the total loss function is configured as a weighted sum of a classification cross entropy loss function, an intermediate-level distillation loss function, and an output-level distillation loss function, wherein the intermediate-level distillation loss function is used to determine the loss between the intermediate node representations generated by each teacher model and the student model, and the output-level distillation loss function is used to determine the loss between the predicted values generated by each teacher model and the student model.
2. The method according to claim 1, characterized in that The total loss function is: L S =αL CE +γL mOKD +βL mMKD Among them, L CE represents the classification cross entropy loss function, L mOKD represents the output level distillation loss function, L mMKD represents the intermediate distillation loss function, α, γ and β represent L CE , L mOKD and L mMKD The weight coefficient of .
3. The method according to claim 2, characterized in that The intermediate distillation loss function is: Where M is the total number of heterogeneous teacher models, m represents the number of the teacher model, Represents the intermediate node representation of the sample generated by the intermediate layer l of the mth teacher model, The intermediate node representation of the sample generated by the intermediate layer l of the student model, For the same sample and Compute the L2 distance function of the difference.
4. The method according to claim 2, characterized in that: The output level distillation loss function is: Where M is the total number of heterogeneous teacher models, m represents the number of teacher models, τ represents the temperature scaling factor, represents the predicted value generated by the m-th teacher model for the sample, represents the predicted value generated by the student model for the sample, For the same sample and Compute the KL divergence function of the discrepancy.
5. The method according to any one of claims 1 to 4, characterized in that: All teacher models and student models are heterogeneous models with different structures from each other, but all teacher models and student models are provided with a designated intermediate layer that produces intermediate node representations of the same size, and the intermediate node representations output by the designated intermediate layer are used to calculate the intermediate-level distillation loss function.
6. The method according to any one of claims 1 to 4, characterized in that: The at least two teacher models include a GAT-based teacher model and another SAGE-based teacher model, and the student model is a GCN-based model.
7. The method according to any one of claims 1 to 4, characterized in that: The sample is graph data recording the co-purchase relationship of commodities, wherein the nodes represent commodities, the edges represent that the connected commodities are frequently purchased together by consumers, the labels represent the categories to which the commodities belong, and the objects are commodities; or The sample is graph data that records the citation relationship of papers, where the nodes represent papers, the edges represent the citation relationship between papers, the labels represent the fields to which the papers belong, and the objects are papers.
8. A classification method based on graph data, characterized in that: The method comprises: Obtaining a trained student model, which is trained according to the method of any one of claims 1-7; The graph data to be predicted is obtained, and the trained student model is used to classify the objects related to the graph data to be predicted.
9. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program can be executed by a processor to implement the steps of the method according to any one of claims 1 to 8.
10. An electronic device, characterized in that: include: one or more processors; as well as A memory, wherein the memory is used to store executable instructions; The one or more processors are configured to implement the steps of the method of one of claims 1 to 8 by executing the executable instructions.
Citation Information
Cited By
Blood smear image classification method and system based on knowledge distillation and graph neural network
CN120472213A
