Social risk heterogeneous graph anomaly detection method based on cross-type semantic alignment
By using feature smoothness analysis and attention mechanism for cross-type propagation, combined with edge type awareness and heterogeneous graph convolutional networks, the problem of anomaly detection signal dilution in heterogeneous graphs of social risk is solved, and accurate anomaly identification and risk linkage detection of multi-type nodes are achieved.
Patent Information
- Application Number
- CN202511790913.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-03-03
AI Technical Summary
Existing technologies struggle to effectively integrate the information differences between nodes in heterogeneous social risk graphs and neglect collaborative detection of multiple node types. This results in anomaly detection signals being masked or diluted when transmitted between nodes of different types, failing to meet the needs of social governance.
Anomaly-sensitive features are screened through feature smoothness analysis, cross-type propagation is performed using an attention mechanism, and hierarchical encoding is performed by combining edge type awareness and heterogeneous graph convolutional networks. Finally, anomaly scoring is performed by combining an independent anomaly detection head.
It achieves accurate identification of multiple types of node anomalies, improves the accuracy and generalization ability of anomaly detection, can capture the risk of anomaly correlation between nodes, and is suitable for complex heterogeneous scenarios.
Smart Images

Figure CN121599658A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data processing technology, and in particular relates to a method for detecting anomalies in heterogeneous social risk graphs based on cross-type semantic alignment. Background Technology
[0002] Anomaly detection is a key technology for identifying various scenarios such as fraud detection, network intrusion detection, misinformation detection, and social network analysis. Among these, utilizing graph structures to model the inherent dependencies between data, and then using machine learning models to distinguish between anomalous and normal nodes, shows significant research potential. In recent years, breakthroughs in Graph Neural Networks (GNNs) have enabled GNNs to learn discriminative node representations by modeling structural dependencies, effectively separating anomalous nodes in the embedding space, and greatly promoting the development of GNN-based anomaly detection methods, demonstrating excellent performance in isomorphic graph scenarios.
[0003] However, in real-world systems, such as social governance risk monitoring, most graphs are heterogeneous, with diverse node types, complex attribute distributions, and rich dependencies. Current mainstream heterogeneous graph neural network methods, such as HAN and HetGNN, have significant limitations in handling such problems: they struggle to address the loss of anomalous features due to large differences in information richness among nodes, especially when anomalous signals involve interactions between nodes at different information levels; and because existing technologies focus on anomaly identification of single-type nodes, ignoring the correlation between anomalies of multiple node types, they are prone to gradient conflicts due to differences in task objectives when processing heterogeneous graphs in social governance, resulting in insufficient model optimization efficiency and generalization ability, and failing to meet the needs of social governance. Summary of the Invention
[0004] To address the aforementioned shortcomings in existing technologies, the present invention provides a social risk heterogeneous graph anomaly detection method based on cross-type semantic alignment. This method solves the problem that current graph anomaly detection methods are unable to fully integrate the information differences between nodes in social risk heterogeneous graphs, and generally only focus on single-type node anomalies, neglecting the practical needs of multi-type node collaborative detection and the problem of risk linkage.
[0005] To achieve the above objectives, the technical solution adopted by this invention is: a social risk heterogeneous graph anomaly detection method based on cross-type semantic alignment, comprising the following steps: S1. Construct a heterogeneous diagram of social risks; S2. Based on the social risk heterogeneous graph, semantically rich nodes and semantically sparse nodes in the social risk heterogeneous graph are fused through feature smoothness analysis and attention mechanism to obtain enhanced abnormal features. S3. Based on the enhanced anomaly features, hierarchical encoding is performed through a heterogeneous graph convolutional network that integrates edge type awareness, attention mechanism and explicit anomaly propagation to obtain the high-level embedding matrix of all nodes in the enhanced anomaly features. S4. Based on the high-level embedding matrix, the independent anomaly detection head is used for processing and combined with the gating mechanism to obtain the comprehensive anomaly score of the final node.
[0006] To address the issues of significant differences in information abundance among nodes in heterogeneous social risk graphs, which can mask or weaken anomaly detection signals, and the limitations of existing technologies that focus on single-type nodes while neglecting collaborative detection of multiple types of nodes, making them unsuitable for heterogeneous social risk graphs, this invention performs feature smoothness analysis on semantically rich nodes in heterogeneous social risk graphs, filters a subset of anomaly-sensitive features, and then propagates these features across types to semantically sparse nodes through an attention mechanism. This achieves semantic alignment and enhancement of heterogeneous nodes, solving the feature dilution problem during risk signal propagation between cross-type nodes, and ensuring that anomaly features of nodes with different information abundances are fully captured. This invention integrates edge type perception, attention mechanism, and explicit anomaly propagation for hierarchical encoding. It outputs local anomaly scores through independent anomaly detection heads, and combines the propagation anomaly impact obtained through explicit propagation to obtain a weighted comprehensive anomaly score for the final node. This achieves accurate anomaly identification of multiple types of nodes and demonstrates the anomaly association risk between nodes. It can meet the multi-dimensional and interconnected anomaly detection needs in heterogeneous social risk graphs, improving the anomaly detection accuracy and generalization ability in complex heterogeneous scenarios.
[0007] Furthermore, the expression for the social risk heterogeneity graph is as follows:
[0008]
[0009]
[0010] in, This is a diagram of social risk heterogeneity. For a set of nodes, Let be the set of edges. A collection of node types A set of edge types, For node mapping functions, This is the edge mapping function.
[0011] The further beneficial effects mentioned above are: by defining the set of nodes, the set of edges, and the set of node types in the heterogeneous graph of social risk, it is possible to distinguish between semantically rich nodes and semantically sparse nodes, providing a data structure foundation for subsequent feature smoothness analysis and cross-type semantic alignment, and effectively avoiding the deviation in abnormal signal identification caused by the ambiguity of node and edge types.
[0012] Further: The specific steps of S2 include: S201: Through feature smoothness analysis, the initial features of semantically rich nodes in the social risk heterogeneous graph are analyzed for feature smoothness, and the feature dimension with the lowest feature smoothness is selected as the anomaly sensitive feature. S202: Anomaly-sensitive features are propagated to semantically sparse nodes through an attention-based cross-type propagation network to obtain enhanced anomaly features.
[0013] The further beneficial effects mentioned above are as follows: by filtering out the low-smoothness anomaly-sensitive feature matrix in semantically rich nodes through feature smoothness analysis, it is ensured that the anomaly signal with high signal-to-noise ratio is passed to the semantically sparse nodes, thereby achieving accurate and efficient cross-type information enhancement. Through attention cross-type propagation, the anomaly signal of the semantically rich nodes is passed to the semantically sparse nodes, providing a high-quality feature foundation for subsequent encoding and detection, and improving the accuracy of anomaly detection in social risk heterogeneous graphs.
[0014] Furthermore, the expression for the feature smoothness is as follows:
[0015] in, For the first Dimensional feature smoothness, A set of edges containing at least one text-rich node. For semantically rich nodes In the Values on dimensional features, For semantically rich nodes In the Values on dimensional features, and All of them are semantically rich nodes.
[0016] The further beneficial effects mentioned above are: the expression of feature smoothness quantifies the neighborhood differences of features in the semantically rich node edge set, filters out abnormally sensitive low smoothness features, reduces redundant information interference and abnormal signal dilution, and improves the anomaly detection accuracy of sparse text nodes.
[0017] Furthermore, the expression for the enhanced anomaly feature is as follows:
[0018]
[0019]
[0020]
[0021]
[0022] in, To enhance the abnormal features, It is a multilayer perceptron. To make semantically sparse nodes The original features and received information are linked together. semantically sparse nodes The original characteristics, semantically sparse nodes Received information, For the type of edge, A set of edge types. semantically sparse nodes The edge type is The set of neighboring nodes, For semantically rich nodes, For edge attention, For semantically rich nodes Feature representation, semantically sparse nodes Feature representation, It is a natural exponential function. For attention weights, For transpose operation, An embedded representation of the edge type. As a dimension, Let r be the feature representation of the node connected to node j via edge r. For semantically rich nodes The learnable weight matrix, semantically sparse nodes The learnable weight matrix, For semantically rich nodes Its abnormally sensitive characteristics.
[0023] The further beneficial effects mentioned above are: the expression for enhancing abnormal features integrates cross-type feature propagation and edge attention mechanism, which can transfer the abnormality-sensitive features of semantically rich nodes to semantically sparse nodes, thereby improving the accuracy and robustness of anomaly detection for multiple types of nodes in heterogeneous graphs.
[0024] Furthermore, the expression for the high-level embedding matrix in S3 is as follows:
[0025]
[0026] in, It is a high-level embedding matrix, and also a semantically rich node. The second layer representation, For the edge Unified weights, For the edge The second layer of unified weights, For the edge The first layer of unified weights, For semantically rich nodes The first layer of representation, For semantically rich nodes and semantically rich nodes Relationship between Attention coefficient For semantically rich nodes Enhanced abnormal features.
[0027] The further beneficial effects mentioned above are: through the hierarchical attention mechanism and cross-layer information aggregation, the formula can effectively capture the complex semantic dependencies between nodes and generate more discriminative embedded representations, thereby improving the accuracy of anomaly detection and robustness to complex risk patterns.
[0028] Furthermore: the expression for the comprehensive anomaly score of the final node in S4 is as follows:
[0029]
[0030]
[0031]
[0032]
[0033] in, The updated overall anomaly score is used to obtain the final node's overall anomaly score. For semantically rich nodes The neighborhood group, For edge-level gating mechanisms, Anomaly score for each node, For logical functions, It is a learnable weight vector. For transpose operation, This is a second-layer feature representation that aggregates domain information for semantically rich node u. For semantically rich nodes The second layer of representation.
[0034] The further beneficial effects mentioned above are: by dynamically weighting neighborhood anomaly information through edge-level gating mechanism, the fusion of node anomaly scoring and propagation is realized, which can accurately quantify the transmission intensity of risk along complex paths and improve the detection sensitivity and robustness of anomaly nodes.
[0035] Furthermore: the independent anomaly detection head is equipped with a joint loss function, the expression of which is as follows:
[0036]
[0037]
[0038]
[0039]
[0040]
[0041] in, For the joint loss function, , , , and All are weights. For attribute reconstruction loss, For semantically rich nodes , It is the square of the 2-norm. Semantic rich nodes obtained from attribute reconstruction Features For semantically rich nodes The original characteristics, For consistency loss, For semantically rich nodes The expression, For semantically rich nodes The expression, For temperature parameters, In addition to semantically rich nodes Other nodes, Cross-entropy loss for node classification, A collection of labeled nodes. For semantically rich nodes The true label, Anomaly score for each node, For the regularization term of consistency loss, The updated overall anomaly score. To propagate regularization loss, From semantically rich nodes to semantically sparse nodes The propagation matrix, It is a collection of semantically sparse node types. A type-specific weight matrix for learnable data. For transpose operation, It is the square of the Frobenius norm.
[0042] The further beneficial effects mentioned above are: the joint loss function integrates structure reconstruction, representation learning and anomaly detection through a multi-objective collaborative optimization mechanism, which alleviates gradient conflicts in multi-task training and improves the model's convergence stability and generalization ability in the face of multiple types of anomaly detection.
[0043] The beneficial effects of this invention are as follows: This invention filters low-smoothness anomaly-sensitive features of semantically rich nodes through feature smoothness analysis, and then uses attention to transfer them across types to semantically sparse nodes, avoiding the dilution of anomaly signals when they are transferred across types, solving the problem of information scarcity in semantically sparse nodes, and providing a high-quality feature foundation for subsequent detection. This invention addresses the problem that existing technologies, which rely on single-node-type detection, are unsuitable for anomalies in heterogeneous graphs due to their inability to detect anomalies in social risk graphs. It utilizes a hierarchical encoding of heterogeneous graph convolutional networks with integrated edge type awareness, combined with a weighted fusion of independent anomaly detection heads and the impact of anomaly propagation. This invention can capture anomaly associations between multiple types of nodes, aligning with the risk linkage characteristics of heterogeneous graphs in social risk. Attached Figure Description
[0044] Figure 1 This is a flowchart of a social risk heterogeneous graph anomaly detection method based on cross-type semantic alignment. Detailed Implementation
[0045] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.
[0046] Example 1 like Figure 1 As shown, this invention provides a method for detecting anomalies in heterogeneous social risk graphs based on cross-type semantic alignment, comprising the following steps: S1. Construct a heterogeneous diagram of social risks; S2. Based on the social risk heterogeneous graph, semantically rich nodes and semantically sparse nodes in the social risk heterogeneous graph are fused through feature smoothness analysis and attention mechanism to obtain enhanced abnormal features. S3. Based on the enhanced anomaly features, hierarchical encoding is performed through a heterogeneous graph convolutional network that integrates edge type awareness, attention mechanism and explicit anomaly propagation to obtain the high-level embedding matrix of all nodes in the enhanced anomaly features. S4. Based on the high-level embedding matrix, the independent anomaly detection head is used for processing and combined with the gating mechanism to obtain the comprehensive anomaly score of the final node.
[0047] To address the issues that existing graph anomaly detection methods suffer from inaccurate detection when dealing with heterogeneous graphs of social risk, due to the large differences in information abundance among nodes in the heterogeneous graph, anomaly signals are masked or diluted when transmitted between nodes of different types, leading to inaccurate detection; and that most current graph anomaly detection methods focus on detecting anomalies of a single type of node, ignoring the correlation and risk linkage between anomalies of different types of nodes, and that gradient conflicts easily lead to poor model adaptability in multi-task detection, thus failing to meet the multi-dimensional detection requirements of heterogeneous graphs of social risk. This invention proposes an anomaly detection method for heterogeneous social risk graphs based on cross-type semantic alignment. It constructs a heterogeneous social risk graph containing multiple node and edge types, performs feature smoothness analysis on semantically rich nodes, and filters out a subset of anomaly-sensitive features with low smoothness. Then, an attention mechanism is used to propagate this feature subset across types to semantically sparse nodes, achieving semantic alignment and feature enhancement, thus preventing the anomaly signal from being masked or diluted during cross-type transmission. A heterogeneous graph convolutional network integrating edge type awareness and attention mechanisms is used to hierarchically encode the enhanced features, and explicit anomaly propagation is combined to quantify risk transmission between nodes with scores. This achieves accurate detection of anomalies in multiple types of nodes in the heterogeneous social risk graph, solving the problems of inaccurate detection caused by differences in information richness between nodes and the difficulty in adapting to anomaly detection of multiple node types, thereby improving the accuracy of anomaly detection in complex heterogeneous scenarios.
[0048] Existing graph neural networks can be used for anomaly detection in diverse scenarios such as fraud detection, network intrusion detection, misinformation detection, and social network analysis, and perform well in homogeneous graphs. However, complex real-world systems, such as social governance risk monitoring, financial transaction networks, and bioinformatics networks, often exhibit highly heterogeneous graph structures: diverse node types, complex attribute distributions, and rich dependencies. Existing technologies struggle to perform anomaly detection in these scenarios. This invention addresses the problem of multi-type node anomaly detection in social governance risk monitoring by constructing a heterogeneous graph dataset that reflects the complexity of social governance risk monitoring, namely, the social risk heterogeneous graph. This dataset includes people, locations, events, and abstract events. In the social risk heterogeneous graph, there are significant differences in information richness among nodes. For example, some nodes represent events and include rich semantic information such as event descriptions, while some nodes represent people and only include basic information such as gender and age, lacking semantic information and contributing little to anomaly detection. Current mainstream heterogeneous graph neural network methods, when processing risk signals, can easily dilute key anomaly features during cross-type propagation when the risk signal is transmitted from semantically rich nodes to semantically sparse nodes. Furthermore, they lack effective semantic enhancement mechanisms for semantically sparse nodes, making it difficult to obtain valuable supplementary information from their neighboring semantically rich nodes. This makes it difficult for existing technologies to capture key risk transmission paths in heterogeneous graphs, especially when the anomaly signal involves interactions between nodes at different information levels.
[0049] In one embodiment of the present invention, a social risk heterogeneous graph is constructed in S1. Based on risk cases of social governance elements, the present invention constructs two social risk heterogeneous graphs based on four types of nodes and their relationships defined by experts in the field of social governance: people, places, events, and abstract events. The first social risk heterogeneous graph mainly focuses on traditional social risk scenarios, such as conflicts and disputes, and violent incidents. The second social risk heterogeneous graph also includes new social risk scenarios, such as telecommunications fraud and cyber theft. Both social risk heterogeneous graphs can comprehensively reflect multiple types of risk subjects and their complex relationships, and support the detection of anomalies in multiple types of nodes. The social governance element risk cases contain a lot of sensitive information. This invention desensitizes this sensitive information that is not related to the risk. For example, the cases may mention specific location information, and this invention maps all locations to a unique number. At the same time, since the social governance element risk cases come from real scenarios, they inherently have risk ratings. The risk level of related nodes can be marked according to their risk ratings. Considering that real-world risk perception needs to focus more on high-risk groups and high-risk areas, and considering that the number of abnormal nodes in graph anomaly detection is far less than the number of normal nodes, high-risk nodes are regarded as abnormal nodes, and the rest of the nodes are regarded as normal nodes. In this way, a social risk heterogeneous graph is constructed. The expression of the social risk heterogeneous graph is as follows:
[0050]
[0051]
[0052] in, This is a diagram of social risk heterogeneity. For a set of nodes, Let be the set of edges. A collection of node types A set of edge types, For node mapping functions, This invention defines the node set, edge set, and node type set of the social risk heterogeneous graph to distinguish between semantically rich nodes and semantically sparse nodes. This provides a data structure foundation for subsequent feature smoothness analysis and cross-type semantic alignment, and reduces the deviation in abnormal signal identification caused by ambiguity of node and edge types.
[0053] In one embodiment of the present invention, in step S2, based on the social risk heterogeneity graph, semantically rich nodes and semantically sparse nodes in the graph are fused through feature smoothness analysis and an attention mechanism to obtain enhanced anomaly features. To achieve effective information enhancement from semantically rich nodes to semantically sparse nodes, the signal-to-noise ratio of the transmitted information must be guaranteed. Conventional methods typically inject all high-dimensional features of semantically rich nodes indiscriminately into semantically sparse nodes, but this easily leads to noise amplification and anomaly signal dilution, polluting the feature space of semantically sparse nodes and reducing anomaly detection performance. This invention proposes an anomaly-sensitive feature screening mechanism. Its core insight is that the anomaly of a node is not only reflected in the isolated values of its own attributes, but also in the feature differences between it and its structured neighbors of the same type. For example, the features of an anomalous event node will significantly differ from other normal event nodes associated with it through nodes of the same person or location. Therefore, the feature dimensions that can capture such anomaly differences between nodes of the same type are the dimensions that carry key anomaly signals. This invention uses feature smoothness as an indicator to measure such anomaly differences between nodes. The expression for feature smoothness is as follows:
[0054] in, For the first Dimensional feature smoothness, A set of edges containing at least one text-rich node. For semantically rich nodes In the Values on dimensional features, For semantically rich nodes In the Values on dimensional features, and All of them are semantically rich nodes.
[0055] The lower the feature smoothness, the more drastic the variation of that feature dimension among structurally related nodes of the same type, and the greater the likelihood that it carries anomaly signals. Therefore, smoothness analysis not only helps identify the key features that best distinguish between abnormal and normal nodes, but also effectively avoids noise interference caused by high-dimensional redundant information. Based on this principle, the model adaptively selects a subset of features that vary drastically in the graph structure, i.e., have low smoothness and are highly sensitive to abnormal states. It focuses on extracting the most discriminative anomaly signals, and through a heterogeneous message passing mechanism, these anomaly-sensitive features are dynamically injected into the representation of semantically sparse nodes, achieving efficient fusion of cross-type risk signals and significantly improving the overall anomaly detection capability.
[0056] S201: By performing feature smoothness analysis, the initial features of semantically rich nodes in the heterogeneous social risk graph are analyzed to select the feature dimension with the lowest feature smoothness as the anomaly sensitive feature. This invention ensures that the anomaly sensitive feature with the lowest smoothness in the semantically rich nodes is transmitted to the semantically sparse nodes by selecting the anomaly sensitive feature with the lowest smoothness and propagating it to the semantically sparse nodes. This achieves accurate and efficient cross-type information enhancement.
[0057] After obtaining the anomaly-sensitive feature matrix, S202: The anomaly-sensitive features are propagated to semantically sparse nodes through an attention-based cross-type propagation network to obtain enhanced anomaly features; through an edge attention mechanism, the anomaly-sensitive features extracted from semantically rich nodes such as event nodes are propagated to semantically sparse nodes such as personnel nodes and location nodes. For semantic coefficient nodes... and The expression is as follows:
[0058]
[0059] in, For semantically rich nodes Feature representation, semantically sparse nodes Feature representation, semantically sparse nodes The learnable weight matrix, semantically sparse nodes The learnable weight matrix, semantically sparse nodes The abnormally sensitive characteristics, semantically sparse nodes The abnormally sensitive characteristics, and All were selected from S201; the strength of passing anomaly-sensitive features to semantically sparse nodes was adjusted by calculating edge attention. The expression for edge attention is as follows:
[0060] in, For edge attention, It is a natural exponential function. For attention weights, For transpose operation, An embedded representation of the edge type. As a dimension, Let r be the feature representation of the node connected to node j via edge r.
[0061] Finally, semantically sparse nodes The expression for the received information is as follows:
[0062] in, semantically sparse nodes Received information, For the type of edge, A collection of edge types; semantically sparse nodes The received information and semantically sparse nodes By fusing the original features, enhanced anomaly features can be obtained. The expression for enhanced anomaly features is as follows:
[0063] Among them, among them, To enhance the abnormal features, It is a multilayer perceptron. To make semantically sparse nodes The original features and received information are connected. In this embodiment, the semantically sparse nodes are first connected. The original features and received information are connected and then further fused through a multilayer perceptron to improve the quality of feature fusion. Other feature fusion methods can also be used.
[0064] In step S2, the semantically sparse node is injected with the key risk signals of its semantically rich node neighbors, which enhances the semantic information of the semantically sparse node. This solves the problem of inaccurate anomaly detection caused by the lack of semantic information of the semantically sparse node when key anomaly features are transmitted between different types of nodes, and lays the foundation for subsequent accurate anomaly detection.
[0065] In one embodiment of the present invention, S3 performs hierarchical encoding based on the enhanced anomaly features using a heterogeneous graph convolutional network that integrates edge type awareness, attention mechanism, and explicit anomaly propagation, to obtain a high-level embedding matrix of all nodes in the enhanced anomaly features. The hierarchical encoding is performed by an encoder, where the node representation of the initial input layer is a hybrid matrix. For semantically sparse nodes, the initial feature vector of the node representation is the enhanced anomaly feature; for semantically rich nodes, the initial feature vector of the node representation is its own original feature. In each layer of the encoder, neighbor information is first aggregated for each relation, i.e., edge type. Therefore, the expression for the high-level embedding matrix is as follows:
[0066]
[0067] in, It is a high-level embedding matrix, and also a semantically rich node. The second layer representation, For the edge Unified weights, For the edge The second layer of unified weights, For the edge The first layer of unified weights, For semantically rich nodes The first layer of representation, For semantically rich nodes and semantically rich nodes Relationship between Attention coefficient For semantically rich nodes Enhanced abnormal features.
[0068] In one embodiment of the present invention, after obtaining the high-level embedding matrix, S4 processes the high-level embedding matrix using an independent anomaly detection head and combines it with a gating mechanism to obtain the comprehensive anomaly score of the final node. The independent anomaly detection head first processes the high-level embedding matrix to obtain the anomaly score for each node, and then propagates and updates it through a gating mechanism to obtain the final comprehensive anomaly score for the node. The expression for the final comprehensive anomaly score of the node is as follows:
[0069]
[0070]
[0071]
[0072]
[0073] in, The updated overall anomaly score is used to obtain the final node's overall anomaly score. For semantically rich nodes The neighborhood group, This is an edge-level gating mechanism, that is, in the case of type edge Above, from the node To the node The credibility of disseminating abnormal information Anomaly score for each node, For logical functions, It is a learnable weight vector used to map the concatenated node representations to a scalar value, and then... The logic function is transformed into a gated value between 0 and 1. For transpose operation, This is a second-layer feature representation that aggregates domain information for semantically rich node u. For semantically rich nodes The second layer representation. Gated score propagation enhances the interpretability of anomaly scores: This invention designs a gated anomaly score propagation mechanism that not only transmits features from semantically rich nodes to semantically sparse nodes, but also propagates the anomaly scores calculated by semantically rich nodes through a "trust gate" based on node representation learning. This ensures that the final anomaly score of a textual sparse node originates from both its own features and the propagation from all its semantically rich nodes, and the propagation weights are interpretable. It allows us to know which high-risk event or location caused a person to be judged as an anomaly, enhancing the transparency and credibility of the model's decision-making process.
[0074] In one embodiment of the present invention, the independent anomaly detection head is provided with a joint loss function, the expression of which is as follows:
[0075]
[0076]
[0077]
[0078]
[0079]
[0080] in, For the joint loss function, , , , and All are weights. For attribute reconstruction loss, For semantically rich nodes , It is the square of the 2-norm. Semantic rich nodes obtained from attribute reconstruction Features For semantically rich nodes The original characteristics, For consistency loss, For semantically rich nodes The expression, For semantically rich nodes The expression, For temperature parameters, In addition to semantically rich nodes Other nodes, Cross-entropy loss for node classification, A collection of labeled nodes. For semantically rich nodes The true label, Anomaly score for each node, For the regularization term of consistency loss, The updated overall anomaly score. To propagate regularization loss, From semantically rich nodes to semantically sparse nodes The propagation matrix, It is a collection of semantically sparse node types. A type-specific weight matrix for learnable data. For transpose operation, The square of the Frobenius norm. For feature propagation operators.
[0081] Among them, attribute reconstruction loss This ensures that the features of each point contain sufficient anomaly information, and further improves the model's accuracy by reconstructing the node's attributes; consistency loss. It can ensure the consistency of nodes within their neighborhood, and the node classification cross-entropy loss. It can measure the difference between the probability distribution of anomaly predictions and the true label distribution; the regularization term of consistency loss. By minimizing the mean squared error between a node's own anomaly score and the propagation scores of its neighbors, the consistency and rationality of anomaly judgments among neighboring nodes in the social risk heterogeneity graph are ensured; propagation regularization loss. By forcing the feature propagation operators to be orthogonal or approximately orthogonal, we can ensure that information is as undistorted as possible during propagation.
[0082] The beneficial effects of this invention are as follows: This invention filters low-smoothness abnormal sensitive features of semantically rich nodes through feature smoothness analysis, and then uses attention to transfer to semantically sparse nodes across types, avoiding the dilution of abnormal signals when they are transferred across types, solving the problem of lack of information in semantically sparse nodes, and providing a high-quality feature foundation for subsequent detection. This invention addresses the problem that existing technologies, which rely on single-node-type detection, are unsuitable for anomalies in heterogeneous graphs due to their inability to detect anomalies in social risk graphs. It utilizes a hierarchical encoding of heterogeneous graph convolutional networks with integrated edge type awareness, combined with a weighted fusion of independent anomaly detection heads and the impact of anomaly propagation. This invention can capture anomaly associations between multiple types of nodes, aligning with the risk linkage characteristics of heterogeneous graphs in social risk.
Claims
1. A method for detecting anomalies in heterogeneous social risk graphs based on cross-type semantic alignment, characterized in that, Includes the following steps: S1. Construct a heterogeneous diagram of social risks; S2. Based on the social risk heterogeneous graph, semantically rich nodes and semantically sparse nodes in the social risk heterogeneous graph are fused through feature smoothness analysis and attention mechanism to obtain enhanced abnormal features. S3. Based on the enhanced anomaly features, hierarchical encoding is performed through a heterogeneous graph convolutional network that integrates edge type awareness, attention mechanism and explicit anomaly propagation to obtain the high-level embedding matrix of all nodes in the enhanced anomaly features. S4. Based on the high-level embedding matrix, the independent anomaly detection head is used for processing and combined with the gating mechanism to obtain the comprehensive anomaly score of the final node.
2. The social risk heterogeneous graph anomaly detection method based on cross-type semantic alignment according to claim 1, characterized in that, The expression for the social risk heterogeneity graph is as follows: in, This is a diagram of social risk heterogeneity. For a set of nodes, Let be the set of edges. A collection of node types A set of edge types, For node mapping functions, This is the edge mapping function.
3. The social risk heterogeneous graph anomaly detection method based on cross-type semantic alignment according to claim 1, characterized in that, The specific steps of S2 include: S201: Through feature smoothness analysis, the initial features of semantically rich nodes in the social risk heterogeneous graph are analyzed for feature smoothness, and the feature dimension with the lowest feature smoothness is selected as the anomaly sensitive feature. S202: Anomaly-sensitive features are propagated to semantically sparse nodes through an attention-based cross-type propagation network to obtain enhanced anomaly features.
4. The social risk heterogeneous graph anomaly detection method based on cross-type semantic alignment according to claim 3, characterized in that, The expression for the feature smoothness is as follows: in, For the first Dimensional feature smoothness, A set of edges containing at least one text-rich node. For semantically rich nodes In the Values on dimensional features, For semantically rich nodes In the Values on dimensional features, and All of them are semantically rich nodes.
5. The social risk heterogeneous graph anomaly detection method based on cross-type semantic alignment according to claim 3, characterized in that, The expression for the enhanced anomaly feature is as follows: in, To enhance the abnormal features, It is a multilayer perceptron. To make semantically sparse nodes The original features and received information are linked together. semantically sparse nodes The original characteristics, semantically sparse nodes Received information, For the type of edge, A set of edge types. semantically sparse nodes The edge type is The set of neighboring nodes, For semantically rich nodes, For edge attention, For semantically rich nodes Feature representation, semantically sparse nodes Feature representation, It is a natural exponential function. For attention weights, For transpose operation, An embedded representation of the edge type. As a dimension, To pass through the edge and Feature representation of nodes connected to a node. For semantically rich nodes The learnable weight matrix, semantically sparse nodes The learnable weight matrix, For semantically rich nodes Its abnormally sensitive characteristics.
6. The social risk heterogeneous graph anomaly detection method based on cross-type semantic alignment according to claim 1, characterized in that, The expression for the high-level embedding matrix in S3 is as follows: in, It is a high-level embedding matrix, and also a semantically rich node. The second layer representation, For the edge Unified weights, For the edge The second layer of unified weights, For the edge The first layer of unified weights, For semantically rich nodes The first layer of representation, For semantically rich nodes and semantically rich nodes Relationship between Attention coefficient For semantically rich nodes Enhanced abnormal features.
7. The social risk heterogeneous graph anomaly detection method based on cross-type semantic alignment according to claim 5, characterized in that, The expression for the comprehensive anomaly score of the final node in S4 is as follows: in, The updated overall anomaly score is used to obtain the final node's overall anomaly score. For semantically rich nodes The neighborhood group, For edge-level gating mechanisms, Anomaly score for each node, For logical functions, It is a learnable weight vector. For transpose operation, This is a second-layer feature representation that aggregates domain information for semantically rich node u. For semantically rich nodes The second layer of representation.
8. The social risk heterogeneous graph anomaly detection method based on cross-type semantic alignment according to claim 1, characterized in that, The independent anomaly detection head is equipped with a joint loss function, the expression of which is as follows: in, For the joint loss function, , , , and All are weights. For attribute reconstruction loss, For semantically rich nodes , It is the square of the 2-norm. Semantic rich nodes obtained from attribute reconstruction Features For semantically rich nodes The original characteristics, For consistency loss, For semantically rich nodes The expression, For semantically rich nodes The expression, For temperature parameters, In addition to semantically rich nodes Other nodes, Cross-entropy loss for node classification, A collection of labeled nodes. For semantically rich nodes The true label, Anomaly score for each node, For the regularization term of consistency loss, The updated overall anomaly score. To propagate regularization loss, From semantically rich nodes to semantically sparse nodes The propagation matrix, It is a collection of semantically sparse node types. A type-specific weight matrix for learnable data. For transpose operation, It is the square of the Frobenius norm.