Deplatable source positioning method from coarse granularity to fine granularity

By constructing an interpretable source positioning model in social networks, using graph diffusion fusion technology and nuclear attention module, the problems of large computing burden, susceptibility to overfitting, insufficient computing efficiency and limited interpretability in the existing technology are solved, and efficient and interpretable source positioning effect is achieved.

CN119739900AActive Publication Date: 2025-04-01NAT UNIV OF DEFENSE TECH

Patent Information

Application Number
CN202411791697.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-06
Publication Date
2025-04-01
Estimated Expiration
2044-12-06

AI Technical Summary

Technical Problem

The prior art has problems such as high computational burden, susceptibility to overfitting, insufficient computational efficiency and limited interpretability when source positioning in social networks.

Method used

An interpretable source positioning method from coarse to fine-grained is designed, by constructing an interpretable source positioning model, including a general feature extractor, coarse fine converter and post-processing module. This model uses graph diffusion and fusion technology to extract propagation features, and reduces the computational complexity through the nuclear attention module, supports parallel computing, and improves the interpretability of the model.

Benefits of technology

Efficient source positioning performance is achieved, interpretable diffusion explanations are generated, cascade errors are avoided, and efficient parallel computing is supported.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739900A_ABST
    Figure CN119739900A_ABST
Patent Text Reader

Abstract

The invention relates to an interpretable source positioning method from coarse granularity to fine granularity. The method comprises the following steps: constructing an interpretable source positioning model; the interpretable source model comprises a general feature extractor, a coarse-fine converter and a post-processing module; generating node features of the social network according to the general feature extractor, and embedding and inputting the final node features and a preset position into a coarse-fine converter to output a snapshot representation matrix; in a fine-grained transformer encoder, according to a coring attention module, interacting fine-grained node information with the snapshot representation matrix in a certain time and memory complexity, and after coring features of nodes are obtained, outputting a hidden representation matrix; and the prediction probability of each node is calculated according to the hidden representation matrix and the attention value between the nodes in the post-processing module, and the node with the highest prediction probability is used as an interpretable source positioning result. By adopting the method, the interpretability and the high efficiency of source positioning can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to an interpretable source positioning method from coarse-grained to fine-grained. Background Art

[0002] Social media networks are ubiquitous in contemporary society, with users represented as nodes and relationships between users represented as edges. However, in addition to benign social interactions, these networks promote the spread of misinformation and disinformation, which can have adverse side effects. For example, some epidemics that infect people are accompanied by a large amount of misinformation on social media platforms, which may hinder the public from obtaining authentic guidelines to avoid being infected by the epidemic. Therefore, identifying the sources of disinformation on social networks through graph analysis techniques is crucial to our daily lives. Existing signal source localization methods can be divided into three categories: (1) methods that utilize sensor observations, (2) methods that can obtain a complete infection graph, and (3) methods that utilize multiple infection snapshots (the same graph at different timestamps). In practice, deploying sensors to collect high-fidelity observations requires a lot of time and resource costs. In addition, recent studies have shown that methods that rely on the complete infection graph suffer from ill-posed problems because multiple potential sources can produce the same infection graph. Two sources can produce an identical infected graph. It is different from traditional (semi-)supervised tasks, where the correct labels for the same input can be diverse. Therefore, with multiple snapshot information, the infection source localization problem can reduce the ambiguity of the problem and produce more precise results.

[0003] However, existing methods still have the following limitations. Limitation 1: The feature construction process of current state-of-the-art models only uses limited graph structure context information. This obvious imbalance leads to a large computational burden and susceptibility to overfitting. Therefore, it is important to redesign feature construction to avoid these problems. Limitation 2: The computational efficiency of mainstream learning-based methods in real-time source localization scenarios is still insufficient. Full observation methods first learn a latent propagation model before inference. The TGASI method adopts a two-stage optimization paradigm to first learn the influence matrix and then extract features based on this estimate. These two-stage methods incur a large amount of latency. In addition, TGASI constructs high-dimensional topological features and utilizes gated recurrent units to model timestamp sequences, which precludes parallelization. Therefore, more effective source localization techniques suitable for real-time applications are imperative. Limitation 3: Explainability techniques for source localization are limited because they simply output the predicted raw nodes without explanation. In practice, identifying possible diffusion fusion pathways leading to predicted sources can provide more insights than source prediction alone. However, existing methods lack the ability to produce such explanatory auxiliary outputs simultaneously with source inference. Summary of the invention

[0004] Based on this, it is necessary to provide an interpretable and efficient interpretable source localization method from coarse-grained to fine-grained to address the above technical problems.

[0005] A method for interpretable source localization from coarse-grained to fine-grained, the method comprising:

[0006] Obtain a social network and a set of graph snapshots observed on the social network; the social network includes a set of nodes and a set of edges; the set of graph snapshots includes a set of infection states of nodes; build an interpretable source location model; the interpretable source model includes a general feature extractor, a coarse-fine converter and a post-processing module; the coarse-fine converter includes a coarse-grained transformer encoder and a fine-grained transformer encoder;

[0007] Generate node features of social networks according to a general feature extractor, including: using graph diffusion fusion technology to obtain a global view of the social network to obtain a graph diffusion matrix; multiplying the graph diffusion model by the node infection state to obtain the global attribute of the node; and obtaining the final node feature by splicing the global attribute and the attribute of the infection state;

[0008] The final node features and the pre-set position embedding are input into the coarse-fine converter. In the coarse-grained transformer encoder, the input is projected according to three linear projection matrices to obtain the query key; the output of the single-layer encoder is calculated according to the query key; the output of the single-layer encoder is multi-headed attention calculated and the snapshot representation matrix is ​​output after passing through a fully connected feedforward network and a residual connection layer; in the fine-grained transformer encoder, the snapshot representation matrix is ​​interacted with the fine-grained node information with a certain time and memory complexity according to the kernelized attention module to obtain the kernelized features of the nodes; the kernelized feature matrix is ​​constructed using the kernelized features of each node; the kernelized multi-headed attention calculation is performed on the kernelized feature matrix and the hidden representation matrix is ​​output after passing through a fully connected feedforward network and a residual connection layer;

[0009] In the post-processing module, the prediction probability of each node is calculated based on the hidden representation matrix and the attention value between the nodes, and the node with the highest prediction probability is taken as the interpretable source localization result.

[0010] In one embodiment, a global view of a social network is obtained by using graph diffusion fusion technology to obtain a graph diffusion matrix, including:

[0011] Using graph diffusion fusion technology to obtain a global view of the social network, the graph diffusion matrix is ​​obtained as

[0012] S PPR =α(I n -(1-α)D -1 / 2 AD -1 / 2 )

[0013] S hcat =exp(βAD -1 -β).

[0014] in, is the identity matrix, α is the restart probability, is the diagonal matrix A, and β is the diffusion time.

[0015] In one embodiment, in a coarse-grained transformer encoder, the input is projected according to three linear projection matrices to obtain a query key, including:

[0016] In the coarse-grained transformer encoder, the input is projected according to three linear projection matrices to obtain the query key:

[0017]

[0018] in, and represents the projection matrix of layer l, H (l-1) Represents input.

[0019] In one embodiment, a multi-head attention calculation is performed on the output of a single-layer encoder and a snapshot representation matrix is ​​output after passing through a fully connected feedforward network and a residual connection layer, including:

[0020] The output of the single-layer encoder is multi-headed and the output snapshot representation matrix is ​​calculated after passing through the fully connected feedforward network and the residual connection layer:

[0021]

[0022] H (l) =LayerNorm(FFN(MultiHead(H (l) ))+H (l-1) )

[0023] Among them, LayerNorm is layer normalization, FFN is a two-layer fully connected feedforward network, MultiHead is a multi-head attention mechanism, H (l) is the output of the l-layer encoder.

[0024] In one embodiment, in a fine-grained transformer encoder, a kernelized attention module is used to interact with fine-grained node information on a snapshot representation matrix with a certain time and memory complexity to obtain kernelized features, including:

[0025] In the fine-grained transformer encoder, the kernelized attention module exchanges fine-grained node information with the snapshot representation matrix at a certain time and memory complexity, and the kernelized feature is obtained as

[0026]

[0027] where φ(·) represents the dot product of the random feature pulse kernel approximation feature map, i.e., the kernelized attention module, and It represents the projection matrix of the fine-grained Transformer, and n represents the total number of nodes.

[0028] In one embodiment, performing kernelized multi-head attention calculation on the kernelized feature matrix and outputting a hidden representation matrix after passing through a fully connected feedforward network and a residual connection layer includes:

[0029] The kernelized feature matrix is ​​subjected to kernelized multi-head attention calculation and the output hidden representation matrix is ​​obtained after passing through a fully connected feedforward network and a residual connection layer:

[0030] P=LayerNorm(FFN(KMultiHead(P (l) ))+P (l-1) )

[0031] Among them, P (l) represents the hidden representation of layer l, and KMultiHead is the kernelized multi-head attention module.

[0032] In one embodiment, the prediction probability of each node is calculated in the post-processing module according to the hidden representation matrix and the attention value between the nodes, and further includes:

[0033] In the post-processing module, the prediction probability of each node is calculated based on the hidden representation matrix and the attention value between the nodes:

[0034] P r =P :,1 +λ2C

[0035]

[0036] Among them, P ;,1 The first column of P represents the probability of a node being infected, λ2 is a hyperparameter used to control the importance of the post-processing module, and A i,j represents the attention value of node i and node j, Represents the projection matrix of the fine-grained Transformer.

[0037] In one of the embodiments, attention scores between nodes are calculated according to the kernelized attention module, a loss function of a fine-grained transformer encoder is set using the attention scores, the fine-grained transformer encoder is trained according to the loss function, and the hidden representation matrix is ​​updated using the trained fine-grained transformer encoder.

[0038] In one embodiment, calculating the attention scores between nodes according to the kernelized attention module includes:

[0039] According to the kernelized attention module, the attention score between nodes is calculated as

[0040]

[0041] where φ(·) represents the dot product of the random feature pulse kernel approximation feature map, i.e., the kernelized attention module, and It represents the projection matrix of the fine-grained Transformer, and z represents the node.

[0042] In one embodiment, the attention score is used to set the loss function of the fine-grained transformer encoder, including:

[0043] The loss function of the fine-grained transformer encoder is set using the attention score as

[0044]

[0045] Among them, ε p is the set of edges between infected nodes.

[0046] The above-mentioned method of interpretable source localization from coarse-grained to fine-grained, this application constructs an interpretable source localization model; the interpretable source model includes a general feature extractor, a coarse-fine converter and a post-processing module, and uses a general feature extractor to extract propagation features without explicit influence matrix estimation, and uses graph diffusion technology to obtain condensed structural representation. In terms of computational efficiency, this application designs a CFT architecture that supports parallelization. First, a coarse-grained tansfommer encoder is set to capture the interaction between time-varying snapshots, and then a fine-grained tansfonmer encoder is set to model node-level interactions, and a kernel attention module is used to reduce the time complexity from O(N2) to O(N) to avoid high computational burden. And according to the propagation contrast learning method, the loss function of the fine-grained tansfonmer encoder is designed for training and updating, and the interpretability of the model is improved by highlighting influential propagation paths. Finally, a post-processing module is proposed to further improve the results by simulating how people consider the attention value of visualization. Through modular design, this application achieves good source localization performance while maintaining high computational efficiency, generates interpretable diffusion explanations, implements one-stage end-to-end learning to avoid cascading errors, and realizes efficient parallel computing. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A schematic diagram of a flow chart of a method for interpretable source localization from coarse-grained to fine-grained in one embodiment;

[0048] Figure 2 A schematic diagram of a technical framework of an interpretable source localization method in an embodiment;

[0049] Figure 3 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0051] In one embodiment, Figure 1 As shown, a method for interpretable source localization from coarse-grained to fine-grained is provided, comprising the following steps:

[0052] Step 102, obtaining a social network and a set of graph snapshots observed on the social network; the social network includes a set of nodes and a set of edges; the set of graph snapshots includes a set of infection states of the nodes; building an interpretable source localization model; the interpretable source model includes a general feature extractor, a coarse-fine converter and a post-processing module; the coarse-fine converter includes a coarse-grained transformer encoder and a fine-grained transformer encoder.

[0053] This application performs explainable source localization, aiming to identify the source of propagating information, given a set of observed snapshots. First, the definitions of social networks, network snapshots, and source localization are provided.

[0054] Definition of social network: A social network G = {V, E, A} consists of a set of nodes V = {v1, v2, ..., vn}, where |V| = n; (2) a set of edges ε, where |ε| = m, edge e i,j =(v i , v j )∈ε represents the node v i and v j There are links; and (3) the adjacency matrix Represents the structural information of the network.

[0055] Network snapshots: Given a social network, you can get a collection of available graph snapshots. , a snapshot is collected at timestamp k, where is the set of infection states of the nodes, If the observed node v i Infected, otherwise

[0056] Source localization: The source localization problem is based on the social network G and the observed snapshots The task of finding the source node, where 1 indicates the original source and 0 otherwise.

[0057] First, we build an end-to-end interpretable source localization model, such as Figure 2 As shown, it includes a universal feature extractor (UFE), a coarse-fine transformer (CFT), including a coarse-grained transformer encoder and a fine-grained transformer encoder and a post-processing module (PPM). The universal feature extractor (UFE) is first used to generate features, which are then fed into the coarse-fine transformer (CFT) to capture time-varying snapshots and interactions between nodes. Finally, the post-processing module (PPM) is used to refine the result based on the generated edge attention value.

[0058] Step 104, generating node features of the social network according to the general feature extractor, including: using the graph diffusion fusion technology to obtain the global view of the social network to obtain the graph diffusion matrix; multiplying the graph diffusion model by the node infection state to obtain the global attributes of the node; and obtaining the final node features by splicing the global attributes and the attributes of the infection state.

[0059] Due to the lack of node features in real-world social networks, node attributes are initially enriched by considering the global structural information of the graph and combining the diffusion results. Subsequently, these enriched node attributes are fed into the tansfommer architecture to effectively capture the interactions between time-varying snapshots. This application does not require estimating the underlying propagation model or utilizing the actual influence matrix, which improves its applicability and reduces the error accumulation caused by inaccurate estimation.

[0060] Unlike previous methods that encode structural information in a static manner, this application incorporates the structural information of the graph into node attributes while taking into account the diffusion state. In addition, previous methods assigned more dimensions to structural embeddings in an attempt to enhance the learning ability of the model. However, this method also increases computational complexity and may lead to overfitting problems. In order to solve the above problems, this application borrows graph diffusion fusion technology to obtain a global view of the graph structure. Subsequently, the importance of each node in the graph can be quantified and used to determine the suspicious ability of each node. This application uses personalized PageRank (PPR) and head kernel, which are two popular diffusion processes. Among them, PPR diffusion uses T=D - 1 A and θ i =α(1-α) i ,where is the diagonal matrix A, and α is the restart probability. heatkernel diffusion uses T = D -1 A and θ i =e -β β i / i! , where β is the diffusion time. Therefore, the graph diffusion matrix S can be calculated by using the above two diffusion processes PPR , which also avoids multiple calculations. Then use the diffusion matrix S PPR Multiply the node infection state by Y to obtain the rich global attribute X g .

[0061]

[0062] We can get the node attribute X with rich structure g By connecting and The embedding X in the time segment can be obtained by splicing the infected state One-hot feature

[0063]

[0064] The final node feature As input to the tansfommer encoder.

[0065] Step 106, the final node features and the preset position embedding are input into the coarse-fine converter, the input is projected according to the three linear projection matrices in the coarse-grained transformer encoder to obtain the query key; the output of the single-layer encoder is calculated according to the query key; the output of the single-layer encoder is multi-headed attention calculated and the snapshot representation matrix is ​​output after passing through the fully connected feedforward network and the residual connection layer; in the fine-grained transformer encoder, the snapshot representation matrix is ​​interacted with the fine-grained node information with a certain time and memory complexity according to the kernelized attention module to obtain the kernelized features of the nodes; the kernelized features of each node are used to construct the kernelized feature matrix; the kernelized multi-headed attention calculation is performed on the kernelized feature matrix and the hidden representation matrix is ​​output after passing through the fully connected feedforward network and the residual connection layer.

[0066] When we obtain rich node attributes X={X1,X2,…,X T}, a coarse-grained transformer encoder is used to capture the interaction between time-varying snapshots, making the information interaction between different snapshots more effective. However, the attention calculation in this process is a parallel calculation method, which may cause the loss of relative position information, such as the order of snapshots in the graph. In order to retain the relative position information, this application adds a position input H to the input of the transformer. (0) =X:H (0) =H (0) +E pos ,in represents a positional embedding of the same dimension as H.

[0067] Then, the input is projected using three linear projection matrices to obtain the query keys Q, K, and V. The attention score is obtained by the dot product between the Q key and the K key:

[0068]

[0069] Here, d is the dimensionality of the hidden representation.

[0070] Then, by using the attention score to weight the V key, the output of the single-layer encoder is obtained as

[0071]

[0072] The process of multi-head attention is expressed as:

[0073]

[0074] in, is the projection matrix.

[0075] In addition, the coarse-grained transformer encoder also contains a two-layer fully connected feedforward network (FFN) and a residual connection to obtain the output of the multi-head attention calculation. Finally, the output of the transformer encoder is obtained by stacking the L1 layer. The output snapshot representation matrix is the mean pooling of the final transformer layer output, and L1 is the number of layers in the coarse-grained transformer encoder.

[0076] Get the snapshot representation matrix Finally, in order to achieve interpretable results, it is necessary to measure the correlation between each edge. The intuitive way is to use attention scores to measure the correlation between each node, and this can be achieved by using the above transformer encoder. However, the time complexity of the vanila-transformer encoder is O(n2), which is not suitable for large-scale graphs. This application designs a fine-grained transformer encoder. Represent Z as a graph with multiple nodes, represented as Z = (z1, z2.......z n ). By designing an efficient kernelized attention module, The time and memory complexity of the attention mechanism are reduced to exchange fine-grained node information. First, the input node features are mapped into a high-dimensional space of size m according to the dot product φ(·) of the positive random feature (pulse) kernel PositiveRandom Feature (PRF). Based on the kernel view, the attention mechanism can be modeled as the linear dot product of the kernelized features:

[0077]

[0078] Among them, due to and Each node can be pre-computed, so the time complexity of the kernelized attention module is reduced to

[0079] The kernelized features of each node are used to construct a kernelized feature matrix; kernelized multi-head attention calculation is performed on the kernelized feature matrix and the hidden representation matrix P is output after passing through a fully connected feedforward network and a residual connection layer.

[0080] Similar to the transformer module above, multi-head attention is also used, but the difference is that a kernelized attention module is used instead of a standard attention module. The process of kernelizing the transformer is:

[0081]

[0082] Among them, KMultiHead is a kernelized multi-head attention module.

[0083] After obtaining the kernelized attention score, it can be used to measure the relevance between each node. However, the fine-grained transformer does not consider the structural information of the graph, which is the same as forming a sequence graph, that is, each node is connected. Therefore, it is necessary to add structural constraints in the kernelized transformer to better adapt to the problem of graph source localization. For each edge ε = {(e i , e j )}, the kernelized attention module is used to calculate the attention score as

[0084]

[0085] Then, edge-level regularization is introduced. For the set of graph snapshots by and Take this as an example. First, extract the candidate propagation paths between G1 and G2 as follows:

[0086]

[0087] Among them, ε p is the set of edges between infected nodes, representing candidate propagation paths, ε p =ε\ε n Represents the negative side.

[0088] The coarse-grained Transformer encoder is used to aggregate time-varying information, and the fine-grained Transformer encoder is used to measure the correlation between each edge.

[0089] Step 108, in the post-processing module, the prediction probability of each node is calculated according to the hidden representation matrix and the attention value between the nodes, and the node with the highest prediction probability is used as the interpretable source positioning result.

[0090] PPM is designed to further enhance the results. In the framework of this application, the source node should show a strong connection with the infected node in the initial snapshot. Therefore, the attention value between the source node and the infected node in the first snapshot is used to enhance the results. The corrected probability is used as the final prediction

[0091] P r=P :,1 +λ2C

[0092]

[0093] Among them, P :,1 represents the first column of P, which indicates the probability of a node being infected. λ2 is a hyperparameter used to control the importance of the post-processing module. i,j represents the attention value of node i and node j. The principle behind this equation is that in the first snapshot, the attention value between the source node and the infected node should be larger than that of other node pairs. The second observation is that information should propagate from closely related nodes to distant nodes. Therefore, the neighbors of the first infected node with low attention scores should be filtered out. i,j In , neighbors are aggregated only once.

[0094] At the same time, the loss function of the design interpretable source localization model is

[0095]

[0096] Among them, λ1 is a hyperparameter used to control the importance of propagating contrastive learning, is the cross loss for the source localization task.

[0097] The above-mentioned method of interpretable source localization from coarse-grained to fine-grained, this application constructs an interpretable source localization model; the interpretable source model includes a general feature extractor, a coarse-fine converter and a post-processing module, and uses a general feature extractor to extract propagation features without explicit influence matrix estimation, and uses graph diffusion technology to obtain condensed structural representation. In terms of computational efficiency, this application designs a CFT architecture that supports parallelization. First, a coarse-grained tansfommer encoder is set to capture the interaction between time-varying snapshots, and then a fine-grained tansfonmer encoder is set to model node-level interactions, and a kernel attention module is used to reduce the time complexity from O(N2) to O(N) to avoid high computational burden. And according to the propagation contrast learning method, the loss function of the fine-grained tansfonmer encoder is designed for training and updating, and the interpretability of the model is improved by highlighting influential propagation paths. Finally, a post-processing module is proposed to further improve the results by simulating how people consider the attention value of visualization. Through modular design, this application achieves good source localization performance while maintaining high computational efficiency, generates interpretable diffusion explanations, implements one-stage end-to-end learning to avoid cascading errors, and realizes efficient parallel computing.

[0098] In one embodiment, a global view of a social network is obtained by using graph diffusion fusion technology to obtain a graph diffusion matrix, including:

[0099] Using graph diffusion fusion technology to obtain a global view of the social network, the graph diffusion matrix is ​​obtained as

[0100] S PPR =α(I n -(1-α)D -1 / 2 AD -1 / 2 )

[0101] S heat =exp(βAD -1 -β).

[0102] in, is the identity matrix, α is the restart probability, is the diagonal matrix A, and β is the diffusion time.

[0103] In one embodiment, in a coarse-grained transformer encoder, the input is projected according to three linear projection matrices to obtain a query key, including:

[0104] In the coarse-grained transformer encoder, the input is projected according to three linear projection matrices to obtain the query key:

[0105]

[0106] in, and represents the projection matrix of layer l, H (l-1) Represents input.

[0107] In one embodiment, a multi-head attention calculation is performed on the output of a single-layer encoder and a snapshot representation matrix is ​​output after passing through a fully connected feedforward network and a residual connection layer, including:

[0108] The output of the single-layer encoder is multi-headed and the output snapshot representation matrix is ​​calculated after passing through the fully connected feedforward network and the residual connection layer:

[0109]

[0110] H (l) =LayerNorm(FFN(MultiHead(H (l) ))+H (l-1) )

[0111] Among them, LayerNorm is layer normalization, FFN is a two-layer fully connected feedforward network, MultiHead is a multi-head attention mechanism, H (l) is the output of the l-layer encoder.

[0112] In one embodiment, in a fine-grained transformer encoder, a kernelized attention module is used to interact with fine-grained node information on a snapshot representation matrix with a certain time and memory complexity to obtain kernelized features, including:

[0113] In the fine-grained transformer encoder, the kernelized attention module exchanges fine-grained node information with the snapshot representation matrix at a certain time and memory complexity, and the kernelized feature is obtained as

[0114]

[0115] where φ(·) represents the dot product of the random feature pulse kernel approximation feature map, i.e., the kernelized attention module, and It represents the projection matrix of the fine-grained Transformer, and n represents the total number of nodes.

[0116] In one embodiment, performing kernelized multi-head attention calculation on the kernelized feature matrix and outputting a hidden representation matrix after passing through a fully connected feedforward network and a residual connection layer includes:

[0117] The kernelized feature matrix is ​​subjected to kernelized multi-head attention calculation and the output hidden representation matrix is ​​obtained after passing through a fully connected feedforward network and a residual connection layer:

[0118] P=LayerNorm(FFN(KMultiHead(P (l) ))+P (l-1) )

[0119] Among them, P (l) represents the hidden representation of layer l, and KMultiHead is the kernelized multi-head attention module.

[0120] In one embodiment, the prediction probability of each node is calculated in the post-processing module according to the hidden representation matrix and the attention value between the nodes, and further includes:

[0121] In the post-processing module, the prediction probability of each node is calculated based on the hidden representation matrix and the attention value between the nodes:

[0122] P r =P :,1 +λ2C

[0123]

[0124] Among them, P ;,1 The first column of P represents the probability of a node being infected, λ2 is a hyperparameter used to control the importance of the post-processing module, and A i,j represents the attention value of node i and node j, Represents the projection matrix of the fine-grained Transformer.

[0125] In one of the embodiments, attention scores between nodes are calculated according to the kernelized attention module, a loss function of a fine-grained transformer encoder is set using the attention scores, the fine-grained transformer encoder is trained according to the loss function, and the hidden representation matrix is ​​updated using the trained fine-grained transformer encoder.

[0126] In one embodiment, calculating the attention scores between nodes according to the kernelized attention module includes:

[0127] According to the kernelized attention module, the attention score between nodes is calculated as

[0128]

[0129] where φ(·) represents the dot product of the random feature pulse kernel approximation feature map, i.e., the kernelized attention module, and It represents the projection matrix of the fine-grained Transformer, and z represents the node.

[0130] In one embodiment, the attention score is used to set the loss function of the fine-grained transformer encoder, including:

[0131] The loss function of the fine-grained transformer encoder is set using the attention score as

[0132]

[0133] Among them, ε p is the set of edges between infected nodes.

[0134] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0135] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for interpretable source positioning from coarse-grained to fine-grained is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0136] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0137] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0138] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0139] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A coarse-grained to fine-grained interpretable source localization method, characterized in that: The method comprises: A social network and a set of graph snapshots observed on the social network are obtained; the social network includes a set of nodes and a set of edges; the set of graph snapshots includes a set of infection states of nodes; an interpretable source location model is constructed; the interpretable source model includes a general feature extractor, a coarse-fine converter and a post-processing module; the coarse-fine converter includes a coarse-grained transformer encoder and a fine-grained transformer encoder; Generating node features of the social network according to a universal feature extractor includes: using a graph diffusion fusion technique to obtain a global view of the social network to obtain a graph diffusion matrix; multiplying the graph diffusion model by the node infection state to obtain a global attribute of the node; and obtaining a final node feature by concatenating the global attribute and the attribute of the infection state; The final node features and the preset position embedding are input into the coarse-fine converter, and the input is projected according to three linear projection matrices in the coarse-grained transformer encoder to obtain a query key; the output of the single-layer encoder is calculated according to the query key; the output of the single-layer encoder is subjected to multi-head attention calculation and a snapshot representation matrix is ​​output after passing through a fully connected feedforward network and a residual connection layer; in the fine-grained transformer encoder, the snapshot representation matrix is ​​interacted with fine-grained node information with a certain time and memory complexity according to the kernelized attention module to obtain the kernelized features of the nodes; the kernelized feature matrix is ​​constructed using the kernelized features of each node; the kernelized multi-head attention calculation is performed on the kernelized feature matrix and a hidden representation matrix is ​​output after passing through a fully connected feedforward network and a residual connection layer; In the post-processing module, the prediction probability of each node is calculated according to the hidden representation matrix and the attention value between the nodes, and the node with the highest prediction probability is used as the interpretable source positioning result.

2. The method according to claim 1, characterized in that The global view of the social network is obtained by using graph diffusion fusion technology to obtain a graph diffusion matrix, including: The global view of the social network is obtained by using graph diffusion fusion technology, and the graph diffusion matrix is ​​obtained as follows: S PPR =α(I n -(1-a)D -1 / 2 AD -1 / 2 ) -1 S heat =exp(βAD -1 -β). in, is the identity matrix, α is the restart probability, is the diagonal matrix A, and β is the diffusion time.

3. The method according to claim 1, characterized in that In the coarse-grained transformer encoder, the input is projected according to three linear projection matrices to obtain the query key, including: In the coarse-grained transformer encoder, the input is projected according to three linear projection matrices to obtain the query key: in, represents the projection matrix of layer l, H (l-1) Represents input.

4. The method according to claim 1, characterized in that: The output of the single-layer encoder is subjected to multi-head attention calculation and outputted as a snapshot representation matrix after passing through a fully connected feedforward network and a residual connection layer, including: The output of the single-layer encoder is subjected to multi-head attention calculation and output through a fully connected feedforward network and a residual connection layer, and the snapshot representation matrix is: H (l) =LayerNorm(FFN(MultiHead(H (l) ))+H (l-1) ) Among them, LayerNorm is layer normalization, FFN is a two-layer fully connected feedforward network, MultiHead is a multi-head attention mechanism, H (l) is the output of the l-layer encoder.

5. The method according to claim 1, characterized in that In the fine-grained transformer encoder, the snapshot representation matrix is ​​interacted with fine-grained node information according to the kernelized attention module with a certain time and memory complexity to obtain kernelized features, including: In the fine-grained transformer encoder, the kernelized attention module interacts with the snapshot representation matrix with a certain time and memory complexity to obtain the kernelized feature: where φ(·) represents the dot product of the random feature pulse kernel approximation feature map, i.e., the kernelized attention module, It represents the projection matrix of the fine-grained Transformer, and n represents the total number of nodes.

6. The method according to claim 1, characterized in that The kernelized feature matrix is ​​subjected to kernelized multi-head attention calculation and outputted as a hidden representation matrix after passing through a fully connected feedforward network and a residual connection layer, including: The kernelized feature matrix is ​​subjected to kernelized multi-head attention calculation and outputted as a hidden representation matrix after passing through a fully connected feedforward network and a residual connection layer: P=LayerNorm(FFN(KMultiHead(P (l) ))+P (l-1) ) Among them, P (l) represents the hidden representation of layer l, and KMultiHead is the kernelized multi-head attention module.

7. The method according to claim 1, characterized in that The prediction probability of each node is calculated in the post-processing module according to the hidden representation matrix and the attention value between the nodes, and further includes: In the post-processing module, the prediction probability of each node is calculated based on the hidden representation matrix and the attention value between the nodes: P r =P :,1 +λ2C Among them, P ;,1 The first column of P represents the probability of a node being infected, λ2 is a hyperparameter used to control the importance of the post-processing module, and A i,j represents the attention value of node i and node j, Represents the projection matrix of the fine-grained Transformer.

8. The method according to claim 1, characterized in that The method further comprises: The attention scores between nodes are calculated according to the kernelized attention module, the loss function of the fine-grained transformer encoder is set using the attention scores, the fine-grained transformer encoder is trained according to the loss function, and the hidden representation matrix is ​​updated using the trained fine-grained transformer encoder.

9. The method according to claim 8, characterized in that Calculating the attention scores between nodes according to the kernelized attention module includes: The attention score between nodes is calculated according to the kernelized attention module: where φ(·) represents the dot product of the random feature pulse kernel approximation feature map, i.e., the kernelized attention module, It represents the projection matrix of the fine-grained Transformer, and z represents the node.

10. The method according to claim 9, characterized in that The attention score is used to set the loss function of the fine-grained transformer encoder, including: Using the attention score, the loss function of the fine-grained transformer encoder is set as Among them, ε p is the set of edges between infected nodes.

Citation Information

Patent Citations

  • Propagation source positioning method based on encoder and decoder framework

    CN117034134A

Cited By

  • Neural network computing method and device based on hybrid granularity reconfigurable computing architecture

    CN121189400A