Object classification method and device, equipment and storage medium
By building an object network and performing graph segmentation and graph characterization learning, node features are generated to classify objects, which solves the problem of low accuracy of object classification in the prior art, and achieves more accurate and multi-feature object classification.
Patent Information
- Application Number
- CN202311159808.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-08
- Publication Date
- 2025-03-11
AI Technical Summary
Existing object classification techniques rely on object characteristics, resulting in low accuracy of classification results and the inability to effectively utilize the correlation between objects.
By building an object network, performing graph segmentation processing, calling the graph neural network model for unsupervised graph characterization learning, generating node features, and classifying objects based on these features.
It improves the accuracy of object classification results and can use multiple features of an object, including the correlation between object features and objects, to perform more accurate classification.
Smart Images

Figure CN119598240A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, specifically to the field of computer technology, and in particular to an object classification method, device, equipment and storage medium. Background Art
[0002] With the development of Internet technology, object classification technology has been proposed; the so-called object classification technology refers to a technology that can be used to classify any object to obtain the category information of the corresponding object. At present, the common object classification technology usually obtains the object features of the object to be classified, and then calls the classification model to classify the corresponding object according to the object features to obtain the category information of the object. This classification method based only on object features is relatively simple, which easily leads to low accuracy of object classification results (i.e., category information obtained by classification). Based on this, how to better classify objects has become a current research hotspot. Summary of the invention
[0003] The embodiments of the present application provide an object classification method, apparatus, device and storage medium, which can improve the accuracy of object classification results (i.e., category information obtained by classification).
[0004] In one aspect, an embodiment of the present application provides an object classification method, the method comprising:
[0005] Obtaining object features of a plurality of objects, and obtaining an object network constructed based on the plurality of objects; wherein the object network includes a plurality of nodes and a plurality of edges; a node represents an object, and nodes corresponding to two objects having an association relationship are connected by at least one edge;
[0006] Performing graph segmentation processing on the object network to obtain a plurality of object subgraphs, each of which includes at least one node;
[0007] Calling the graph neural network model to perform unsupervised graph representation learning on each object subgraph according to the object features of the multiple objects to obtain node features of each node;
[0008] According to the node features of each node, the objects represented by the corresponding nodes are classified to obtain category information of each object.
[0009] On the other hand, an embodiment of the present application provides an object classification device, the device comprising:
[0010] A processing unit, configured to obtain object features of a plurality of objects, and obtain an object network constructed based on the plurality of objects; wherein the object network includes a plurality of nodes and a plurality of edges; a node represents an object, and nodes corresponding to two objects having an association relationship are connected by at least one edge;
[0011] The processing unit is further used to perform graph segmentation processing on the object network to obtain multiple object subgraphs, each of which includes at least one node;
[0012] The processing unit is further used to call the graph neural network model to perform unsupervised graph representation learning on each object subgraph according to the object features of the multiple objects, so as to obtain the node features of each node;
[0013] The classification unit is used to classify the objects represented by the corresponding nodes according to the node features of each node, so as to obtain the category information of each object.
[0014] In another aspect, an embodiment of the present application provides a computer device, the computer device comprising an input interface and an output interface, the computer device further comprising:
[0015] processor and computer storage media;
[0016] The processor is suitable for implementing one or more instructions, the computer storage medium stores one or more instructions, and the one or more instructions are suitable for being loaded by the processor and executing the above-mentioned object classification method.
[0017] On the other hand, an embodiment of the present application provides a computer storage medium, which stores one or more instructions, and the one or more instructions are suitable for being loaded by a processor and executing the above-mentioned object classification method.
[0018] On the other hand, an embodiment of the present application provides a computer program product, which includes one or more instructions; when one or more instructions in the computer program product are executed by a processor, the above-mentioned object classification method is implemented.
[0019] The embodiment of the present application can obtain the object features of multiple objects, and can also obtain an object network constructed based on multiple objects, the object network includes multiple nodes and multiple edges, one node represents one object, and the nodes corresponding to two objects with an association relationship are connected by at least one edge. After obtaining the object network, the object network can be segmented to obtain multiple object subgraphs, thereby calling the graph neural network model to perform unsupervised graph representation learning on each object subgraph according to the object features of multiple objects, and obtain the node features of each node, so that the node features of each node express the network features of the corresponding object (such as the topological structure of the object network, the association relationship between the corresponding object and other objects, etc.), and can also express the object features of the corresponding object, so that when the corresponding object is classified based on the node features of each node, not only the object features of the corresponding object can be applied, but also the association relationship between the corresponding object and other objects can be applied. By classifying according to multiple features of the object, the accuracy of the object classification result (i.e., the category information obtained by classification) can be improved. Moreover, the node features of each node are obtained through unsupervised graph representation learning, so that the generation of node features does not need to rely on the label information of the object, which can avoid the node features being affected by inaccurate label information, and can effectively improve the accuracy of node features, thereby further improving the accuracy of object classification results. In addition, the embodiment of the present application divides the entire object network into multiple object subgraphs through graph segmentation to perform unsupervised graph representation learning, which can not only improve the efficiency of node feature generation, thereby improving the efficiency of object classification, but also avoid the problem that graph representation learning cannot handle large-scale networks, thereby improving the success rate of object classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0021] Figure 1a It is a flowchart of a method for classifying an object jointly executed by a terminal and a server provided in an embodiment of the present application;
[0022] Figure 1b It is a flowchart of another method for jointly executing an object classification method by a terminal and a server provided in an embodiment of the present application;
[0023] Figure 2 It is a flowchart of an object classification method provided in an embodiment of the present application;
[0024] Figure 3ais a schematic diagram of an object network provided in an embodiment of the present application;
[0025] Figure 3b It is a schematic diagram of the execution process of a Metis algorithm provided in an embodiment of the present application;
[0026] Figure 3c It is a schematic diagram of an embodiment of the present application for performing unsupervised learning on a graph neural network model using three object subgraphs;
[0027] Figure 4 is a flowchart of an object classification method provided by another embodiment of the present application;
[0028] Figure 5a is a schematic diagram of iteratively performing graph coarsening processing on an object network provided by another embodiment of the present application;
[0029] Figure 5b It is a schematic diagram of label propagation using the LPA algorithm provided in an embodiment of the present application;
[0030] Figure 5c It is a schematic diagram of a binary problem provided by an embodiment of the present application;
[0031] Figure 5d It is a schematic diagram of label propagation using the CLP algorithm provided in an embodiment of the present application;
[0032] Figure 5e It is a flowchart of identifying minors in games provided by an embodiment of the present application;
[0033] Figure 5f is a schematic diagram of a face recognition provided by an embodiment of the present application;
[0034] Figure 5g is a schematic diagram of face recognition provided by another embodiment of the present application;
[0035] Figure 6 is a structural schematic diagram of an object classification device provided in an embodiment of the present application;
[0036] Figure 7 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0037] 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.
[0038] In order to classify any object more accurately and improve the accuracy of the object classification results, the embodiment of the present application proposes an object classification method based on artificial intelligence (AI) technology. The so-called AI refers to the theory, method, technology and application system of simulating, extending and expanding human intelligence, perceiving the environment, acquiring knowledge and using knowledge to obtain the best results using digital computers or machines controlled by digital computers. In other words, AI is a comprehensive technology in computer science. It mainly produces a new intelligent machine that can respond in a similar way to human intelligence by understanding the essence of intelligence, so that the intelligent machine has multiple functions such as perception, reasoning and decision-making; it can be seen that AI is to study the design principles and implementation methods of various intelligent machines, so that the machine has the functions of perception, reasoning and decision-making. Correspondingly, AI technology is a comprehensive discipline involving a wide range of fields; it has both hardware-level technology and software-level technology. The technology at the hardware level mainly includes sensors, dedicated artificial intelligence chips, etc.; the technology at the software level mainly includes computer vision technology (Computer Vision, CV), speech processing technology, natural language processing technology and machine learning (Machine Learning, ML) / deep learning and other major directions.
[0039] Among them, machine learning is the core of AI and is the basis for making computer devices intelligent. Machine learning is a multi-disciplinary interdisciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and other disciplines; it specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Correspondingly, deep learning is a technology that uses deep neural network systems to perform machine learning. Machine learning / deep learning can usually include artificial neural networks, supervised learning, unsupervised learning, and graph representation learning. The so-called supervised learning refers to the processing method of using samples with known categories (with labeled categories) for model optimization training; while unsupervised learning refers to the processing method of using samples with unknown categories (without labeled categories) for model optimization training. Graph representation learning can also be called network representation learning (Network Representation Learning) or graph embedding (Graph Embedding). Graph representation learning is a machine learning method whose goal is to learn a function that maps the nodes in the graph to a low-dimensional vector space, so that similar nodes in the low-dimensional vector space are also similar in the original graph, thereby obtaining the low-dimensional vector representation (i.e., node features) of the corresponding nodes. The low-dimensional vector representation mentioned here can be understood as: a vector representation of a vector dimension that is less than a dimension threshold; that is, if the vector dimension of a vector representation is less than the dimension threshold, then the vector representation is a low-dimensional vector representation.
[0040] The object classification method proposed in the embodiment of the present application mainly involves the machine learning / deep learning technology in the AI technology mentioned above; the general principle of the object classification method is as follows: for multiple objects to be classified, the object features of the multiple objects and the object network formed based on the multiple objects can be obtained; the object network includes multiple nodes and multiple edges, one node represents an object, and the nodes corresponding to the two objects with an association relationship are connected by at least one edge. Then, the object network can be segmented to obtain multiple object subgraphs, so that based on machine learning / deep learning technology, the graph neural network model is called to perform unsupervised graph representation learning on each object subgraph according to the object features of multiple objects, and the node features of each node are obtained, so that the node features of each node can not only express the network features of the corresponding object (such as the topological structure of the object network, the association relationship between the corresponding object and other objects, etc.), but also express the object features of the corresponding object. Then, based on machine learning / deep learning technology, the objects represented by the corresponding nodes can be classified according to the node features of each node, so that when classifying any object, the network features of the corresponding object can be additionally introduced on the basis of the object features of the corresponding object, and the accuracy of the object classification result can be improved by multiple features of the object. In addition, the node features of each node are generated through unsupervised graph representation learning, so that the generation of node features does not need to rely on the label information of the object. This can avoid the node features being affected by inaccurate label information, ensure the accuracy of the node features, and further improve the accuracy of the object classification results.
[0041] It should be noted that the above is only an exemplary explanation of the general principle of the object classification method proposed in the embodiment of the present application, and does not limit it. For example, the above is to obtain the node features of each node by first performing graph segmentation on the object network, and then performing unsupervised graph representation learning on each object subgraph obtained by the segmentation; however, in other embodiments, the object network may not be subjected to graph segmentation, and the graph neural network model may be directly called to perform unsupervised graph representation learning on the object network according to the object features of multiple objects to obtain the node features of each node. For another example, the above is to obtain the node features of each node by combining graph segmentation with unsupervised graph representation learning; however, in other embodiments, the feature propagation technology of the graph may also be used to generate the node features of each node according to the object features of multiple objects and the topological structure of the object network. The general principle of the graph-based feature propagation technology mentioned here is: a target feature matrix is constructed using the object features of multiple objects, and an adjacency matrix of the object network is constructed according to the topological structure of the object network. The adjacency matrix of the object network is used to indicate: the connection relationship between each node in the object network; sparse matrix multiplication is performed on the target feature matrix and the adjacency matrix of the object network to obtain the node features of each node.
[0042] Furthermore, in a specific implementation, the object classification method proposed in the embodiment of the present application can be executed by a computer device, which can be a terminal or a server; that is, the object classification method proposed in the embodiment of the present application can be executed by a terminal or a server. Alternatively, the object classification method proposed in the embodiment of the present application can also be executed by a terminal and a server together. For example, see Figure 1a As shown, the terminal can be responsible for obtaining the object network and performing graph segmentation processing on the object network to obtain multiple object subgraphs, thereby sending the multiple object subgraphs to the server, which obtains the object features of the multiple objects and, based on machine learning / deep learning technology, calls the graph neural network model to perform unsupervised graph representation learning on each object subgraph according to the object features of the multiple objects, obtains the node features of each node, and classifies the objects represented by the corresponding nodes according to the node features of each node based on the machine learning / deep learning technology. For example, see Figure 1b As shown, the server may also be responsible for obtaining the object features and object networks of multiple objects, and for performing graph segmentation processing operations and unsupervised graph representation learning operations, thereby sending the node features of each node to the terminal, and the terminal classifies the objects represented by the corresponding nodes according to the node features of each node based on machine learning / deep learning technology.
[0043] It should also be noted that the embodiments of the present application do not limit the communication method between the terminal and the server; that is, communication between the terminal and the server can be achieved through any communication method, such as mobile communications based on the fourth generation mobile communication technology (the 4th generation mobile communication technology, 4G), the fifth generation mobile communication technology (5th Generation Mobile Communication Technology, 5G), Long Term Evolution (Long Term Evolution, LTE), Worldwide Interoperability for Microwave Access (Worldwide Interoperability for Microwave Access, WiMAX), or computer network communications based on the TCP / IP Protocol Suite (TCP / IP), User Datagram Protocol (User Datagram Protocol, UDP), etc. Among them, the terminals mentioned above can be smart phones, computers (such as tablet computers, laptops, desktop computers, etc.), smart wearable devices (such as smart watches, smart glasses), smart voice interaction devices, smart home appliances (such as smart TVs), vehicle terminals or aircraft, etc.; the servers mentioned above can be independent physical servers, or server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and basic cloud computing services such as big data and artificial intelligence platforms, etc. Further, the terminals and servers can be located inside or outside the blockchain network, without limitation; further, the terminals and servers can also upload any data stored inside to the blockchain network for storage to prevent the data stored inside from being tampered with and improve data security.
[0044] Based on the principle description of the above object classification method, the present application embodiment proposes a method such as Figure 2 The flowchart of the object classification method shown in FIG. 1 is a flowchart of the object classification method shown in FIG. 1 ; in the embodiment of the present application, the object classification method is mainly described by taking a computer device executing the object classification method as an example. Figure 2 The object classification method proposed in the embodiment of the present application may include the following steps S201-S204:
[0045] S201, obtaining object features of multiple objects, and obtaining an object network constructed based on the multiple objects.
[0046] Among them, the object network includes multiple nodes and multiple edges; one node represents an object, and the nodes corresponding to two objects with an associated relationship are connected by at least one edge. It should be noted that the number of associated relationships between any two objects can be one or more (i.e., at least two). In one embodiment, for two objects with an associated relationship, the number of edges between the nodes used to represent the two objects is independent of the number of associated relationships between the two objects; that is, no matter whether the number of associated relationships is one or more, the nodes used to represent the two objects can be connected by one edge. In another embodiment, for two objects with an associated relationship, the number of edges between the nodes used to represent the two objects may depend on the number of associated relationships between the two objects; that is, if the number of associated relationships is multiple, the nodes used to represent the two objects can be connected by multiple edges. For example, see Figure 3a As shown: there is an association relationship between object A and object B, and the node representing object A is node A, and the node representing object B is node B, then node A and node B are connected by an edge; and there are two association relationships between object A and object D, and the node representing object D is node D, then node A and node D are connected by two edges.
[0047] The objects mentioned above may include, but are not limited to, any of the following: users in a certain business scenario, multimedia data (such as images, music, videos, etc.), advertising data, and so on. Moreover, the business scenario mentioned here refers to a scenario in which any application provides business services. For example, the business scenario may be a game scenario in which a game application provides game services; then, the objects mentioned above may specifically be game users in the game scenario. For another example, the business scenario may be a social scenario in which a social application provides social services; then, the objects mentioned above may specifically be social users in the social scenario. For another example, the business scenario may be an audio and video playback scenario in which an audio and video application provides audio and video playback services; then, the objects mentioned above may specifically be audio and video playback users in the audio and video playback scenario.
[0048] Accordingly, when the object is a user, the association relationship between the objects may include at least one of the following: an interactive relationship between users, a friend relationship between users, and a follow relationship between users; the so-called interactive relationship refers to a relationship in which there is an interactive behavior between two users, the so-called friend relationship refers to a relationship in which each of the two users is a contact of the other user, and the so-called follow relationship refers to a relationship formed by one user following another user. When the object is multimedia data, the association relationship between the objects may include a media co-occurrence relationship between the multimedia data, and the so-called media co-occurrence relationship refers to a relationship in which they have appeared together in the same playlist. When the object is advertising data, the association relationship between the objects may include an advertising co-occurrence relationship between the advertising data, and the so-called advertising co-occurrence relationship refers to a relationship in which they have appeared together on the same advertising delivery platform. It should be understood that the specific contents of the association relationship are only listed here by way of example, and are not exhaustive.
[0049] In addition, when the object is a user, the object characteristics of the object can be understood as the characteristics generated according to the user's operation behavior information; with different business scenarios, the user's operation behavior information submitted here will also be different. For example, in the game scenario, the user's operation behavior information may include but is not limited to: the game user's active time, play mode, payment information, user's behavior sequence in the game, operation habits and speech style preferences; for another example, in the social scenario, the user's operation behavior information may include but is not limited to: the length of time the social user logs into the social application, the frequency of the social user using the social application for conversation, etc. For another example, in the audio and video playback scenario, the user's operation behavior information may include but is not limited to: the type of multimedia data played by the audio and video playback user, the length of time the audio and video playback user uses the multimedia playback application, etc. When the object is multimedia data or advertising data, the object characteristics of the object can be understood as the characteristics generated according to the attribute information of the multimedia data or advertising data; for example, the attribute information of any data in the multimedia data and advertising data may include but is not limited to: the name of the corresponding data, and the data content contained in the corresponding data, etc.
[0050] Furthermore, the object network mentioned above may also include a base edge weight for each edge; the base edge weight for any edge is used to indicate: the degree of association between the objects represented by the two nodes connected by the corresponding edge. In this case, if SG is used to represent the object network, then SG = (V, E, W); where V is a node set, E is an edge set, and W is an edge weight matrix, which contains the base edge weight for each edge. If there is an edge e from node u to node v u,v (That is, there is an edge e u,v connects node u and node v), then this edge e u,v It is in E, W u,v is the edge e from node u to node vu,v 's baseline edge weight. It is understandable that when the object is a user, the object network can also be called a social network; and if the user refers to a game user in a game scene, the object network can be further called a game social network. In a game social network, each node in V can be used to represent a game user (i.e., a game player), and each edge in E can be used to represent the association between game users, such as friend relationships, interactive relationships, etc.; each baseline edge weight in W can be used to represent the degree of association between game users, such as intimacy, which can be calculated based on the interactive behavior between game users.
[0051] In addition, it should be emphasized that: if the object is a user, when the embodiments of the present application are applied to specific products or technologies, the relevant data about user privacy involved in the embodiments of the present application (such as the above-mentioned association relationships, object characteristics, user operation behavior information, etc.) are all collected with the user's permission or consent, and the collection, use and processing of relevant data comply with the relevant laws, regulations and standards of relevant countries and regions.
[0052] S202, performing graph segmentation processing on the object network to obtain a plurality of object subgraphs, each of which includes at least one node.
[0053] Considering that the scale of the object network may be relatively large, that is, the object network includes more nodes and more edges, graph representation learning may not be able to handle such a large-scale object network; based on this, after obtaining the object network, the computer device can perform graph segmentation processing on the object network to divide the object network into multiple smaller object sub-graphs, so as to facilitate subsequent unsupervised graph representation learning with a single object sub-graph as the learning unit, thereby improving the efficiency and success rate of graph representation learning.
[0054] In a specific implementation, a computer device may use a graph segmentation algorithm to implement graph segmentation processing on an object network to obtain multiple object subgraphs. The graph segmentation algorithm here may include but is not limited to any of the following algorithms: RandomHash algorithm (random hash point segmentation algorithm), Metis algorithm (a hierarchical segmentation algorithm), LPMetis algorithm (Label Propagation with Metis, a Metis algorithm combined with label propagation), etc. Among them:
[0055] The core idea of the Random Hash algorithm is to map nodes to different subgraphs through a given hash function, thereby achieving graph segmentation. Accordingly, if the graph segmentation algorithm used by the computer device is the Random Hash algorithm, the specific implementation method of step S202 can be: using a given hash function to perform subgraph mapping processing on each node in the object network, and obtaining the mapping results of each node. The mapping result of any node can be used to indicate the subgraph where the corresponding node is located; after obtaining the mapping results of each node, the computer device can segment the object network into multiple subgraphs according to the mapping results of each node.
[0056] The core idea of the Metis algorithm is: for a given original graph (such as the object network in the embodiment of the present application), iteratively performs multiple rounds of graph coarsening processing (i.e., graph compression processing, which is essentially the processing of merging at least one node into one node) to reduce the size of the original graph. After the multiple rounds of graph coarsening processing are completed, the reduced graph is initially divided into multiple small graphs, and each small graph is mapped to the original graph to obtain multiple subgraphs. Taking two rounds of graph coarsening processing as an example, see Figure 3b It can be seen that the execution process of the Metis algorithm is mainly divided into the following three stages: coarsening (or sparse) stage, initial partitioning (initial partitioning) stage and uncoarsening (refining) stage. In the coarsening stage, the original graph is iteratively coarsened for two rounds, so that the size of the original graph (represented by G0) gradually decreases, that is, G0→G1 (graph after the first round of coarsening)→G2 (graph after the second round of coarsening); in the initial partitioning stage, G2 is initially partitioned to obtain 4 small graphs (such as Figure 3b s1, s2, s3 and s4 in ); in the uncoarsening stage, the four small graphs are iteratively mapped to map the four small graphs into the original graph (i.e., s1-s4 are mapped to G1, and then mapped to G0), and multiple subgraphs are obtained.
[0057] The LPMetis algorithm is an embodiment of the present application, which is inspired by the multi-level process of Label Propagation and the Metis algorithm, and is a new large-scale graph segmentation algorithm proposed. It can rely on heuristic methods to find a good balance between balance and minimum edge cutting, thereby improving the graph segmentation effect. The LPMetis algorithm omits the refinement stage in the Metis algorithm, and introduces a label propagation method in the coarsening stage to reduce the size of the original image (such as the object network in the embodiment of the present application) so that it can be suitable for large-scale graphs and GNNs (Graph Neural Networks, graph neural network models). Specifically, the pseudocode form of the LPMetis algorithm can be exemplarily shown as follows:
[0058] Input: G, K, T / / Input the original image (G), the number of sub-image IDs (K), and the number of rounds (T)
[0059] Output: Cut graph nodes into K partitions g1, g2,…,g K / / Output the subgraph ID of each node in the original graph
[0060]
[0061]
[0062] Output: K partitions{g1,g2,...,g K} / / Output the subgraph IDs of K subgraphs
[0063] In the pseudo code of the above LPMetis algorithm, the CLP algorithm is a modified label propagation algorithm, and the full name of CLP is Constrained Label Propagation; the label propagation logic adopted by the CLP algorithm is roughly as follows: in the tth round of label propagation, the label of any node (assuming node v) is determined based on the weight coefficient of the labels of each neighbor node of node v in the tth graph, which can specifically be the label corresponding to the largest weight coefficient. Among them, the neighbor node of node v in the tth graph refers to: in the tth graph, the node connected to node v by at least one edge; the weight coefficient of the label of any neighbor node is determined by considering the number of subgraph nodes of the corresponding neighbor node. The specific determination method can be referred to the description of the subsequent embodiments, which will not be repeated here. It should be noted that the above pseudo code is only used as an example of the CLP algorithm and is not limited to it; for example, other label propagation algorithms such as the LPA algorithm can also be used. The full name of LPA is Label Propagation Algorithm (also known as the community discovery algorithm). The label propagation logic adopted by the LPA algorithm is roughly as follows: in the tth round of label propagation, the label of any node (assuming node v) is determined based on the frequency of occurrence of the labels of each neighboring node of node v in the tth graph, which can specifically be the label corresponding to the maximum frequency of occurrence; the frequency of occurrence of the label of any neighboring node refers to: the number of times the label of the corresponding node appears in the labels of each neighboring node of node v.
[0064] Based on the pseudo code of the LPMetis algorithm mentioned above, the core idea of the LPMetis algorithm can be roughly divided into three stages: the first stage (lines "1" to "6" in the pseudo code above) is a fast coarsening stage based on the label propagation algorithm (such as the CLP algorithm or the LPA algorithm). This stage retains more original graph information and accelerates the coarsening process. It mainly uses the label propagation algorithm (such as the CLP algorithm or the LPA algorithm) to update the labels of each node in the graph involved in the current round of iteration in each round of iteration, so as to merge the nodes with the same label into one node and obtain the corresponding coarsened graph; the second stage (lines "1" to "6" in the pseudo code above) is a fast coarsening stage based on the label propagation algorithm (such as the CLP algorithm or the LPA algorithm). The seventh line in the pseudocode above is to subdivide the coarsened graph obtained in the first stage into K subgraphs, and assign a subgraph ID (identifier) to each subgraph, with different subgraphs assigned different subgraph IDs. The third stage (the eighth line in the pseudocode above) is to map each subgraph ID to the corresponding node in the original graph, so that the nodes corresponding to the same subgraph ID can be segmented into the same subgraph, and the nodes corresponding to different subgraph IDs can be segmented into different subgraphs. The original graph is segmented directly based on the subgraph ID of each node, without further refinement or projection, thereby improving the efficiency of graph segmentation.
[0065] In another specific implementation, the computer device can implement graph segmentation processing on the object network based on node clustering to obtain multiple object subgraphs. In this specific implementation, the specific implementation method of step S202 can be: according to the connection relationship between each node in the object network, each node in the object network is clustered to obtain the category information of each node, and then according to the principle that each node with the same category information needs to be segmented into the same object subgraph, the object network is segmented according to the category information of each node to obtain multiple object subgraphs.
[0066] Among them, when clustering the nodes in the object network according to the connection relationship between the nodes in the object network to obtain the category information of each node, the computer device can execute the following steps s11-s14: s11, select a node from the unvisited nodes in the object network as the starting node of the current access process, and visit the starting node; s12, according to the connection relationship between the nodes in the object network, based on the node width priority access principle and along the access direction from small to large node depth, visit the nodes in the object network that have not been visited and are connected to the starting node; s13, if If the node depth of the currently visited node is greater than a preset threshold, the current visit process is terminated, and it is determined that the nodes visited in the current visit process constitute a cluster set; s14, after the current visit process is terminated, if there are still unvisited nodes in the object network, jump to step s11, if there are no unvisited nodes in the object network, terminate the clustering, and obtain multiple cluster sets. According to the principle that nodes in the same cluster set must have the same category information, and nodes in different cluster sets have different category information, the nodes in each cluster set are respectively labeled with categories to obtain the category information of each node.
[0067] It should be noted that: ① The node connected to the starting node refers to: a node that can be reached from the starting node through at least one edge; for example, see the aforementioned Figure 3a As shown: Let the starting node be Figure 3aNode A in the graph can be reached from node A through two edges (the edge between node A and node B, and the edge between node B and node F). Therefore, node F can be considered to be a node connected to node A. ② In the current access process, the node depth of any node is determined according to the number of edges between the corresponding node and the starting node; for example, if the number of edges between a node and the starting node is 3, the node depth of the node can be equal to 3. ③ The node width-first access principle mentioned above refers to: the principle of giving priority to visiting nodes with the same node depth; the access direction of node depth from small to large refers to: first traverse the nodes with a node depth of 1, then traverse the nodes with a node depth of 2... and so on. For example Figure 3a In the object network shown, nodes A to F have not been visited. If the starting node of the current traversal process is node A, then after visiting node A, nodes B and D (both with a node depth of 1) are visited first. After visiting nodes B and D, nodes C and F (both with a node depth of 2) are visited, and then node E (with a node depth of 3) is visited.
[0068] S203, calling the graph neural network model to perform unsupervised graph representation learning on each object subgraph according to the object features of multiple objects, to obtain the node features of each node.
[0069] In a specific implementation, the computer device can assign (inject) the object features of multiple objects to the corresponding nodes in multiple object subgraphs according to the corresponding relationship between nodes and objects, so as to obtain a set of object subgraphs carrying object features, so that each object subgraph carrying object features can be used to perform unsupervised learning on the graph neural network model. After each object subgraph is adopted, the learned graph neural network is called to perform graph representation processing on the object network to obtain the node features of each node in the object network; or, the learned graph neural network can be called to perform graph representation processing on each object subgraph to obtain the node features of each node in the object network.
[0070] The above-mentioned use of each object subgraph carrying object features to perform unsupervised learning on the graph neural network model can be understood as: inputting each object subgraph carrying object features into the graph neural network model in batches to perform unsupervised learning on the graph neural network model (i.e., unsupervised model training). It should be understood that the first object subgraph used is input into the original graph neural network model to perform unsupervised learning on the original graph neural network model, and any subsequent object subgraph used is input into the graph neural network model after the previous model training to perform unsupervised learning on the graph neural network model after the previous model training. For example, see Figure 3cAs shown: there are a total of 3 object subgraphs carrying object features, namely the object subgraph marked with label 31, the object subgraph marked with label 32, and the object subgraph marked with label 33; the object subgraph marked with label 31 can first be used to perform unsupervised learning on the original graph neural network model 34 to obtain the learned graph neural network model 35, and then the object subgraph marked with label 32 can be used to perform unsupervised learning on the graph neural network model 35 to obtain the learned graph neural network model 36, and finally, the object subgraph marked with label 33 can be used to perform unsupervised learning on the graph neural network model 36 to obtain the learned graph neural network model 37.
[0071] It should be noted that, for any object subgraph carrying object features, the computer device can directly input the object subgraph into the graph neural network model, so that the graph neural network model performs unsupervised learning on it. Optionally, the PageRank algorithm (importance algorithm) can also be used to calculate the importance of each node in the object subgraph, and after deleting a certain number of nodes (such as 5% of the total number of nodes in the object subgraph) in order of importance from low to high, the object subgraph is input into the graph neural network model, so that the graph neural network model performs unsupervised learning on it; in this case, the graph neural network model can focus on learning the more important nodes in the object subgraph (i.e., the nodes that have not been deleted), thereby improving the learning effect and learning efficiency.
[0072] It should be noted that the embodiments of the present application can flexibly select unsupervised graph neural network models to perform unsupervised graph representation learning on each object subgraph, thereby generating node features of the nodes; for example, the graph neural network models mentioned above can be: DGI model, GraphMAE model or GraphMAE2 model, etc. Among them, the full name of DGI is Deep GraphInformax, which is an unsupervised graph embedding algorithm based on contrastive learning; the full name of GraphMAE is Graph MaskedAuto-Encoders, which is a graph embedding algorithm based on generative graph self-supervised learning; and GraphMAE2 is an improved version of GraphMAE, which adds multi-view random re-masking and the need to restore the intermediate hidden layer representation and other operations on the basis of GraphMAE.
[0073] S204, classifying the objects represented by the corresponding nodes according to the node features of each node, and obtaining category information of each object.
[0074] In one embodiment, the computer device may call the classification model to classify the objects represented by the corresponding nodes according to the node features of each node, and obtain the category information of each object. In another embodiment, the computer device may also integrate the node features of each node and the object features of the corresponding node to obtain the integrated features of each node, thereby calling the classification model to classify the objects represented by the corresponding nodes according to the integrated features of each node, and obtain the category information of each object; through this embodiment, when classifying the corresponding object by combining the object features and the node features (i.e., the network features of the object), not only the association relationship between the object and other objects can be applied, but also the object features of the object can be applied multiple times, thereby further improving the accuracy of the object classification results.
[0075] The embodiment of the present application can obtain the object features of multiple objects, and can also obtain an object network constructed based on multiple objects, the object network includes multiple nodes and multiple edges, one node represents one object, and the nodes corresponding to two objects with an association relationship are connected by at least one edge. After obtaining the object network, the object network can be segmented to obtain multiple object subgraphs, thereby calling the graph neural network model to perform unsupervised graph representation learning on each object subgraph according to the object features of multiple objects, and obtain the node features of each node, so that the node features of each node express the network features of the corresponding object (such as the topological structure of the object network, the association relationship between the corresponding object and other objects, etc.), and can also express the object features of the corresponding object, so that when the corresponding object is classified based on the node features of each node, not only the object features of the corresponding object can be applied, but also the association relationship between the corresponding object and other objects can be applied. By classifying according to multiple features of the object, the accuracy of the object classification result (i.e., the category information obtained by classification) can be improved. Moreover, the node features of each node are obtained through unsupervised graph representation learning, so that the generation of node features does not need to rely on the label information of the object, which can avoid the node features being affected by inaccurate label information, and can effectively improve the accuracy of node features, thereby further improving the accuracy of object classification results. In addition, the embodiment of the present application divides the entire object network into multiple object subgraphs through graph segmentation to perform unsupervised graph representation learning, which can not only improve the efficiency of node feature generation, thereby improving the efficiency of object classification, but also avoid the problem that graph representation learning cannot handle large-scale networks, thereby improving the success rate of object classification.
[0076] Based on the above Figure 2 In the description of the method embodiment shown in the figure, the present application embodiment proposes another more specific object classification method; in the present application embodiment, the computer device is still used as the execution subject for example. Figure 4As shown, the object classification method may include the following steps S401-S408:
[0077] S401, obtaining object features of multiple objects, and obtaining an object network constructed based on the multiple objects; wherein the object network includes multiple nodes and multiple edges; a node represents an object, and the nodes corresponding to two objects having an association relationship are connected by at least one edge.
[0078] S402, initialize a label for each node in the object network, and iteratively perform multiple rounds of graph coarsening processing based on label propagation on the object network to obtain a target graph.
[0079] Among them, different nodes have different labels; the graph coarsening process of label propagation includes: after label propagation is performed on each node in the graph, each node with the same label is merged into a node. It should be noted that: in the process of iteratively performing multiple rounds of graph coarsening processes based on label propagation on the object network, the first round is a graph coarsening process on the object network, and each subsequent round is a graph coarsening process on the coarsened graph obtained in the previous round; the coarsened graph obtained by the last round of graph coarsening is the target graph, and a node in the target graph corresponds to at least one node in the object network. It is understandable that after each round of graph coarsening, the node correspondence between the graph after the current round of graph coarsening and the graph before the current round of graph coarsening (i.e., the graph after the previous round of graph coarsening) can be obtained. Based on the node correspondence obtained after each round of graph coarsening, the correspondence between each node in the target graph and each node in the object network can be inferred.
[0080] For example, see Figure 5aAs shown: it is assumed that the object network 51 includes a total of 8 nodes, namely, node 511 to node 518, and a total of 2 rounds of graph coarsening processing need to be iteratively performed on the object network 51. Then, the object network 51 can be subjected to a first round of graph coarsening processing based on label propagation to obtain a graph labeled with number 52. The node correspondence between this graph and the graph before the first round of graph coarsening processing (i.e., the object network) is: node 521 in this graph corresponds to nodes 511-node 513 in the object network, node 522 in this graph corresponds to nodes 514-node 515 in the object network, and node 523 in this graph corresponds to nodes 516-node 518 in the object network; then the graph labeled with number 52 is subjected to a second round of graph coarsening processing based on label propagation to obtain a graph labeled with number 53 (i.e., the target graph). The node correspondence between this graph and the graph before the second round of graph coarsening processing (i.e., the graph labeled with number 52) is: node 531 in this graph corresponds to nodes 521-522 in the graph labeled with number 52, and node 532 in this graph corresponds to node 523 in the graph labeled with number 52. Then, since node 531 in the target graph (graph marked with number 53) corresponds to nodes 521-522 in the graph marked with number 52, and node 521 corresponds to nodes 511-node 513 in the object network, and node 522 corresponds to nodes 514-node 515 in the object network, it can be inferred that node 531 in the target graph corresponds to nodes 511-node 515 in the object network; similarly, it can be inferred that node 532 in the target graph corresponds to nodes 516-node 518 in the object network.
[0081] In a specific implementation, the computer device may perform the following steps s21-s26 in the process of iteratively performing multiple rounds of graph coarsening processing based on label propagation on the object network to obtain the target graph:
[0082] s21 obtains the graph required to be coarsened in the tth round as the tth graph, where t is a positive integer and can be less than or equal to the number of iteration rounds; when t=, the graph required to be coarsened in the tth round is the object network, and when t>1, the graph required to be coarsened in the tth round is the coarsened graph obtained in the t-1th round.
[0083] s22, traverse each node in the tth graph in turn, and determine the i-th node currently traversed; i is a positive integer and is less than or equal to the number of nodes in the tth graph.
[0084] s23, obtaining at least one neighbor node of the ith node from the tth graph, where the neighbor node of the ith node refers to a node in the tth graph that is connected to the ith node through at least one edge.
[0085] In a specific implementation, the computer device may use each node connected to the i-th node in the t-th graph as a neighbor node of the i-th node to ensure the comprehensiveness of the neighbor nodes, thereby ensuring the comprehensiveness of the label propagation and improving the accuracy of the label propagation results. Based on this, when the computer device executes step s23, it can determine the X edges connected to the i-th node in the t-th graph, and then obtain at least one neighbor node of the i-th node from the t-th graph based on the X edges, where X is a positive integer; in this implementation, any neighbor node obtained is: a node connected to the i-th node through at least one of the X edges.
[0086] In another specific implementation, considering that each edge has a base edge weight, the base edge weight of any edge can be used to indicate: the association between the objects represented by the two nodes connected by the corresponding edge; when the base edge weight of an edge is small, the association between the objects represented by the two nodes connected by the edge is low. In this case, either of the two nodes has a lower label reference to the other node; based on this, in order to accelerate the process of label propagation, thereby accelerating the process of graph coarsening and improving the efficiency of graph coarsening, the computer device can discard some invalid edges by considering the base edge weight of each edge, thereby filtering out some nodes with lower label references, so as to perform label propagation in nodes with higher label references. This can not only ensure the accuracy of label propagation to a certain extent, but also improve the efficiency of label propagation.
[0087] Based on this, when executing step s23, the computer device can determine the X edges connecting the i-th node in the t-th graph, and obtain the target edge weight of each of the X edges, and the target edge weight of any edge is positively correlated with the degree of association between the objects represented by the two nodes connected by the corresponding edge. Specifically, the reference edge weight of each of the X edges can be obtained, and the reference edge weight of each edge can be used as the target edge weight of the corresponding edge, or considering that the reference edge weight is a dimensional data, in order to simplify the calculation involved in the subsequent invalid edge detection, the reference edge weight of each of the X edges can also be normalized respectively to convert the reference edge weight of each edge into scalar data (i.e., dimensionless data) to obtain the target edge weight of each of the X edges; the normalization mentioned here refers to: calculating the ratio between the reference edge weight of any edge and the sum of the reference edge weights of the X edges. After obtaining the target edge weight of each edge, the computer device may detect invalid edges among the X edges according to the size relationship between the target edge weight of each edge and the first weight threshold; and discard the detected invalid edges among the X edges to obtain the remaining Y edges (i.e., the edges other than the invalid edges among the X edges, Y∈[1,X]), thereby obtaining at least one neighbor node of the i-th node from the t-th graph based on the Y edges; in this implementation manner, any neighbor node obtained is: a node connected to the i-th node through at least one edge among the Y edges.
[0088] Further, according to the size relationship between the target edge weight of each edge and the first weight threshold, the specific implementation method of detecting invalid edges among X edges can be: if the target edge weight of the xth edge among the X edges is greater than the first weight threshold, the xth edge is determined to be a valid edge, x∈[1,X]. If the target edge weight of the xth edge among the X edges is less than or equal to the first weight threshold, the xth edge is directly determined to be an invalid edge. It can be seen that the invalid edge in this case refers to: the edge corresponding to the target edge weight that is less than or equal to the first weight threshold.
[0089] Optionally, considering that if all edges corresponding to the target edge weights of all the first weight thresholds are discarded as invalid edges, the graph will lose a large number of low-weight edges, which may affect the stability of the graph and thus affect the accuracy of label propagation; based on this, the computer device can use a "selection" strategy to retain more edges to ensure the accuracy of label propagation. Among them, the "selection" strategy refers to: a strategy of randomly selecting low-weight edges for retention. Correspondingly, if the target edge weight of the xth edge among the x edges is less than or equal to the first weight threshold, the computer device can generate a random number for the xth edge, and the random number can obey a uniform distribution from 0 to 1 or other distributions, which is not limited. Then, the validity of the x edges can be checked according to the size relationship between the generated random number and the second weight threshold; specifically, if the generated random number is less than the second weight threshold, the xth edge can be determined to be a valid edge; if the generated random number is greater than or equal to the second weight threshold, the xth edge can be determined to be an invalid edge. It can be seen that the invalid edge in this case refers to an edge that meets the following conditions: the target edge weight is less than or equal to the first weight threshold, and the corresponding random number is greater than or equal to the second weight threshold.
[0090] It is worth noting that the above is only an exemplary list of a specific implementation method for implementing the "selection" strategy, and is not exhaustive. For example, another specific implementation method for implementing the "selection" strategy may be: for the xth edge among the X edges, according to the size relationship between the target edge weight of the xth edge and the first weight threshold, the target edge weight of the xth edge is corrected to obtain the corrected target edge weight, if the corrected target edge weight is an invalid value (such as a value of 0), then the xth edge is determined to be an invalid edge, if the corrected target edge weight is not an invalid value, then the xth edge is determined to be a valid edge. Among them, according to the size relationship between the target edge weight of the xth edge and the first weight threshold, the target edge weight of the xth edge is corrected to obtain the corrected target edge weight in the following manner: if the target edge weight of the xth edge is greater than the first weight threshold, the target edge weight of the xth edge is used as the corrected target edge weight; if the target edge weight of the xth edge is less than or equal to the first weight threshold, the invalid value is directly used to correct the target edge weight of the xth edge to obtain the corrected target edge weight, so that the corrected target edge weight is an invalid value. Optionally, if the target edge weight of the xth edge is less than or equal to the first weight threshold, a random number may be generated for the xth edge. If the generated random number is greater than or equal to the second weight threshold, the target edge weight of the xth edge is corrected by using an invalid value to obtain a corrected target edge weight. If the generated random number is less than the second weight threshold, the target edge weight of the xth edge is used as the corrected target edge weight. Based on this, the calculation formula for the corrected target edge weight of the xth edge can be shown in the following formula 1.1:
[0091]
[0092] Among them, P ij ' represents the corrected target edge weight, P ij represents the target edge weight of the xth edge, P ratio Represents the first weight threshold, using P bound represents the second weight threshold, P rand represents the random number generated for the xth edge; the meaning of formula 1.1 is: if (if) P ij >P ratio , or (or), if P ij ≤P ratio and P rand Less than P bound , then P ij '=P ij , otherwise, P ij '=0 (i.e. invalid value). ij represents the base edge weight of the xth edge, e f If any of the X edges belongs to X, then P ij The calculation formula can be found in the following formula 1.2:
[0093]
[0094] s24, using the label of at least one neighboring node to perform label propagation on the i-th node to update the label of the i-th node.
[0095] In a specific implementation, the computer device may execute step s24 according to the label propagation logic adopted by the aforementioned LPA algorithm. In this specific implementation, the implementation method of step s24 may be: among the labels of at least one neighboring node, count the occurrence frequency (i.e., the number of occurrences) of each label; based on the statistical results, select the label corresponding to the maximum occurrence frequency from the labels of at least one neighboring node, and propagate the selected label to the i-th node to update the label of the i-th node, so that the updated label of the i-th node is the selected label. For example, see Figure 5b As shown, let the i-th node be node v i , which has three neighbor nodes, namely node v1, node v2 and node v3; among them, the label of node v1 is label 1 (represented by a vertical stripe pattern), and the labels of node v2 and node v3 are both label 2 (represented by a grid pattern). Since among the labels of these three neighbor nodes, the frequency of occurrence of label 1 is 1, and the frequency of occurrence of label 2 is 2, the label with the largest frequency of occurrence is label 2, so label 2 can be propagated to node v i , to convert node v iThe label is updated to label 2.
[0096] In another specific implementation, considering that the LPA algorithm will select the label with the highest frequency among the labels of each neighboring node for label propagation to update the label of the i-th node, this method does not take into account the size of the subgraph of each neighboring node (the graph composed of each node used to fuse the corresponding neighboring node), which is easy to produce the following Figure 5c The binary problem shown (i.e., the two labels have the same frequency of occurrence). Based on this, in order to avoid the binary problem, the computer device can execute step s24 according to the label propagation logic adopted by the CLP algorithm mentioned above. In this specific implementation, the implementation method of step s24 can be: obtain the number of subgraph nodes of each neighbor node in at least one neighbor node, and the number of subgraph nodes of any neighbor node is determined according to the number of nodes used when the corresponding neighbor node is obtained by fusion; for example, a certain neighbor node is obtained by fusion of 3 nodes, then the number of subgraph nodes of the neighbor node is 3. Then, the label weight value of the corresponding neighbor node can be determined according to the number of subgraph nodes of each neighbor node, and the label weight values of each neighbor node with the same label are aggregated (for example, summed) to obtain the weight coefficient of the corresponding label; then, from the label of at least one neighbor node, select the label corresponding to the largest weight coefficient; and propagate the selected label to the i-th node to update the label of the i-th node, so that the updated label of the i-th node is the selected label.
[0097] Furthermore, in order to make the sizes of each object subgraph obtained by subsequent segmentation more uniform, when the computer device determines the label weight value of the corresponding neighbor node according to the number of subgraph nodes of each neighbor node, it can set a label weight value for the corresponding neighbor node according to the principle that the number of subgraph nodes and the label weight value are negatively correlated. Alternatively, the reference edge weight of the edge between each neighbor node and the i-th node can be obtained as the label weight measurement parameter of the corresponding neighbor node, so as to determine the label weight value of the corresponding neighbor node according to the number of subgraph nodes of each neighbor node and the label weight measurement parameter of the corresponding neighbor node. The label weight value of any neighbor node is equal to: the ratio between the label weight measurement parameter of the corresponding neighbor node and the number of subgraph nodes of the corresponding neighbor node. In this case, the specific implementation process of step s24 can be expressed as shown in the following formula 1.3:
[0098]
[0099] Among them, C vi is the updated label of the i-th node, C vi1 , C vim and C vinrepresents the label of the first neighbor node, the label of the mth neighbor node, and the label of the nth neighbor node. f is a function that returns the label corresponding to the maximum weight coefficient according to the weight coefficient of the labels of each neighbor node, so as to propagate it to the i-th node. i1 、e im and e in represents the base edge weight of the edge between the first neighbor node and the i-th node, the base edge weight of the edge between the m-th neighbor node and the i-th node, and the base edge weight of the edge between the n-th neighbor node and the i-th node, m∈[1,n], n is the number of neighbor nodes of the i-th node. Correspondingly, |v i1 |、|v im | and |v in | represents the number of subgraph nodes of the 1st neighbor node, the number of subgraph nodes of the mth neighbor node, and the number of subgraph nodes of the nth neighbor node respectively.
[0100] See for example Figure 5d As shown, let the i-th node be node v i , which has three neighbor nodes, namely node v1, node v2 and node v3; among them, the label of node v1 (using C vi1 ) are all labeled 1 (indicated by vertical stripes), and the label of node v2 (indicated by C vi2 ) and the label of node v3 (using C vi3 In addition, nodes v1 and v i The edge between (using e i1 The base edge weight of node v2 and node v is 0.8. i The edge between (using e i2 The base edge weight of node v3 and node v is 0.2. i The edge between (using e i3 The base edge weight of node v1 is 0.1; the number of subgraph nodes of node v1 (expressed by |v1|) is 30, the number of subgraph nodes of node v2 (expressed by |v2|) is 20, and the number of subgraph nodes of node v3 (expressed by |v3|) is 30. Then the label weight value of node v1 can be calculated as e i1 / |v1|=0.8 / 30=0.026, the label weight value of node v2 is e i2 / |v2|=0.2 / 20=0.01, the label weight value of node v3 is e i3 / |v3|=0.1 / 30=0.003. Since only node v1 has label 1, the label weight value of node v1 can be aggregated to obtain a weight coefficient of label 1 of 0.026; and since both nodes v2 and v3 have label 2, the label weight value of node v2 and the label weight value of node v2 can be summed to obtain a weight coefficient of label 2 of 0.013 (i.e. 0.01+0.003). It can be seen that the largest weight coefficient is 0.026, and its corresponding label is label 1, so label 1 can be propagated to node v i , to convert node v i The label of is updated to label1.
[0101] Based on the above description of using the CLP algorithm to implement step s24, the embodiment of the present application exemplarily provides a pseudo code of the CLP algorithm, as shown below:
[0102] Input: G = (V, E), T / / Input graph (G) and number of rounds (T)
[0103] Output: Cut graph nodes into L partitions g1, g2,…,g L / / Output the label of each node in the graph
[0104]
[0105] Output: L partitions{g1,g2,...,g L} / / Output L labels
[0106] Based on the pseudo code of the CLP algorithm above, it can be seen that CLP uses asynchronous updates; in the tth stage, the label of node v is updated based on the label corresponding to the maximum weight coefficient in the labels of the corresponding neighboring nodes. It should be noted that for simplicity, the tth stage is not marked in the pseudo code above; and in the process of label propagation, there is a sequence of label updates between nodes. For node v, the label update order of its neighbor nodes is earlier than the label update order of node v. When updating the label of node v, the label of the neighbor node used is the label updated in the tth round. If the label update order of the neighbor node is later than the label update order of node v, when updating the label of node v, the label of the neighbor node used is the label updated in the t-1th round. In addition, the CLP algorithm uses the "selection" strategy (lines "2" to "5" in the pseudo code above) to accelerate the coarsening process and retain more edges, and uses the "stabilization" strategy (line "3" in the pseudo code above) to asynchronously update the weight of the balance edge eij and the number of subgraph nodes, so as to calculate the weight coefficient of the label, and use the weight coefficient to propagate the label to avoid the binary problem. It can be seen that by performing graph coarsening processing based on the CLP algorithm proposed in the embodiment of the present application, a large graph can be quickly and evenly divided while retaining more edges in the original graph.
[0107] s25, continue to traverse the tth graph until the labels of all nodes in the tth graph are updated.
[0108] s26, merge the nodes with the same label in the t-th graph into one node to obtain a coarsened graph. The label of any node in the coarsened graph is: the label of any node used to fuse to obtain the corresponding node; for example, if three nodes with label 1 in the t-th graph are fused into one node, the label of the node is label 1. In addition, the base edge weight of an edge connected to any node in the coarsened graph can be obtained by integrating (such as summing or averaging) the base edge weights of the edges between the nodes used to fuse to obtain the node.
[0109] S403, performing graph segmentation processing on the object network according to the target graph to obtain multiple object subgraphs; wherein each node in the same object subgraph corresponds to the same node in the target graph.
[0110] In a specific implementation, the computer device can divide the target graph into nodes according to the number of object subgraphs to be divided, and obtain multiple groups of nodes, wherein one group of nodes includes at least one node; assign the same subgraph ID to each node in the same group of nodes, and the nodes in different groups of nodes have different subgraph IDs; then, according to the node correspondence between the target graph and the object network, map the subgraph ID of each node in the target graph to the object network to obtain the subgraph ID of each node in the object network; then, according to the principle of dividing the nodes with the same subgraph ID into one object subgraph, perform graph segmentation processing on the object network according to the subgraph ID of each node in the object network to obtain multiple object subgraphs. It is understandable that if different nodes in the target graph are divided into different groups, that is, each group of nodes includes one node, then the number of object subgraphs obtained in this way is the same as the number of nodes in the target graph, and the nodes in different object subgraphs correspond to different nodes in the target graph.
[0111] S404, assigning object features of multiple objects to corresponding nodes in multiple object subgraphs according to the correspondence between nodes and objects, so that each node in the object subgraph carries the object feature.
[0112] S405, performing unsupervised learning on the graph neural network model using the corresponding object subgraph according to the object features of each node in each object subgraph.
[0113] In a specific implementation, the graph neural network model can be a DGI model. The DGI model can generate a damaged version subgraph by randomly perturbing the original subgraph (for example, randomly deleting edges, adding edges, and randomly disrupting the object features of nodes). The two subgraphs are respectively passed through the encoder in the GCN (graph neural network model) to obtain the node features (i.e., node representation) of each node in each subgraph, so that the node features of the nodes in the original subgraph should be as similar as possible to the global features of the original subgraph, and the node features of the nodes in the damaged version subgraph should be as dissimilar as possible to the global features of the original subgraph, and the model parameters are updated and optimized. Furthermore, the loss function of the DGI model can be shown in the following formula 1.4:
[0114]
[0115] In the above formula 1.4, L represents the model loss value of the DGI model, and E represents the expectation. X and A represent the subgraph features of the original subgraph (including the object features of each node in the original subgraph) and the adjacency matrix, respectively. and They respectively represent the subgraph features of the damaged version subgraph (including the object features of each node in the damaged version subgraph) and the adjacency matrix. represents the embedding (vector) representation of the i-th node in the original subgraph (i.e., node features), represents the embedding representation of node j in the damaged version subgraph, Represents the overall representation of the original subgraph (i.e., global features), which is generally the average value of the embedding representation of each node in the original subgraph. N represents the number of nodes in the original subgraph, and M represents the number of nodes in the corrupted version of the subgraph. Represents a probability score calculated based on the embedding representation of the i-th node and the overall representation of the original subgraph. The higher the probability score, the more graph-level information the embedding representation of the i-th node contains, and thus the more similar the embedding representation of the i-th node is to the overall representation of the original subgraph. The meaning and The meanings are similar and will not be elaborated here.
[0116] Then in this specific implementation, the implementation method of step S405 can be: for the rth object subgraph, the rth object subgraph is perturbed to obtain a perturbation graph; wherein r is a positive integer and is less than or equal to the number of object subgraphs. The perturbation processing performed on the rth object subgraph may include at least one of the following: randomly deleting at least one edge in the rth object subgraph, adding at least one edge in the rth object subgraph, and randomly disrupting the object features of at least one node in the rth object subgraph, etc. In addition, the graph neural network model is called, and the graph representation processing is performed on the rth object subgraph according to the object features of each node in the rth object subgraph to obtain the node features of each node in the rth object subgraph; and the node features of each node in the rth object subgraph are integrated (such as summing) to obtain the global features of the rth object subgraph. In addition, the graph neural network model can also be called to perform graph representation processing on the perturbation graph according to the object features of each node in the perturbation graph to obtain the node features of each node in the perturbation graph. Then, the model loss value of the graph neural network model can be determined based on the global features, the node features of each node in the rth object subgraph, and the node features of each node in the perturbation graph. Specifically, the rth object subgraph can be taken as the original subgraph, and the perturbation graph can be taken as the damaged version subgraph, so that these three types of features can be input into the loss function of the graph neural network model (i.e., the loss function shown in the aforementioned formula 1.4) to calculate the model loss value, and then optimize the model parameters of the graph neural network model in the direction of reducing the model loss value.
[0117] In another specific implementation, the graph neural network model can be a GraphMAE model. The GraphMAE model masks the object features of some nodes in the original subgraph (represented by a set V~), and reconstructs the features of these nodes through an encoder to obtain a reconstructed subgraph. The reconstructed subgraph passes through a decoder to obtain the node features of the masked nodes, so as to update and optimize the model parameters according to the goal that the node features of these nodes should be as similar as possible to the original features (i.e., object features). The node v in the reconstructed subgraph i The characteristics of can be shown in the following formula 1.5, and the loss function of the GraphMAE model can be shown in the following formula 1.6:
[0118]
[0119]
[0120] In the above formulas 1.5-1.6, Represents the node v in the reconstructed subgraph i The characteristics of x [M] represents the virtual feature (i.e., reconstructed feature) corresponding to the special mask mark [M], x i represents the original feature (i.e., object feature); zi represents the set The representation of node vi after passing through the encoder and decoder (i.e., node feature), Representing a collection The similarity between the node features and object features of node vi in , and γ is a hyperparameter.
[0121] Then in this specific implementation, the implementation method of step S405 can be: for the rth object subgraph, Q nodes are selected in the rth object subgraph, Q is a positive integer; and the object features in the selected Q nodes in the rth object subgraph are masked to obtain a mask graph. Secondly, the encoder in the graph neural network model can be called to perform feature reconstruction on the Q nodes in the mask graph to obtain a reconstructed graph; wherein, for any node in the reconstructed graph, if the any node does not belong to the Q nodes, then the feature of the any node is the object feature of the corresponding node, and if the any node is one of the Q nodes, then the feature of the any node is the reconstructed feature obtained by reconstructing the features of the corresponding node. Then, the decoder of the graph neural network model can be called to perform graph representation processing on the reconstructed graph according to the features of each node in the reconstructed graph to obtain the node features of each node in the reconstructed graph. Next, the model loss value of the graph neural network model can be determined based on the node features of each node in the Q nodes included in the reconstructed graph and the similarity between the object features in the corresponding node. Specifically, the Q nodes can be used as a set Therefore, the node features of each of the Q nodes and the object features in the corresponding nodes are input into the loss function of the graph neural network model (i.e., the loss function shown in the above formula 1.6) to calculate the model loss value, and then optimize the model parameters of the graph neural network model in the direction of reducing the model loss value.
[0122] It should be noted that the above is only an illustrative example of the specific implementation of step S405 using the graph neural network as a DGI model or a GraphMAE model, and does not limit this. For example, the graph neural network model can also be a GraphMAE2 model, which adds multi-view random re-masking and the need to restore the intermediate hidden layer representation on the basis of the GraphMAE model. The principle of unsupervised learning is similar to that of the GraphMAE model, which will not be elaborated here. Moreover, regardless of whether the graph neural network model is a DGI model, a GraphMAE model, or a GraphMAE2 model, the embodiments of the present application all treat the object subgraph as a batch and input it into the graph neural network model to achieve shared parameter learning of the unsupervised model, so that the learned graph neural network model can infer the node features of all nodes.
[0123] In addition, the above-mentioned "in the direction of reducing the model loss value" refers to: the model optimization direction with the goal of minimizing the model loss value; by optimizing the model in this direction, the model loss value generated again by the graph neural network model after each optimization must be smaller than the model loss value generated by the graph neural network model before optimization. For example, the model loss value of the graph neural network model calculated this time is 0.85, so after optimizing the graph neural network model in the direction of reducing the model loss value, the model loss value generated by the optimized graph neural network model should be less than 0.85.
[0124] S406, after all object subgraphs are adopted, the learned graph neural network is called to perform graph representation processing on the object network to obtain node features of each node in the object network.
[0125] S407, integrating the node feature of each node and the object feature of the corresponding node to obtain the integrated feature of each node.
[0126] In a specific implementation, the computer device may splice the node feature of each node with the object feature of the corresponding node to integrate the node feature and the object feature of the corresponding node to obtain the integrated feature of each node (i.e., the spliced feature). By integrating features in this implementation, the integration operation can be simplified and the efficiency of feature integration can be improved.
[0127] In another specific implementation, since both the node feature and the object feature are essentially a vector representation, the computer device can also perform an element-by-element addition operation to superimpose the node feature of each node on the object feature of the corresponding node, so as to integrate the node feature and the object feature of the corresponding node and obtain the integrated feature of each node (i.e., the superimposed feature). The element-by-element addition operation refers to the operation of adding the vector elements at the same arrangement position in the two vector representations; for example, for a node v i For example, the node v i The first vector element in the node feature and the node v i Add the first vector element in the object feature of the node v i The second vector element in the node feature and the node v i The second vector element in the object feature of is added, and so on. For example, let node v i The node features of node v are [2, 3, 1], and node v i The object features of the node v are [4, 1, 3], then the node v i The integrated feature can be [6, 4, 4]. By integrating features in this implementation, the node features and object features of the node can be better integrated together, thereby improving the effect of feature integration.
[0128] S408, calling the classification model to classify the objects represented by the corresponding nodes according to the integrated features of each node, and obtaining the category information of each object.
[0129] In a specific implementation, the classification model mentioned here can be a binary classification model, and the so-called binary classification model refers to: predicting the probability that an object belongs to the first class of objects. In this specific implementation, the specific implementation method of step S408 can be: calling the classification model to predict the probability that the object represented by the corresponding node belongs to the first class of objects according to the integrated features of each node, and obtaining the probability value of each object. Then, the first L objects (L is a positive integer) can be screened out from multiple objects according to the probability value of each object in the order from large to small, so that the category information of each object in the L objects is set to the first category information, and the category information of each object other than the L objects in the multiple objects is set to the second category information. Alternatively, the size relationship between the probability value of each object and the probability threshold can be compared respectively, and the category information of the object corresponding to each probability value less than the probability threshold is set to the first category information, and the category information of the object corresponding to each probability value greater than or equal to the probability threshold is set to the second category information.
[0130] Among them, the first category information mentioned above refers to the category information used to indicate the first category of objects, the second category information refers to the category information used to indicate the second category of objects, and the second category of objects refers to objects other than the first category of objects. In addition, the first category of objects mentioned here can be set according to actual business needs. For example, when any object is a user, the first category of objects may refer to: users whose age is within the first age range; when the embodiment of the present application is used in a scene for identifying minors, the first age range refers to the age range defined for minors, such as if a natural person under the age of 18 is defined as a minor, the first age range may be [0, 17]; when the embodiment of the present application is used in a scene for identifying the elderly, the first age range refers to the age range defined for the elderly, such as if a natural person over the age of 60 is defined as an elderly, the first age range may be [60, +∞), +∞ represents positive infinity. For another example, when any object is advertising data, the first category of objects may refer to: illegal advertising data; for another example, when any object is multimedia data, the first category of objects may refer to: illegal multimedia data, or hot (i.e., high heat value) multimedia data, and so on.
[0131] In another specific implementation, the classification model mentioned here can also be a multi-classification model. The so-called multi-classification model refers to: based on multiple preset category labels, predicting the probability that the object belongs to the category indicated by each category label. In this specific implementation, the specific implementation method of step S408 can be: calling the classification model to predict the probability that the object represented by the corresponding node belongs to the category indicated by each preset category label according to the integrated features of each node, and obtaining a probability set for each object. The probability set of any object includes the probability that the corresponding object belongs to the category indicated by each category label. Then, for any object, the category label corresponding to the largest probability can be selected from the probability set of the object as the category information of the corresponding object.
[0132] Among them, the multiple category labels mentioned here can be set according to actual business needs. For example, when any object is a user, the multiple category labels may include but are not limited to: minor labels, adult labels, and elderly labels. For another example, when any object is advertising data, the multiple category labels may include but are not limited to: junk advertising labels, fraudulent advertising labels, diversion advertising labels, and normal advertising labels. For another example, when any object is multimedia data, the multiple category labels may include but are not limited to: lyrical labels and funny labels.
[0133] The embodiment of the present application can be classified according to multiple features of the object, and the accuracy of the object classification result (i.e., the category information obtained by classification) is improved. In addition, the node features of each node are obtained by unsupervised graph representation learning, so that the generation of node features does not need to rely on the label information of the object, so that the node features can be avoided from being affected by inaccurate label information, and the accuracy of node features can be effectively improved, thereby further improving the accuracy of the object classification result. In addition, the embodiment of the present application proposes a more efficient graph segmentation algorithm LP-Metis algorithm, which can efficiently divide the entire object network into multiple object subgraphs for unsupervised graph representation learning, which can not only improve the generation efficiency of node features, thereby improving the efficiency of object classification, but also avoid the problem that graph representation learning cannot handle large-scale networks, and improve the success rate of object classification.
[0134] In practical applications, the above Figure 2 and Figure 4 The object classification method shown can be used in various scenes involving object classification, such as scenes where minors need to be identified in games, scenes where illegal advertisements need to be identified, and so on. Exemplarily, taking the game scene where minors need to be identified as an example, the application process of the object classification method is described; in this application scenario, the object can be called a player (i.e., a game user), the object feature can be called a player feature, and the object network can be called a player's social network. Specifically, when the object classification method proposed in the embodiment of the present application is applied to the scene of minors identification, a large-scale unsupervised network representation learning framework can be constructed. According to a given large-scale game player network, an embedding representation that can express both network structure information and player features can be learned. First, the community discovery algorithm Label Propagation can be distributedly executed on the large-scale network to form several smaller communities. If the number of communities is still large, the formed communities can be treated as virtual nodes to continue to execute Label Propagation. When the number of communities is less than a certain level, these communities are treated as virtual nodes, and then the graph segmentation algorithm Metis can be executed on a single machine, and then the subgraph ID of the virtual node is mapped back to the real node, and each node belongs to only one object subgraph. Then, for each object subgraph, we can use masked auto-encoders (MAE) to mask some of the player's features and restore them, and learn the player's node representation in an unsupervised way. Finally, we can concatenate the learned node representation with the player's original features and input them into the classifier for prediction. By combining the player's features and the information of the social network, we can effectively improve the accuracy of underage identification.
[0135] See also Figure 5e As shown in the figure, the input of the graph neural network model in this application scenario has two parts: player features {X u|u∈V} and the player's social network SG=(V,E,W), and the output of the graph neural network model is the network representation vector of any player u (i.e., the node features used to represent any player's node). Specifically, the application process of the object classification method generally includes the following four steps:
[0136] 1. Large-scale graph partitioning: Assign each node u in the node set V in the social network to a unique object subgraph c; in this process, ensure that the sizes of each object subgraph are uniform and retain as many edges as possible in the edge set E in the social network.
[0137] 2. Unsupervised graph representation learning: Input each object subgraph in batches into an unsupervised GNN model (such as a DGI model or a mask pre-training model (Graph MAE)) for unsupervised learning, and then use the learned GCN model to infer the embedding representations (i.e., node features) of all nodes. After the unsupervised graph representation learning is completed, the node corresponding to each player can be represented as a d-dimensional vector h u (i.e. embedding representation).
[0138] 3. Prediction of the minor model: The embedding representation of the node corresponding to each player is used as an additional feature of the classification model, the classification model is trained, and the probability (p value) of each player being a minor is predicted. Specifically, the original feature x u and the embedding representation of the corresponding node h u The data is spliced together and input into the trained classification model. The predicted value of the corresponding minor label output by the model is taken as the probability that the player to be predicted is a minor. The greater the probability, the more likely it is that the player is a minor.
[0139] 4. Screening of underage players: Sort the players according to their probability from high to low, and select the top ranked players as the target user set for underage identification. The target user set includes the top ranked players who are identified as underage. Optionally, after obtaining the target user set, a user package of size K (for example, 1 million) can be output for the game as potential underage users of the game. After that, the business side of the Growth Guardian Platform will send face recognition messages to the users in the user package (such as Figure 5f ) as shown, so that the terminal screen on the user side displays Figure 5g The interface shown in FIG. 1 is displayed, so that the user can perform face authentication in the interface. If the user passes the face authentication, the first prompt information (such as Figure 5g If the user fails the face recognition, the right side of the terminal screen may display a second prompt message indicating that the authentication failed (eg Figure 5g Information marked with reference number 55)
[0140] Based on the above description, it can be known that when the object classification method proposed in the embodiment of the present application is applied to the identification of minors in the game, the large-scale player social network can be first segmented, and then the player characteristics and friend relationships of each subgraph are learned through masked self-supervision to represent the player's node embedding to obtain a representation vector for each player. The representation vector is then used as an additional feature to train the classifier to predict the probability (p value) that the player is a minor, and the players with the highest p value are regarded as potential minors. When they log in to the game, face recognition pops up for verification. Due to the combination of player characteristics and social networks, when selecting potential minors, it is possible to consider not only the player's own in-game active behavior patterns, payment and other attributes, but also the in-game information of friends who interact closely with the player, thereby significantly improving the performance of the algorithm and enhancing the anti-addiction protection for minors.
[0141] It is understandable that there is a large amount of user interaction information (such as sending gifts, forming teams, making friends) and player characteristics (such as player's active time, play mode, payment information) in the game field. Using user interaction information and player characteristics to generate low-dimensional graph embedding is beneficial to various game businesses, including identification of minors, acquisition of new players, player return, etc. In the scenario of identification of minors, a social network can be composed of 300 million player nodes and 12 billion friend edges. Traditional network representation learning methods cannot handle such a large-scale network. The Metis graph segmentation algorithm LPMetis proposed in the embodiment of the present application in combination with label propagation efficiently segments large-scale graphs and retains more edges. Further, the representation learning of mask pre-training of the object subgraph after cutting can obtain a network representation of hundreds of millions of nodes; and through the large-scale network representation learning algorithm designed by the embodiment of the present application, the player node can be mapped to a vector with a fixed length and far less than the number of nodes. These vectors not only retain the network structure information, making the players who interact more frequently closer; but also retain the player's characteristic information, so that the players with similar behaviors in the game are closer. In addition to learning the representation vectors of the nodes, these vectors can be further used to predict the probability that the player is a minor (expressed as a floating point number between (0,1)), thereby improving the accuracy of minor identification.
[0142] Furthermore, in order to verify the performance of various algorithms proposed in the embodiments of the present application, the embodiments of the present application conducted the following offline experiments.
[0143] (I) Dataset: Player characteristics and player game social networks can be extracted from the large-scale game data as offline experimental test data. Among them:
[0144] (1) Player characteristics: We obtained 304,725,215 players and their 188-dimensional features from the game logs, of which 4,083,721 players had real age labels.
[0145] (2) Game social network: covers the friendship and interaction data (including team formation, gift sending, gold coin sending, etc.) of 304,725,215 players in more than a dozen games.
[0146] (II) Comparison scheme: A comparison experiment was conducted on the above offline data set between the object classification method proposed in the embodiment of the present application (named PB-GNN: Partition-based Billion-scale Graph Neural Network) and the basic scheme. The comparison scheme includes:
[0147] (1) The original PU-DNN model for classification of minors, denoted as base;
[0148] (2) PU-DNN with large-scale social network representation in this application is added, including after using LPMetis to divide the graph:
[0149] a) Execute DGI on the subgraph, denoted as base+PB-GNN(DGI)
[0150] b) Execute GraphMAE on the subgraph, denoted as base+PG-GNN(GraphMAE)
[0151] c) Execute GraphMAE2 on the subgraph, denoted as base+PG-GNN(GraphMAE2)
[0152] (III) Evaluation indicators: Randomly sample 20% of the players from the labeled samples of the above offline data set as test samples, and use AUC (Area Under the receiver operating characteristic Curve) as an evaluation indicator to measure the effectiveness of each solution. AUC measures the probability that the classifier correctly judges that the value of the positive sample is approximately the value of the negative sample when a positive sample (y=1) and a negative sample (y=0) are randomly selected. Therefore, the larger the AUC value of the classifier, the higher the accuracy.
[0153] (IV) Experimental results: The results of the comparative experiment are shown in Table 1:
[0154] Table 1
[0155]
[0156] Based on the above Table 1, it can be seen that the large-scale unsupervised network representation of the embodiment of the present application can significantly improve the prediction performance. More specifically, the embedding using DGI embedding can improve the absolute value of AUC by 0.41%. GraphMAE using mask pre-training can achieve better results, and GraphMAE2 has an absolute improvement of 1.61%.
[0157] (V) Online A / B test results: The results of online A / B test are shown in Table 2:
[0158] Table 2
[0159]
[0160] Based on the above Table 2, it can be seen that the embodiment of the present application performs online face recognition verification on the top K potential underage players extracted by the base method and the top K underage players extracted by base+DGI embedding, and it is found that the proportion of those authenticated as underage players through the embodiment of the present application is 21.83%, which is significantly higher than the 19.50% authenticated as underage players through the base, a relative increase of 11.95%.
[0161] Based on the description of the above-mentioned object classification method embodiment, the present application embodiment further discloses an object classification device; the object classification device may be a computer program (including one or more instructions) running in a computer device, and the object classification device may execute Figure 2 or Figure 4 The steps in the method flow are shown. Figure 6 , the object classification device can run the following units:
[0162] The processing unit 601 is used to obtain object features of multiple objects and obtain an object network constructed based on the multiple objects; wherein the object network includes multiple nodes and multiple edges; a node represents an object, and the nodes corresponding to two objects having an association relationship are connected by at least one edge;
[0163] The processing unit 601 is further configured to perform graph segmentation processing on the object network to obtain a plurality of object subgraphs, each of which includes at least one node;
[0164] The processing unit 601 is further used to call the graph neural network model to perform unsupervised graph representation learning on each object subgraph according to the object features of the multiple objects to obtain the node features of each node;
[0165] The classification unit 602 is used to classify the objects represented by the corresponding nodes according to the node features of each node, so as to obtain the category information of each object.
[0166] In one implementation, when the processing unit 601 is used to perform graph segmentation processing on the object network to obtain multiple object subgraphs, it can be specifically used to:
[0167] Initializing a label for each node in the object network, where different nodes have different labels;
[0168] Iteratively performing multiple rounds of graph coarsening processing based on label propagation on the object network to obtain a target graph, wherein a node in the target graph corresponds to at least one node in the object network; the graph coarsening processing based on label propagation includes: after performing label propagation on each node in the graph, merging each node with the same label into one node;
[0169] The object network is segmented according to the target graph to obtain a plurality of object subgraphs; wherein each node in the same object subgraph corresponds to the same node in the target graph.
[0170] In another implementation manner, when the processing unit 601 is used to iteratively perform multiple rounds of graph coarsening processing based on label propagation on the object network to obtain the target graph, it can be specifically used to:
[0171] The graph required to be coarsened in the tth round is obtained as the tth graph, where t is a positive integer; when t=1, the graph required to be coarsened in the tth round is the object network, and when t>1, the graph required to be coarsened in the tth round is the coarsened graph obtained in the t-1th round;
[0172] Traverse each node in the t-th graph in sequence and determine the i-th node currently traversed; i is a positive integer and is less than or equal to the number of nodes in the t-th graph;
[0173] Acquire at least one neighbor node of the i-th node from the t-th graph; the neighbor node of the i-th node refers to: a node in the t-th graph that is connected to the i-th node through at least one edge;
[0174] Using the label of the at least one neighboring node to perform label propagation on the i-th node to update the label of the i-th node;
[0175] Continue traversing the t-th graph until the labels of all nodes in the t-th graph are updated;
[0176] The nodes with the same label in the t-th graph are merged into one node to obtain a coarsened graph; wherein the label of any node in the coarsened graph is: the label of any node used to merge to obtain the corresponding node.
[0177] In another implementation manner, when the processing unit 601 is used to obtain at least one neighbor node of the i-th node from the t-th graph, it may be specifically used to:
[0178] Determine M edges connecting the i-th node in the t-th graph, and obtain a target edge weight of each of the X edges, where X is a positive integer;
[0179] According to the size relationship between the target edge weight of each edge and the first weight threshold, invalid edges are detected in the X edges; and the detected invalid edges are discarded in the X edges to obtain the remaining Y edges, Y∈[1,X];
[0180] Based on the Y edges, at least one neighbor node of the ith node is obtained from the tth graph; wherein any obtained neighbor node is: a node connected to the ith node through at least one edge among the Y edges.
[0181] In another implementation manner, when the processing unit 601 is used to obtain the target edge weight of each edge of the X edges, it can be specifically used to:
[0182] Obtaining a base edge weight of each of the X edges, wherein the base edge weight of any edge is used to indicate: a degree of association between objects represented by two nodes connected by the corresponding edge;
[0183] The reference edge weight of each edge in the X edges is normalized respectively to obtain a target edge weight of each edge in the X edges.
[0184] In another implementation manner, when the processing unit 601 is used to detect the invalid edge among the X edges according to the magnitude relationship between the target edge weight of each edge and the first weight threshold, it can be specifically used to:
[0185] If the target edge weight of the xth edge among the X edges is greater than the first weight threshold, the xth edge is determined to be a valid edge, x∈[1,X];
[0186] If the target edge weight of the xth edge among the X edges is less than or equal to the first weight threshold, a random number is generated for the xth edge, and the validity of the x edges is checked based on the size relationship between the generated random number and the second weight threshold.
[0187] In another implementation manner, when the process 601 is used to perform validity detection on the x edges according to the magnitude relationship between the generated random number and the second weight threshold, it can be specifically used to:
[0188] If the generated random number is less than the second weight threshold, determining the xth edge as a valid edge;
[0189] If the generated random number is greater than or equal to the second weight threshold, the x-th edge is determined to be an invalid edge.
[0190] In another implementation manner, when the processing unit 601 is used to perform label propagation on the i-th node using the label of the at least one neighboring node to update the label of the i-th node, it can be specifically used to:
[0191] Obtaining the number of subgraph nodes of each neighbor node in the at least one neighbor node, wherein the number of subgraph nodes of any neighbor node is determined according to the number of nodes used when the corresponding neighbor node is obtained by fusion;
[0192] Determine the label weight value of the corresponding neighbor node according to the number of subgraph nodes of each neighbor node; and aggregate the label weight values of each neighbor node with the same label to obtain the weight coefficient of the corresponding label;
[0193] A label corresponding to a maximum weight coefficient is selected from the labels of the at least one neighboring node; and the selected label is propagated to the i-th node to update the label of the i-th node.
[0194] In another implementation manner, when the processing unit 601 is used to determine the label weight value of the corresponding neighbor node according to the number of subgraph nodes of each neighbor node, it can be specifically used to:
[0195] Obtaining a reference edge weight of an edge between each neighbor node and the i-th node as a label weight measurement parameter of the corresponding neighbor node;
[0196] Determine the label weight value of the corresponding neighbor node according to the number of subgraph nodes of each neighbor node and the label weight measurement parameter of the corresponding neighbor node;
[0197] Among them, the label weight value of any neighbor node is equal to: the ratio between the label weight measurement parameter of the corresponding neighbor node and the number of subgraph nodes of the corresponding neighbor node.
[0198] In another implementation, when the processing unit 601 is used to call the graph neural network model to perform unsupervised graph representation learning on each object subgraph according to the object features of the multiple objects to obtain the node features of each node, it can be specifically used to:
[0199] According to the correspondence between nodes and objects, assigning object features of the plurality of objects to corresponding nodes in the plurality of object subgraphs;
[0200] According to the object features of each node in each object subgraph, the corresponding object subgraph is used to perform unsupervised learning on the graph neural network model;
[0201] After all object subgraphs are adopted, the learned graph neural network is called to perform graph representation processing on the object network to obtain the node features of each node in the object network.
[0202] In another implementation, when the processing unit 601 is used to perform unsupervised learning on the graph neural network model using the corresponding object subgraph according to the object features of each node in each object subgraph, it can be specifically used to:
[0203] For the rth object subgraph, perturb the rth object subgraph to obtain a perturbation graph; r is a positive integer and is less than or equal to the number of object subgraphs;
[0204] Calling a graph neural network model, performing graph representation processing on the rth object subgraph according to the object features of each node in the rth object subgraph, and obtaining the node features of each node in the rth object subgraph; and integrating the node features of each node in the rth object subgraph to obtain the global features of the rth object subgraph;
[0205] Calling the graph neural network model, and performing graph representation processing on the perturbation graph according to the object features of each node in the perturbation graph to obtain node features of each node in the perturbation graph;
[0206] Determine a model loss value of the graph neural network model according to the global features, the node features of each node in the r-th object subgraph, and the node features of each node in the perturbation graph;
[0207] Optimize the model parameters of the graph neural network model in the direction of reducing the model loss value.
[0208] In another implementation, when the processing unit 601 is used to perform unsupervised learning on the graph neural network model using the corresponding object subgraph according to the object features in each node in each object subgraph, it can be specifically used to:
[0209] For the rth object subgraph, Q nodes are selected in the rth object subgraph; and object features in the selected Q nodes are masked in the rth object subgraph to obtain a mask graph; r is a positive integer and is less than or equal to the number of object subgraphs, and Q is a positive integer;
[0210] Calling the encoder in the graph neural network model, reconstructing the features of the Q nodes in the mask graph to obtain a reconstructed graph; the feature of any node in the reconstructed graph is the object feature in the corresponding node, or the reconstructed feature obtained by reconstructing the features of the corresponding node;
[0211] Calling the decoder of the graph neural network model, performing graph representation processing on the reconstructed graph according to the features of each node in the reconstructed graph, and obtaining node features of each node in the reconstructed graph;
[0212] Determine a model loss value of the graph neural network model according to a node feature of each of the Q nodes included in the reconstructed graph and a similarity between an object feature in a corresponding node;
[0213] Optimize the model parameters of the graph neural network model in the direction of reducing the model loss value.
[0214] In another implementation manner, the classification unit 601, when used to classify the objects represented by the corresponding nodes according to the node features of each node to obtain the category information of each object, can be specifically used to:
[0215] Integrate the node feature of each node and the object feature of the corresponding node to obtain the integrated feature of each node;
[0216] The classification model is called to classify the objects represented by the corresponding nodes according to the integrated features of each node, so as to obtain the category information of each object.
[0217] In another implementation manner, when the processing unit 601 is used to call the classification model to classify the objects represented by the corresponding nodes according to the integrated features of each node to obtain the category information of each object, it can be specifically used to:
[0218] Calling the classification model to predict the probability that the object represented by the corresponding node belongs to the first category of objects according to the integrated features of each node, and obtaining the probability value of each object;
[0219] In descending order of probability values, select first L objects from the multiple objects according to the probability value of each object, where L is a positive integer;
[0220] Setting the category information of each object in the L objects as first category information, and setting the category information of each object in the plurality of objects except the L objects as second category information;
[0221] The first category information refers to category information used to indicate the first category of objects, the second category information refers to category information used to indicate the second category of objects, and the second category of objects refers to objects other than the first category of objects.
[0222] According to another embodiment of the present application, Figure 6The various units in the object classification device shown can be separately or completely combined into one or several other units to constitute, or one (some) of the units can also be split into multiple smaller units in function to constitute, which can achieve the same operation without affecting the realization of the technical effects of the embodiments of the present application. The above-mentioned units are divided based on logical functions. In practical applications, the function of one unit can also be implemented by multiple units, or the functions of multiple units can be implemented by one unit. In other embodiments of the present application, other units can also be included based on the object classification device. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.
[0223] According to another embodiment of the present application, the program can be executed by running on a general computing device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 or Figure 4 A computer program (including one or more instructions) for each step involved in the corresponding method shown in , to construct Figure 6 The object classification device shown in the embodiment of the present application is used to implement the object classification method of the present application. The computer program can be recorded on a computer-readable storage medium, for example, and loaded into the above-mentioned computing device through the computer-readable storage medium and run therein.
[0224] The embodiment of the present application can obtain the object features of multiple objects, and can also obtain an object network constructed based on multiple objects, the object network includes multiple nodes and multiple edges, one node represents one object, and the nodes corresponding to two objects with an association relationship are connected by at least one edge. After obtaining the object network, the object network can be segmented to obtain multiple object subgraphs, thereby calling the graph neural network model to perform unsupervised graph representation learning on each object subgraph according to the object features of multiple objects, and obtain the node features of each node, so that the node features of each node express the network features of the corresponding object (such as the topological structure of the object network, the association relationship between the corresponding object and other objects, etc.), and can also express the object features of the corresponding object, so that when the corresponding object is classified based on the node features of each node, not only the object features of the corresponding object can be applied, but also the association relationship between the corresponding object and other objects can be applied. By classifying according to multiple features of the object, the accuracy of the object classification result (i.e., the category information obtained by classification) can be improved. Moreover, the node features of each node are obtained through unsupervised graph representation learning, so that the generation of node features does not need to rely on the label information of the object, which can avoid the node features being affected by inaccurate label information, and can effectively improve the accuracy of node features, thereby further improving the accuracy of object classification results. In addition, the embodiment of the present application divides the entire object network into multiple object subgraphs through graph segmentation to perform unsupervised graph representation learning, which can not only improve the efficiency of node feature generation, thereby improving the efficiency of object classification, but also avoid the problem that graph representation learning cannot handle large-scale networks, thereby improving the success rate of object classification.
[0225] Based on the description of the above method embodiment and device embodiment, the present application embodiment also provides a computer device. Figure 7 , the computer device at least includes a processor 701, an input interface 702, an output interface 703 and a computer storage medium 704. Among them, the processor 701, the input interface 702, the output interface 703 and the computer storage medium 704 in the computer device can be connected via a bus or other means. The computer storage medium 704 can be stored in the memory of the computer device, the computer storage medium 704 is used to store a computer program, the computer program includes one or more instructions, and the processor 701 is used to execute one or more instructions in the computer program stored in the computer storage medium 704. The processor 701 (or CPU (Central Processing Unit)) is the computing core and control core of the computer device, which is suitable for implementing one or more instructions, specifically suitable for loading and executing one or more instructions to realize the corresponding method flow or corresponding function.
[0226] In one embodiment, the processor 701 described in the embodiment of the present application can be used to perform a series of object classification processes, specifically including: obtaining object features of multiple objects, and obtaining an object network constructed based on the multiple objects; wherein the object network includes multiple nodes and multiple edges; a node represents an object, and the nodes corresponding to two objects with an association relationship are connected by at least one edge; performing graph segmentation processing on the object network to obtain multiple object subgraphs, each object subgraph including at least one node; calling a graph neural network model to perform unsupervised graph representation learning on each object subgraph according to the object features of the multiple objects to obtain node features of each node; classifying the objects represented by the corresponding nodes according to the node features of each node to obtain category information of each object, and so on.
[0227] The embodiment of the present application also provides a computer storage medium (Memory), which is a memory device in a computer device for storing computer programs and data. It is understandable that the computer storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer storage medium provides a storage space, which stores the operating system of the computer device. In addition, a computer program is also stored in the storage space, which includes one or more instructions suitable for being loaded and executed by the processor 701, and these instructions can be one or more program codes. It should be noted that the computer storage medium here can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage; optionally, it can also be at least one computer storage medium located away from the aforementioned processor.
[0228] In one embodiment, the processor may load and execute one or more instructions stored in the computer storage medium to implement the above-mentioned Figure 2 or Figure 4 Corresponding steps in the method embodiment shown; in a specific implementation, one or more instructions in the computer storage medium can be loaded by the processor and execute the following steps:
[0229] Obtaining object features of a plurality of objects, and obtaining an object network constructed based on the plurality of objects; wherein the object network includes a plurality of nodes and a plurality of edges; a node represents an object, and nodes corresponding to two objects having an association relationship are connected by at least one edge;
[0230] Performing graph segmentation processing on the object network to obtain a plurality of object subgraphs, each of which includes at least one node;
[0231] Calling the graph neural network model to perform unsupervised graph representation learning on each object subgraph according to the object features of the multiple objects to obtain node features of each node;
[0232] According to the node features of each node, the objects represented by the corresponding nodes are classified to obtain category information of each object.
[0233] In one implementation, when the object network is segmented to obtain a plurality of object subgraphs, the one or more instructions may be loaded and specifically executed by the processor:
[0234] Initializing a label for each node in the object network, where different nodes have different labels;
[0235] Iteratively performing multiple rounds of graph coarsening processing based on label propagation on the object network to obtain a target graph, wherein a node in the target graph corresponds to at least one node in the object network; the graph coarsening processing based on label propagation includes: after performing label propagation on each node in the graph, merging each node with the same label into one node;
[0236] The object network is segmented according to the target graph to obtain a plurality of object subgraphs; wherein each node in the same object subgraph corresponds to the same node in the target graph.
[0237] In another implementation, when the object network is iteratively subjected to multiple rounds of graph coarsening processing based on label propagation to obtain a target graph, the one or more instructions may be loaded and specifically executed by the processor:
[0238] The graph required to be coarsened in the tth round is obtained as the tth graph, where t is a positive integer; when t=1, the graph required to be coarsened in the tth round is the object network, and when t>1, the graph required to be coarsened in the tth round is the coarsened graph obtained in the t-1th round;
[0239] Traverse each node in the t-th graph in sequence and determine the i-th node currently traversed; i is a positive integer and is less than or equal to the number of nodes in the t-th graph;
[0240] Acquire at least one neighbor node of the i-th node from the t-th graph; the neighbor node of the i-th node refers to: a node in the t-th graph that is connected to the i-th node through at least one edge;
[0241] Using the label of the at least one neighboring node to perform label propagation on the i-th node to update the label of the i-th node;
[0242] Continue traversing the t-th graph until the labels of all nodes in the t-th graph are updated;
[0243] The nodes with the same label in the t-th graph are merged into one node to obtain a coarsened graph; wherein the label of any node in the coarsened graph is: the label of any node used to merge to obtain the corresponding node.
[0244] In another implementation, when obtaining at least one neighbor node of the i-th node from the t-th graph, the one or more instructions may be loaded and specifically executed by the processor:
[0245] Determine M edges connecting the i-th node in the t-th graph, and obtain a target edge weight of each of the X edges, where X is a positive integer;
[0246] According to the size relationship between the target edge weight of each edge and the first weight threshold, invalid edges are detected in the X edges; and the detected invalid edges are discarded in the X edges to obtain the remaining Y edges, Y∈[1,X];
[0247] Based on the Y edges, at least one neighbor node of the ith node is obtained from the tth graph; wherein any obtained neighbor node is: a node connected to the ith node through at least one edge among the Y edges.
[0248] In another implementation, when obtaining the target edge weight of each of the X edges, the one or more instructions may be loaded and specifically executed by the processor:
[0249] Obtaining a base edge weight of each of the X edges, wherein the base edge weight of any edge is used to indicate: a degree of association between objects represented by two nodes connected by the corresponding edge;
[0250] The reference edge weight of each edge in the X edges is normalized respectively to obtain a target edge weight of each edge in the X edges.
[0251] In another implementation, when detecting invalid edges among the X edges according to the magnitude relationship between the target edge weight of each edge and the first weight threshold, the one or more instructions may be loaded and specifically executed by the processor:
[0252] If the target edge weight of the xth edge among the X edges is greater than the first weight threshold, the xth edge is determined to be a valid edge, x∈[1,X];
[0253] If the target edge weight of the xth edge among the X edges is less than or equal to the first weight threshold, a random number is generated for the xth edge, and the validity of the x edges is checked based on the size relationship between the generated random number and the second weight threshold.
[0254] In another implementation, when the validity of the x edges is checked according to the magnitude relationship between the generated random number and the second weight threshold, the one or more instructions may be loaded and specifically executed by the processor:
[0255] If the generated random number is less than the second weight threshold, determining the xth edge as a valid edge;
[0256] If the generated random number is greater than or equal to the second weight threshold, the x-th edge is determined to be an invalid edge.
[0257] In another implementation, when the label of the at least one neighboring node is used to perform label propagation on the i-th node to update the label of the i-th node, the one or more instructions may be loaded and specifically executed by the processor:
[0258] Obtaining the number of subgraph nodes of each neighbor node in the at least one neighbor node, wherein the number of subgraph nodes of any neighbor node is determined according to the number of nodes used when the corresponding neighbor node is obtained by fusion;
[0259] Determine the label weight value of the corresponding neighbor node according to the number of subgraph nodes of each neighbor node; and aggregate the label weight values of each neighbor node with the same label to obtain the weight coefficient of the corresponding label;
[0260] A label corresponding to a maximum weight coefficient is selected from the labels of the at least one neighboring node; and the selected label is propagated to the i-th node to update the label of the i-th node.
[0261] In another implementation, when determining the label weight value of the corresponding neighbor node according to the number of subgraph nodes of each neighbor node, the one or more instructions may be loaded and specifically executed by the processor:
[0262] Obtaining a reference edge weight of an edge between each neighbor node and the i-th node as a label weight measurement parameter of the corresponding neighbor node;
[0263] Determine the label weight value of the corresponding neighbor node according to the number of subgraph nodes of each neighbor node and the label weight measurement parameter of the corresponding neighbor node;
[0264] Among them, the label weight value of any neighbor node is equal to: the ratio between the label weight measurement parameter of the corresponding neighbor node and the number of subgraph nodes of the corresponding neighbor node.
[0265] In another implementation, when calling the graph neural network model to perform unsupervised graph representation learning on each object subgraph according to the object features of the multiple objects to obtain the node features of each node, the one or more instructions may be loaded and specifically executed by the processor:
[0266] According to the correspondence between nodes and objects, assigning object features of the plurality of objects to corresponding nodes in the plurality of object subgraphs;
[0267] According to the object features of each node in each object subgraph, the corresponding object subgraph is used to perform unsupervised learning on the graph neural network model;
[0268] After all object subgraphs are adopted, the learned graph neural network is called to perform graph representation processing on the object network to obtain the node features of each node in the object network.
[0269] In another implementation, when unsupervised learning of the graph neural network model is performed using the corresponding object subgraph according to the object features of each node in each object subgraph, the one or more instructions may be loaded and specifically executed by the processor:
[0270] For the rth object subgraph, perturb the rth object subgraph to obtain a perturbation graph; r is a positive integer and is less than or equal to the number of object subgraphs;
[0271] Calling a graph neural network model, performing graph representation processing on the rth object subgraph according to the object features of each node in the rth object subgraph, and obtaining the node features of each node in the rth object subgraph; and integrating the node features of each node in the rth object subgraph to obtain the global features of the rth object subgraph;
[0272] Calling the graph neural network model, and performing graph representation processing on the perturbation graph according to the object features of each node in the perturbation graph to obtain node features of each node in the perturbation graph;
[0273] Determine a model loss value of the graph neural network model according to the global features, the node features of each node in the r-th object subgraph, and the node features of each node in the perturbation graph;
[0274] Optimize the model parameters of the graph neural network model in the direction of reducing the model loss value.
[0275] In another implementation, when unsupervised learning of the graph neural network model is performed using the corresponding object subgraph according to the object features in each node in each object subgraph, the one or more instructions may be loaded and specifically executed by the processor:
[0276] For the rth object subgraph, Q nodes are selected in the rth object subgraph; and object features in the selected Q nodes are masked in the rth object subgraph to obtain a mask graph; r is a positive integer and is less than or equal to the number of object subgraphs, and Q is a positive integer;
[0277] Calling the encoder in the graph neural network model, reconstructing the features of the Q nodes in the mask graph to obtain a reconstructed graph; the feature of any node in the reconstructed graph is the object feature in the corresponding node, or the reconstructed feature obtained by reconstructing the features of the corresponding node;
[0278] Calling the decoder of the graph neural network model, performing graph representation processing on the reconstructed graph according to the features of each node in the reconstructed graph, and obtaining node features of each node in the reconstructed graph;
[0279] Determine a model loss value of the graph neural network model according to a node feature of each of the Q nodes included in the reconstructed graph and a similarity between an object feature in a corresponding node;
[0280] Optimize the model parameters of the graph neural network model in the direction of reducing the model loss value.
[0281] In another implementation, when the objects represented by the corresponding nodes are classified according to the node features of each node to obtain the category information of each object, the one or more instructions may be loaded and specifically executed by the processor:
[0282] Integrate the node feature of each node and the object feature of the corresponding node to obtain the integrated feature of each node;
[0283] The classification model is called to classify the objects represented by the corresponding nodes according to the integrated features of each node, so as to obtain the category information of each object.
[0284] In another implementation, when the classification model is called to classify the objects represented by the corresponding nodes according to the integrated features of each node to obtain the category information of each object, the one or more instructions may be loaded and specifically executed by the processor:
[0285] Calling the classification model to predict the probability that the object represented by the corresponding node belongs to the first category of objects according to the integrated features of each node, and obtaining the probability value of each object;
[0286] In descending order of probability values, select first L objects from the multiple objects according to the probability value of each object, where L is a positive integer;
[0287] Setting the category information of each object in the L objects as first category information, and setting the category information of each object in the plurality of objects except the L objects as second category information;
[0288] The first category information refers to category information used to indicate the first category of objects, the second category information refers to category information used to indicate the second category of objects, and the second category of objects refers to objects other than the first category of objects.
[0289] The embodiment of the present application can obtain the object features of multiple objects, and can also obtain an object network constructed based on multiple objects, the object network includes multiple nodes and multiple edges, one node represents one object, and the nodes corresponding to two objects with an association relationship are connected by at least one edge. After obtaining the object network, the object network can be segmented to obtain multiple object subgraphs, thereby calling the graph neural network model to perform unsupervised graph representation learning on each object subgraph according to the object features of multiple objects, and obtain the node features of each node, so that the node features of each node express the network features of the corresponding object (such as the topological structure of the object network, the association relationship between the corresponding object and other objects, etc.), and can also express the object features of the corresponding object, so that when the corresponding object is classified based on the node features of each node, not only the object features of the corresponding object can be applied, but also the association relationship between the corresponding object and other objects can be applied. By classifying according to multiple features of the object, the accuracy of the object classification result (i.e., the category information obtained by classification) can be improved. Moreover, the node features of each node are obtained through unsupervised graph representation learning, so that the generation of node features does not need to rely on the label information of the object, which can avoid the node features being affected by inaccurate label information, and can effectively improve the accuracy of node features, thereby further improving the accuracy of object classification results. In addition, the embodiment of the present application divides the entire object network into multiple object subgraphs through graph segmentation to perform unsupervised graph representation learning, which can not only improve the efficiency of node feature generation, thereby improving the efficiency of object classification, but also avoid the problem that graph representation learning cannot handle large-scale networks, thereby improving the success rate of object classification.
[0290] It should be noted that according to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program includes one or more instructions, and the one or more instructions are stored in a computer storage medium. The processor of the computer device reads the one or more instructions from the computer storage medium, and the processor executes the one or more instructions, so that the computer device performs the above Figure 2 or Figure 4It should be understood that the above disclosure is only the preferred embodiment of the present application, and certainly cannot be used to limit the scope of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope of the present application.
Claims
1. A method for object classification, characterized in that: include: Obtaining object features of a plurality of objects, and obtaining an object network constructed based on the plurality of objects; wherein the object network includes a plurality of nodes and a plurality of edges; a node represents an object, and nodes corresponding to two objects having an association relationship are connected by at least one edge; Performing graph segmentation processing on the object network to obtain a plurality of object subgraphs, each of which includes at least one node; Calling the graph neural network model to perform unsupervised graph representation learning on each object subgraph according to the object features of the multiple objects to obtain node features of each node; According to the node features of each node, the objects represented by the corresponding nodes are classified to obtain category information of each object.
2. The method according to claim 1, characterized in that The object network is subjected to graph segmentation processing to obtain a plurality of object subgraphs, including: Initializing a label for each node in the object network, where different nodes have different labels; Iteratively performing multiple rounds of graph coarsening processing based on label propagation on the object network to obtain a target graph, wherein a node in the target graph corresponds to at least one node in the object network; the graph coarsening processing based on label propagation includes: after performing label propagation on each node in the graph, merging each node with the same label into one node; The object network is segmented according to the target graph to obtain a plurality of object subgraphs; wherein each node in the same object subgraph corresponds to the same node in the target graph.
3. The method according to claim 2, characterized in that The iteratively performing multiple rounds of graph coarsening processing based on label propagation on the object network to obtain a target graph includes: The graph required to be coarsened in the tth round is obtained as the tth graph, where t is a positive integer; when t=1, the graph required to be coarsened in the tth round is the object network, and when t>1, the graph required to be coarsened in the tth round is the coarsened graph obtained in the t-1th round; Traverse each node in the t-th graph in sequence and determine the i-th node currently traversed; i is a positive integer and is less than or equal to the number of nodes in the t-th graph; Acquire at least one neighbor node of the i-th node from the t-th graph; the neighbor node of the i-th node refers to: a node in the t-th graph that is connected to the i-th node through at least one edge; Using the label of the at least one neighboring node to perform label propagation on the i-th node to update the label of the i-th node; Continue traversing the t-th graph until the labels of all nodes in the t-th graph are updated; The nodes with the same label in the t-th graph are merged into one node to obtain a coarsened graph; wherein the label of any node in the coarsened graph is: the label of any node used to merge to obtain the corresponding node.
4. The method according to claim 3, characterized in that The acquiring at least one neighbor node of the i-th node from the t-th graph comprises: Determine M edges connecting the i-th node in the t-th graph, and obtain a target edge weight of each of the X edges, where X is a positive integer; According to the size relationship between the target edge weight of each edge and the first weight threshold, invalid edges are detected in the X edges; and the detected invalid edges are discarded in the X edges to obtain the remaining Y edges, Y∈[1,X]; Based on the Y edges, at least one neighbor node of the ith node is obtained from the tth graph; wherein any obtained neighbor node is: a node connected to the ith node through at least one edge of the Y edges.
5. The method according to claim 4, characterized in that The obtaining of the target edge weight of each edge of the X edges comprises: Obtaining a base edge weight of each of the X edges, wherein the base edge weight of any edge is used to indicate: a degree of association between objects represented by two nodes connected by the corresponding edge; The reference edge weight of each edge in the X edges is normalized respectively to obtain a target edge weight of each edge in the X edges.
6. The method according to claim 4, characterized in that The detecting an invalid edge among the X edges according to the magnitude relationship between the target edge weight of each edge and the first weight threshold comprises: If the target edge weight of the xth edge among the X edges is greater than the first weight threshold, the xth edge is determined to be a valid edge, x∈[1,X]; If the target edge weight of the xth edge among the X edges is less than or equal to the first weight threshold, a random number is generated for the xth edge, and the validity of the x edges is checked based on the size relationship between the generated random number and the second weight threshold.
7. The method according to claim 6, characterized in that The performing validity detection on the x edges according to the magnitude relationship between the generated random number and the second weight threshold comprises: If the generated random number is less than the second weight threshold, determining the xth edge as a valid edge; If the generated random number is greater than or equal to the second weight threshold, the x-th edge is determined to be an invalid edge.
8. The method according to claim 3, characterized in that The using the label of the at least one neighboring node to perform label propagation on the i-th node to update the label of the i-th node includes: Obtaining the number of subgraph nodes of each neighbor node in the at least one neighbor node, wherein the number of subgraph nodes of any neighbor node is determined according to the number of nodes used when the corresponding neighbor node is obtained by fusion; Determine the label weight value of the corresponding neighbor node according to the number of subgraph nodes of each neighbor node; and aggregate the label weight values of each neighbor node with the same label to obtain the weight coefficient of the corresponding label; A label corresponding to a maximum weight coefficient is selected from the labels of the at least one neighboring node; and the selected label is propagated to the i-th node to update the label of the i-th node.
9. The method according to claim 8, characterized in that The determining the label weight value of the corresponding neighbor node according to the number of subgraph nodes of each neighbor node respectively includes: Obtaining a reference edge weight of an edge between each neighbor node and the i-th node as a label weight measurement parameter of the corresponding neighbor node; Determine the label weight value of the corresponding neighbor node according to the number of subgraph nodes of each neighbor node and the label weight measurement parameter of the corresponding neighbor node; Among them, the label weight value of any neighbor node is equal to: the ratio between the label weight measurement parameter of the corresponding neighbor node and the number of subgraph nodes of the corresponding neighbor node.
10. The method according to claim 1, characterized in that The call graph neural network model performs unsupervised graph representation learning on each object subgraph according to the object features of the multiple objects to obtain node features of each node, including: According to the correspondence between nodes and objects, assigning object features of the plurality of objects to corresponding nodes in the plurality of object subgraphs; According to the object features of each node in each object subgraph, the corresponding object subgraph is used to perform unsupervised learning on the graph neural network model; After all object subgraphs are adopted, the learned graph neural network is called to perform graph representation processing on the object network to obtain the node features of each node in the object network.
11. The method according to claim 10, characterized in that The method of performing unsupervised learning on the graph neural network model using the corresponding object subgraph according to the object features of each node in each object subgraph includes: For the rth object subgraph, perturb the rth object subgraph to obtain a perturbation graph; r is a positive integer and is less than or equal to the number of object subgraphs; Calling a graph neural network model, performing graph representation processing on the rth object subgraph according to the object features of each node in the rth object subgraph, and obtaining the node features of each node in the rth object subgraph; and integrating the node features of each node in the rth object subgraph to obtain the global features of the rth object subgraph; Calling the graph neural network model, and performing graph representation processing on the perturbation graph according to the object features of each node in the perturbation graph to obtain node features of each node in the perturbation graph; Determine a model loss value of the graph neural network model according to the global features, the node features of each node in the r-th object subgraph, and the node features of each node in the perturbation graph; Optimize the model parameters of the graph neural network model in the direction of reducing the model loss value.
12. The method according to claim 10, characterized in that The method of performing unsupervised learning on the graph neural network model using the corresponding object subgraph according to the object features in each node in each object subgraph includes: For the rth object subgraph, Q nodes are selected in the rth object subgraph; and object features in the selected Q nodes are masked in the rth object subgraph to obtain a mask graph; r is a positive integer and is less than or equal to the number of object subgraphs, and Q is a positive integer; Calling the encoder in the graph neural network model, reconstructing the features of the Q nodes in the mask graph to obtain a reconstructed graph; the feature of any node in the reconstructed graph is the object feature of the corresponding node, or the reconstructed feature obtained by reconstructing the features of the corresponding node; Calling the decoder of the graph neural network model, performing graph representation processing on the reconstructed graph according to the features of each node in the reconstructed graph, and obtaining node features of each node in the reconstructed graph; Determine a model loss value of the graph neural network model according to a node feature of each of the Q nodes included in the reconstructed graph and a similarity between an object feature in a corresponding node; Optimize the model parameters of the graph neural network model in the direction of reducing the model loss value.
13. The method according to claim 1, characterized in that The classifying process is performed on the objects represented by the corresponding nodes according to the node features of each node to obtain the category information of each object, including: Integrate the node feature of each node and the object feature of the corresponding node to obtain the integrated feature of each node; The classification model is called to classify the objects represented by the corresponding nodes according to the integrated features of each node, so as to obtain the category information of each object.
14. The method according to claim 13, characterized in that The calling classification model classifies the objects represented by the corresponding nodes according to the integrated features of each node to obtain category information of each object, including: Calling the classification model to predict the probability that the object represented by the corresponding node belongs to the first category of objects according to the integrated features of each node, and obtaining the probability value of each object; In descending order of probability values, select first L objects from the multiple objects according to the probability value of each object, where L is a positive integer; Setting the category information of each object in the L objects as first category information, and setting the category information of each object in the plurality of objects except the L objects as second category information; The first category information refers to category information used to indicate the first category of objects, the second category information refers to category information used to indicate the second category of objects, and the second category of objects refers to objects other than the first category of objects.
15. The method according to claim 14, characterized in that Any object is a user, and the first type of object refers to: users whose ages are within a first age range; The association relationship between objects includes at least one of the following: an interactive relationship between users, and a friend relationship between users.
16. An object classification device, characterized in that: include: A processing unit, configured to obtain object features of a plurality of objects, and obtain an object network constructed based on the plurality of objects; wherein the object network includes a plurality of nodes and a plurality of edges; a node represents an object, and nodes corresponding to two objects having an association relationship are connected by at least one edge; The processing unit is further used to perform graph segmentation processing on the object network to obtain multiple object subgraphs, each of which includes at least one node; The processing unit is further used to call the graph neural network model to perform unsupervised graph representation learning on each object subgraph according to the object features of the multiple objects, so as to obtain the node features of each node; The classification unit is used to classify the objects represented by the corresponding nodes according to the node features of each node, so as to obtain the category information of each object.
17. A computer device comprising an input interface and an output interface, characterized in that: Also includes: processor and computer storage media; The processor is suitable for implementing one or more instructions, the computer storage medium stores one or more instructions, and the one or more instructions are suitable for being loaded by the processor and executing the object classification method as described in any one of claims 1-15.
18. A computer storage medium, characterized in that: The computer storage medium stores one or more instructions, and the one or more instructions are suitable for being loaded by a processor and executing the object classification method according to any one of claims 1-15.
Citation Information
Cited By
Unsupervised graph anomaly detection method and device, equipment and storage medium
CN121920454A
Unsupervised graph anomaly detection method, device and equipment and storage medium
CN121920454B