Emergency event recognition model training method, recognition method and device
Through the federated graph structure learning method, homogeneous graphs are constructed and global classifiers are optimized, which solves the problem of heterogeneity and noise of graph data of emergencies recognition models on social platforms, improves the recognition accuracy and model generalization capabilities, and realizes efficient training under data privacy protection.
Patent Information
- Application Number
- CN202411079785.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2044-08-07
AI Technical Summary
In the prior art, the emergencies recognition model on social platforms has poor recognition effect under the influence of graph data heterogeneity and graph structure noise, and due to data privacy issues, the model generalization ability is poor.
Using a method based on federated graph structure learning, a heterogeneous graph is constructed and converted into a homogeneous graph through the collaboration of global servers and multiple clients. The local classifier is independently trained using graph neural network, and the global classifier is optimized through random block model and knowledge distillation technology. Combined with the comparison learning method, the difference in graph structure and characterization differences are reduced, and the model is improved.
It effectively eliminates the influence of graph data heterogeneity and structural noise, improves the accuracy of emergencies and generalization capabilities of the model, and realizes efficient training under data privacy protection.
Smart Images

Figure CN119249258B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to an emergency event recognition model training method, recognition method and device. Background Art
[0002] The effectiveness of deep learning models is highly correlated with the quality and quantity of data. Models can learn useful knowledge from high-quality, representative data. However, high-quality data is often held by numerous companies, organizations, and devices. Due to privacy, regulations, and other factors, this data cannot flow freely among various parties, making it difficult to centralize and train models.
[0003] In recent years, graph neural networks (GNNs) have been widely used in fields such as social networks, traffic modeling, recommender systems, and drug discovery due to their powerful ability to model complex graph-structured data. Similar to machine learning tasks in other fields, training high-performing GNN models requires not only sufficient training data but also independent and identically distributed (IID) data. In reality, data owners are confined to their own domains, unable to observe the global distribution, and typically collect limited and biased graphs. To improve model generalization performance, multi-party collaborative training is necessary. However, data is stored locally with the data owner, and due to data privacy concerns, centralized training through direct data transfer between clients is not possible. Federated learning (FL) aims to train machine learning models with data distributed across multiple local systems to address the information silo problem. Federated learning has demonstrated its advantages in improving the performance and generalization of collaboratively trained models without sharing any original data. For example, FL has been designed in computer vision (CV) and natural language processing (NLP) to allow the joint training of powerful and generalizable deep convolutional neural networks and language models on separately stored image and text datasets.
[0004] In existing technologies, the identification of sudden events on social platforms is achieved by using graph neural networks to semantically represent the graph data nodes generated on social platforms and further classify and identify them. However, social platforms suffer from heterogeneous graph data. Existing graph federated learning algorithms have proposed a large number of solutions to this problem, mainly including methods such as model interpolation, adding regularization constraints to local losses, and meta-learning to improve the adaptability of local models or learn a powerful global federated model. However, most of these federated graph learning methods only consider the deviations in node features and lack in-depth research on the graph structure differences that are unique to graph data. Existing graph neural networks generally rely on the assumption that the original graph structure is high-quality. However, the graph structure in the implemented data inevitably contains noise, which can negatively impact downstream tasks. Therefore, a new solution is needed to address the impact of heterogeneous graph data and noise in the graph structure when identifying sudden events on social platforms. Summary of the Invention
[0005] In view of this, the embodiments of the present invention provide an emergency event recognition model training method, recognition method and device to eliminate or improve one or more defects existing in the existing technology, and eliminate the impact of graph data heterogeneity and graph structure noise when the existing technology recognizes emergencies.
[0006] One aspect of the present invention provides a method for training an emergency event recognition model based on federated graph structure learning. The method is executed based on a global server and multiple clients, and includes the following steps:
[0007] Each client obtains local emergency text data through a set social platform. Keywords in the emergency text data include user information, user-posted text, event type, topic identifier, like / forward relationship, time and location elements, and co-occurrence relationships between the keywords. An event heterogeneous graph is constructed based on the emergency text data. Based on the meta-paths in the event heterogeneous graph, the event heterogeneous graph is converted into a text-based homogeneous graph to obtain an isolated subgraph for each client.
[0008] Each client independently trains a local classifier based on a graph neural network using the local isolated subgraph, and the global server aggregates the local classifiers of each client, minimizes the aggregation risk, and optimizes the parameters to obtain a global classifier;
[0009] Extracting local graph structure information of the isolated subgraph of each client using a random block model and performing aggregation; reconstructing a local graph with global information on the client;
[0010] Based on the knowledge distillation method, the representation difference between the isolated subgraph and the reconstructed local graph corresponding to each client through the global classifier is minimized, and the debiasing parameters of the global classifier are optimized; and the reconstructed local graph is used as the enhanced view. Based on the contrastive learning method, the representation of the corresponding nodes in the isolated subgraph and the enhanced view in each client is used as positive samples, and the representation between non-corresponding nodes is used as negative samples. By constraining the representation distance of positive and negative samples, the parameters of the global classifier are optimized to obtain the emergency event recognition model.
[0011] In some embodiments, the homogeneous graph is initially represented using a text embedding model Bert.
[0012] In some embodiments, minimizing the aggregate risk and performing parameter optimization to obtain a global classifier includes:
[0013] The problem is formulated as finding the global classifier parameter θ that minimizes the aggregate risk. * , the expression is:
[0014]
[0015] Wherein, F represents the global classifier, R represents the aggregate risk, M represents the number of clients, and F i (θ) represents the classification result of the local classifier of the i-th client under the parameter θ; is the experience loss function of the i-th client, expressed as:
[0016]
[0017] Where l represents the hinge loss function, |V i | represents the number of nodes in the isolated subgraph of the i-th client, Represents the local classifier of the i-th client under the parameter θ, and its isolated subgraph The classification result of the vth node in y v Represents an isolated subgraph The event type of the vth node in .
[0018] In some embodiments, extracting local graph structure information of the isolated subgraph of each client using a random block model and performing aggregation; and reconstructing a local graph with global information on the client, including:
[0019] Assume that the N nodes of the original isolated subgraph in the client can be divided into K communities, and each node i belongs to a community z i ;
[0020] Define a K×K matrix Ω, Ω ab represents the connection probability between community a and community b;
[0021] Set community c i Node v i and community c j Node v j The probability that there is an edge between Based on Determine node v i With node v j Is there a connection? Given Ω, the prediction result Z and the label Y, the probability of generating the reconstructed local graph A is formalized as:
[0022]
[0023] Among them, P(A|Ω, Z, Y) represents the probability of the edge, A ij Represents node v i and node v j The connection probability of represents the annotation set, y i For node v i Labeled event classification, z i For node v i Predicted event classification; c i Represents the node v i classification of events identified during the reconstruction process;
[0024] In some embodiments, the method further comprises:
[0025] The original isolated subgraph and node features are input into the graph neural network of the pre-trained global classifier, and the i-th layer node h i Construct a k-nearest neighbor graph as the observation value O i , and form the observation set O = {A, O0, ..., O l};
[0026] The observation set O, the node classification recognition result Z and the label Y are put into the graph estimator to calculate the observation probability of the observation set O. The expression is:
[0027]
[0028] Where, E ij represents the number of times the edge between nodes i and j appears in the observation set, M represents the total number of observation samples; α represents the true positive probability, that is, an edge appears in both the observation set and the actual optimal graph structure G * β represents the probability of a false positive, that is, the probability that an edge is not in the optimal graph structure but is observed;
[0029] Optimal graph structure G based on Bayesian formula * The probability is expressed as:
[0030]
[0031] Among them, P(Ω) represents the community matrix probability; P(G * |Ω,Z,Y L ) represents the probability distribution of graph generation, P(O, Z, Y L ) represents the probability of observed data, P(α) represents the probability of variable α, and P(β) represents the probability of variable β;
[0032] The community adjacency matrix Q is estimated by the expectation maximization algorithm, and the structural information is aggregated by weighting each client Q. Finally, the formula Estimate the link probability of the client graph nodes and estimate the local graph structure S from a global perspective by setting a threshold ∈.
[0033] In some embodiments, the representation difference between the isolated subgraph and the reconstructed local graph corresponding to each client through the global classifier is minimized, and in the debiasing parameter optimization of the global classifier, the representation difference adopts mean square error or KL divergence.
[0034] In some embodiments, the global classifier is optimized by constraining the distance between positive and negative sample representations, including:
[0035] Construct contrast loss to optimize the parameters of the global classifier. The contrast loss expression is:
[0036]
[0037] Among them, z l,i Indicates the information of the i-th node in the original isolated subgraph of the client, z g,i represents the i-th node information in the enhanced view of the client, z g,j represents the j-th node information in the enhanced view of the client; τ represents the temperature coefficient, and sim represents the cosine similarity.
[0038] On the other hand, the present invention also provides a method for identifying emergencies based on federated graph structure learning, the method comprising the following steps:
[0039] By setting up a social platform to obtain text data of unprocessed emergency events, the keywords of the unprocessed emergency event text data include user information, user-posted text, event type, topic identifier, like and forwarding relationship, and time and location elements; constructing a heterogeneous graph of unprocessed events based on the co-occurrence relationship between the keywords, and converting the heterogeneous graph of unprocessed events into a text-based homogeneous graph based on the meta-path in the heterogeneous graph of unprocessed events;
[0040] The homogeneous graph to be processed is input into the emergency event recognition model in the above-mentioned emergency event recognition model training method based on federated graph structure learning, and the emergency event recognition results of each node in the homogeneous graph to be processed are output; wherein, the emergency event recognition model semantically represents each node through a graph neural network, and then uses a K-Mean clustering algorithm to cluster and identify the type of emergency events.
[0041] On the other hand, the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon, which implements the steps of the above method when executed by a processor.
[0042] On the other hand, the present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the above method when executed by a processor.
[0043] The beneficial effects of the present invention are at least:
[0044] The emergency event recognition model training method, recognition method and device described in the present invention pre-train a global classifier based on a federated learning architecture, extract and aggregate local structural information from the local graph of each client through a random block model, reconstruct a local view with global information, and use knowledge distillation to guide model optimization training from a local perspective, thereby minimizing the representation difference between the two graph structures; using a contrastive learning method, by perturbing and expanding the graph data, an enhanced view is constructed, and the representations of corresponding nodes in the original image and the enhanced view are selected as positive samples, and the representations of different nodes are selected as negative samples, thereby constraining the representation distance between the positive and negative samples and improving the representation learning ability and robustness of the model.
[0045] Additional advantages, objects, and features of the present invention will be set forth in part in the following description and will become apparent to those skilled in the art upon examination of the following or may be learned from practice of the present invention. The objects and other advantages of the present invention may be realized and obtained by the structures particularly pointed out in the description and drawings.
[0046] Those skilled in the art will understand that the purposes and advantages that can be achieved by the present invention are not limited to the above specific descriptions, and the above and other purposes that can be achieved by the present invention will be more clearly understood based on the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of this application, and do not constitute a limitation of the present invention. In the drawings:
[0048] Figure 1 The figure is a flow chart of a method for training an emergency event recognition model based on federated graph structure learning according to an embodiment of the present invention.
[0049] Figure 2 This is a schematic diagram of the training process of the model in the event recognition method based on federated graph structure learning described in another embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0051] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, the accompanying drawings only show structures and / or processing steps closely related to the solutions according to the present invention, while other details that are not closely related to the present invention are omitted.
[0052] It should be emphasized that the term "include / comprises" when used herein refers to the existence of features, elements, steps or components, but does not exclude the existence or addition of one or more other features, elements, steps or components.
[0053] The purpose of the present invention is to solve the data heterogeneity problem in the federated learning framework during the training of the social network emergency event recognition scenario model. Specifically, in the federated scenario, the training data is collected independently by each client. Due to issues such as data privacy, the training set cannot be shared between clients. The graph structure data of each client has structural differences, which leads to the problem of event recognition model deviation and poor generalization ability.
[0054] Specifically, the present invention provides a method for training an emergency event recognition model based on federated graph structure learning, wherein the method is executed based on a global server and multiple clients, such as Figure 1 As shown, the method includes the following steps S101 to S104:
[0055] Step S101: Each client obtains local emergency text data by setting up a social platform. The keywords of the emergency text data include user information, text posted by users, event type, topic identifier, like and forwarding relationship, time and place elements and co-occurrence relationship between keywords. An event heterogeneous graph is constructed based on the emergency text data. According to the meta-path in the event heterogeneous graph, the event heterogeneous graph is converted into a text-based homogeneous graph to obtain an isolated subgraph of each client.
[0056] Step S102: Each client independently trains a local classifier based on a graph neural network using a local isolated subgraph, and the global server aggregates the local classifiers of each client, minimizes the aggregation risk, and optimizes the parameters to obtain a global classifier.
[0057] Step S103: extracting local graph structure information of isolated subgraphs of each client using a random block model and performing aggregation; reconstructing a local graph with global information on the client.
[0058] Step S104: Based on the knowledge distillation method, minimize the representation difference between the isolated subgraphs corresponding to each client and the reconstructed local graph through the global classifier, and optimize the debiasing parameters of the global classifier; and use the reconstructed local graph as the enhanced view, based on the contrastive learning method, with the representation of the corresponding nodes in the isolated subgraphs and the enhanced view in each client as positive samples, and the representation between non-corresponding nodes as negative samples. By constraining the representation distance of positive and negative samples, optimize the parameters of the global classifier to obtain an emergency event recognition model.
[0059] In step S101, different types of nodes and edges in the heterogeneous graph represent different entities and relationships, for example, user nodes, text nodes, keyword nodes and the publishing, likes, forwarding, and co-occurrence relationships between them. In order to simplify the processing, the complex heterogeneous graph is converted into a homogeneous graph. According to the meta-path contained in the graph, for example: text-user-text (Text-User-Text) relationship chain: through this relationship chain, the relationship between different texts posted by the same user can be found. Through these meta-paths, the relationships in the heterogeneous graph are converted into homogeneous text-text relationships, and a new text-text homogeneous graph is constructed. In the homogeneous graph, each node represents a text. Use the text embedding model BERT (Bidirectional Encoder Representations from Transformers) to embed each text and convert the text content into a high-dimensional vector representation.
[0060] This step constructs a homogeneous graph based on social media platform emergencies, successfully transforming heterogeneous data into a homogeneous graph structure. Using the BERT model for node initialization improves the quality of node representation and the preservation of textual semantic information.
[0061] This step integrates multi-source information such as user behavior, text content, time and location, uses the BERT model to semantically embed text, optimizes graph node representation, simplifies complex heterogeneous graph structures through meta-path transformation, and constructs comprehensive homogeneous event graph data, thereby improving the ability to track and analyze emergencies and enhancing the timeliness and accuracy of event detection and response.
[0062] In step S102, the pre-training of the graph model follows the basic graph federated learning method. To obtain a global classifier, each client first trains a local classifier using local data, and then aggregates the data. The goal of graph neural networks (GNNs) is to learn graph representations. A classic graph node embedding involves two steps: message propagation and aggregation. Each node in the graph uses its own information to iteratively collect information from its neighbors to update and improve its representation.
[0063] During the aggregation process, the global classifier is obtained by minimizing the aggregation risk and optimizing the parameters, including:
[0064] The problem is transformed into finding the global classifier parameter θ* that minimizes the aggregate risk, which is expressed as:
[0065]
[0066] Among them, F represents the global classifier, R represents the aggregate risk, M represents the number of clients, and F i(θ) represents the classification result of the local classifier of the i-th client under the parameter θ; is the experience loss function of the i-th client, expressed as:
[0067]
[0068] Where l represents the hinge loss function, |V i | represents the number of nodes in the isolated subgraph of the i-th client, Represents the local classifier of the i-th client under the parameter θ, and its isolated subgraph The classification result of the vth node in y v Represents an isolated subgraph The event type of the vth node in .
[0069] In step S103, the local graph structure information of the isolated subgraph of each client is extracted using a random block model and aggregated; and a reconstructed local graph with global information is reconstructed on the client, including:
[0070] Assume that the N nodes of the original isolated subgraph in the client can be divided into K communities, and each node i belongs to a community z i ;
[0071] Define a K×K matrix Ω, Ω ab represents the connection probability between community a and community b;
[0072] Set community c i Node v i and community c j Node v j The probability that there is an edge between Based on Determine node v i With node v j Is there a connection? Given Ω, the prediction result Z and the label Y, the probability of generating the reconstructed local graph A is formalized as:
[0073]
[0074] Among them, P(A|Ω, Z, Y) represents the probability of the edge, A ij Represents node v i and node v j The connection probability of represents the annotation set, y i For node v i Labeled event classification, z i For node v i Predicted event classification; c i Represents the node v iclassification of events identified during the reconstruction process;
[0075] In some embodiments, the method further comprises:
[0076] The original isolated subgraph and node features are input into the graph neural network of the pre-trained global classifier, and the i-th layer node h i Construct a k-nearest neighbor graph as the observation value O i , and form the observation set O = {A, O0, ..., O l};
[0077] The observation set O, the node classification recognition result Z and the label Y are put into the graph estimator to calculate the observation probability of the observation set O. The expression is:
[0078]
[0079] Where, E ij represents the number of times the edge between nodes i and j appears in the observation set, M represents the total number of observation samples; α represents the true positive probability, that is, an edge appears in both the observation set and the actual optimal graph structure G * β represents the probability of a false positive, that is, the probability that an edge is not in the optimal graph structure but is observed;
[0080] Optimal graph structure G based on Bayesian formula * The probability is expressed as:
[0081]
[0082] Among them, P(Ω) represents the community matrix probability; P(G * |Ω,Z,Y L ) represents the probability distribution of graph generation, P(O, Z, Y L ) represents the probability of the observed data, P(α) represents the probability of the variable α, and P(β) represents the probability of the variable β.
[0083] The community adjacency matrix Q is estimated by the expectation maximization algorithm, and the structural information is aggregated by weighting each client Q. Finally, the formula Estimate the link probability of the client graph nodes and estimate the local graph structure S from a global perspective by setting a threshold ∈.
[0084] In step S104, the knowledge distillation process specifically includes: training the teacher model, global Train the teacher model to get the node representation Initialize the student model in the local graph structure G local Train the student model to get the initial node representation Distillation training, the output of the student model (local representation ) and the output of the teacher model (global representation By minimizing the designed loss function (MSE or KL divergence), the parameters of the student model are continuously adjusted so that its output gradually approaches the output of the teacher model.
[0085] Contrastive learning is an unsupervised learning method whose main idea is to enhance the robustness of the model's representation of data by constructing pairs of positive and negative samples and optimizing their representations. Specifically, contrastive learning learns more discriminative feature representations by narrowing the representation gap between positive pairs and widening the representation gap between negative pairs. In contrastive learning, data augmentation enhances model robustness by perturbing the data (such as adding noise or transforming it) to generate different views. In graph-structured learning, this perturbation can be achieved by reconstructing the graph structure.
[0086] The reconstructed graph structure is a reconstruction result based on a global perspective, representing the distribution of graph data from a global perspective. Using this reconstructed graph structure as an enhanced view can introduce more global information, thereby improving representation learning under local graph structures.
[0087] In the two graph structures (the original local graph structure and the reconstructed global graph structure), the representations of corresponding nodes are selected as positive sample pairs. In each batch, the representations of other nodes are selected as negative samples.
[0088] In some embodiments, the representation difference between the isolated subgraph and the reconstructed local graph corresponding to each client through the global classifier is minimized, and the debiasing parameters of the global classifier are optimized, and the representation difference adopts mean square error or KL divergence.
[0089] In some embodiments, the global classifier is optimized by constraining the distance between positive and negative sample representations, including:
[0090] Construct contrast loss to optimize the parameters of the global classifier. The contrast loss expression is:
[0091]
[0092] Among them, z l,i Indicates the information of the i-th node in the client's original isolated subgraph, z g,j Indicates the information of the i-th node in the client's enhanced view, z g,j represents the j-th node information in the client's enhanced view; τ represents the temperature coefficient, and sim represents the cosine similarity.
[0093] On the other hand, the present invention also provides a method for identifying emergencies based on federated graph structure learning, the method comprising the following steps S201 to S202:
[0094] Step S201: Acquire text data of pending emergency events by setting up a social platform. Keywords of the pending emergency event text data include user information, text posted by users, event type, topic identifier, like and forwarding relationship, and time and place elements; construct a heterogeneous graph of pending events based on the co-occurrence relationship between keywords, and convert the heterogeneous graph of pending events into a text-based homogeneous graph based on the meta-path in the heterogeneous graph of pending events.
[0095] Step S202: Input the homogeneous graph to be processed into the emergency event recognition model in the emergency event recognition model training method based on federated graph structure learning described in the above steps S101 to S104, and output the emergency event recognition results of each node in the homogeneous graph to be processed; wherein, the emergency event recognition model uses a K-Mean clustering algorithm to cluster and identify the type of emergency event after semantically representing each node through a graph neural network.
[0096] On the other hand, the present invention further provides a computer-readable storage medium having a computer program / instruction stored thereon, which implements the steps of the above method when executed by a processor.
[0097] On the other hand, the present invention also provides a computer program product, comprising a computer program / instruction, which implements the steps of the above method when executed by a processor.
[0098] The present invention will be described below in conjunction with a specific embodiment:
[0099] This embodiment provides an event recognition method based on federated graph structure learning. By designing a graph structure learning method to extract local graph structure information and reconstructing the local graph structure based on mixed global information, this method achieves federated model alignment tailored to structural differences by comparative learning between the original and reconstructed graphs. Applying this graph structure comparative learning in federated scenarios is compatible with heterogeneous cross-client data, enabling robust semantic modeling of event text and identification of event text clusters.
[0100] like Figure 2As shown, the model training process mainly includes five parts: graph data construction, pre-training, graph structure learning based on stochastic block model, federated graph comparative learning, and emergency event recognition. Specifically, the present invention proposes a federated graph structure information sharing framework for emergency event recognition. The framework first collects text data from social platforms, then constructs a graph according to rules, extracts local structural information through graph structure learning methods (such as stochastic block model, SBM) and aggregates it. The aggregated structural information is used to reconstruct a local view with global information on the client, and a local model is used to calculate node representations on the local graph and the reconstructed graph. The global and local representations are aligned through methods such as distillation or comparative learning to reduce model offset caused by structural differences.
[0101] 1) Construction of emergency graph data
[0102] The method first collects potential event-related text data on social platforms, which includes users, texts posted by users, events, topic tags (hash tags), likes and forwarding, time and location, etc. Based on the posting, likes, and forwarding relationships between users and texts, and the co-occurrence relationship between keywords contained in the data, an event heterogeneous graph is constructed. Then, based on the meta-paths contained in the graph, such as the text-user-text relationship chain, the complex heterogeneous graph is converted into a text-text homogeneous graph. The initial representation of the graph nodes is Initialize with the text embedding model Bert.
[0103] 2) Pre-training
[0104] The graph model pre-training step follows the basic graph federated learning method, which usually gives the structure and feature information of the graph. Where V, A, and X represent nodes, adjacency matrices, and node features, respectively. Graph neural networks (GNNs) aim to learn graph representations. A classic graph node embedding involves two steps: message propagation and aggregation. Each node in the graph iteratively collects information from its neighbors using its own information to update and improve its representation.
[0105] Generally speaking, a l-layer GNN can be expressed as:
[0106]
[0107] In federated graph learning, the global graph identity is marked as There is a global server S and M clients. For client subgraphs, there are no common nodes between client subgraphs, which can be expressed as The federated learning framework is used to collaboratively learn on isolated subgraphs of all data owners without the need to share the original graph data. To obtain the global node classifier F, the learnable weights θ in F are calculated based on the client subgraph G. iPerform optimization. The problem is formalized as finding θ* that minimizes the aggregate risk:
[0108]
[0109] Wherein, F represents the global classifier, R represents the aggregate risk, M represents the number of clients, and F i (θ) represents the classification result of the local classifier of the i-th client under the parameter θ; is the experience loss function of the i-th client, expressed as:
[0110]
[0111] Where l represents the hinge loss function, |V i | represents the number of nodes in the isolated subgraph of the i-th client, Represents the local classifier of the i-th client under the parameter θ, and its isolated subgraph The classification result of the vth node in y v Represents an isolated subgraph The event type of the vth node in .
[0112] 3) Graph structure learning based on stochastic block model
[0113] The stochastic block model assumes that the probability of an edge between nodes depends only on their communities. For example, community c i Node v i and node v in community cj j The probability that there is an edge between Therefore, Ω represents the probability of intra-community and inter-community connections. Given the parameter Ω, prediction Z and label Y, the probability of generating graph A is formalized as:
[0114]
[0115] Among them, P(A|Ω, Z, Y) represents the probability of the edge, A ij Represents node v i and node v j The connection probability of represents the annotation set, y i For node v i Labeled event classification, z i For node v i Predicted event classification; c i Represents the node v i Event classifications identified during reconstruction.
[0116] The original graph A and node features X are input into the pre-trained GNN model. Given that the node representations of different layers reveal multi-order neighborhood information, the node representation h of each layer is used to i Construct a k-nearest neighbor graph as the observation value O of the optimal graph i , combined with the original graph A, to form the observation set O = {A, O0, ..., O l Then, these observations 0, model node classification results Z and labels Y are put into the graph estimator. By modeling the graph structure with a random block model, the probability of observing 0 can be expressed as P(O|G, α, β), where α represents the true positive probability, that is, an edge appears in both the observation set and the actual optimal graph structure G. * β represents the probability of a false positive, that is, the probability that an edge is not in the optimal graph structure but is observed. The specific expression of the observation probability is as follows:
[0117]
[0118] Where M represents the number of times the edge between nodes i and j appears in the observation set, M represents the total number of observation samples; α represents the true positive probability, that is, an edge appears in both the observation set and the actual optimal graph structure G * β represents the false positive probability, that is, the probability that an edge is not in the optimal graph structure but is observed.
[0119] The intermediate goal of this example is to infer the optimal graph structure G based on the observation O and the predicted label Z. * , the probability of the optimal graph structure based on the Bayesian formula can be expressed as:
[0120]
[0121] where P(O|G,α,β) is the probability of these observations O given the optimal graph G and model parameters α and β.
[0122] The graph generates a probability distribution P(G|Ω,Z,YL), where Ω represents the parameters of SBM. SBM assumes that the probability of an edge between nodes depends only on their communities. For example, with community c i Node v i and have community c j Node v j The probability that there is an edge between them is Ω ci cj P(Ω), P(α), P(β), and P(O, Z, YL) are the parameters and the probability of the observed data.
[0123] P(O,Z,YL) represents the joint probability of the observation graph and node label classification recognition result Z and label Y.
[0124] Finally, the community adjacency matrix Q is estimated by the expectation maximization (EM) algorithm. The structural information is aggregated by simply weighting each client Q. Finally, the link probability of the client graph node is estimated by formula (4), and the local graph structure S from a global perspective is estimated by setting a threshold ∈.
[0125] 4) Federated Graph Comparative Learning
[0126] The goal of this embodiment is to achieve model debiasing by aligning global representations and local representations. Here, we mainly consider knowledge distillation and contrastive learning methods. For the graph structure under the global perspective reconstructed by structural learning, the mean square error (MAE) or KL divergence of the representations under the two graph structures is minimized by the knowledge distillation method to achieve model debiasing. The contrastive learning method mainly achieves data expansion by perturbing the data, and improves the robustness of representation learning by constraining the distance between positive and negative sample representations. The reconstructed graph structure is used as an enhanced view, and the representations of the corresponding nodes under the two graph structures are used as positive samples z i , select other nodes in each batch as negative samples z j , and construct the following contrast loss:
[0127]
[0128] Among them, z l,i Indicates the information of the i-th node in the original isolated subgraph of the client, z g,i represents the i-th node information in the enhanced view of the client, z g,j represents the j-th node information in the enhanced view of the client; τ represents the temperature coefficient, and sim represents the cosine similarity.
[0129] 5) Time Recognition Based on Graph Learning
[0130] The specific problem solved by this embodiment is the data heterogeneity problem in emergency event recognition under the federated learning framework. Based on the above-mentioned federated graph comparative learning method, a robust semantic representation of each text is obtained, and finally a clustering algorithm such as K-Mean is used to realize the recognition of emergency event text clusters.
[0131] This example migrates traditional graph learning-based event recognition methods to a federated scenario, addressing model drift caused by data heterogeneity. Local features estimated using traditional stochastic block models are aggregated in a federated manner, and the aggregated information is used for structural reconstruction, enabling the sharing of federated graph structural information. Furthermore, using this federated graph structural learning as a data augmentation method, global and local features are aligned, improving model training convergence efficiency and event recognition accuracy.
[0132] Corresponding to the above method, the present invention also provides an apparatus / system, which includes a computer device, the computer device includes a processor and a memory, the memory stores computer instructions, and the processor is used to execute the computer instructions stored in the memory. When the computer instructions are executed by the processor, the apparatus / system implements the steps of the method described above.
[0133] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the aforementioned edge computing server deployment method. The computer-readable storage medium may be a tangible storage medium, such as a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a floppy disk, a hard disk, a removable storage disk, a CD-ROM, or any other form of storage medium known in the art.
[0134] In summary, the emergency event recognition model training method, recognition method and device described in the present invention pre-train a global classifier based on the federated learning architecture, extract and aggregate local structural information from the local graph of each client through a random block model, reconstruct a local view with global information, and use knowledge distillation to guide model optimization training from a local perspective, minimizing the representation difference between the two graph structures; using a contrastive learning method, by perturbing and expanding the graph data, constructing an enhanced view, and selecting the representations of corresponding nodes in the original image and the enhanced view as positive samples, and the representations of different nodes as negative samples, constraining the representation distance between positive and negative samples, and improving the representation learning ability and robustness of the model.
[0135] It should be understood by those skilled in the art that the various exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is specifically performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link via a data signal carried in a carrier.
[0136] It should be understood that the present invention is not limited to the specific configurations and processes described above and illustrated in the figures. For the sake of brevity, a detailed description of known methods is omitted. In the above embodiments, several specific steps are described and illustrated as examples. However, the method of the present invention is not limited to the specific steps described and illustrated. Those skilled in the art may make various changes, modifications, and additions, or change the order of the steps after understanding the spirit of the present invention.
[0137] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with or replace features of other embodiments.
[0138] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations to the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A method for training an emergency event recognition model based on federated graph structure learning, characterized in that: The method is performed based on a global server and multiple clients, and includes the following steps: Each client obtains local emergency text data through a set social platform. Keywords in the emergency text data include user information, user-posted text, event type, topic identifier, like / forward relationship, time and location elements, and co-occurrence relationships between the keywords. An event heterogeneous graph is constructed based on the emergency text data. Based on the meta-paths in the event heterogeneous graph, the event heterogeneous graph is converted into a text-based homogeneous graph to obtain an isolated subgraph for each client. Each client independently trains a local classifier based on a graph neural network using the local isolated subgraph, and the global server aggregates the local classifiers of each client, minimizes the aggregation risk, and optimizes the parameters to obtain a global classifier; Extracting local graph structure information of the isolated subgraph of each client using a random block model and performing aggregation; reconstructing a local graph with global information on the client; Based on knowledge distillation, the difference between the representations of the isolated subgraph and the reconstructed local graph corresponding to each client through the global classifier is minimized, and the debiasing parameters of the global classifier are optimized; and the reconstructed local graph is used as an enhanced view. Based on contrastive learning, the representations of the corresponding nodes in the isolated subgraph and the enhanced view in each client are used as positive samples, and the representations between non-corresponding nodes are used as negative samples. By constraining the distance between the positive and negative sample representations, the parameters of the global classifier are optimized to obtain the emergency event recognition model; The random block model is used to extract the local graph structure information of the isolated subgraph of each client and aggregate the information; and the reconstructed local graph with global information is reconstructed on the client, including: Assume that the N nodes of the original isolated subgraph in the client can be divided into K communities, and each node i belongs to a community z i ; Define a K×K matrix Ω, Ω ab represents the connection probability between community a and community b; Set community c i Node v i and community c j Node v j The probability that there is an edge between Based on Determine node v i With node v j Is there a connection? Given Ω, the prediction result Z and the label Y, the probability of generating the reconstructed local graph A is formalized as: Among them, P(A|Ω, Z, Y) represents the probability of the edge, A ij Represents node v i and node v j The connection probability of represents the annotation set, y i For node v i Labeled event classification, z i For node v i Predicted event classification; c i Represents the node v i Event classifications identified during reconstruction.
2. The method for training an emergency event recognition model based on federated graph structure learning according to claim 1, characterized in that: The homogeneous graph is initially represented using the text embedding model Bert.
3. The method for training an emergency event recognition model based on federated graph structure learning according to claim 1, characterized in that: Minimize the aggregation risk and optimize the parameters to obtain a global classifier, including: The problem is formulated as finding the global classifier parameter θ that minimizes the aggregate risk. * , the expression is: Wherein, F represents the global classifier, R represents the aggregate risk, M represents the number of clients, and F i (θ) represents the classification result of the local classifier of the i-th client under the parameter θ; is the experience loss function of the i-th client, expressed as: Where l represents the hinge loss function, |V i | represents the number of nodes in the isolated subgraph of the i-th client, Represents the local classifier of the i-th client under the parameter θ, and its isolated subgraph The classification result of the vth node in y v Represents an isolated subgraph The event type of the vth node in .
4. The method for training an emergency event recognition model based on federated graph structure learning according to claim 1, characterized in that: The method further comprises: The original isolated subgraph and node features are input into the graph neural network of the pre-trained global classifier, and the i-th layer node h i Construct a k-nearest neighbor graph as the observation value O i , and form the observation set O = {A, O0, ..., O l }; The observation set O, the node classification recognition result Z and the label Y are put into the graph estimator to calculate the observation probability of the observation set O. The expression is: Where, E ij represents the number of times the edge between nodes i and j appears in the observation set, M represents the total number of observation samples; α represents the true positive probability, that is, an edge appears in both the observation set and the actual optimal graph structure G * β represents the probability of a false positive, that is, the probability that an edge is not in the optimal graph structure but is observed; Optimal graph structure G based on Bayesian formula * The probability is expressed as: Among them, P(Ω) represents the community matrix probability; P(G * |Ω,Z,Y L ) represents the probability distribution of graph generation, P(O, Z, Y L ) represents the probability of observed data, P(α) represents the probability of variable α, and P(β) represents the probability of variable β; The community adjacency matrix Q is estimated by the expectation maximization algorithm, and the structural information is aggregated by weighting each client Q. Finally, the formula Estimate the link probability of the client graph nodes and estimate the local graph structure S from a global perspective by setting a threshold ∈.
5. The method for training an emergency event recognition model based on federated graph structure learning according to claim 1, characterized in that: Minimize the representation difference between the isolated subgraph and the reconstructed local graph corresponding to each client through the global classifier, and optimize the debiasing parameters of the global classifier, wherein the representation difference adopts mean square error or KL divergence.
6. The method for training an emergency event recognition model based on federated graph structure learning according to claim 1, characterized in that: By constraining the distance between positive and negative samples, the parameters of the global classifier are optimized, including: Construct contrast loss to optimize the parameters of the global classifier. The contrast loss expression is: Among them, z l,i Indicates the information of the i-th node in the original isolated subgraph of the client, z g,i represents the i-th node information in the enhanced view of the client, z g,j represents the j-th node information in the enhanced view of the client; τ represents the temperature coefficient, and sim represents the cosine similarity.
7. A method for identifying emergencies based on federated graph structure learning, characterized in that: The method comprises the following steps: By setting up a social platform to obtain text data of unprocessed emergency events, the keywords of the unprocessed emergency event text data include user information, user-posted text, event type, topic identifier, like and forwarding relationship, and time and location elements; constructing a heterogeneous graph of unprocessed events based on the co-occurrence relationship between the keywords, and converting the heterogeneous graph of unprocessed events into a text-based homogeneous graph based on the meta-path in the heterogeneous graph of unprocessed events; The homogeneous graph to be processed is input into the emergency event recognition model in the emergency event recognition model training method based on federated graph structure learning as described in any one of claims 1 to 6, and the emergency event recognition results of each node in the homogeneous graph to be processed are output; wherein, the emergency event recognition model semantically represents each node through a graph neural network, and then uses a K-Mean clustering algorithm to cluster and identify the type of emergency events.
8. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Heterogeneous graph data node embedded feature extraction model training method, embedded feature extraction method and node classification method and device
CN117272017A
Graph contrast learning quotation network node classification method and system based on global and local information enhancement
CN118395116A