A method, device, computer equipment and storage medium for training classification model
By dividing and adjusting topological relationships in the sample topology graph, the training topology graph is generated to re-extract node features, and the problem of low accuracy and reliability of classification models in the existing technology is solved, and higher classification accuracy and model stability are achieved sex.
Patent Information
- Application Number
- CN202210247661.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-14
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2042-03-14
AI Technical Summary
The classification accuracy and reliability of the classification model trained in the prior art is low, mainly due to the complex topological relationship in the sample topology graph, resulting in node feature extraction errors.
By obtaining the sample topology graph, based on the matching degree and probability distribution of the topology relationship, the sample nodes are divided into combinations, delete or add topology relationships, and a training topology graph is generated, thereby re-extracting the node characteristics and adjusting the model parameters.
The classification accuracy and reliability of the classification model are improved, and the model's representation of topological relationships is enhanced, ensuring that the model can accurately maintain high accuracy after multiple rounds of training.
Smart Images

Figure CN114595777B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer device and storage medium for training a classification model. Background Art
[0002] With the continuous development of technology, more and more devices can use trained target classification models to perform intelligent classification tasks on various data. Since there may be correlations between various data, the device can store various data in the form of a topological graph, and then use the target classification model to predict the category of each data based on the topological graph.
[0003] In the related art, the trained target classification model is obtained by performing multiple rounds of iterative training on the classification model to be trained. When training the classification model to be trained, the classification model to be trained is usually used to extract the node features of each sample node contained in the sample topology map based on the sample topology map, and then determine the prediction category of each sample node based on each node feature, and finally adjust the model parameters based on each prediction category to achieve the purpose of iterative training of the classification model to be trained.
[0004] However, since the topological relationships between sample nodes are rich and varied in the sample topology map, when classifying sample nodes based on the sample topology map, some topological relationships can promote the classification model to be trained to extract correct node features, while some topological relationships can easily mislead the classification model to be trained to extract incorrect node features, resulting in low accuracy and reliability of the predicted categories of sample nodes determined based on the node features, which further leads to low classification accuracy and reliability of the trained target classification model.
[0005] It can be seen that in the related art, the classification accuracy and reliability of the trained target classification model are low. Summary of the invention
[0006] The embodiments of the present application provide a method, apparatus, computer device, and storage medium for training a classification model, which are used to solve the problem of low classification accuracy and reliability of a trained classification model.
[0007] In a first aspect, a method for training a classification model is provided, comprising:
[0008] Obtain a sample topology graph, wherein each sample node represents a piece of data to be classified, and the topological relationship between each two sample nodes represents the data association relationship between the corresponding two pieces of data to be classified;
[0009] Based on the sample topology graph, multiple rounds of iterative training are performed on the classification model to be trained, and the trained target classification model is output. In each round of iterative training, at least the following operations are performed:
[0010] Using the classification model to be trained, based on the matching degree between the sample nodes determined from the sample topology graph, the sample nodes are divided into a plurality of sample node combinations;
[0011] Based on the multiple sample node combinations, in the sample topology graph, at least one topology relationship that meets the topology relationship screening condition is deleted, and at least one topology relationship is added between each sample node that meets the node screening condition to obtain a training topology graph;
[0012] Based on the training topology graph, the training node features of each sample node are re-extracted, and based on the obtained training node features, the corresponding prediction category is determined to adjust the model parameters.
[0013] In a second aspect, a device for training a classification model is provided, comprising:
[0014] Acquisition module: used to acquire a sample topology graph, wherein each sample node represents a data to be classified, and the topological relationship between each two sample nodes represents the data association relationship between the corresponding two data to be classified;
[0015] Processing module: used to perform multiple rounds of iterative training on the classification model to be trained based on the sample topology map, and output the trained target classification model. In each round of iterative training, at least the following operations are performed:
[0016] The processing module is further used to: adopt the classification model to be trained currently, and divide the sample nodes into a plurality of sample node combinations based on the matching degree between the sample nodes determined from the sample topology graph;
[0017] The processing module is further used to: based on the plurality of sample node combinations, delete at least one topological relationship that meets the topological relationship screening condition in the sample topological graph, and add at least one topological relationship between each sample node that meets the node screening condition, to obtain a training topological graph;
[0018] The processing module is also used to: re-extract the training node features of each sample node based on the training topology graph, and determine the corresponding prediction category based on the obtained training node features to adjust the model parameters.
[0019] Optionally, the processing module is specifically used for:
[0020] Extracting features from the sample topology graph to obtain initial node features of each sample node;
[0021] Based on the obtained initial node features, the probability of each sample node belonging to each preset reference category is predicted respectively, and the category probability distribution corresponding to each sample node is obtained;
[0022] Based on the obtained probability distribution of each category, determining whether the matching degree between the sample nodes meets the preset matching condition;
[0023] The sample nodes whose matching degrees satisfy the matching condition are respectively divided into a group to obtain the plurality of sample node combinations.
[0024] Optionally, the processing module is specifically configured to perform at least one of the following:
[0025] When the reference categories corresponding to the maximum probabilities contained in the probability distributions of each category are the same, it is determined that the matching degree between the corresponding sample nodes meets the matching condition;
[0026] When the probability error between the probability distributions of each category is not greater than a preset error threshold, it is determined that the matching degree between the corresponding sample nodes meets the matching condition.
[0027] Optionally, the processing module is specifically used for:
[0028] Based on the multiple sample node combinations, at least one heterogeneous node pair and at least one homogeneous node pair are determined from the respective sample nodes, wherein the two heterogeneous nodes included in each heterogeneous node pair belong to different sample node combinations respectively, and there is a topological relationship between the two heterogeneous nodes, and the two homogeneous nodes included in each homogeneous node pair belong to the same sample node combination, and there is no topological relationship between the two homogeneous nodes;
[0029] In the sample topology graph, the topology relationship between the at least one heterogeneous node pair is deleted, and the topology relationship between the at least one homogeneous node pair is added to obtain the training topology graph.
[0030] Optionally, each of the sample nodes has a corresponding category probability distribution, and each category probability distribution represents the probability that the corresponding sample node predicted by the current classification model to be trained belongs to each preset reference category; the processing module is specifically used to:
[0031] Based on the kurtosis function, respectively determine the prediction confidence of the category probability distribution corresponding to each of the sample nodes;
[0032] Determine a topological confidence of a topological relationship between at least one heterogeneous node pair based on a product of prediction confidences corresponding to two heterogeneous nodes included in each heterogeneous node pair;
[0033] In the sample topology graph, the topological relationships whose topological confidence is greater than a preset topological confidence threshold are deleted, and topological relationships are added between the homogeneous node pairs whose prediction confidence is greater than a preset prediction confidence threshold to obtain the training topology graph.
[0034] Optionally, when the number of the homogeneous node pairs whose prediction confidence is greater than the prediction confidence threshold is multiple, the processing module is specifically configured to:
[0035] From the plurality of homogeneous nodes, at least one isolated homogeneous node pair is selected according to a preset first specified number, and at least one non-isolated homogeneous node pair is selected according to a preset second specified number, wherein two homogeneous nodes included in each isolated homogeneous node pair do not have a topological relationship, and one of the two homogeneous nodes included in each non-isolated homogeneous node pair does not have a topological relationship;
[0036] A topological relationship is added between the at least one isolated homogeneous node pair, and a topological relationship is added between the at least one non-isolated homogeneous node pair.
[0037] Optionally, the acquired sample topology map is associated with a sample category label corresponding to each sample node, and the sample category label represents a reference category corresponding to the corresponding sample node; the processing module is specifically used to:
[0038] Based on the characteristics of each training node, respectively predict the probability that the corresponding sample node belongs to each preset reference category;
[0039] The reference categories corresponding to the maximum probabilities are respectively used as the prediction categories of the corresponding sample nodes to obtain the prediction categories of the respective sample nodes;
[0040] Determine the training loss of the current classification model to be trained based on the error between the predicted category of each sample node and the corresponding sample category label;
[0041] When the training loss does not meet the training target, the model parameters of the current classification model to be trained are adjusted.
[0042] Optionally, the training topology map includes a first topology map and a second topology map, the first topology map is obtained after deleting at least one topological relationship in the sample topology map, and the second topology map is obtained after adding at least one topological relationship in the first topology map; the processing module is specifically used to:
[0043] Using the current classification model to be trained, based on the first topological graph, re-extracting the first node features of each sample node, and determining the corresponding first category based on each obtained first node feature, so as to adjust the model parameters of the current classification model to be trained, and obtain the adjusted classification model to be trained;
[0044] Using the obtained adjusted classification model to be trained, based on the second topological map, the second node features of each sample node are re-extracted, and based on the obtained each second node feature, the corresponding second category is determined to continue adjusting the model parameters of the adjusted classification model to be trained.
[0045] According to a third aspect, a computer program product is provided, comprising a computer program, which implements the method according to the first aspect when executed by a processor.
[0046] According to a fourth aspect, a computer device is provided, comprising:
[0047] A memory for storing program instructions;
[0048] The processor is used to call the program instructions stored in the memory and execute the method as described in the first aspect according to the obtained program instructions.
[0049] According to a fifth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method described in the first aspect.
[0050] In an embodiment of the present application, when training a classification model to be trained based on a sample topology map, the current classification model to be trained is adopted, and each sample node is divided into a plurality of sample node combinations based on the sample topology map. The divided plurality of sample node combinations can characterize the classification accuracy of the current classification model to be trained to a certain extent. On this basis, based on the plurality of sample node combinations, in the sample topology map, at least one topological relationship satisfying the topological relationship screening condition is deleted, and the difference between two sample nodes corresponding to at least one topological relationship satisfying the topological relationship screening condition is increased. At the same time, at least one topological relationship is added between each sample node satisfying the node screening condition, and the matching degree between each sample node satisfying the node screening condition is increased. Thus, the obtained training topology map enhances the characterization effect of the classification accuracy of the current classification model to be trained compared with the original sample topology map.
[0051] Therefore, based on the obtained training topology map, the current classification model to be trained is trained and the model parameters are adjusted so that after this round of training, the current classification model to be trained can accurately maintain the part with higher classification accuracy and adjust the part with lower classification accuracy. Thus, after multiple rounds of training, a target classification model with higher classification accuracy can be obtained, thereby achieving the purpose of improving the classification accuracy and reliability of the target classification model. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1a A topological relationship diagram 1 provided for an embodiment of the present application;
[0053] Figure 1b A topological relationship diagram provided in the embodiment of the present application Figure 2 ;
[0054] Figure 1c An application scenario of the method for training a classification model provided in an embodiment of the present application;
[0055] Figure 2 A flowchart of a method for training a classification model provided in an embodiment of the present application is shown in FIG1 ;
[0056] Figure 3a A schematic diagram of a method for training a classification model provided in an embodiment of the present application;
[0057] Figure 3b A schematic diagram of a method for training a classification model provided in an embodiment of the present application Figure 2 ;
[0058] Figure 4 A third schematic diagram of a principle of a method for training a classification model provided in an embodiment of the present application;
[0059] Figure 5a A schematic diagram of a method for training a classification model provided in an embodiment of the present application Figure 4 ;
[0060] Figure 5b A schematic diagram of a method for training a classification model provided in an embodiment of the present application;
[0061] Figure 5c A schematic diagram of a principle of a method for training a classification model provided in an embodiment of the present application is shown in FIG6;
[0062] Figure 6a A schematic diagram of a method for training a classification model provided in an embodiment of the present application is shown in FIG7;
[0063] Figure 6b A schematic diagram of a method for training a classification model provided in an embodiment of the present application Figure 8 ;
[0064] Figure 7a A schematic diagram of a method for training a classification model provided in an embodiment of the present application Figure 9 ;
[0065] Figure 7b A schematic diagram of a principle of a method for training a classification model provided in an embodiment of the present application is shown in FIG10;
[0066] Figure 7c A schematic diagram of a principle of a method for training a classification model provided in an embodiment of the present application is shown in FIG11;
[0067] Figure 8 A structural schematic diagram 1 of a device for training a classification model provided in an embodiment of the present application;
[0068] Fig. 9 A structural diagram of a device for training a classification model provided in an embodiment of the present application Figure 2 . DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0070] Some of the terms used in the embodiments of the present application are explained below to facilitate understanding by those skilled in the art.
[0071] (1) Topological graph:
[0072] A topological graph is a non-Euclidean topological structure consisting of nodes and the edges that link them, such as molecular structures, computer networks, social networks, and the force relationships of celestial bodies.
[0073] (2) Graph Convolution Network (GCN):
[0074] Graph convolutional neural networks can obtain the embedded expression of nodes by aggregating the features of each node with parameters, which is equivalent to a model that can be used for feature extraction.
[0075] (3) Sample node label:
[0076] Sample node labels are an attribute that can be used to classify certain nodes in the graph. Usually, this attribute is exclusive and orthogonal. For example, different families in interpersonal relationships can be used as labels.
[0077] (4) Homophily and Heterophily:
[0078] The classifications of two nodes linked by an edge in a topological graph tend to be the same. If there are more such edges, the homogeneity of the topological graph is higher.
[0079] If two nodes connected by an edge in a topological graph are classified differently, they are heterogeneous. The more such edges there are, the higher the heterogeneity of the topological graph.
[0080] (5) Neighbor:
[0081] In a topological graph, the set of all edges corresponding to a certain node constitutes the neighbors of the node.
[0082] (6) Embedding, node features, and aggregation:
[0083] Embedding is equivalent to expressing each node or edge using a high-dimensional vector.
[0084] Node features are equivalent to a set of attributes of each node in the topological graph, such as the age, gender, hobbies, etc. of each person in the social network.
[0085] Aggregation is equivalent to a topological graph in which each node somehow aggregates the information of its neighbors and maps it into its own new embedding.
[0086] The embodiments of the present application relate to the field of artificial intelligence (AI), are designed based on computer vision (CV) technology and machine learning (ML) technology, and can be applied to cloud computing, smart transportation, assisted driving, maps and other fields.
[0087] Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science. It studies the design principles and implementation methods of various machines, attempts to understand the essence of intelligence, and produces a new intelligent machine that can respond in a similar way to human intelligence, so that the machine has the functions of perception, reasoning and decision-making.
[0088] Artificial intelligence is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation interaction systems, mechatronics and other technologies. The software technology of artificial intelligence mainly includes computer vision technology, speech processing technology, natural language processing technology, machine learning / deep learning, automatic driving, smart transportation and other major directions. With the development and progress of artificial intelligence, artificial intelligence has been able to carry out research and application in many fields, such as common smart homes, smart customer service, virtual assistants, smart speakers, smart marketing, smart wearable devices, unmanned driving, automatic driving, drones, robots, smart medical care, Internet of Vehicles, automatic driving, smart transportation and other fields. It is believed that with the further development of future technology, artificial intelligence will be applied in more fields and play an increasingly important role. The solution provided in the embodiment of this application involves technologies such as deep learning and augmented reality of artificial intelligence, which are further explained by the following embodiments.
[0089] Computer vision is a science that studies how to make machines "see". To put it more specifically, it refers to machine vision that uses cameras and computers to replace human eyes to identify, track and measure targets, and further performs graphic processing to make computer processing into images that are more suitable for human eye observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and mapping, autonomous driving, smart transportation and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.
[0090] Machine learning is an interdisciplinary subject that involves probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines. It specializes in studying how computers can acquire new knowledge or skills and reorganize existing knowledge structures by simulating human learning behaviors, so that computers can continuously improve their performance.
[0091] Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. The core of machine learning is deep learning, a technology that implements machine learning. Machine learning usually includes deep learning, reinforcement learning, transfer learning, inductive learning, artificial neural networks, and self-learning. Deep learning includes convolutional neural networks (CNN), deep belief networks, recursive neural networks, autoencoders, generative adversarial networks, and other technologies.
[0092] It should be noted that in the embodiments of the present application, related data such as data to be classified are involved. When the above embodiments of the present application are applied to specific products or technologies, each time data is acquired, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0093] The following is a brief introduction to the application fields of the method for training a classification model provided in the embodiments of the present application.
[0094] With the continuous development of technology, more and more devices can use trained target classification models to perform intelligent classification tasks on various data. Since there may be correlations between various data, the device can store various data in the form of a topological graph, and then use the target classification model to predict the category of each data based on the topological graph.
[0095] For example, in the field of film and television, the data may be films, TV series, variety shows and other film and television works. There may be correlations between the film and television works. For example, they may have the same director, the same actors, the same theme, similar plots, the same film and television characters, audiences of similar age groups, the same broadcasting platforms, etc., without specific restrictions.
[0096] Please refer to Figure 1a , the device can store each film and television work in the form of a topological graph, each node represents a film and television work, and each topological relationship represents the association relationship between the corresponding two film and television works. Film and television A and film and television C have the same director, film and television C, film and television D and film and television E have the same actors, and film and television B and film and television E have similar plots.
[0097] For another example, in the application field, each data may be a display element such as a display interface or a button, and there may be an association relationship between the display elements, such as they may have the same destination address, may have the same display background, may be used to access the same server, may have similar functions, etc., without specific limitation.
[0098] Please refer to Figure 1b ,The device can store each display element in the form of a topological graph, where each node represents a display element, and each topological relationship represents the association between the corresponding two display elements.,The home page of the application has the same destination address as the back button, the home page has the same display background as the details page, and the search button accesses the same server as the details page.
[0099] In the related art, before using the target classification model to predict the category of each data based on the topological map, the trained target classification model can be obtained by performing multiple rounds of iterative training on the classification model to be trained. When training the classification model to be trained, the classification model to be trained is usually used to extract the node features of each sample node contained in the sample topological map based on the sample topological map, and then determine the predicted category of each sample node based on each node feature. Finally, based on the error between each predicted category and the corresponding sample category, the model parameters are adjusted to achieve the purpose of iterative training of the classification model to be trained.
[0100] However, since the topological relationships between the various sample nodes in the sample topology map are rich and varied, when classifying the various sample nodes based on the sample topology map, some topological relationships can promote the classification model to be trained to extract the correct node features, while some topological relationships can easily mislead the classification model to be trained to extract the wrong node features. Therefore, when adjusting the model parameters by determining the predicted category of each sample node based on the features of each node, the classification model to be trained cannot accurately maintain the part from which the correct node features can be extracted, nor can it accurately adjust the part from which the wrong node features are extracted, so that the classification model to be trained cannot be accurately trained and learned based on the sample topology map. As a result, the classification accuracy and reliability of the trained target classification model are low.
[0101] It can be seen that in the related art, the classification accuracy and reliability of the trained target classification model are low.
[0102] In order to solve the problem of low classification accuracy and reliability of the trained classification model, the present application proposes a method for training a classification model. In the method, after obtaining a sample topology map, the classification model to be trained is trained for multiple rounds based on the sample topology map, and the trained target classification model is output. Each sample node represents a data to be classified, and the topological relationship between each two sample nodes represents the data association relationship between the corresponding two data to be classified.
[0103] In each round of iterative training, at least the following operations are performed: using the classification model to be trained, based on the matching degree between each sample node determined from the sample topology map, each sample node is divided into multiple sample node combinations. Based on the multiple sample node combinations, in the sample topology map, at least one topological relationship that meets the topological relationship screening condition is deleted, and at least one topological relationship is added between each sample node that meets the node screening condition to obtain a training topology map. Based on the training topology map, the training node features of each sample node are re-extracted, and based on the obtained training node features, the corresponding prediction category is determined to adjust the model parameters.
[0104] In an embodiment of the present application, when training a classification model to be trained based on a sample topology map, the current classification model to be trained is adopted, and each sample node is divided into a plurality of sample node combinations based on the sample topology map. The divided plurality of sample node combinations can characterize the classification accuracy of the current classification model to be trained to a certain extent. On this basis, based on the plurality of sample node combinations, in the sample topology map, at least one topological relationship satisfying the topological relationship screening condition is deleted, and the difference between two sample nodes corresponding to at least one topological relationship satisfying the topological relationship screening condition is increased. At the same time, at least one topological relationship is added between each sample node satisfying the node screening condition, and the matching degree between each sample node satisfying the node screening condition is increased. Thus, the obtained training topology map enhances the characterization effect of the classification accuracy of the current classification model to be trained compared with the original sample topology map.
[0105] Therefore, based on the obtained training topology map, the current classification model to be trained is trained and the model parameters are adjusted so that after this round of training, the current classification model to be trained can accurately maintain the part with higher classification accuracy and adjust the part with lower classification accuracy. Thus, after multiple rounds of training, a target classification model with higher classification accuracy can be obtained, thereby achieving the purpose of improving the classification accuracy and reliability of the target classification model.
[0106] The following describes the application scenarios of the method for training a classification model provided in this application.
[0107] Please refer to Figure 1c , which is a schematic diagram of an application scenario of the method for training a classification model provided in the present application. The application scenario includes a client 101 and a server 102. The client 101 and the server 102 can communicate with each other. The communication method can be to communicate using wired communication technology, for example, by connecting a network cable or a serial port cable; or to communicate using wireless communication technology, for example, by communicating using technologies such as Bluetooth or wireless fidelity (WIFI), without specific limitation.
[0108] The client 101 generally refers to a device that can provide a sample topology map to the server 102, such as a terminal device, a third-party application that the terminal device can access, or a web page that the terminal device can access. Terminal devices include but are not limited to mobile phones, computers, intelligent transportation equipment, smart appliances, etc. The server 102 generally refers to a device that can train a classification model, such as a terminal device or a server. The server includes but is not limited to a cloud server, a local server, or an associated third-party server. Both the client 101 and the server 102 can use cloud computing to reduce the occupation of local computing resources; cloud storage can also be used to reduce the occupation of local storage resources.
[0109] As an embodiment, the client 101 and the server 102 can be the same device. For example, the embodiment of the present application can be implemented only through the client 101, or only through the server 102, etc., without specific limitation. In the embodiment of the present application, the client 101 and the server 102 are different devices as an example for introduction.
[0110] The following is based on Figure 1c , the method for training the classification model provided in the embodiment of the present application is specifically introduced. Please refer to Figure 2 , which is a flow chart of a method for training a classification model provided in an embodiment of the present application.
[0111] S201, obtaining a sample topology map.
[0112] Before training the classification model to be trained, the server can obtain a sample topology map. The server can read a pre-stored sample topology map from the memory, receive a sample topology map sent by other devices, download a sample topology map from a network resource, or generate a sample topology map based on each data to be classified, etc., without any specific restrictions.
[0113] In the sample topology diagram, each sample node represents a data to be classified, and the topological relationship between each two sample nodes represents the data association relationship between the corresponding two data to be classified. Figure 3a , is a sample topology graph, which includes eight sample nodes, namely a first sample node, a second sample node, a third sample node, a fourth sample node, a fifth sample node, a sixth sample node, a seventh sample node and an eighth sample node.
[0114] There is a topological relationship between the first sample node and the second sample node, there is a topological relationship between the second sample node and the third sample node, there is a topological relationship between the third sample node and the seventh sample node, there is a topological relationship between the third sample node and the fifth sample node, there is a topological relationship between the fourth sample node and the seventh sample node, there is a topological relationship between the fourth sample node and the fifth sample node, there is a topological relationship between the fourth sample node and the eighth sample node, and there is a topological relationship between the fourth sample node and the sixth sample node.
[0115] S202, based on the sample topology map, perform multiple rounds of iterative training on the classification model to be trained, and output the trained target classification model.
[0116] After obtaining the sample topology map, the server can perform multiple rounds of iterative training on the classification model to be trained based on the sample topology map, and output the trained target classification model. The number of sample topology maps can be one or more. When there is one sample topology map, the server can repeatedly perform multiple rounds of iterative training on the classification model to be trained based on the one sample topology map, and output the trained target classification model. When there are multiple sample topology maps, the server can perform one or more rounds of iterative training on the classification model to be trained based on each sample topology map in turn, so as to achieve the purpose of performing multiple rounds of iterative training on the classification model to be trained based on multiple sample topology maps, and outputting the trained target classification model, etc., without specific limitation.
[0117] The following is an example of an iterative training of a classification model to be trained based on a sample topology graph. The process of each iterative training round is similar and will not be repeated here. Please refer to S203 to S205.
[0118] S203, using the current classification model to be trained, and based on the matching degree between each sample node determined from the sample topology graph, dividing each sample node into a plurality of sample node combinations.
[0119] The server can use the current classification model to be trained to determine the matching degree between each two sample nodes from the sample topology map. The matching degree can represent whether the sample nodes are similar or related. For example, when two sample nodes represent different movies and the introductions of the two movies are similar, it can be determined that the matching degree of the two sample nodes is high. For another example, when two sample nodes represent different pictures and the backgrounds of the two pictures are similar, it can be determined that the two sample nodes are related, etc. There is no specific limitation.
[0120] The server can divide each sample node into multiple sample node combinations based on each matching degree. For example, the server can divide the sample nodes whose matching degree is greater than a first preset threshold into a group to obtain multiple sample node combinations. For another example, the server can divide the sample nodes whose matching degree is less than a second preset threshold into different groups to obtain multiple sample node combinations, etc., without specific limitation.
[0121] As an embodiment, when determining the matching degree between each sample node from the sample topology map, the server can determine the matching degree between each sample node based on the similarity between the initial node features of each sample node extracted from the sample topology map; the server can also determine the matching degree between each sample node based on the category of each sample node predicted from the sample topology map, etc., without specific limitation.
[0122] The server can use the classification model to be trained to extract features from the sample topology map, obtain the initial node features of each sample node, and quantify the sample nodes through the initial node features. Thus, the server can determine whether the matching degree between each sample node meets the preset matching condition based on the obtained initial node features. For example, if the features of two initial nodes are similar, it can be shown that the matching degree between the two sample nodes meets the preset matching condition. The server can determine whether the features of two initial nodes are similar by calculating the distance between the features of the two initial nodes. The smaller the distance, the more similar, and the larger the distance, the more different. The server can divide each sample node whose matching degree meets the matching condition into a group to obtain multiple sample node combinations.
[0123] After obtaining the features of each initial node, the server can also predict the probability of each sample node belonging to each preset reference category based on the obtained features of each initial node, obtain the category probability distribution corresponding to each sample node, and quantify the sample node through the category probability distribution. Thus, the server can determine whether the matching degree between each sample node meets the preset matching condition based on the obtained category probability distribution. For example, if the distribution characteristics of two category probability distributions are similar, it can be shown that the matching degree between the two sample nodes meets the preset matching condition. The server can divide each sample node whose matching degree meets the matching condition into a group to obtain multiple sample node combinations.
[0124] As an embodiment, there are multiple methods for determining whether the matching degree between each sample node meets the preset matching condition based on the obtained probability distribution of each category. Two of them are introduced as examples below without specific limitation.
[0125] Method 1:
[0126] Based on whether the reference categories corresponding to the maximum probabilities contained in the probability distributions of each two categories are the same, it is determined that the matching degree between the corresponding two sample nodes meets the matching condition.
[0127] After obtaining the probability distribution of each category, the server can determine the reference category corresponding to the maximum probability contained in each category probability distribution, and can use the reference category as the category predicted by the current classification model to be trained for the corresponding sample node. Then, when the server determines that the reference categories corresponding to the maximum probabilities contained in the probability distribution of each category are the same, it can determine that the matching degree between the corresponding sample nodes meets the matching condition; when the server determines that the reference categories corresponding to the maximum probabilities contained in the probability distribution of each category are different, it can determine that the matching degree between the corresponding sample nodes does not meet the matching condition.
[0128] Please refer to Figure 3b , the preset reference categories include the first category, the second category, the third category and the fourth category. The server obtains the category probability distribution of the first sample node respectively, please refer to Figure 3b (1); For the category probability distribution of the second sample node, please refer to Figure 3b (2); For the probability distribution of the third sample node, please refer to Figure 3b (3).
[0129] In the category probability distribution of the first sample node, the reference category corresponding to the maximum probability is the third category; in the category probability distribution of the second sample node, the reference category corresponding to the maximum probability is the third category; in the category probability distribution of the third sample node, the reference category corresponding to the maximum probability is the second category.
[0130] Then, the server can determine that the matching degree between the first sample node and the second sample node meets the matching condition, so that the first sample node and the second sample node can be divided into the same sample node combination. The matching degree between the first sample node and the third sample node does not meet the matching condition, and the matching degree between the second sample node and the third sample node does not meet the matching condition, so the third sample node can be divided into a sample node combination different from the first sample node and the second sample node.
[0131] Method 2:
[0132] Based on whether the probability error between each two category probability distributions is greater than an error threshold, it is determined that the matching degree between the corresponding two sample nodes meets the matching condition.
[0133] After obtaining the probability distributions of each category, the server can determine the error between each two category probability distributions respectively. The error between the two category probability distributions can be the average difference between the probabilities on the corresponding reference categories. The error between the two category probability distributions can reflect whether the distribution characteristics of the two category probability distributions are similar. Then, when the server determines that the probability error between the probability distributions of each category is not greater than the preset error threshold, it can determine that the matching degree between the corresponding sample nodes meets the matching condition. When the server determines that the probability error between the probability distributions of each category is greater than the preset error threshold, it can determine that the matching degree between the corresponding sample nodes does not meet the matching condition.
[0134] For example, see Figure 4 , the three sample nodes are Movie A, Movie B and Movie C. Movie A tells a campus love story, Movie B tells a college life story, and Movie C tells a science fiction story. Using the classification model to be trained, feature extraction is performed on Movie A, Movie B and Movie C respectively to obtain the corresponding initial node feature A, initial node feature B and initial node feature C. Initial node feature A represents campus love, initial node feature B represents college life, and initial node feature C represents science fiction. Based on initial node feature A, initial node feature B and initial node feature C.
[0135] The server determines that the probability that movie A belongs to the youth film category is 0.7, the probability that it belongs to the suspense film category is 0.2, and the probability that it belongs to the science fiction film category is 0.1. The server determines that the probability that movie B belongs to the youth film category is 0.8, the probability that it belongs to the suspense film category is 0.1, and the probability that it belongs to the science fiction film category is 0.1. The server determines that the probability that movie C belongs to the youth film category is 0, the probability that it belongs to the suspense film category is 0.1, and the probability that it belongs to the science fiction film category is 0.9.
[0136] The server determines that movie A is in the youth film category, movie B is in the youth film category, and movie C is in the science fiction film category. Movie A and movie B are in the same category, but movie A and movie C, as well as movie B and movie C, are in different categories. Therefore, the server determines that the matching degree between movie A and movie B meets the matching condition, and divides movie A and movie B into one sample node combination. The matching degree between movie A and movie C, and the matching degree between movie B and movie C do not meet the matching condition, and movie C is divided into another sample node combination different from movie A and movie B.
[0137] As an embodiment, the classification model to be trained includes a shallow GCN model. In the process of dividing each sample node into multiple sample node combinations, the server can use the shallow GCN model included in the classification model to be trained to learn the aggregated knowledge of each sample node through the shallow GCN model.
[0138] The server uses the shallow GCN model included in the classification model to be trained to extract features from the sample topology map and obtain the feature matrix of each sample node. The shallow GCN model is continued to be used to fuse each feature matrix in turn to obtain the corresponding embedding, which is the initial node feature h. Please refer to formula (1).
[0139] h=GCN1(g,feat) (1)
[0140] Among them, GCN1(·) represents the GCN model, g represents the sample topology, and feat represents each feature matrix.
[0141] After obtaining the features of each initial node, the server can use the logistic regression function softmax to predict the features of each initial node and determine the category probability distribution of each sample node belonging to each reference category. Please refer to formula (2).
[0142]
[0143] Among them, x i Represents the initial node features of the currently predicted sample node, Represents the sum of the initial node features of each sample node.
[0144] S204, based on the combination of multiple sample nodes, in the sample topology graph, delete at least one topology relationship that meets the topology relationship screening condition, and add at least one topology relationship between each sample node that meets the node screening condition to obtain a training topology graph.
[0145] After obtaining each sample node combination, the server can delete at least one topological relationship that meets the topological relationship screening condition in the sample topological graph based on multiple sample node combinations, and add at least one topological relationship between each sample node that meets the node screening condition to obtain a training topological graph.
[0146] By deleting at least one topological relationship that meets the topological relationship screening conditions, the difference between the two sample nodes corresponding to each topological relationship can be increased. Therefore, when learning and training is performed based on the topological graph after deleting at least one topological relationship, the classification model to be trained can more accurately learn whether the two sample nodes belong to the same sample node combination, thereby improving the accuracy and reliability of the trained target classification model.
[0147] By adding at least one topological relationship between each sample node that meets the node screening conditions, the similarity between the two sample nodes corresponding to the topological relationship can be increased. Therefore, when learning and training is performed based on the topological graph after adding at least one topological relationship, the classification model to be trained can more accurately learn whether two sample nodes belong to the same sample node combination, thereby improving the accuracy and reliability of the trained target classification model.
[0148] When there is only one topological relationship that meets the topological relationship screening condition, the server can delete the topological relationship. When there are multiple topological relationships that meet the topological relationship screening condition, the server can delete all topological relationships that meet the topological relationship screening condition, or delete one or more topological relationships among the topological relationships that meet the topological relationship screening condition.
[0149] When there is a pair of sample nodes that meet the node screening condition, the server can add a topological relationship between the pair of sample nodes. When there are multiple pairs of sample nodes that meet the node screening condition, the server can add a topological relationship between each pair of sample nodes, or between one pair of sample nodes or multiple pairs of sample nodes.
[0150] As an embodiment, the topological relationship screening condition at least includes that the two sample nodes corresponding to the topological relationship belong to different sample node combinations respectively. Thus, when deleting the topological relationship that meets the topological relationship screening condition, the difference between the two sample nodes corresponding to the topological relationship belonging to different sample node combinations can be increased.
[0151] The server may determine at least one heterogeneous node pair from each sample node based on multiple sample node combinations, wherein two heterogeneous nodes included in each heterogeneous node pair belong to different sample node combinations, and there is a topological relationship between the two heterogeneous nodes. After determining at least one heterogeneous node pair, the server may delete the topological relationship between at least one heterogeneous node pair in the sample topological graph, thereby deleting at least one topological relationship that meets the topological relationship screening condition.
[0152] The node screening condition at least includes that each sample node belongs to the same sample node combination and there is no topological relationship between two homogeneous nodes. Therefore, when a topological relationship is added between each sample node that meets the node screening condition, the similarity between each sample node that belongs to the same sample node combination but has no topological relationship can be increased.
[0153] The server may determine at least one homogeneous node pair from each sample node based on multiple sample node combinations, wherein two homogeneous nodes included in each homogeneous node pair belong to the same sample node combination, and there is no topological relationship between the two homogeneous nodes. After determining at least one homogeneous node pair, the server adds a topological relationship between the at least one homogeneous node pair, thereby achieving at least one topological relationship between each sample node that meets the node screening condition.
[0154] After adjusting the topological relationship, the server can obtain a training topology map. The training topology map is optimized compared to the sample topology map. The current classification model to be trained can accurately learn the accurate and inaccurate parts of the current model parameters based on the training topology map. Therefore, when adjusting the current model parameters, accurate adjustments can be made, making the target classification model obtained through training more accurate and reliable.
[0155] As an embodiment, when each sample node has a corresponding category probability distribution, and each category probability distribution represents the probability that the corresponding sample node predicted by the current classification model to be trained belongs to each preset reference category, the server can determine the prediction confidence corresponding to each sample node based on the category probability distribution. The higher the prediction confidence, the greater the probability that the current classification model to be trained predicts the corresponding sample node as the corresponding reference category; the topological confidence of each topological relationship can also be determined. The higher the topological confidence, the greater the probability that the current classification model to be trained predicts the corresponding two sample nodes as different reference categories. In the embodiment of the present application, when deleting or adding a topological relationship, select the one with high confidence for deletion or addition, so as to reduce the misleading effect of deleting or adding the wrong topological relationship on the training effect.
[0156] Thus, the server can select, from among the various topological relationships, topological relationships between different reference categories that are more likely to belong to different reference categories and delete them according to the topological confidence. The server can also select, from among the various sample nodes, sample nodes that are more likely to be predicted accurately and add them to the topological relationship according to the prediction confidence.
[0157] The server can determine the prediction confidence of the category probability distribution corresponding to each sample node based on the kurtosis function. The kurtosis function kurtosis(·) can refer to formula (3).
[0158]
[0159] Among them, x i Represents the category probability distribution of each sample node, Represents x iThe corresponding sample nodes belong to the average category probability distribution of all sample nodes in the same sample node combination, n represents the probability distribution of x i The corresponding sample nodes belong to the number of sample nodes contained in the same sample node combination.
[0160] The server can also determine the prediction confidence of each sample node based on the range function, variance function or standard deviation function, etc., without specific limitation. In the embodiment of the present application, the prediction confidence of each sample node is determined based on the kurtosis function as an example.
[0161] As an embodiment, after calculating the category probability distribution according to the kurtosis function, the calculation result may be further normalized for the convenience of calculation, please refer to formula (4).
[0162]
[0163] Among them, min(x) represents the minimum value among all calculation results, and max(x) represents the maximum value among all calculation results.
[0164] Therefore, the server can use the normalized result as the prediction confidence of each sample node.
[0165] After obtaining the prediction confidence corresponding to each sample node, the server can determine the topological confidence of the topological relationship between at least one heterogeneous node pair based on the product of the prediction confidence corresponding to the two heterogeneous nodes included in each heterogeneous node pair. The topological confidence confidence(·) can refer to formula (5).
[0166]
[0167] Among them, n i represents the sample node belonging to sample node combination i, n j represents the sample node belonging to sample node combination j, e ij Represents sample node n i With sample node n j The topological relationship between them.
[0168] The server can determine the topological relationship that needs to be deleted in the sample topology map. cut , please refer to formula (6).
[0169]
[0170] Among them, u and v represent different sample nodes respectively. Indicates the sample node combination to which the sample node u belongs, represents the sample node combination to which the sample node v belongs, g represents the sample topology graph, e uv represents the topological relationship between sample nodes u and v, and t1 represents the topological confidence threshold.
[0171] Therefore, the server can delete the topological relationships whose topological confidence is greater than a preset topological confidence threshold in the sample topological graph, and obtain the topological graph g′ after deleting the topological relationships. Please refer to formula (7).
[0172]
[0173] Among them, v represents the sample node, e represents the topological relationship, and e cut represents the deleted topological relationship, and g represents the sample topological graph.
[0174] The server can determine the homogeneous node pairs g whose prediction confidence is greater than the preset prediction confidence threshold from each sample node. c , please refer to formula (8).
[0175]
[0176] Among them, v represents the sample node, e represents the topological relationship, represents the sample node combination to which the sample node v belongs, g represents the sample topology graph, kurtosis(v) represents the prediction confidence between sample nodes v, and t2 represents the topology confidence threshold.
[0177] The server may add a topological relationship between homogeneous node pairs whose prediction confidence is greater than a preset prediction confidence threshold in the sample topology graph.
[0178] As an embodiment, when there are multiple homogeneous node pairs whose prediction confidence is greater than the prediction confidence threshold, the server can select at least one isolated homogeneous node pair from the multiple homogeneous nodes according to a preset first specified number, and select at least one non-isolated homogeneous node pair according to a preset second specified number, wherein the two homogeneous nodes included in each isolated homogeneous node pair do not have a topological relationship, and one of the two homogeneous nodes included in each non-isolated homogeneous node pair does not have a topological relationship. By setting the first specified number and the second specified number, the current classification model to be trained can learn the optimized topology map in a targeted manner, avoiding the problem that the current classification model to be trained cannot accurately determine the model parameters that need to be adjusted due to the large amount of knowledge to be learned, resulting in inaccurate model parameter adjustment, etc.
[0179] The server determines the homogeneous nodes contained in the isolated homogeneous node pair Please refer to formula (9).
[0180]
[0181] Where n represents the topological relationship, v.neighbor represents the topological relationship between the sample node v and the sample nodes in the sample node combination to which it belongs, ∑ n∈v.neighbor 1=0 indicates that there is no topological relationship between the sample node v and the sample nodes in the sample node combination to which it belongs.
[0182] The server determines that a non-isolated homogeneous node pair contains a homogeneous node Please refer to formula (10).
[0183]
[0184] Where n represents the topological relationship, v.neighbor represents the topological relationship between the sample node v and the sample nodes in the sample node combination to which it belongs, ∑ n∈v.neighbor 1>0 indicates that there is a topological relationship between the sample node v and the sample nodes in the sample node combination to which it belongs.
[0185] Thus, the server may add a topological relationship between at least one isolated homogeneous node pair and a topological relationship between at least one non-isolated homogeneous node pair.
[0186] The first specified number and the second specified number may be the same or different, may be an integer greater than or equal to 0, may be pre-set, or may be learned during training, etc., and there is no specific limitation.
[0187] First designated quantity It can also be calculated based on homogeneous nodes u and v, please refer to formula (11).
[0188]
[0189] Among them, ||·|| represents the norm, and α represents the preset coefficient.
[0190] The second specified quantity It can also be calculated based on homogeneous nodes u and v, please refer to formula (12).
[0191]
[0192] Among them, ||·|| represents the norm, and β represents the preset coefficient.
[0193] After adding the topological relationship, the server can obtain the training topological graph g″, please refer to formula (13).
[0194]
[0195] Among them, v and e are sample nodes respectively, g represents the sample topology graph, and g′ represents the topology graph obtained after deleting the topological relationship. Indicates adding the corresponding topological relationship in g′.
[0196] Please refer to Figure 5a The sample topology graph contains eight sample nodes, namely the first sample node, the second sample node, the third sample node, the fourth sample node, the fifth sample node, the sixth sample node, the seventh sample node and the eighth sample node. The topological relationship is as follows: Figure 5a (1) as shown.
[0197] By executing S203, the eight sample nodes are divided into three sample node combinations, the first sample node combination includes the first sample node, the second sample node, the third sample node and the fourth sample node, the second sample node combination includes the fifth sample node and the sixth sample node, and the third sample node combination includes the seventh sample node and the eighth sample node. Figure 5a (2).
[0198] The heterogeneous node pairs include the third sample node and the fifth sample node, the third sample node and the seventh sample node, the fourth sample node and the fifth sample node, the fourth sample node and the sixth sample node, the fourth sample node and the seventh sample node, and the fourth sample node and the eighth sample node. The server can be in the sample topology diagram, please refer to Figure 5b In (1), the topological relationship between each heterogeneous node pair is deleted, so that the topological graph after the topological relationship is deleted can be obtained. Please refer to Figure 5b (2).
[0199] Homogeneous node pairs include the first sample node and the fourth sample node, the third sample node and the fourth sample node, the fifth sample node and the sixth sample node, and the seventh sample node and the eighth sample node. The server can delete the topological relationship after the topological diagram, please refer to Figure 5c In (1), add topological relationships between homogeneous node pairs to obtain the topological graph after adding the topological relationship. Please refer to Figure 5c (2).
[0200] S205, based on the training topology graph, re-extract the training node features of each sample node, and based on the obtained training node features, determine the corresponding prediction category to adjust the model parameters.
[0201] After obtaining the training topology map, the server can re-extract the training node features of each sample node based on the training topology map, and determine the corresponding prediction category based on the obtained training node features. The server can determine whether the training loss of the current classification model to be trained meets the training objectives based on each prediction category. When the training objectives are not met, the model parameters are adjusted and the next round of iterative training is entered. When the training objectives are met, the current classification model to be trained is output to obtain a trained target classification model. In the embodiment of the present application, homogeneous information and heterogeneous information can be obtained at the same time, which improves the robustness of the sample topology map. Compared with the method of directly training the model based on the sample topology map, effective information can be accurately learned, so that the classification accuracy and reliability of the trained target classification model are higher.
[0202] As an embodiment, when obtaining a sample topology map associated with a sample category label corresponding to each sample node, and the sample category label represents the reference category corresponding to the corresponding sample node, the server can predict the probability that the corresponding sample node belongs to each preset reference category based on the characteristics of each training node. The reference category corresponding to the maximum probability is used as the predicted category of the corresponding sample node to obtain the predicted category of each sample node. Based on the error between the predicted category of each sample node and the corresponding sample category label, the training loss of the current classification model to be trained is determined. When the training loss does not meet the training target, the model parameters of the current classification model to be trained are adjusted, and the next round of iterative training is entered. When the training loss meets the training target, the current classification model to be trained is output to obtain the trained target classification model.
[0203] As an embodiment, the training topology map may include a first topology map and a second topology map, wherein the first topology map is obtained after deleting at least one topology relationship in the sample topology map, and the second topology map is obtained after adding at least one topology relationship in the first topology map.
[0204] Please refer to Figure 6a , continue with Figure 5a to Figure 5c Taking the topological map shown in FIG. 1 as an example, after determining the topological relationship that needs to be deleted in the sample topological map, the server deletes the corresponding topological relationship in the sample topological map to obtain a first topological map. After determining the topological relationship that needs to be added, the server can add the corresponding topological relationship to the obtained first topological map to obtain a second topological map. The server can use the first topological map and the second topological map as training topological maps.
[0205] The server can use the current classification model to be trained, based on the first topological graph, to re-extract the first node features of each sample node. Based on the obtained first node features, each sample node is predicted and classified, and the corresponding first category is determined to adjust the model parameters of the current classification model to be trained, and obtain the adjusted classification model to be trained.
[0206] The server can use the obtained adjusted classification model to be trained, re-extract the second node features of each sample node based on the second topological map, and determine the corresponding second category based on the obtained each second node feature, so as to continue to adjust the model parameters of the adjusted classification model to be trained.
[0207] Please refer to Figure 6b After obtaining the first topological map, the server uses the current classification model to be trained to extract features from the first topological map, and obtains the first node features of each sample node, including the first node feature A, the first node feature B, ..., and the first node feature M. The server uses the current classification model to be trained to predict and classify the first node feature A, the first node feature B, ..., and the first node feature M, and obtains the first category of each sample node, including the first category A, the first category B, ..., and the first category M. The server can adjust the model parameters of the current classification model to be trained based on the first category of each sample node to obtain the adjusted classification model to be trained.
[0208] The server uses the adjusted classification model to be trained to extract features from the second topological graph, and obtains the second node features of each sample node, including the second node feature A, the second node feature B, ..., and the second node feature M. The server uses the adjusted classification model to be trained to predict and classify the second node feature A, the second node feature B, ..., and the second node feature M, and obtains the second category of each sample node, including the second category A, the second category B, ..., and the second category M. The server can adjust the model parameters of the adjusted classification model to be trained based on the second category of each sample node, and perform the next round of iterative training.
[0209] As an embodiment, the training process after obtaining the initial node features of each sample node can be implemented using a deep GCN model, or other models, such as a GraphSAGE model, a GraphSAINT model, a GAT model, a SIGN model, a SAGN model, etc., without specific limitation. After deleting the topological relationship, the server can obtain a first topological graph. The server can use a deep GCN model to re-extract the first node features of each sample node based on the first topological graph, please refer to formula (14).
[0210] h′=GCN2(g′,concatenate(h,feat)) (14)
[0211] Among them, GCN2(·) represents the deep GCN model, g′ represents the first topological graph, and concatenate(h,feat) represents the correlation between the initial node features extracted from the sample topological graph during the training process of the current classification model to be trained.
[0212] A deep GCN model is adopted to determine the corresponding first category based on the obtained features of each first node, so as to adjust the model parameters of the current classification model to be trained and obtain the adjusted classification model to be trained.
[0213] After adding the topological relationship, the server can obtain a second topological graph. The server can use a deep GCN model to re-extract the second node features of each sample node based on the second topological graph, please refer to formula (15).
[0214] h″=GCN3(g″,concatenate(h″,h′,feat)) (15)
[0215] Among them, GCN3(·) and GCN2(·) are the same deep GCN model, g″ represents the second topological graph, and concatenate(h″,h′,feat) represents the correlation between the initial node features extracted from the sample topological graph during the training process of the current classification model to be trained and the first node features extracted from the first topological graph.
[0216] A deep GCN model is used to determine the corresponding second category based on the obtained features of each second node, so as to adjust the model parameters of the current classification model to be trained and obtain the adjusted classification model to be trained.
[0217] The following is an example of the process of using a trained target classification model.
[0218] The eight nodes to be classified are Movie A, Movie B, Movie C, Movie D, Movie E, Movie F, Movie G, and Movie H. The server generates a topological graph to be classified based on the movie profiles, directors, actors, and filming locations of Movie A, Movie B, Movie C, Movie D, Movie E, Movie F, Movie G, and Movie H, and on each node to be classified. Please refer to Figure 7a .
[0219] The server uses the target classification model to extract features from the topology graph to be classified, and obtains the node features of each node to be classified, including node feature A, node feature B, node feature C, node feature D, node feature E, node feature F, node feature G, and node feature H. Please refer to Figure 7b .
[0220] The server uses the target classification model to predict and classify the node features of each node to be classified, and determines which reference category of each preset reference category has the highest probability for each node to be classified. The reference category corresponding to the maximum probability is used as the target category of the corresponding node to be classified, and the target category of each node to be classified is obtained. Among them, each reference category includes the first category, the second category and the third category, so that the target category of movie A, movie B, movie C, and movie D can be determined as the first category, the target category of movie E and movie F is the second category, and the target category of movie G and movie H is the third category. Please refer to Figure 7c .
[0221] As an embodiment, the classification model A trained only based on the sample topology map, the classification model B trained only based on the topology map obtained by deleting the topological relationship, the classification model C trained only based on the topology map obtained by adding the topological relationship, and the target classification model trained based on the topology maps obtained by deleting the topological relationship and adding the topological relationship, the classification accuracy on the cora dataset, please refer to Table 1.
[0222] Table 1
[0223] Classification Model A Classification Model B Classification Model C Target Classification Model 0.814 0.823 0.824 0.840
[0224] Based on the same inventive concept, the present application embodiment provides a device for training a classification model, which can realize the functions corresponding to the aforementioned method for training a classification model. Figure 8 , the device includes an acquisition module 801 and a processing module 802, wherein:
[0225] Acquisition module 801: used to acquire a sample topology graph, wherein each sample node represents a piece of data to be classified, and the topological relationship between each two sample nodes represents the data association relationship between the corresponding two pieces of data to be classified;
[0226] Processing module 802: Based on the sample topology graph, perform multiple rounds of iterative training on the classification model to be trained, and output the trained target classification model. In each round of iterative training, at least the following operations are performed:
[0227] The processing module 802 is further used to: use the classification model to be trained currently, and divide each sample node into a plurality of sample node combinations based on the matching degree between each sample node determined from the sample topology graph;
[0228] The processing module 802 is further used to: based on the combination of multiple sample nodes, delete at least one topological relationship that meets the topological relationship screening condition in the sample topological graph, and add at least one topological relationship between each sample node that meets the node screening condition to obtain a training topological graph;
[0229] The processing module 802 is also used to: re-extract the training node features of each sample node based on the training topology graph, and determine the corresponding prediction category based on the obtained training node features to adjust the model parameters.
[0230] In a possible embodiment, the processing module 802 is specifically configured to:
[0231] Extract features from the sample topology graph to obtain the initial node features of each sample node;
[0232] Based on the obtained initial node features, the probability of each sample node belonging to each preset reference category is predicted respectively, and the category probability distribution corresponding to each sample node is obtained;
[0233] Based on the obtained probability distribution of each category, determine whether the matching degree between each sample node meets the preset matching condition;
[0234] The sample nodes whose matching degrees meet the matching conditions are divided into a group to obtain multiple sample node combinations.
[0235] In a possible embodiment, the processing module 802 is specifically configured to perform at least one of the following:
[0236] When the reference categories corresponding to the maximum probabilities contained in the probability distributions of each category are the same, it is determined that the matching degree between the corresponding sample nodes meets the matching condition;
[0237] When the probability error between the probability distributions of each category is not greater than a preset error threshold, it is determined that the matching degree between the corresponding sample nodes meets the matching condition.
[0238] In a possible embodiment, the processing module 802 is specifically configured to:
[0239] Based on multiple sample node combinations, at least one heterogeneous node pair and at least one homogeneous node pair are determined from each sample node, wherein the two heterogeneous nodes included in each heterogeneous node pair belong to different sample node combinations respectively, and there is a topological relationship between the two heterogeneous nodes, and the two homogeneous nodes included in each homogeneous node pair belong to the same sample node combination, and there is no topological relationship between the two homogeneous nodes;
[0240] In the sample topology graph, a topological relationship between at least one heterogeneous node pair is deleted, and a topological relationship between at least one homogeneous node pair is added to obtain a training topology graph.
[0241] In a possible embodiment, each sample node has a corresponding category probability distribution, and each category probability distribution represents the probability that the corresponding sample node predicted by the current classification model to be trained belongs to each preset reference category; the processing module 802 is specifically used to:
[0242] Based on the kurtosis function, the prediction confidence of the category probability distribution corresponding to each sample node is determined respectively;
[0243] Determine a topological confidence of a topological relationship between at least one heterogeneous node pair based on the product of the prediction confidences corresponding to the two heterogeneous nodes included in each heterogeneous node pair;
[0244] In the sample topology graph, the topological relationships whose topological confidence is greater than a preset topological confidence threshold are deleted, and topological relationships are added between homogeneous node pairs whose prediction confidence is greater than the preset prediction confidence threshold to obtain a training topology graph.
[0245] In a possible embodiment, when the number of homogeneous node pairs whose prediction confidence is greater than the prediction confidence threshold is multiple, the processing module 802 is specifically configured to:
[0246] From a plurality of homogeneous nodes, at least one isolated homogeneous node pair is selected according to a preset first specified number, and at least one non-isolated homogeneous node pair is selected according to a preset second specified number, wherein two homogeneous nodes included in each isolated homogeneous node pair do not have a topological relationship, and one of the two homogeneous nodes included in each non-isolated homogeneous node pair does not have a topological relationship;
[0247] A topological relationship is added between at least one isolated homogeneous pair of nodes, and a topological relationship is added between at least one non-isolated homogeneous pair of nodes.
[0248] In a possible embodiment, the sample topology map is obtained and associated with a sample category label corresponding to each sample node, and the sample category label represents a reference category corresponding to the corresponding sample node; the processing module 802 is specifically used to:
[0249] Based on the characteristics of each training node, the probability that the corresponding sample node belongs to each preset reference category is predicted respectively;
[0250] The reference category corresponding to the maximum probability is used as the prediction category of the corresponding sample node to obtain the prediction category of each sample node;
[0251] Based on the error between the predicted category of each sample node and the corresponding sample category label, the training loss of the current classification model to be trained is determined;
[0252] When the training loss does not meet the training target, the model parameters of the current classification model to be trained are adjusted.
[0253] In a possible embodiment, the training topology map includes a first topology map and a second topology map, the first topology map is obtained after deleting at least one topological relationship in the sample topology map, and the second topology map is obtained after adding at least one topological relationship in the first topology map; the processing module 802 is specifically used to:
[0254] Using the current classification model to be trained, based on the first topological graph, re-extracting the first node features of each sample node, and determining the corresponding first category based on each first node feature obtained, so as to adjust the model parameters of the current classification model to be trained, and obtain the adjusted classification model to be trained;
[0255] The obtained adjusted classification model to be trained is adopted, and based on the second topological map, the second node features of each sample node are re-extracted, and based on the obtained second node features, the corresponding second category is determined to continue to adjust the model parameters of the adjusted classification model to be trained.
[0256] Please refer to Fig. 9 The apparatus for training the classification model can be run on a computer device 900, and the current version and the historical version of the data storage program and the application software corresponding to the data storage program can be installed on the computer device 900, and the computer device 900 includes a processor 980 and a memory 920. In some embodiments, the computer device 900 may include a display unit 940, and the display unit 940 includes a display panel 941 for displaying an interactive operation interface by a user.
[0257] In a possible embodiment, the display panel 941 may be configured in the form of a liquid crystal display (LCD) or an organic light-emitting diode (OLED).
[0258] The processor 980 is used to read the computer program and then execute the method defined by the computer program. For example, the processor 980 reads the data storage program or file, so as to run the data storage program on the computer device 900 and display the corresponding interface on the display unit 940. The processor 980 may include one or more general-purpose processors and may also include one or more DSPs (Digital Signal Processors) to perform related operations to implement the technical solutions provided in the embodiments of the present application.
[0259] The memory 920 generally includes internal memory and external memory, and the internal memory can be a random access memory (RAM), a read-only memory (ROM), and a cache (CACHE), etc. The external memory can be a hard disk, an optical disk, a USB disk, a floppy disk, or a tape drive, etc. The memory 920 is used to store computer programs and other data, and the computer program includes applications corresponding to each client, etc. Other data may include data generated after the operating system or application is run, and the data includes system data (such as configuration parameters of the operating system) and user data. In the embodiment of the present application, program instructions are stored in the memory 920, and the processor 980 executes the program instructions in the memory 920 to implement any of the methods discussed in the previous figure.
[0260] The display unit 940 is used to receive input digital information, character information or contact touch operation / contactless gesture, and generate signal input related to user settings and function control of the computer device 900. Specifically, in the embodiment of the present application, the display unit 940 may include a display panel 941. The display panel 941 is, for example, a touch screen, which can collect user touch operations on or near it (such as operations performed by the user using fingers, stylus, or any other suitable object or accessory on or on the display panel 941), and drive corresponding connection devices according to a pre-set program.
[0261] In a possible embodiment, the display panel 941 may include two parts: a touch detection device and a touch controller. The touch detection device detects the touch position of the player, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 980, and can receive and execute the command sent by the processor 980.
[0262] The display panel 941 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the display unit 940, in some embodiments, the computer device 900 may further include an input unit 930, which may include an image input device 931 and other input devices 932, wherein the other input devices may include, but are not limited to, one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0263] In addition to the above, the computer device 900 may also include a power supply 990 for supplying power to other modules, an audio circuit 960, a near field communication module 970, and an RF circuit 910. The computer device 900 may also include one or more sensors 950, such as an acceleration sensor, a light sensor, a pressure sensor, etc. The audio circuit 960 specifically includes a speaker 961 and a microphone 962, etc. For example, the computer device 900 can collect the user's voice through the microphone 962 to perform corresponding operations, etc.
[0264] As an embodiment, the number of processors 980 may be one or more, and the processor 980 and the memory 920 may be coupled or relatively independently configured.
[0265] As an example, Fig. 9 The processor 980 in the embodiment can be used to implement the following Figure 8 The functions of the acquisition module 801 and the processing module 802 in .
[0266] As an example, Fig. 9 The processor 980 in can be used to implement the corresponding functions of the server or terminal device discussed above.
[0267] A person skilled in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, etc. Various media that can store program codes.
[0268] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product, for example, through a computer program product, which is stored in a storage medium and includes a number of instructions for a computer device to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0269] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for training a classification model, characterized in that: include: Obtain a sample topology graph, wherein each sample node represents a piece of data to be classified, and the topological relationship between each two sample nodes represents the data association relationship between the corresponding two pieces of data to be classified; Based on the sample topology graph, multiple rounds of iterative training are performed on the classification model to be trained, and the trained target classification model is output. In each round of iterative training, at least the following operations are performed: Based on the classification model to be trained, the probability distribution of the categories of each sample node predicted from the sample topology map belonging to each preset reference category is used to determine the matching degree between the sample nodes; Based on the obtained matching degrees, the sample nodes are divided into a plurality of sample node combinations; Based on the prediction confidence of the category probability distribution corresponding to each of the sample nodes determined according to the kurtosis function, in the sample topology graph, the topological relationship between at least one heterogeneous node pair is deleted, and a topological relationship is added between at least one homogeneous node pair to obtain a training topology graph; wherein the two heterogeneous nodes included in each heterogeneous node pair belong to different sample node combinations, and there is a topological relationship between the two heterogeneous nodes, and the two homogeneous nodes included in each homogeneous node pair belong to the same sample node combination, and there is no topological relationship between the two homogeneous nodes; Based on the training topology graph, the training node features of each sample node are re-extracted, and based on the obtained training node features, the corresponding prediction category is determined to adjust the model parameters.
2. The method according to claim 1, characterized in that The method of determining the matching degree between the sample nodes based on the classification model to be trained and predicting the probability distribution of the categories of the preset reference categories of the sample nodes from the sample topology map comprises: Extracting features from the sample topology graph to obtain initial node features of each sample node; Based on the obtained initial node features, the probability of each sample node belonging to each preset reference category is predicted respectively, and the category probability distribution corresponding to each sample node is obtained; Determine the matching degree between the sample nodes based on the obtained probability distribution of each category; The dividing each sample node into a plurality of sample node combinations based on each obtained matching degree includes: The sample nodes whose matching degrees satisfy the preset matching conditions are respectively divided into a group to obtain the plurality of sample node combinations.
3. The method according to claim 2, characterized in that The matching degree meets the preset matching conditions, including at least one of the following: When the reference categories corresponding to the maximum probabilities contained in the probability distributions of each category are the same, it is determined that the matching degree between the corresponding sample nodes meets the matching condition; When the probability error between the probability distributions of each category is not greater than a preset error threshold, it is determined that the matching degree between the corresponding sample nodes meets the matching condition.
4. The method according to claim 1, characterized in that The method of deleting a topological relationship between at least one heterogeneous node pair and adding a topological relationship between at least one homogeneous node pair in the sample topological graph based on the prediction confidence of the category probability distribution corresponding to each sample node determined according to the kurtosis function to obtain a training topological graph comprises: Based on the plurality of sample node combinations, determining at least one heterogeneous node pair and at least one homogeneous node pair from the respective sample nodes; Determine the prediction confidence of the category probability distribution corresponding to each of the sample nodes based on the kurtosis function; Based on the obtained prediction confidences, in the sample topology graph, the topological relationship between the at least one heterogeneous node pair is deleted, and the topological relationship between the at least one homogeneous node pair is added to obtain the training topology graph.
5. The method according to claim 4, characterized in that The method of deleting the topological relationship between the at least one heterogeneous node pair and adding a topological relationship between the at least one homogeneous node pair in the sample topological graph based on the obtained prediction confidences to obtain the training topological graph includes: Determine a topological confidence of a topological relationship between at least one heterogeneous node pair based on a product of prediction confidences corresponding to two heterogeneous nodes included in each heterogeneous node pair; In the sample topology graph, the topological relationships whose topological confidence is greater than a preset topological confidence threshold are deleted, and topological relationships are added between the homogeneous node pairs whose prediction confidence is greater than a preset prediction confidence threshold to obtain the training topology graph.
6. The method according to claim 5, characterized in that When the number of the homogeneous node pairs whose prediction confidence is greater than the prediction confidence threshold is multiple, adding a topological relationship between the homogeneous node pairs whose prediction confidence is greater than the preset prediction confidence threshold includes: From the plurality of homogeneous nodes, at least one isolated homogeneous node pair is selected according to a preset first specified number, and at least one non-isolated homogeneous node pair is selected according to a preset second specified number, wherein two homogeneous nodes included in each isolated homogeneous node pair do not have a topological relationship, and one of the two homogeneous nodes included in each non-isolated homogeneous node pair does not have a topological relationship; A topological relationship is added between the at least one isolated homogeneous node pair, and a topological relationship is added between the at least one non-isolated homogeneous node pair.
7. The method according to any one of claims 1 to 6, characterized in that: The acquired sample topology graph is associated with a sample category label corresponding to each sample node, and the sample category label represents a reference category corresponding to the corresponding sample node; The step of determining corresponding prediction categories based on the obtained features of each training node to adjust model parameters includes: Based on the characteristics of each training node, respectively predict the probability that the corresponding sample node belongs to each preset reference category; The reference categories corresponding to the maximum probabilities are respectively used as the prediction categories of the corresponding sample nodes to obtain the prediction categories of the respective sample nodes; Determine the training loss of the current classification model to be trained based on the error between the predicted category of each sample node and the corresponding sample category label; When the training loss does not meet the training target, the model parameters of the current classification model to be trained are adjusted.
8. The method according to any one of claims 1 to 6, characterized in that: The training topology map includes a first topology map and a second topology map, wherein the first topology map is obtained after deleting at least one topology relationship in the sample topology map, and the second topology map is obtained after adding at least one topology relationship in the first topology map; The re-extracting the training node features of each sample node based on the training topology graph, and determining the corresponding prediction category based on each obtained training node feature to adjust the model parameters, includes: Using the current classification model to be trained, based on the first topological graph, re-extracting the first node features of each sample node, and determining the corresponding first category based on each obtained first node feature, so as to adjust the model parameters of the current classification model to be trained, and obtain the adjusted classification model to be trained; Using the obtained adjusted classification model to be trained, based on the second topological map, the second node features of each sample node are re-extracted, and based on the obtained each second node feature, the corresponding second category is determined to continue adjusting the model parameters of the adjusted classification model to be trained.
9. A device for training a classification model, characterized in that: include: Acquisition module: used to acquire a sample topology graph, wherein each sample node represents a data to be classified, and the topological relationship between each two sample nodes represents the data association relationship between the corresponding two data to be classified; Processing module: used to perform multiple rounds of iterative training on the classification model to be trained based on the sample topology map, and output the trained target classification model. In each round of iterative training, at least the following operations are performed: The processing module is further used to: determine the matching degree between each sample node based on the classification model to be trained and the category probability distribution of each sample node predicted from the sample topology map belonging to each preset reference category; and divide each sample node into a plurality of sample node combinations based on the obtained matching degrees; The processing module is also used for: based on the prediction confidence of the category probability distribution corresponding to each of the sample nodes determined according to the kurtosis function, deleting the topological relationship between at least one heterogeneous node pair in the sample topological graph, and adding a topological relationship between at least one homogeneous node pair, to obtain a training topological graph; wherein the two heterogeneous nodes included in each heterogeneous node pair belong to different sample node combinations, and there is a topological relationship between the two heterogeneous nodes, and the two homogeneous nodes included in each homogeneous node pair belong to the same sample node combination, and there is no topological relationship between the two homogeneous nodes; The processing module is also used to: re-extract the training node features of each sample node based on the training topology graph, and determine the corresponding prediction category based on the obtained training node features to adjust the model parameters.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
11. A computer device, characterized in that: include: A memory for storing program instructions; The processor is used to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 8 according to the obtained program instructions.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method according to any one of claims 1 to 8.
