A method and system for recognizing heterogeneous graph structures in public safety scenarios
By constructing cognitive fusion models and spectral models to perturb and train heterogeneous graphs in public safety scenarios, the problems of network structure being susceptible to interference and differences in cognitive perspectives are solved, and more accurate risk assessment is achieved.
Patent Information
- Application Number
- CN202410968447.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-07-18
AI Technical Summary
Existing technologies are susceptible to interference in graph-based network structures in public safety scenarios, and researchers have different perspectives on data model cognition, leading to unreasonable risk assessment results.
A cognitive fusion model is constructed, which decomposes a heterogeneous graph into a neighboring subgraph. The model is trained by perturbing the subgraph with a standardized Laplacian matrix and combining it with a spectral graph model and a multilayer perceptron. This enables metacognitive control of noisy neighboring subgraphs and promotes the model's understanding of public safety scenarios.
It improves the rationality and accuracy of risk assessment in public safety scenarios and overcomes the subjective differences caused by different cognitive perspectives of researchers during the experiment.
Smart Images

Figure CN119128415B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of public safety scenario cognition, and particularly relates to a method and system for cognizing a heterogeneous graph structure in a public safety scenario. BACKGROUND
[0002] A public scenario refers to an open space or place for the public to use or participate in, and maintaining the safety of the public scenario is crucial for individuals, communities, institutions and countries. With the rapid development of technology and the improvement of living standards, complex things in public safety scenarios, such as social platforms, online payment platforms, e-commerce platforms, and transportation platforms, account for an increasingly large proportion of people's lives. These platforms provide various public services, resources and information through network technology and information dissemination, providing convenience and communication channels for people. In this process, a large amount of non-Euclidean data is generated, and traditional machine learning cannot capture the complex relationship structure. Therefore, it has become a common practice to use graph representation learning knowledge to represent entities in the scene as nodes and the relationship between entities as edges, and store them in the form of a network structure containing a large amount of information for understanding and analysis. There have been very successful breakthroughs and applications in fields such as social media, bioinformatics and recommendation systems. For example, in social networks, users, comments, blog posts and other things can be nodes of a graph structure, and there are various relationships between different types of nodes. Analyzing the implicit relationships can help avoid risks and prevent incidents from harming the public. Non-Euclidean data refers to data that does not follow the traditional Euclidean space geometric rules.
[0003] Existing graph-based network structures include homogeneous information networks and heterogeneous information networks, which have been widely used by governments, companies and other social institutions in practical work. However, a large number of studies have shown that these network structures are easily disturbed, and even minor disturbances can have a profound impact on models and downstream tasks, which poses a threat to maintaining public order. Compared to homogeneous graphs, heterogeneous graphs contain multiple types of nodes and edges, and are more susceptible to interference. This interference can be divided into antagonistic and non-antagonistic in nature, the former being a unique threat in public safety scenarios and being more subjective, and the latter being objectively existing. Therefore, from the perspective of the state or company, not only do we need advanced models to capture the complex relationships in real society, but we also need models to understand the risks involved.
[0004] In addition, current scientific research experiments mostly assume that the data model is in a safe scene, and lack in-depth research on the data model itself. When dealing with specific tasks, there is a problem of cognitive confusion. For example, in the face of a large amount of complex data structure, different choices of data sets, data preprocessing methods, models, etc. may lead to similar research results that cannot be compared horizontally. The most fundamental reason is that researchers have different cognitive angles on the data model during the experiment. SUMMARY
[0005] In view of this, the embodiments of the present application provide a method and system for recognizing heterogeneous graph structure in a public safety scene to eliminate or improve one or more defects existing in the prior art.
[0006] One aspect of the present application provides a method for recognizing heterogeneous graph structure in a public safety scene, the method comprising the steps of: obtaining a cognitive fusion model pre-built for a public safety scene, the cognitive fusion model containing a heterogeneous graph pre-built for things and relationships between things contained in the public safety scene; constructing a meta-path based on semantic information and topological information contained in the heterogeneous graph, decomposing the heterogeneous graph into a plurality of neighbor subgraphs; using a standardized Laplacian matrix to flip a preset number of selected meta-paths, thereby realizing disturbance of the neighbor subgraphs, and obtaining a plurality of neighbor subgraphs with noise; using a spectral graph model contained in the cognitive fusion model to perform meta-cognitive control on the neighbor subgraphs with noise in a node prediction task, using a multilayer perceptron to train the cognitive fusion model in the node prediction task, and using the trained cognitive fusion model for risk assessment in the public safety scene.
[0007] In some embodiments of the present application, the heterogeneous graph takes things in the public safety scene as nodes and relationships between things as edges, and stores safety-related information in the public safety scene into the heterogeneous graph; the spectral graph model contained in the cognitive fusion model belongs to a machine learning model, and downstream task decisions are made through the trained spectral graph model.
[0008] In some embodiments of the present application, the step of constructing a meta-path based on semantic information and topological information contained in the heterogeneous graph and decomposing the heterogeneous graph into a plurality of neighbor subgraphs comprises: decomposing a plurality of meta-paths from the heterogeneous graph based on semantic information and topological information contained in the heterogeneous graph, and decomposing the heterogeneous graph into a plurality of neighbor subgraphs through the adjacency relationship between the meta-paths and the nodes.
[0009] In some embodiments of the present application, the step of flipping the selected preset number of meta-paths using the normalized Laplacian matrix comprises: converting the disturbance of the neighbor subgraph into a linear transformation of the graph using the normalized Laplacian matrix, and flipping the selected preset number of meta-paths; the flipping step comprises adding or deleting edges in the neighbor subgraph within a given budget range.
[0010] In some embodiments of the present application, in the process of flipping each meta-path, the following steps are included: calculating the generalized eigenvector of the neighbor subgraph; retaining at least one random edge for each node of the neighbor subgraph to prevent the existence of isolated nodes, and the remaining edges form a candidate edge set; randomly sampling in the candidate edge set to select a candidate edge; and selecting the top preset number of meta-paths based on the selected candidate edge by calculating the complexity, thereby realizing the disturbance of the neighbor subgraph.
[0011] In some embodiments of the present application, the spectral graph model comprises an attention mechanism layer and a multi-layer perceptron, the attention mechanism layer comprises a misled node-level attention mechanism and a misled semantic attention mechanism; and the step of using the spectral graph model contained in the cognitive fusion model to perform meta-cognitive control on the noisy neighbor subgraph in the node prediction task further comprises: adjusting the weight parameters of different meta-paths using the attention mechanism layer, performing fusion semantic embedding based on the weight parameters of the different meta-paths to obtain the embedding representation of the noisy neighbor subgraph, so that the multi-layer perceptron trains the cognitive fusion model based on the embedding representation of the noisy neighbor subgraph in the node prediction task.
[0012] In some embodiments of the present application, the method further comprises: using the meta-path to read data to build a public safety event quality dataset, the public safety event quality dataset contains the number of nodes, edges, relationships, and feature values, as well as the number of training sets, validation sets, and test sets, and lists the selected meta-paths, and the cognitive fusion model combines the public safety event quality dataset to cognize the semantic changes of non-Euclidean data in the public safety scenario.
[0013] Another aspect of the present application provides a system for cognizing heterogeneous graph structures in a public safety scenario, which comprises a processor, a memory, and a computer program / instruction stored on the memory, the processor being configured to execute the computer program / instruction, and the system implementing the steps of the method according to any one of the above embodiments when the computer program / instruction is executed.
[0014] Another aspect of the present application provides a computer-readable storage medium having a computer program / instruction stored thereon, the computer program / instruction being executed by a processor to implement the steps of the method according to any one of the above embodiments.
[0015] Another aspect of the present application provides a computer program product comprising computer programs / instructions which, when executed by a processor, implement the steps of the method according to any of the above embodiments.
[0016] The method and system for recognizing heterogeneous graph structure in a public safety scenario provided by the present application proposes a method for attacking heterogeneous graph structure, which regards the structural change of the graph as describing a certain motion state, and in the case of keeping the data features basically unchanged, it can specifically disturb the different semantics of the heterogeneous information network, and at the same time, based on the machine learning model contained in the cognitive fusion model, the neighbor subgraph with noise is learned and trained, and in the learning process, the understanding degree of the cognitive fusion model to the public safety scenario is promoted, and the trained cognitive fusion model can perform risk assessment on the public safety scenario in the node prediction task. The method proposed in the present application overcomes the subjective differences of researchers in the experimental process due to different cognitive angles, triggers from the perspective of heterogeneous graph, so that the risk assessment result of the cognitive fusion model is more reasonable.
[0017] Additional advantages, objects, and features of the application will be set forth in part by the description that follows, and will become apparent to those skilled in the art upon examination of the following detailed description and drawings in which:
[0018] Those skilled in the art will appreciate that the objects and advantages of the application can be implemented without regard to the specific details of the following description and that the application can be implemented in various ways, as will be apparent to persons skilled in the art from the following detailed description. BRIEF DESCRIPTION OF DRAWINGS
[0019] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate the present application and, together with the description, further serve to explain the principles of the application and to enable a person skilled in the relevant art(s) to make and use the application.
[0020] Figure 1 Flow chart of the method for recognizing heterogeneous graph structure in a public safety scenario according to an embodiment of the present application.
[0021] Figure 2 Schematic diagram of the heterogeneous graph recognition method with decision maker as the cognitive perspective according to an embodiment of the present application.
[0022] Figure 3 Schematic diagram of the process for promoting cognitive heterogeneous graph structure in a public safety scenario according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to make the objects, technical solutions and advantages of the present application clearer, further detailed description will be made to the present application in combination with embodiments and drawings. Herein, the illustrative embodiments of the present application and their descriptions are used to explain the present application, but not as a limitation to the present application.
[0024] Herein, it is also needed to be explained that, in order to avoid the present application being obscured by unnecessary details, only the structures and / or processing steps closely related to the solutions according to the present application are shown in the drawings, and other details not closely related to the present application are omitted.
[0025] It should be emphasized that the term "comprise / comprising" as used herein is used to indicate the presence of a feature, element, step or component but does not exclude the presence or addition of one or more other features, elements, steps or components.
[0026] Herein, it is also needed to be explained that, if not specially stated, the term "connection" as used herein can not only mean direct connection, but also indirect connection with intermediate objects.
[0027] Hereinafter, embodiments of the present application will be described with reference to the accompanying drawings. In the drawings, the same reference numerals represent the same or similar components, or the same or similar steps.
[0028] The problems existing in the prior art proposed in the background section are fundamentally caused by the differences in the cognitive angle of researchers to data models during experiments. In order to overcome the problems existing in the prior art, the present application studies how graphs are applied to the real world from the perspective of applying heterogeneous graphs (i.e. from the perspective of decision makers), so as to be more reasonable in different scenarios when dealing with specific tasks.
[0029] The present application constructs a cognitive fusion model for cognitive public safety scenarios, which regards the complex relationships in the scenarios as heterogeneous graph structures, and strives to mine the relationships between data from the perspective of decision makers. In the cognitive learning process, strategies such as adversarial attack are used to promote the understanding degree of the model to cognition. Graph algorithms are used as tools to construct the cognitive fusion model, and how to cognize the relationships constituted by various things in the graph is discussed in detail in the cognitive fusion model. Through the downstream tasks of graph learning, the risks in the public safety environment are cognized, the complex associations in the graph are comprehensively understood and captured, more accurate and in-depth information is provided for public safety decision-making, and the decision maker is assisted to make decisions. Among them, the public safety scenario refers to a place or environment that involves public interests and public safety, and is commonly used by multiple users. It can be a real place or a virtual network space. For example, the public scenario can be a social platform, an online payment platform, an e-commerce platform, a traffic travel platform, etc.
[0030] Other basic concepts are summarized as follows:
[0031] (1) Meta-cognition monitoring: During the cognitive process, the agent perceives and evaluates its cognitive state, learning progress and task completion.
[0032] (2) Meta-cognition control: The agent improves the learning and cognitive effect by selecting appropriate learning strategies and adjusting attention.
[0033] (3) Cognitive environment / cognitive state: The cognitive environment refers to the external system or actual situation in which the agent interacts. The learning state set of the agent in the process of cognitive learning is called cognitive state, which can be discrete or continuous.
[0034] (4) Learning strategy: Learning strategy is a method, skill or behavior consciously selected and used by the agent in the process of cognitive learning, aiming to promote effective learning and knowledge acquisition. In the scheme proposed in the present application, in order to recognize things in the public safety scene, two main learning strategies are given here, mainly referring to the spectrum model based on double attention mechanism.
[0035] Figure 1 The method flowchart for recognizing heterogeneous graph structure in public safety scene in an embodiment of the present application comprises the following steps:
[0036] Step S110: Obtain the cognitive fusion model pre-built for the public safety scene, which contains the heterogeneous graph pre-built for the things and the relationship between the things in the public safety scene.
[0037] In the specific implementation process, the heterogeneous graph takes the things in the public safety scene as nodes and the relationship between the things as edges, and stores the safety related information in the public safety scene into the heterogeneous graph. Moreover, the spectrum model contained in the cognitive fusion model belongs to a machine learning model, and the downstream task decision is made through the trained spectrum model. The cognitive fusion model (agent) refers to a conceptual model that describes and explains the thinking process and structure of human or other intelligent agents when processing information, understanding and recognizing the world, which is generally composed of multiple algorithms and multiple machine learning models.
[0038] Step S120: Based on the semantic information and topological information contained in the heterogeneous graph, the meta-path is constructed, and the heterogeneous graph is decomposed into multiple neighbor subgraphs.
[0039] In the specific implementation process, the step of constructing meta-path based on the semantic information and topological information contained in the heterogeneous graph and decomposing the heterogeneous graph into multiple neighbor subgraphs in step S120 comprises: based on the semantic information and topological information contained in the heterogeneous graph, a plurality of meta-paths are obtained by decomposing the heterogeneous graph, and the heterogeneous graph is decomposed into a plurality of neighbor subgraphs through the adjacency relationship between the meta-paths and the nodes.
[0040] Step S130: flipping the selected preset number of meta-paths by using the normalized Laplacian matrix to realize the disturbance of the neighbor subgraph, and obtaining a plurality of noisy neighbor subgraphs.
[0041] In the implementation process, the step of flipping the selected preset number of meta-paths by using the normalized Laplacian matrix in step S130 includes: (1) converting the disturbance of the neighbor subgraph into a linear transformation of the graph by using the normalized Laplacian matrix, and flipping the selected preset number of meta-paths; (2) the flipping step includes adding or deleting edges in the neighbor subgraph within a given budget range.
[0042] Step S140: performing meta-cognitive control on the noisy neighbor subgraph in the node prediction task by using the spectral graph model contained in the cognitive fusion model, training the cognitive fusion model in the node prediction task by using a multilayer perceptron, and using the trained cognitive fusion model for risk assessment in the public security scenario.
[0043] The method for cognitively recognizing a heterogeneous graph structure in a public security scenario provided in the application regards the structural change of the graph as a description of a certain motion state, and in the case of keeping the data features basically unchanged, the different semantics of the heterogeneous information network are disturbed in a targeted manner. Meanwhile, the noisy neighbor subgraph is learned and trained based on the machine learning model contained in the cognitive fusion model, the understanding degree of the cognitive fusion model for the public security scenario is promoted in the learning process, and the trained cognitive fusion model can perform risk assessment on the public security scenario in the node prediction task. The method provided in the application overcomes the subjective differences in the data model caused by different cognitive angles of the researchers in the experiment process, triggers from the perspective of the heterogeneous graph, and makes the risk assessment result of the cognitive fusion model more reasonable.
[0044] In some embodiments of the application, in the process of flipping each meta-path, the following steps are included: (1) calculating the generalized eigenvector of the neighbor subgraph; (2) reserving at least one random edge for each node of the neighbor subgraph to prevent the existence of isolated points, and the remaining edges form a candidate edge set; (3) randomly sampling in the candidate edge set to select a candidate edge; (4) selecting the preset number of meta-paths located at the top on the basis of the selected candidate edge by calculating the complexity, and flipping the meta-paths to realize the disturbance of the neighbor subgraph.
[0045] In some embodiments of the present application, the spectral graph model comprises an attention mechanism layer and a multi-layer perceptron, the attention mechanism layer comprises a misled node-level attention mechanism and a misled semantic attention mechanism. Further, the step of using the spectral graph model contained in the cognitive fusion model to perform meta-cognitive control on the noisy neighbor subgraph in the node prediction task further comprises: (1) adjusting the weight parameters of different meta-paths using the attention mechanism layer; (2) obtaining the embedding representation of the noisy neighbor subgraph based on the weight parameters of the different meta-paths to make the multi-layer perceptron train the cognitive fusion model based on the embedding representation of the noisy neighbor subgraph in the node prediction task.
[0046] In some embodiments of the present application, the method further comprises: using the meta-path to read data to build a public safety event quality dataset, the public safety event quality dataset comprises the number of nodes, the number of edges, the number of relationships, and the number of feature values, as well as the number of training sets, validation sets, and test sets, and lists the selected meta-paths, and the cognitive fusion model combines the public safety event quality dataset to cognize the semantic changes of non-Euclidean data in the public safety scene.
[0047] In public scenarios, management and planning often need to consider basic factors such as safety, convenience, sustainability, and public interest. However, these factors are not enough to deal with various objective interference factors in real-world working environments. In particular, in public safety scenarios, there are also malicious adversarial factors that can disrupt people's and public institutions' correct cognition, leading to serious losses.
[0048] For example, in combination with the actual situation, Figure 2 For an embodiment of the heterogeneous graph cognitive method in the decision maker's cognitive perspective of the present application, taking the quantification of the risk degree evaluation of public safety events on the Sina Weibo platform as an example, the problem to be solved is to help the decision maker (also known as an intelligent agent Agent) to cognize the risk in the public safety scene, with the decision maker as the cognitive perspective. First, some raw data is obtained from Sina Weibo to constitute the features of the heterogeneous graph, such as bloggers, micro-blog publishing time, participating topics, blog posts, publishing platforms, forwarding times, publishing locations, likes, and comments, etc. Then, based on the results of prior knowledge or simple machine learning model operations, some nodes and labels that can quantify the risk of public safety events in Sina Weibo are obtained, such as topic heat, event heat, safety events, blog post heat, and event categories, etc. In this process, in order to better mine the relationship between data, the decision maker can use some algorithms to reduce the complexity of the model, such as constructing meta-paths, studying malicious noise, and using graph representation learning models, etc. Finally, through the downstream task of graph learning, the risk in the public safety environment is cognized to assist the decision maker to make decisions.
[0049] Optionally, Meta-Path refers to a path in a complex network composed of multiple nodes and edges, which is a path based on high-order relationships between nodes. Meta-Path is a concept for heterogeneous networks, which helps to discover hidden relationships in complex networks. The method of constructing a meta-path usually includes the following steps: (1) Determine the types of nodes and edges: In a heterogeneous network, first, the different types of nodes and edges in the network need to be determined. (2) Define the meta-path pattern: Based on domain knowledge and actual needs, define one or more meta-path patterns. These patterns specify the types of nodes and edges in the meta-path and their connection order. (3) Extract meta-path instances: According to the defined meta-path pattern, extract the meta-path instances that conform to the pattern from the network. (4) Analysis and application: Analyze the extracted meta-path instances to discover hidden relationships or patterns in the network, and apply them to practical scenarios.
[0050] However, it is not enough to recognize risks in public safety by constructing a heterogeneous graph model that quantifies the risk level of public safety events. So far, researchers have created many graph-related algorithms. There are important challenges in fully utilizing and combining these knowledge to enable the model to deeply mine more complex association relationships in the graph.
[0051] Table 1: Example of Public Safety Event Quantification (PSEQ) dataset
[0052]
[0053] In some embodiments of the present application, a public safety event quality dataset specifically built for public safety cognition can be constructed, which contains data read using the meta-path method. Table 1 provides an example of a Public Safety Event Quantification (PSEQ) dataset, which includes the number of nodes, edges, relationships, feature values, and the number of training, validation, and test sets in this dataset, and also lists the selected meta-paths.
[0054] With the embodiments of the present application, the security and robustness of the agent model in public safety scenarios for various data models can be explored through experiments. At the same time, the transferability of the disturbance algorithm proposed in the present application to most spectral graph models can be expanded. This will help to deeply understand the adaptability of the agent model to different data models, and evaluate the effectiveness and transferability of the disturbance algorithm in the present application under different circumstances. At present, the heterogeneous graph dataset combined with specific downstream tasks itself is a complex data model, and there is no research in the prior art on how to construct a safe and robust data structure.
[0055] Figure 3A process diagram for promoting cognitive heterogeneous graph structure in a public safety scenario in an embodiment of the present application. Figure 3 (a) shows the steps of perturbing the meta-path-based graph structure in the decision-maker's cognitive perspective. First, the heterogeneous graph contains rich semantic information and topological information. By constructing a meta-path, the heterogeneous graph is decomposed into several neighbor subgraphs. Then, perturb the decomposed neighbor subgraphs (for example, add or delete edges), generate neighbor subgraphs with noise. In the node prediction task, using the spectral graph model (MLP), the decision-maker can achieve "meta-cognitive control" of the heterogeneous graph. Finally, the graph task is processed by a multilayer perceptron to obtain the final risk assessment result. The node prediction task refers to using existing node and edge information in the graph data structure to classify or regress the newly added nodes in the graph through machine learning algorithms. Multilayer Perceptron (MLP) is a basic feedforward artificial neural network model, which is widely used to solve classification and regression problems.
[0056] Figure 3 In the cognitive fusion model shown in the middle, the key part is to construct various things and relationships in the public safety scenario into a heterogeneous graph structure, and to promote the cognitive process of the cognitive fusion model to the public safety scenario by constructing adversarial noise (adversarial attack). Figure 3 The invention embodiment shown in the figure is based on the graph Laplace method in spectral graph theory, which converts the complex motion process in the graph structure into a linear transformation of the graph, and uses the spectrum of the Laplace matrix and related theories to disturb the graph model and its related downstream tasks, thereby realizing the transferable adversarial attack. Figure 3 (a) shows the process of trying to use various learning strategies to promote cognition in order to better learn in a public safety scenario. Specifically, in a certain public safety scenario, a heterogeneous graph data model is constructed according to the actual task, and the topological structure information and semantic information in the heterogeneous graph are stored in the form of an adjacency matrix. In this paper, by using the method of meta-path, edges in the original graph are added or deleted (referred to as flipping) within a given budget, and with the help of two attention mechanisms and a multilayer perceptron, the perception process of the model is misled, thereby accelerating the cognitive process of the agent.
[0057] Next, we discuss how to add perturbations to the neighbor subgraph, i.e., perform adversarial attacks.
[0058] Suppose there are two kinds of motion in the given heterogeneous graph G(V,E,T), namely, graph structure adversarial attack and graph embedding. To describe the motion trajectory, any two nodes (a,b) in the graph are represented as a standardized adjacency matrix:
[0059]
[0060] where L = I - D -1 / 2 WD -1 / 2 is a normalized laplace matrix, which describes the displacement or variation of motion, which can be expressed as W is a real symmetric (weight) matrix, and D is a diagonal matrix.
[0061] For any node a in different meta-paths φ i The neighbor nodes (including node a) of different categories can be solved by mapping the feature vectors of different dimensions in φ a to the same dimension, that is:
[0062]
[0063] where h a and h a ' are the feature vectors of the (target) center node a before and after conversion, and the conversion matrix is Each meta-path-based conversion matrix corresponds to a subgraph SubG i,i∈(1,n) . Then the adversarial disturbance of the given subgraph is represented as the following double optimization problem:
[0064]
[0065] where is the loss of the disturbed model, Z i is the embedding representation of the subgraph SubG i , and Z * is the optimal embedding result of the graph under the aggregation of all meta-paths; f is the entry of the original neighbor subgraph modified in the disturbance process. In this process, the embedding loss of the model is minimized as much as possible under the premise of maximizing the structure loss of the model. Due to the discrete nature of the graph structure itself, as well as the more diverse structure and semantics of the heterogeneous graph, the difficulty of the problem will increase when combined with the above double optimization problem.
[0066] The embedding process of the neighbor subgraph SubG i can be equivalent to the factorization of
[0067]
[0068] where Vol(·) is the volume of the subgraph, T represents the sampling size of the embedding model, and b is the number of negative samples. Then the embedding representation can be obtained by singular value decomposition (SVD) to represent the top-K largest singular values / vectors. However, the SVD method is difficult to compute in a graph representation learning model, such as Figure 3 (b) shows that the neighbor subgraph SubG i can be represented as an m-by-n matrix. The SVD decomposition of the matrix is an m-by-m matrix, an m-by-n matrix, and an n-by-n matrix. This calculation and storage cost are very cumbersome. On the one hand, even a very small heterogeneous graph dataset carries a very large amount of information. On the other hand, even the matrix represented by the homogeneous graph, it is difficult to use SVD for back propagation. Therefore, the idea of eigenvalue perturbation theory is used for approximation. In this case, the loss of the perturbed graph can be represented as
[0069]
[0070] where is the adjacency matrix of the perturbed graph, vol(A) = ∑ i,j A ij , S is the size of the convolution kernel, b is the number of negative samples, Δω ij = (1-2A ij ) represents edge flip, and σ is a constant.
[0071]
[0072] Algorithm 1 shows how to use the meta-path-based method to perturb the heterogeneous graph structure in the public security environment, which aims to mislead the agent from three aspects: 1) assuming that there are n meta-paths in the target heterogeneous graph, the algorithm selects the relationship of k meta-paths to perturb; 2) the perturbation budget of different meta-paths is different; 3) for the relationship of a certain meta-path, flip the edges of a node and its neighbors under the specified budget. At the beginning of the destruction, the algorithm selects k from n meta-paths, and generates a feature vector for each adjacency submatrix corresponding to each meta-path. In order to prevent the existence of isolated points in the graph, one random edge is reserved for each node to form a candidate edge set, and random sampling is performed. Finally, by calculating the complexity, the top f flip operations are selected for perturbation.
[0073] Next, meta-cognitive control based on graph learning is discussed.
[0074] In the cognitive fusion model proposed in this paper, once the cognitive progress is promoted using the attack method, the data structure constructed in the public security environment needs to be perceived and adjusted, which is called graph metacognitive control (GMC), as shown in Figure 3 (a). In this process, the metapath-based transferable flips method promotes agent cognitive errors from two aspects, which will be further elaborated in Figure 3 (c).
[0075] The double attention mechanism includes misguided node-level attention and misguided semantic attention.
[0076] (1) Misguided node-level attention: for a heterogeneous graph structure containing adversarial noise, the transition vector h i ′ of node a in different meta-paths φ a is calculated using the self-attention mechanism, and the misguided attention value between a given node pair (a, b) is:
[0077]
[0078] where att node represents the attention of the node, that is, for a node a, the weight of the neighbor node in different meta-paths φ i is shared; σ is the sigmoid activation function; is the misguided node-level attention vector; then the weight coefficients of the feature vectors of the k meta-paths involved in node a are normalized through the softmax operation:
[0079]
[0080] The final embedding of node a is calculated as:
[0081]
[0082] where m is the multi-head attention mechanism, and the size of M controls the degree of cognitive misdirection. Then for a given meta-path set {φ1, φ2, …, φ} n}, n sets of semantic-related embeddings can be obtained, that is,
[0083] (2) Misguided Semantic Attention: The embeddings of different semantics are combined by semantic-level attention. Assuming corresponding to a weight set {β1, β2, …, β n}, then the semantic-level attention neural network attsem(·) can be abstractly represented as:
[0084]
[0085] Specifically, the embedding is first converted by a fully connected layer, and the importance of each meta-path is represented by the similarity between the converted embedding and the semantic-level attention vector q. The importance calculation formula of each meta-path is as follows:
[0086]
[0087] where W is a weight matrix, b is a bias vector, q, W, and b are all learnable parameters and are shared by all meta-paths. Normalize ω φ to obtain the weight parameter calculation formula of the meta-path as follows:
[0088]
[0089] The semantic-level attention expresses the importance of a meta-path in a specific task, that is, the weight of a meta-path for different tasks can be different. Then the prediction formula for all nodes is expressed as follows:
[0090]
[0091] Finally, the final representation vector of the node is input into the graph task, and the result of the meta-cognitive control can be obtained.
[0092]
[0093] Algorithm 2 shows the process of meta-cognitive control based on a graph model, wherein a spectral graph model and a graph task can be selected according to the existing experience in meta-cognitive knowledge and in combination with a specific task. When the selected spectral graph model is a GAT model, lines 2-9 in the algorithm constitute a HAN model. The meta-cognitive knowledge refers to the basic knowledge and strategies possessed by the agent before completing the learning goal.
[0094] The above-mentioned embodiments of the application can realize more accurate heterogeneous graph structure cognition in public safety scenarios. Figure 3
[0095] Corresponding to the above method, the application also provides a system for recognizing a heterogeneous graph structure in a public safety scenario, which comprises a computer device, the computer device comprising a processor and a memory, the memory storing computer instructions, and the processor being configured to execute the computer instructions stored in the memory, and the system implements the steps of the method as described above when the computer instructions are executed by the processor.
[0096] The method and system for recognizing a heterogeneous graph structure in a public safety scenario provided by the application propose a method for attacking a heterogeneous graph structure, which regards a change in the structure of a graph as describing a certain motion state, and in the case of keeping the data features basically unchanged, the different semantics of the heterogeneous information network are disturbed in a targeted manner. Meanwhile, the neighbor subgraph with noise is trained based on the machine learning model contained in the cognitive fusion model, and the understanding of the public safety scenario by the cognitive fusion model is promoted in the learning process. The trained cognitive fusion model can perform risk assessment on the public safety scenario in a node prediction task. The method proposed in the application overcomes the subjective differences in data models caused by different cognitive angles of researchers in the experimental process, triggers from the perspective of a heterogeneous graph, and makes the risk assessment result of the cognitive fusion model more reasonable.
[0097] Specifically, the scheme proposed by the application mainly has the following key points:
[0098] (1) A method for interfering with (or attacking) a heterogeneous graph structure is proposed. This method regards a change in the structure of a graph as describing a certain motion state, and in the case of keeping the data features basically unchanged, the different semantics of the heterogeneous information network are disturbed in a targeted manner.
[0099] (2) A fusion model for recognizing a public safety scenario is constructed, which regards the complex relationships in the scenario as a heterogeneous graph structure, and uses strategies such as adversarial attack to promote the understanding of the model in the learning process.
[0100] (3) A public safety event quality data set named Public Safety Events Quality (PSEQ) is constructed to help understand the effectiveness of the proposed model. That is, the proposed fusion model can recognize the semantic changes of non-Euclidean data in a public safety scenario.
[0101] (4) In the step of recognizing risks, meta-cognition promotion, meta-path-based disturbance, and meta-cognition control based on graph learning can be used to recognize risks in the scenario.
[0102] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the aforementioned edge computing server deployment method. The computer readable storage medium can be a tangible storage medium, such as a random access memory (RAM), a memory, a read only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0103] Those of ordinary skill in the art will appreciate that the various illustrative components, systems and methods described in connection with the embodiments disclosed herein can be implemented as hardware, software, or a combination thereof. The choice of hardware or software implementation is a matter of design choice and will depend on the particular application and constraints of the design. Those of ordinary skill in the art can implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application. When implemented in hardware, the hardware can comprise, for example, an electronic circuit, an application specific integrated circuit (ASIC), a suitably programmed firmware, a plug-in card, a function card, etc. When implemented in software, the elements of the application are the program or code segments to perform the necessary tasks. The program or code segments can be stored in a machine readable medium, or transmitted by carrier waves over a transmission medium or communication link, either optically, acoustically, or electrically.
[0104] It is to be understood that the application is not limited to the particular configurations and processes described herein and shown in the drawings, which are provided by way of example only. Detailed descriptions of known methods are omitted so as not to obscure the description of the present application. In the above embodiments, several specific steps are described and illustrated in order to provide a thorough understanding of the present application. However, the process of the present application is not limited to the specific steps described and illustrated, and the order of the steps can be changed, or other steps can be added, or some steps can be omitted, without departing from the spirit of the present application.
[0105] In the present application, features described and / or illustrated in relation to one embodiment can be used in the same or a similar way in one or more other embodiments, and / or combined with or instead of features on other embodiments.
[0106] The above description is merely illustrative of the application, and is not intended to limit the application. The application can be modified, adapted, and / or combined in various ways without departing from the spirit and scope of the application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the application should be included in the scope of the application.
Claims
1. A method of recognizing heterogeneous graph structures in public safety scenarios, characterized in that, The method comprises the following steps: acquiring a cognitive fusion model pre-built for a public safety scene, the cognitive fusion model containing a heterogeneous graph pre-built for things and relationships between things in the public safety scene; the heterogeneous graph taking the things in the public safety scene as nodes and the relationships between the things as edges, and storing safety-related information in the public safety scene into the heterogeneous graph; the cognitive fusion model containing a spectral graph model belonging to a machine learning model, and the spectral graph model being used to make downstream task decisions after being trained; constructing meta-paths based on semantic information and topological information contained in the heterogeneous graph, and decomposing the heterogeneous graph into a plurality of neighbor subgraphs; inverting a preset number of selected meta-paths by using a standardized Laplacian matrix, so as to disturb the neighbor subgraphs and obtain a plurality of neighbor subgraphs with noise; the step of inverting the preset number of selected meta-paths by using the standardized Laplacian matrix comprises: converting the disturbance of the neighbor subgraphs into linear transformation of the graph by using the standardized Laplacian matrix, and inverting the preset number of selected meta-paths; the step of inverting comprises adding or deleting edges in the neighbor subgraphs within a given budget range; controlling meta-cognition of the neighbor subgraphs with noise in a node prediction task by using the spectral graph model contained in the cognitive fusion model, training the cognitive fusion model in the node prediction task by using a multilayer perceptron, and using the trained cognitive fusion model for risk assessment in the public safety scene; in the process of inverting each meta-path, the following steps are included: calculating a generalized eigenvector of the neighbor subgraph; reserving at least one random edge for each node of the neighbor subgraph to prevent the existence of isolated points, and forming a candidate edge set with the remaining edges; randomly sampling in the candidate edge set to select a candidate edge; and selecting a preset number of meta-paths located at the top on the basis of the selected candidate edge by calculating the complexity, so as to disturb the neighbor subgraph.
2. The method of claim 1, wherein, The step of constructing meta-paths based on semantic information and topological information contained in the heterogeneous graph and decomposing the heterogeneous graph into a plurality of neighbor subgraphs comprises: a plurality of meta-paths are obtained by decomposing the heterogeneous graph based on semantic information and topological information contained in the heterogeneous graph, and the heterogeneous graph is decomposed into a plurality of neighbor subgraphs through the adjacency relationship between the meta-paths and the nodes.
3. The method of claim 1, wherein, The spectral graph model comprises an attention mechanism layer and a multilayer perceptron, and the attention mechanism layer comprises a misled node-level attention mechanism and a misled semantic attention mechanism; The step of controlling meta-cognition of the neighbor subgraphs with noise in a node prediction task by using the spectral graph model contained in the cognitive fusion model further comprises: adjusting weight parameters of different meta-paths by using the attention mechanism layer, fusing semantic embeddings based on the weight parameters of the different meta-paths, and obtaining embedding representations of the neighbor subgraphs with noise, so that the multilayer perceptron trains the cognitive fusion model in the node prediction task based on the embedding representations of the neighbor subgraphs with noise.
4. The method of claim 1, wherein, The method further comprises: using the meta-path to read data to build a public safety event quality data set, the public safety event quality data set containing the number of nodes, the number of edges, the number of relationships, and the number of characteristic values, and the number of training sets, validation sets, and test sets, and listing the selected meta-path, and the cognitive fusion model combines the public safety event quality data set to cognize semantic changes of non-Euclidean data in a public safety scenario.
5. A system for recognizing heterogeneous graph structures in public safety scenarios, comprising a processor, a memory and a computer program / instructions stored on the memory, characterized in that, The processor is configured to execute the computer program / instructions, which, when executed, cause the system to perform the steps of the method of any one of claims 1-4.
6. A computer readable storage medium having stored thereon computer programs / instructions, characterized in that, The computer program / instructions, when executed by the processor, perform the steps of the method of any one of claims 1-4.
7. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instructions, when executed by the processor, perform the steps of the method of any one of claims 1-4. The computer program / instructions, when executed by the processor, perform the steps of the method of any one of claims 1-4.
Citation Information
Patent Citations
Construction method of universal embedding framework of multi-semantic heterogeneous graph
CN112989842A
Security event identification method and system based on heterogeneous graph
CN115086004A