Cross-language social media event detection method based on federal knowledge distillation
Through federated knowledge distillation and a four-stage life cycle mechanism, it solves the problem of insufficient performance and data increment of social media event detection in low-resource language scenarios, and achieves cross-language semantic alignment and improved event detection efficiency.
Patent Information
- Application Number
- CN202410639047.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2044-05-22
AI Technical Summary
Existing cross-language social media event detection methods based on federated distillation perform poorly in low-resource language scenarios, and language migration is difficult due to different data distributions. They also face the scarcity of low-resource data and the large and growing volume of social media event data. The question of speed.
A cross-language social media event detection method based on federated knowledge distillation is adopted, cross-language word embedding pre-training is performed through efficient parameter fine-tuning technology and three sets of contrast losses, a weighted isomorphic message graph is constructed, and a four-stage life cycle is introduced under the federated framework. Mechanism to achieve effective transfer of knowledge and incremental detection.
It effectively improves the performance of low-resource language models, achieves semantic space alignment between different languages, adapts to incremental changes in social media event data, and improves the efficiency and accuracy of event detection.
Smart Images

Figure CN118586431A
Abstract
Description
Technical Field
[0001] The invention discloses a cross-language social media event detection method based on federated distillation, and relates to the technical field of detecting real-time events. Background Art
[0002] Social media platforms play a key role in today's information age, providing us with a wealth of real-time information resources, including multiple data types such as text, images, and videos, covering events, trends, and topics in various fields. Therefore, it is crucial for businesses, governments, and individuals to effectively detect events from social media platforms and make cross-domain decisions.
[0003] Graph Neural Network (GNN) is a method that has made significant progress in social media event detection and has successfully solved many problems existing in traditional methods. Traditional methods, such as keyword-based, machine learning or topic modeling, are often limited by topic drift, poor generalization ability, low real-time detection efficiency and poor interpretability. At present, advanced graph neural network methods have been widely used for social media event detection. These methods represent social media messages as nodes and construct heterogeneous social media message graphs by establishing additional relationships between elements, which are then converted into homogeneous social media message graphs. Social media event detection methods based on GNN have achieved remarkable results in scenarios with rich resource languages (such as English), but there is still much room for improvement in model performance in scenarios with low resource languages (such as Vietnamese). Therefore, how to effectively use the knowledge of rich resource languages to improve the performance of social media event detection models in low resource languages has become a recent research hotspot. In addition, in practical applications, rich resource data and low resource data are usually distributed on different social media platforms. Existing methods use a data-centric approach to migrate from rich resource languages to low resource languages, which obviously ignores this feature. Due to privacy and legal restrictions, a large amount of high-quality data cannot flow between different platforms. Federated learning, as a data decentralized learning architecture, provides a possible solution to this situation. It is worth mentioning that in the face of a large amount of social media event data, federated learning can also reduce the cost of data transmission and storage, which is more in line with display needs.
[0004] However, the existing federated distillation-based framework still faces many challenges:
[0005] Lack of low-resource data: Due to problems such as data scarcity, it is difficult to build a low-resource language model alone, and the performance in social media event detection in low-resource scenarios does not meet expectations.
[0006] Language migration is difficult: Due to the differences in grammar and expression between different languages, the data distributed on different clients are quite different, which leads to model drift, thus affecting the effect of knowledge distillation. At the same time, data sharing between rich-resource languages and low-resource languages is subject to many restrictions, which is also an urgent problem to be solved.
[0007] Social events continue to emerge: In real scenarios, social media events are characterized by large amounts of data and rapid growth, which places higher demands on the model's ability to receive and process new information. Summary of the invention
[0008] In order to solve the above problems, the present invention proposes a cross-language social media event detection method based on federated knowledge distillation, which effectively distills the rich-resource client knowledge to the low-resource client while protecting data privacy, thereby improving the performance of the low-resource language model.
[0009] In order to solve the problem of scarce low-resource data, the present invention proposes a knowledge distillation strategy under the federated learning framework, so that the data of rich-resource clients can be effectively migrated to low-resource clients and guide the training of the models of low-resource clients. At the same time, we trained a cross-language word embedding model, using efficient parameter fine-tuning technology and three sets of contrastive losses to capture the semantic differences between different languages and overcome the difficulty of inconsistent semantic spaces between languages. In addition, in the face of the continuous emergence of social media event data, the present invention introduces an incremental life cycle under the federated framework and designs a four-stage life cycle mechanism, so that the model can continuously adapt to the incoming new data and continuously detect new events, thereby achieving the effect of data increment.
[0010] The technical solution of the present invention is: a cross-language social media event detection method based on federated knowledge distillation, the method comprising:
[0011] Step 1: Cross-language word embedding pre-training: To address the problem of inconsistent input features in the federated framework due to different client languages, we use efficient parameter fine-tuning technology and three sets of contrastive losses to map non-English languages into the English semantic space.
[0012] Step 2: Construction of weighted isomorphic message graph: Use the entity, user, and hashtag relationships in existing social data information to construct a weighted isomorphic message graph, and use graph neural network as a feature extractor.
[0013] Step 3, federated network message distillation: Introduce local models and global models in the federated framework to achieve private model customization, and use process supervision guided by the global model and result supervision guided by the global anchor point to achieve effective knowledge distillation. And design a four-stage life cycle mechanism to achieve incremental event detection in the federated framework.
[0014] Specifically, in terms of the overall architecture, we follow the traditional knowledge distillation-based server-client design. On the server side, we design a global model W g and the global anchor point A g To communicate between resource-rich clients and low-resource clients. Each client contains a local model W k,l A global model W is used to adapt to local data. k,g For feature distillation, a global anchor point A k,g Used to align the feature spaces of each client. We use the global model as process supervision and the global anchor as result supervision to achieve effective knowledge transfer. The local model is updated based on the local data to adapt to the characteristics of the local data. The global model is shared among all clients with the same architecture and initial parameters, and collaborative learning is performed. We use the lifecycle mechanism to adapt to online and offline scenarios.
[0015] As a preferred embodiment of the present invention, the specific steps of Step 1 are:
[0016] Step 1.1: The cross-language word embedding model trained by the present invention uses a dataset from hungryface. We map the semantic space of non-English texts to the English semantic space, so our dataset is a non-English-English parallel corpus.
[0017] Step 1.2 The cross-lingual word embedding model is composed of a frozen multilingual pre-trained language model and a multilingual pre-trained model with Lora added.
[0018] Step 1.3 The present invention uses contrastive learning to train the model. Specifically, we introduce three sets of contrastive losses to enable the added Lora to learn the differences between different languages. They are: non-English to English similarity contrast loss, English self-similarity contrast, and non-English internal similarity contrast.
[0019] As a preferred embodiment of the present invention, in the step 1.2:
[0020] Step 1.2.1. Since different clients use different languages, we fine-tune the pre-trained language model and train a cross-language word embedding module to ensure that each client has a consistent input feature space. We use parallel corpora from non-English to English to train a cross-language word embedding model to achieve semantic space mapping from non-English text to English text. We use the low-rank adaptive strategy of LoRA, a parameter-efficient fine-tuning technology, to capture semantic differences between different languages.
[0021] Step 1.2.2, in order to prevent the introduced LoRA module from losing English semantics, the present invention introduces a guidance model (M′), that is, a frozen multilingual pre-training model. M′ is used to guide M to learn. The cross-language word embedding module (M) designed by the present invention is the attention calculation matrix W in the multilingual pre-training model. q and W v Specifically, the original W q and W v Calculated as:
[0022] Q origin =X·W q ,V origin =X·W v
[0023] First improve as follows:
[0024] Q lora =X·(W q +scale·BA),V lora =X·(W v +scale·BA)
[0025] In this process, A is initialized with random Gaussian, while B is initialized with zero, so the initial value of BA is 0. Later, as the downstream task data is learned, only the values of B and A are fine-tuned to achieve the effect of downstream task adaptation.
[0026] As a preferred embodiment of the present invention, in the step 1.3:
[0027] Step 1.3.1. During the training phase, the present invention introduces three sets of contrast losses: non-English to English similarity contrast loss, English self-similarity contrast, and non-English internal similarity contrast. Non-English to English similarity contrast is used to measure the similarity between non-English text and the corresponding English text, with the aim of ensuring that the model can identify and match the correct language pair. English self-similarity contrast focuses on the similarity between different representations within English text, which helps the model maintain consistency within the same language. Non-English internal similarity contrast is used to evaluate the similarity between non-English text and its corresponding English representation to ensure that the semantic relationship within the non-English text is properly expressed. In general, these loss functions work together on the model to achieve effective cross-language word embedding learning by maximizing the similarity between positive sample pairs while minimizing the similarity with other non-corresponding samples.
[0028] Step 1.3.2: Use three sets of contrastive losses to achieve alignment of semantic spaces between different languages. The semantic alignment loss L total for:
[0029] L total =L c1 +L c2 +L c3
[0030] Among them, L c1 , L c2 , and L c3 Three sets of contrastive learning losses, in the form of:
[0031]
[0032]
[0033]
[0034] Where N is the number of samples in a batch, sim(a,b) represents the similarity between a and b, x represents non-English text, and M(y i ) represents the corresponding English text, and τ is a temperature parameter used to adjust the scale of similarity. The goal of this loss function is to maximize the similarity between positive sample pairs while minimizing the similarity with other non-corresponding samples. In this way, the model is trained to preserve the semantic information between cross-lingual texts, thereby achieving effective semantic alignment.
[0035] As a preferred embodiment of the present invention, the specific steps of Step 2 are:
[0036] Step 2.1. Divide the social media message streams of rich-resource clients and low-resource clients into different message blocks. For each message block, divide the training set, test set and validation set according to a certain ratio, and construct heterogeneous message graphs between messages. The message content is regarded as the message node, and the topic entity, user and hashtag elements between messages are regarded as the relationship nodes. At the same time, the co-occurrence number of the three elements is used as the weight of the edge, thereby constructing a weighted isomorphic message graph. We construct an initial message block and a streaming message block for each client.
[0037] Step 2.2, model selection, we choose the GNN model as the feature extractor, mainly for the following two reasons: 1) GNN retains strong structural information and semantic information, and can make full use of user, entity, and hashtag element information on social media. 2) The fewer parameters of the graph neural network can adapt to each client more flexibly and reduce the time of federated communication. The constructed weighted isomorphic message graph can learn the result information and semantic information in the social media text through the graph neural network.
[0038] As a preferred embodiment of the present invention, the specific steps of Step 2.1 are:
[0039] Step 2.1.1. Define social flow: S = M0, M1, ..., M i-1 ,M i ,…a set of continuous time series of social media message blocks, M i is the time block = [t i ,t i+1 ) constitutes a social media message block; i Expressed as: M i ={m j |1≤j≤|M i |}, where |M i |For M i The total number of messages in m j is a single message; each social media message belongs to only one category; M0, {M_i|i≠0} are the message blocks in offline and online scenarios respectively.
[0040] For federated cross-lingual social media event detection, our goal is to distill the knowledge learned by rich-resource clients to low-resource clients. Assume that H is the set of rich-resource clients, L is the set of low-resource clients, and M k,i is the i-th message block on the k-th client, where each message block on the client is in a single language. The event set C(M) in the i-th message block on the rich resource client k,i |k∈H) contains the low-resource client event set C(M k,i |k∈L), that is In round t on the kth client, message block M k,i The global model output for sample x in is is the corresponding local model output. The global model f on each client g The architecture is consistent, and the local model of each client is k,l The design can be customized based on the characteristics of the local dataset.
[0041] Step 2.1.2, encoding information combined with semantic and time information. For time information, we convert the timestamp into OLE date to obtain a two-dimensional time feature. For semantic information, we use a cross-language word embedding model to uniformly encode the message to obtain a semantic representation. The final message representation is the concatenation of the semantic representation of the message and the time feature in the last dimension.
[0042] Step 2.1.3, construct a message graph with the encoded data set. Specifically, on each client, use one week of data to construct the initial message block M0, and divide the subsequent 21 days of data into message blocks M1, M2, …, M 21 For each message block, the initial message block is divided into training set, test set and validation set in the ratio of 7:2:1. A heterogeneous message graph between messages is constructed respectively, with the message content as the message node, and the three elements of topic hashtag, entity and user between messages as the relationship nodes; the co-occurrence number of the above three elements is used as the edge weight, so as to transform the heterogeneous message graph into a homogeneous message graph.
[0043] As a preferred embodiment of the present invention, the specific steps of Step 2.2 are:
[0044] Step 2.2.1. In order to deeply fuse rich semantic and relational information, the GNN encoder learns node representation by iteratively aggregating information from its one-hop neighbors. Formally, the l-th layer message m i Expressed as Its update at layer l+1 can be expressed as:
[0045]
[0046] in, Represents message m i One hop neighbor. Represents the feature aggregation method,
[0047] Aggregators and extractors are different in different GNN models. Different clients can design different GNNs based on local data and customize local models.
[0048] As a preferred embodiment of the present invention, the specific steps of Step 3 are:
[0049] Step 3.1. In order to make the framework adaptable to social media event detection in online and offline scenarios, we introduce a four-stage life cycle mechanism. At different stages of the life cycle, the federation aggregation method is slightly different, but there are certain commonalities. Specifically, in the first stage of the life cycle, only the local model of the rich resource client. In the second stage of the life cycle, the local model of the rich resource client, the global model of the rich resource client, and the local model of the low resource client participate in the training. Aggregation only aggregates and pulls down the global model of the rich resource client and the global anchor point. In the fourth stage of the life cycle, the local model of the rich resource client, the global model of the rich resource client, the local model of the low resource client, and the global model of the low resource client all participate in the training. The aggregation method performs weighted aggregation on the global anchor points and global models uploaded by each client (including the low resource client) according to the current block data set size of each client, and then pulls down the aggregation results to each client.
[0050] Step 3.2: In order to adapt the framework to the streaming characteristics of social media, we designed a 4-stage life cycle mechanism. Figure 2 As shown in the figure. The life cycle of FedEvent includes four stages: rich resource client pre-training (Stage I), low resource client pre-training (Stage II), each client detection (Stage III) and maintenance (Stage IV). In the first stage, we use M0 on the rich resource client message block to build an initial weighted isomorphic message graph and train the initial model using a specific algorithm. In the second stage, we use the model trained in stage I to assist the low resource client in training the initial model with the central server as the medium for knowledge transmission. In the third stage, a new graph is built for each incoming block, and then each incoming message block is directly detected using the trained model. In the fourth stage, the model is continuously trained with the latest message blocks, and the federated co-distillation mechanism is used to realize online learning of each client, so that the model can learn new knowledge. Among them, stage I and stage II are used for offline learning, and stage IV is used for online learning. Stages III and IV are carried out alternately. In this way, the model constantly adapts to the incoming data, can detect new events and update the knowledge of the model. Through the life cycle mechanism, FedEvent can better adapt to the characteristics of streaming media.
[0051] As a preferred embodiment of the present invention, the specific steps of Step 3.1 are:
[0052] Step 3.1.1, after the local model training is completed, the anchor point (cluster center vector) of the current message block of the current client will be calculated. The local anchor point is the message block M on the current client. i The local anchor point is the comprehensive representation of the characteristics of the same event message cluster on the current client. At round t, the local anchor point representation of event cluster c in client k is The calculation is as follows:
[0053]
[0054] in, represents the number of samples of event cluster c on client k. k,l Represents the output of the local model.
[0055] Step 3.1.2, after the anchor point calculation of each client is completed, the central server will accept the local anchor point representation from each client, and aggregate the local message cluster anchor point representations on $M_i$ from different clients. The aggregation method is weighted average according to the number of messages in each client message block, that is:
[0056]
[0057] Among them, S is the set of clients that meet the aggregation conditions. The set S is different at different stages of the life cycle mechanism. The global anchor point is obtained by the above formula The global anchor point will be broadcasted to all shared clients. At this point, the obtained global anchor point can comprehensively reflect the characteristics of the same event cluster and can be used to guide the model training of each client.
[0058] Step 3.1.3: After the global anchor aggregation is completed, the global model aggregation begins. The central server receives and aggregates the global models from all clients, and generates the next round of updated global models through aggregation processing. Right now:
[0059]
[0060] in, represents the number of samples in client k, are the parameters of the global model in the tth round in the kth client.
[0061] Step 3.1.4: After the central server completes the aggregation, it will pull the aggregation results down to each client, and then a new round of training will begin. The process of uploading and pulling down will repeat until the model converges.
[0062] As a preferred embodiment of the present invention, the specific steps of Step 3.2 are:
[0063] Step 3.2.1, in the first stage of the life cycle, the purpose of the present invention is to train a robust local model W using the initial message block M0 in the rich resource client k,l . As new events continue to emerge, the total number of events is difficult to know in advance. Considering that the cross entropy loss is only applicable to the case where the total number of events is known and fixed, it is difficult to process streaming data. Therefore, we turn to the use of paired learning methods to ensure inter-cluster compactness and intra-cluster separation. Due to this feature, in the subsequent second and third stages, the clear inter-cluster boundary information of the rich-resource client can be distilled to the low-resource client. The task-specific loss and total loss of this stage are respectively
[0064]
[0065] in, is the first stage loss, {Pos} is the sample pair from the same event cluster, and {Neg} is the sample pair from different event clusters. a is the boundary distance hyperparameter, D(,) calculates the Euclidean distance, and h is the message representation learned by the GNN encoder. After training, the model is tested.
[0066] Step 3.2.2, in the second stage of the life cycle, the present invention uses the local model trained in stage one to assist low-resource clients in training the initial model. We propose a global model-oriented process supervision and a global anchor-oriented result supervision to achieve knowledge transfer. Specifically, for rich-resource clients, freeze the local model, use the local model as the teacher model, and the global model as the student model. While the student model learns the data characteristics of the rich-resource client, it will also learn the hidden layer output of the teacher model (Local-To-Global strategy). In low-resource clients, freeze the global model, use the global model as the teacher model, and the local model as the student model. While the student model learns general knowledge from the teacher model, it uses local data to learn knowledge suitable for local data characteristics (Global-To-Local strategy). We regard the above two strategies as process-oriented supervision. And introduce global anchor-oriented result supervision to unify the cluster centers of each client. Knowledge transfer is carried out from both result-oriented and process-oriented aspects.
[0067] In process-oriented supervised learning, the student model can flexibly learn the output of a specific or several hidden layers in the teacher model according to the characteristics of local data. On client k, the distillation loss of each client student model is It can be expressed as:
[0068]
[0069] Among them, MSE represents the mean square error, I represents the number of hidden layers that the student model needs to learn from the teacher model, Represent the output of the i-th hidden layer of the teacher model and the student model respectively.
[0070] When training on the local client, we expect each feature to be closer to the corresponding global anchor and away from the non-corresponding global anchor. We use contrastive learning to coordinate the local centers of all clients to exchange information between clients. The global anchor and the client-side model can be represented as right
[0071] For the data sample x of the i-th block, the anchor point alignment loss for:
[0072]
[0073]
[0074] in is the cross entropy loss, s=[s1,s2,…,s c ] is a similarity vector, $s_n$ represents the similarity between the current feature and each anchor point, α determines the level of concentration, and <,> is the inner product. Minimizing the cross entropy loss maximizes the feature and its corresponding anchor point The similarity between them, and minimize the feature and The similarity between each non-corresponding anchor point in .
[0075] In stage 2, the client set S=H participating in the aggregation, that is, only the rich resource clients participate in the aggregation. On client k, this stage only trains the student model on each client, and the total loss in this stage is It can be expressed as:
[0076]
[0077] After the second phase of the life cycle training is completed, the trained model begins to be tested.
[0078] Step 3.2.3, in the third stage of the life cycle, we use the trained model to i ,M i+w ] The message blocks in the window are clustered. Distance-based clustering algorithms (such as K-Means) or density-based algorithms (such as HDBSCAN) can cluster messages. Among them, HDBSCAN does not need to specify the total number of categories, which is very suitable for incremental detection needs. Therefore, we use the HDBSCAN algorithm for message detection.
[0079] Step3.2.4, the above two steps are used for offline learning. In the fourth stage of the life cycle, incremental training begins. We designed a co-distillation mechanism guided by task-specific losses to adapt to online scenarios. In this process, the local models of each client and the global model participate in model training, learn from each other and adapt to data distribution and pattern changes in online scenarios. Since the local model is more adaptable to local data than the global model, the useful knowledge encoded by the local model can help guide the global model. In addition, the local model can only learn from local data, while the global model integrates the data characteristics of all clients. Therefore, the local model can also benefit from the knowledge distilled from the global model. Therefore, the local model and the global model can learn from each other. Based on this, we designed a co-distillation mechanism guided by task-specific losses in this stage, so that the local model and the global model can learn useful knowledge from each other. For the global model and the local model, the distillation loss can be expressed as:
[0080]
[0081] The client set S = {L∪H} participating in the aggregation in this stage, that is, all clients participate in the aggregation. The total loss in this stage includes task-specific loss, co-distillation loss based on task-specific loss, and anchor alignment loss. The losses of the local model and the global model in this stage can be expressed as
[0082]
[0083]
[0084] Step 3.2.5, Step 3.2.4 and Step 3.2.3 are performed alternately, so that the model can continuously adapt to social media event detection in online scenarios and learn new knowledge.
[0085] Beneficial effects of the present invention:
[0086] 1. The present invention uses a lifecycle mechanism to adapt to the event detection needs in online and offline scenarios, and realizes effective knowledge transfer through process supervision and result supervision; through knowledge distillation technology, it effectively alleviates the challenges faced with low-resource languages, and uses a cross-language word embedding module to realize semantic space mapping between different languages; this technology effectively improves the efficiency of social media event detection and realizes incremental event detection.
[0087] 2. Based on a large public English dataset Events2012, the present invention supplements Chinese and Vietnamese event samples according to its topic descriptions and constructs a private dataset on a low-resource client. Compared with the traditional baseline model, the evaluation indicators of the experimental group are significantly improved compared with all baseline models. BRIEF DESCRIPTION OF THE DRAWINGS
[0088] Figure 1 The overall framework diagram of the cross-language social media event detection method based on federated knowledge distillation provided in an embodiment of the present invention;
[0089] Figure 2 A life cycle diagram of a cross-language social media event detection method based on federated knowledge distillation provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0090] The embodiments of the present invention are described below in conjunction with the accompanying drawings. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention.
[0091] like Figure 1 , which is an overall framework diagram of a cross-language social media event detection method based on federated knowledge distillation provided by an embodiment of the present invention. Figure 2 The framework life cycle diagram is shown in Figure 2. The cross-language social media event detection method based on federated knowledge distillation includes the following steps:
[0092] Step 1: Cross-language word embedding pre-training: To address the problem of inconsistent input features in the federated framework due to different client languages, we use efficient parameter fine-tuning technology and three sets of contrastive losses to map non-English languages into the English semantic space.
[0093] Step 2. Construct a weighted isomorphic message graph for each client: Construct a weighted isomorphic message graph based on the entities, users, and hashtag relationships in the data set divided by each client, and use the graph neural network as a feature extractor.
[0094] Step 3, federated network message distillation: Introduce local models and global models in the federated framework to achieve private model customization, and use process supervision guided by the global model and result supervision guided by the global anchor point to achieve effective knowledge distillation. And design a four-stage life cycle mechanism to achieve incremental event detection in the federated framework.
[0095] The detection system corresponding to the present invention comprises:
[0096] The cross-language word embedding module is used to train a cross-language word embedding model using parallel corpora from non-English to English, aiming to achieve semantic space mapping from non-English text to English text. The semantic differences between different languages are captured through a low-rank adaptive strategy with efficient parameter fine-tuning technology.
[0097] The message representation graph learning module is used to construct a weighted isomorphic message graph using the user, entity, and hashtag relationships in social media, and use a two-layer GAT to extract features from social information.
[0098] The federated network message distillation module is used to introduce local models and global models under the federated framework to achieve private model customization, and to achieve effective knowledge distillation by utilizing process supervision guided by the global model and result supervision guided by the global anchor point. A four-stage lifecycle mechanism is designed to achieve incremental event detection under the federated framework.
[0099] The cross-language word embedding module includes: The cross-language word embedding module is an attention calculation matrix W in the multi-language pre-training model q and W v Add a branch. In order to prevent the introduced LoRA module from losing English semantics, we use the frozen multilingual pre-trained model as a guide model; align the semantic space by introducing three sets of comparisons; specifically, the non-English to English similarity comparison loss measures the similarity between non-English text and the corresponding English text, with the aim of ensuring that the model can identify and match the correct language pair; the English self-similarity comparison loss focuses on the similarity between different representations within the English text, which helps the model maintain consistency within the same language; the non-English internal similarity comparison loss is used to bring the non-English text closer to its corresponding English representation, to ensure that the semantic relationship within the non-English text is properly expressed.
[0100] The message representation graph learning module includes: a module for constructing a weighted isomorphic message graph based on the three elements of user, entity and hashtag. Specifically, when two messages share any of the three elements, an edge is added to them in the graph; intuitively, the more elements are shared, the closer the relationship between the two messages is; therefore, the number of co-occurring elements is used as the weight of the edge to construct a weighted isomorphic message graph; then the semantic information and structural information of the message are learned through the graph neural network.
[0101] The federated network message distillation module includes: a method for introducing a four-stage lifecycle strategy, so that the knowledge of rich-resource clients can be distilled to low-resource clients while realizing online and offline learning under the federated framework.
[0102] As a preferred embodiment of the present invention, the specific steps of Step 1 are:
[0103] Step 1.1, Dataset: The cross-language word embedding model trained by the present invention uses a dataset from Hunging Face. We map the semantic space of non-English texts to the English semantic space, so our dataset is a non-English-English parallel corpus. The present invention searches for the required non-English-English parallel sentence pairs from Hunging Face.
[0104] Step 1.2, model construction: The cross-lingual word embedding model is composed of a frozen multilingual pre-trained language model and a multilingual pre-trained model with Lora added.
[0105] Step 1.3, model training: The present invention uses contrastive learning to train the model. Specifically, we introduce three sets of contrastive losses to enable the added Lora to learn the differences between different languages. They are: non-English to English similarity contrast loss, English self-similarity contrast, and non-English internal similarity contrast.
[0106] As a preferred embodiment of the present invention, in the step 1.2:
[0107] Step 1.2.1. Since different clients use different languages, we fine-tune the pre-trained language model and train a cross-language word embedding module to ensure that each client has a consistent input feature space. We use parallel corpora from non-English to English to train a cross-language word embedding model to achieve semantic space mapping from non-English text to English text. We use the low-rank adaptive strategy of LoRA, a parameter-efficient fine-tuning technology, to capture semantic differences between different languages.
[0108] Step 1.2.2, in order to prevent the introduced LoRA module from losing English semantics, the present invention introduces a guidance model (M′), that is, a frozen multilingual pre-training model. M′ is used to guide M to learn. The cross-language word embedding module (M) designed by the present invention is the attention calculation matrix W in the multilingual pre-training model. q and W v Specifically, the original W q and W v Calculated as:
[0109] Q origin =X·W q ,V origin =X·W v
[0110] First improve as follows:
[0111] Q lora =X·(W q +scale·BA),Vlora =X·(W v +scale·BA)
[0112] In this process, A is initialized with random Gaussian, while B is initialized with zero, so the initial value of BA is 0. Later, as the downstream task data is learned, only the values of B and A are fine-tuned to achieve the effect of downstream task adaptation.
[0113] As a preferred embodiment of the present invention, in the step 1.3:
[0114] Step 1.3.1. During the training phase, the present invention introduces three sets of contrast losses: non-English to English similarity contrast loss, English self-similarity contrast, and non-English internal similarity contrast. Non-English to English similarity contrast is used to measure the similarity between non-English text and the corresponding English text, with the aim of ensuring that the model can identify and match the correct language pair. English self-similarity contrast focuses on the similarity between different representations within English text, which helps the model maintain consistency within the same language. Non-English internal similarity contrast is used to evaluate the similarity between non-English text and its corresponding English representation to ensure that the semantic relationship within the non-English text is properly expressed. In general, these loss functions work together on the model to achieve effective cross-language word embedding learning by maximizing the similarity between positive sample pairs while minimizing the similarity with other non-corresponding samples.
[0115] Step 1.3.2: Use three sets of contrastive losses to achieve alignment of semantic spaces between different languages. The semantic alignment loss L total for:
[0116] L total =L c1 +L c2 +L c3
[0117] Among them, L c1 , L c2 , and L c3 Three sets of contrastive learning losses, in the form of:
[0118]
[0119]
[0120]
[0121] Where N is the number of samples in a batch, sim(a,b) represents the similarity between a and b, x represents non-English text, and M(y i) represents the corresponding English text, and τ is a temperature parameter used to adjust the scale of similarity. The goal of this loss function is to maximize the similarity between positive sample pairs while minimizing the similarity with other non-corresponding samples. In this way, the model is trained to preserve the semantic information between cross-lingual texts, thereby achieving effective semantic alignment.
[0122] As a preferred embodiment of the present invention, the specific steps of Step 2 are:
[0123] Step 2.1. Divide the social media message streams of rich-resource clients and low-resource clients into different message blocks. For each message block, divide the training set, test set and validation set according to a certain ratio, and construct heterogeneous message graphs between messages. The message content is regarded as the message node, and the topic entity, user and hashtag elements between messages are regarded as the relationship nodes. At the same time, the co-occurrence number of the three elements is used as the weight of the edge, thereby constructing a weighted isomorphic message graph. We construct an initial message block and a streaming message block for each client.
[0124] Step 2.2, model selection, we choose the GNN model as the feature extractor, mainly for the following two reasons: 1) GNN retains strong structural information and semantic information, and can make full use of user, entity, and hashtag element information on social media. 2) The fewer parameters of the graph neural network can adapt to each client more flexibly and reduce the time of federated communication. The constructed weighted isomorphic message graph can learn the result information and semantic information in the social media text through the graph neural network.
[0125] As a preferred embodiment of the present invention, the specific steps of Step 2.1 are:
[0126] Step 2.1.1. Define social flow: S = M0, M1, ..., M i-1 ,M i ,…a set of continuous time series of social media message blocks, M i is the time block = [t i ,t i+1 ) constitutes a social media message block; i Expressed as: M i ={m j |1≤j≤|M i |}, where |M i |For M i The total number of messages in m j is a single message; each social media message belongs to only one category; M0, {M_i|i≠0} are the message blocks in offline and online scenarios respectively.
[0127] For federated cross-lingual social media event detection, our goal is to distill the knowledge learned by rich-resource clients to low-resource clients. Assume that H is the set of rich-resource clients, L is the set of low-resource clients, and M k,i is the i-th message block on the k-th client, where each message block on the client is in a single language. The event set C(M) in the i-th message block on the rich resource client k,i |k∈H) contains the low-resource client event set C(M k,i |k∈L), that is In round t on the kth client, message block M k,i The global model output for sample x in is is the corresponding local model output. The global model f on each client g The architecture is consistent, and the local model of each client is k,l The design can be customized based on the characteristics of the local dataset.
[0128] Step 2.1.2, encoding information combined with semantic and time information. For time information, we convert the timestamp into OLE date to obtain a two-dimensional time feature. For semantic information, we use a cross-language word embedding model to uniformly encode the message to obtain a semantic representation. The final message representation is the concatenation of the semantic representation of the message and the time feature in the last dimension.
[0129] Step 2.1.3, construct a message graph with the encoded data set. Specifically, on each client, use one week of data to construct the initial message block M0, and divide the subsequent 21 days of data into message blocks M1, M2, …, M 21 For each message block, the initial message block is divided into training set, test set and validation set in the ratio of 7:2:1. A heterogeneous message graph between messages is constructed respectively, with the message content as the message node, and the three elements of topic hashtag, entity and user between messages as the relationship nodes; the co-occurrence number of the above three elements is used as the edge weight, so as to transform the heterogeneous message graph into a homogeneous message graph.
[0130] As a preferred embodiment of the present invention, the specific steps of Step 2.2 are:
[0131] Step 2.2.1. In order to deeply fuse rich semantic and relational information, the GNN encoder learns node representation by iteratively aggregating information from its one-hop neighbors. Formally, the l-th layer message m i Expressed as Its update at layer l+1 can be expressed as:
[0132]
[0133] in, Represents message m i One hop neighbor. Represents the feature aggregation method,
[0134] Aggregators and extractors are different in different GNN models. Different clients can design different GNNs based on local data and customize local models.
[0135] As a preferred embodiment of the present invention, the specific steps of Step 3 are:
[0136] Step 3.1. In order to make the framework adaptable to social media event detection in online and offline scenarios, we introduce a four-stage life cycle mechanism. At different stages of the life cycle, the federation aggregation method is slightly different, but there are certain commonalities. Specifically, in the first stage of the life cycle, only the local model of the rich resource client. In the second stage of the life cycle, the local model of the rich resource client, the global model of the rich resource client, and the local model of the low resource client participate in the training. Aggregation only aggregates and pulls down the global model of the rich resource client and the global anchor point. In the fourth stage of the life cycle, the local model of the rich resource client, the global model of the rich resource client, the local model of the low resource client, and the global model of the low resource client all participate in the training. The aggregation method performs weighted aggregation on the global anchor points and global models uploaded by each client (including the low resource client) according to the current block data set size of each client, and then pulls down the aggregation results to each client.
[0137] Step 3.2: In order to adapt the framework to the streaming characteristics of social media, we designed a 4-stage life cycle mechanism. Figure 2As shown in the figure. The life cycle of FedEvent includes four stages: rich resource client pre-training (Stage I), low resource client pre-training (Stage II), each client detection (Stage III) and maintenance (Stage IV). In the first stage, we use M0 on the rich resource client message block to build an initial weighted isomorphic message graph and train the initial model using a specific algorithm. In the second stage, we use the model trained in stage I to assist the low resource client in training the initial model with the central server as the medium for knowledge transmission. In the third stage, a new graph is built for each incoming block, and then each incoming message block is directly detected using the trained model. In the fourth stage, the model is continuously trained with the latest message blocks, and the federated co-distillation mechanism is used to realize online learning of each client, so that the model can learn new knowledge. Among them, stage I and stage II are used for offline learning, and stage IV is used for online learning. Stages III and IV are carried out alternately. In this way, the model constantly adapts to the incoming data, can detect new events and update the knowledge of the model. Through the life cycle mechanism, FedEvent can better adapt to the characteristics of streaming media.
[0138] As a preferred embodiment of the present invention, the specific steps of Step 3.1 are:
[0139] Step 3.1.1, after the local model training is completed, the anchor point (cluster center vector) of the current message block of the current client will be calculated. The local anchor point is the message block M on the current client. i The local anchor point is the comprehensive representation of the characteristics of the same event message cluster on the current client. At round t, the local anchor point representation of event cluster c in client k is The calculation is as follows:
[0140]
[0141] in, represents the number of samples of event cluster c on client k. k,l Represents the output of the local model.
[0142] Step 3.1.2, after the anchor point calculation of each client is completed, the central server will accept the local anchor point representation from each client and convert the anchor point representation from different clients into i The local message cluster anchor point representation on the client is summarized, and the aggregation method is weighted average according to the number of messages in each client message block, that is:
[0143]
[0144] Among them, S is the set of clients that meet the aggregation conditions. The set S is different at different stages of the life cycle mechanism. The global anchor point is obtained by the above formula The global anchor point will be broadcasted to all shared clients. At this point, the obtained global anchor point can comprehensively reflect the characteristics of the same event cluster and can be used to guide the model training of each client.
[0145] Step 3.1.3: After the global anchor aggregation is completed, the global model aggregation begins. The central server receives and aggregates the global models from all clients, and generates the next round of updated global models through aggregation processing. Right now:
[0146]
[0147] in, represents the number of samples in client k, are the parameters of the global model in the tth round in the kth client.
[0148] Step 3.1.4: After the central server completes the aggregation, it will pull the aggregation results down to each client, and then a new round of training will begin. The process of uploading and pulling down will repeat until the model converges.
[0149] As a preferred embodiment of the present invention, the specific steps of Step 3.2 are:
[0150] Step 3.2.1, in the first stage of the life cycle, the purpose of the present invention is to train a robust local model W using the initial message block M0 in the rich resource client k,l . As new events continue to emerge, the total number of events is difficult to know in advance. Considering that the cross entropy loss is only applicable to the case where the total number of events is known and fixed, it is difficult to process streaming data. Therefore, we turn to the use of paired learning methods to ensure inter-cluster compactness and intra-cluster separation. Due to this feature, in the subsequent second and third stages, the clear inter-cluster boundary information of the rich-resource client can be distilled to the low-resource client. The task-specific loss and total loss of this stage are respectively
[0151]
[0152] in, is the first stage loss, {Pos} is the sample pair from the same event cluster, and {Neg} is the sample pair from different event clusters. a is the boundary distance hyperparameter, D(,) calculates the Euclidean distance, and h is the message representation learned by the GNN encoder. After training, the model is tested.
[0153] Step 3.2.2, in the second stage of the life cycle, the present invention uses the local model trained in the first stage to assist the low-resource client in training the initial model. We propose a global model-oriented process supervision and a global anchor-oriented result supervision to achieve knowledge transfer. Specifically, for rich-resource clients, freeze the local model, use the local model as the teacher model, and the global model as the student model. While the student model learns the data characteristics of the rich-resource client, it will also learn the hidden layer output of the teacher model (Local-To-Global strategy). In low-resource clients, freeze the global model, use the global model as the teacher model, and the local model as the student model. While the student model learns general knowledge from the teacher model, it uses local data to learn knowledge suitable for local data characteristics (Global-To-Local strategy). We regard the above two strategies as process-oriented supervision. And introduce global anchor-oriented result supervision to unify the cluster centers of each client. Knowledge transfer is carried out from both result-oriented and process-oriented aspects.
[0154] In process-oriented supervised learning, the student model can flexibly learn the output of a specific or several hidden layers in the teacher model according to the characteristics of local data. On client k, the distillation loss of each client student model is It can be expressed as:
[0155]
[0156] Among them, MSE represents the mean square error, I represents the number of hidden layers that the student model needs to learn from the teacher model, Represent the output of the i-th hidden layer of the teacher model and the student model respectively.
[0157] When training on the local client, we expect each feature to be closer to the corresponding global anchor and away from the non-corresponding global anchor. We use contrastive learning to coordinate the local centers of all clients to exchange information between clients. The global anchor and the client-side model can be represented as right
[0158] For the data sample x of the i-th block, the anchor point alignment loss for:
[0159]
[0160]
[0161] in is the cross entropy loss, s=[s1,s2,…,s c] is a similarity vector, $s_n$ represents the similarity between the current feature and each anchor point, α determines the level of concentration, and <,> is the inner product. Minimizing the cross entropy loss maximizes the feature and its corresponding anchor point The similarity between them, and minimize the feature and The similarity between each non-corresponding anchor point in .
[0162] In stage 2, the client set S=H participating in the aggregation, that is, only the rich resource clients participate in the aggregation. On client k, this stage only trains the student model on each client, and the total loss in this stage is It can be expressed as:
[0163]
[0164] After the second phase of the life cycle training is completed, the trained model begins to be tested.
[0165] Step 3.2.3, in the third stage of the life cycle, we use the trained model to [M i ,M i+w ] The message blocks in the window are clustered. Distance-based clustering algorithms (such as K-Means) or density-based algorithms (such as HDBSCAN) can cluster messages. Among them, HDBSCAN does not need to specify the total number of categories, which is very suitable for incremental detection needs. Therefore, we use the HDBSCAN algorithm for message detection.
[0166] Step 3.2.4, the above two steps are used for offline learning. In the fourth stage of the life cycle, incremental training begins. We designed a co-distillation mechanism guided by task-specific losses to adapt to online scenarios. In this process, the local models of each client and the global model participate in model training, learn from each other and adapt to the data distribution and pattern changes in online scenarios. Since the local model is more adaptable to local data than the global model, the useful knowledge encoded by the local model can help guide the global model. In addition, the local model can only learn from local data, while the global model integrates the data characteristics of all clients. Therefore, the local model can also benefit from the knowledge distilled by the global model. Therefore, the local model and the global model can learn from each other. Based on this, we designed a co-distillation mechanism guided by task-specific losses in this stage, so that the local model and the global model can learn useful knowledge from each other. For the global model and the local model, the distillation loss can be expressed as:
[0167]
[0168] The client set S = {L∪H} participating in the aggregation in this stage, that is, all clients participate in the aggregation. The total loss in this stage includes task-specific loss, co-distillation loss based on task-specific loss, and anchor alignment loss. The losses of the local model and the global model in this stage can be expressed as
[0169]
[0170]
[0171] Step 3.2.5, Step 3.2.4 and Step 3.2.3 are performed alternately, so that the model can continuously adapt to social media event detection in online scenarios and learn new knowledge.
[0172] In order to illustrate the effect of the present invention, the present invention is compared with the existing methods and tested on the expanded data set. The clustering algorithm is unified as the HDBSCAN clustering algorithm, and the evaluation index is consistent with the comparison method. NMI and AMI are used as indicators to evaluate the clustering results, among which Normalized Mutual Information (NMI) and Adjusted Mutual Information (AMI); NMI is a metric that aims to measure the quality of clustering, with the aim of evaluating the similarity between the clustering results generated by our model and the actual basic truth categories. AMI is an improved version of NMI, which takes into account the errors introduced by random clustering and provides a more robust measurement method. The experimental results of the data sets used are shown in Tables 1-3:
[0173] Table 1 Offline evaluation results for low-resource clients
[0174]
[0175] Offline evaluation: For each client, we divide the initial message block M0 on the client into training set, test set and validation set according to 70%, 20% and 10%. From the experimental results with subscript c in Table 1, it can be seen that in the offline scenario, the multi-machine environment (FedEvent, FedKP, etc.) is better than the event detection method in the single-machine environment, proving that the multi-machine environment can improve the performance of the model in the single-machine environment. The reason is that the federation framework can integrate knowledge from various clients. Specifically, on the Chinese client, the multi-machine environment showed a significant improvement of 1.6%-204.3% and 2.0%-342.9% on NMI and AMI respectively compared with the method in the single-machine environment, and on the Vietnamese client, it increased by 2.3%-6200% and 0%-4400% respectively. After the introduction of federation, although the effects of FedKP and FedQS methods have also improved, they are not obvious because of the inconsistency of the feature space on each client and the differences between different languages. FedEvent uses global anchors to unify the feature space on each client, uses local models to adapt to the characteristics of local private data, and uses global models to transfer global knowledge. Therefore, when dealing with distributed social event detection tasks, FedEvent is more suitable for implementing knowledge migration from rich-resource clients to low-resource clients. Specifically, compared with FedKP and FedQS, FedEvent has improved the NMI and AMI indicators by 11.1%-34.0% and 17.0%-28.6%, respectively, demonstrating the effectiveness of our framework.
[0176] Table 2 Chinese online evaluation results (NMI)
[0177]
[0178]
[0179] Table 3 Chinese online evaluation results (AMI)
[0180]
[0181] Table 4 Vietnamese online assessment results (NMI)
[0182]
[0183] Table 5 Vietnamese online assessment results (AMI)
[0184]
[0185] Online Evaluation: In the online scenario, the experimental results are shown in Tables 2, 3, 4, and 5. Our method mostly outperforms all methods in both single-machine and multi-machine environments in the online scenario.
[0186] Ablation experiment: To further verify the effectiveness of this method, this paper sets up the following two sets of ablation experiments: the impact of the cross-language word embedding module and anchor alignment loss on model performance. By comparing the experimental results with subscript a in Tables 2, 3, 4, and 5, we observe that the cross-language word embedding module and anchor alignment loss significantly improve model performance in both offline and online scenarios. Cross-language word embedding module Compared with mBERT, This significantly alleviates the shortcomings of mBERT in representing text in low-resource languages. Specifically, on the Chinese client, the cross-language word embedding module Compared with mBERT, the NMI and AMI indicators have been improved by an average of 149.4%, and on the Vietnamese client, the average improvement is 322.3%. Furthermore, FedEvent has introduced cross-language word embedding, which has improved the Chinese client by an average of 2.4% and the Vietnamese client by an average of 4.3% compared with the method without this module (i.e. w / oNC). After the introduction of the cross-language word embedding module, FedEvent ensures the consistency of the input feature space on different clients, thereby enhancing the distillation effect. Specifically, it can be found that the cross-language word embedding module The performance is particularly outstanding on the Vietnamese client. This may be because mBERT’s ability to represent Vietnamese is not as strong as that for Chinese. The effect is more obvious after characterizing the messages. In addition, on each client, FedEvent has an average decrease of 5.3% on NMI and AMI compared to the method without anchor alignment loss (i.e. w / o NA), further confirming the importance of anchor alignment loss. In the absence of anchor alignment loss, it is not easy for low-resource clients to capture anchor alignment information, resulting in poor distillation effect. In the online evaluation, we observed significant performance differences between different blocks, which may be due to the large difference in the number of messages in different message blocks and the long-tail distribution of data in message blocks.
[0187] In the description of this specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0188] The preferred embodiments of the present invention disclosed above are only used to help illustrate the present invention. The preferred embodiments do not describe all the details in detail, nor do they limit the invention to the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can understand and use the present invention well. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. A cross-language social media event detection method based on federated knowledge distillation, characterized in that: include: Step 1: Cross-language word embedding pre-training: Use efficient parameter fine-tuning techniques and three sets of contrastive losses to map non-English languages into the English semantic space; Step 2: Weighted isomorphic message graph construction: Use the entity, user, and hashtag relationships in existing social data information to construct a weighted isomorphic message graph, and use the graph neural network as a feature extractor; Step 3, Federated Network Message Distillation: Introduce local models and global models under the federated framework to achieve private model customization, and use process supervision guided by the global model and result supervision guided by the global anchor point to achieve effective knowledge distillation; and design a four-stage life cycle mechanism to achieve incremental event detection under the federated framework.
2. The cross-language social media event detection method based on federated knowledge distillation according to claim 1 is characterized in that: The specific steps of Step 1 are: Step 1.1: The trained cross-language word embedding model uses a dataset from Hunging Face; the non-English text semantic space is mapped to the English semantic space, and the dataset is a non-English-English parallel corpus; Step 1.2, the cross-language word embedding model is composed of a frozen multi-language pre-trained language model and a multi-language pre-trained model with Lora added; Step 1.3, use contrastive learning to train the cross-language word embedding model; specifically, introduce three sets of contrastive losses to enable the added Lora to learn the differences between different languages, namely: non-English to English similarity contrast loss, English self-similarity contrast, and non-English internal similarity contrast.
3. The cross-language social media event detection method based on federated knowledge distillation according to claim 1 is characterized in that: The specific steps of Step 2 are: Step 2.1, divide the social media message streams of resource-rich clients and low-resource clients into different message blocks; for each message block, divide the training set, test set and validation set according to a certain ratio, and construct heterogeneous message graphs between messages, taking the message content as the message node, and the topic entity, user and hashtag elements between messages as the relationship node; at the same time, take the co-occurrence number of the three elements as the edge weight, so as to construct a weighted isomorphic message graph; construct an initial message block and a streaming message block for each client; Step 2.2: In terms of model selection, the GNN model is selected as the feature extractor. The constructed weighted isomorphic message graph learns the result information and semantic information in the social media text through the graph neural network.
4. The cross-language social media event detection method based on federated knowledge distillation according to claim 3 is characterized in that: The specific steps of Step 2.1 are: Step 2.1.
1. Define social flow: S = M0, M1, ..., M i-1 , M i ,...a set of continuous time series of social media message blocks, M i is the time block = [t i , t i+1 ) constitutes a social media message block; i Expressed as: M i ={m j |1≤j≤|M i |}, where |M i |For M i The total number of messages in m j is a single message; each social media message belongs to only one category; M0, {M_i|i≠0} are message blocks in offline and online scenarios respectively; For federated cross-language social media event detection, the goal is to distill the knowledge learned by rich-resource clients to low-resource clients; suppose H is the set of rich-resource clients, L is the set of low-resource clients, and M k,i is the i-th message block on the k-th client, where each message block on the client is in a single language; the event set C(M) in the i-th message block on the rich resource client k,i |k∈H) contains the low-resource client event set C(M k,i |k∈L), that is In round t on the kth client, message block M k,i The global model output for sample x in is is the corresponding local model output; the global model f on each client g The architecture is consistent, and the local model of each client is k,l The design is customized according to the characteristics of the local dataset; Step 2.1.2, the encoded information combines semantic and temporal information; For time information, the timestamp is converted into OLE date to obtain a two-dimensional time feature; For semantic information, a cross-language word embedding model is used to uniformly encode messages to obtain semantic representation; the final message representation is the concatenation of the semantic representation of the message and the time feature in the last dimension. Step 2.1.3, construct a message graph with the encoded data set. Specifically, on each client, use one week of data to construct the initial message block M0, and divide the subsequent 21 days of data into message blocks M1, M2, ..., M 21 ; For each message block, the initial message block is divided into training set, test set and validation set in the ratio of 7:2:1, and heterogeneous message graphs between messages are constructed respectively, with message content as message nodes and the three elements of topic hashtag, entity and user between messages as relationship nodes; the co-occurrence number of the above three elements is used as the weight of the edge, so as to convert the heterogeneous message graph into a homogeneous message graph.
5. The cross-language social media event detection method based on federated knowledge distillation according to claim 1 is characterized in that: The specific steps of Step 3 are: Step 3.1, introduce a four-stage lifecycle mechanism to achieve online and offline learning under the federated framework while distilling the knowledge of rich-resource clients to low-resource clients; In the first stage of the life cycle, only the local model of the rich-resource client is used; in the second stage of the life cycle, the local model of the rich-resource client, the global model of the rich-resource client, and the local model of the low-resource client participate in the training; the aggregation only aggregates and pulls down the global model of the rich-resource client and the global anchor point, and in the fourth stage of the life cycle, the local model of the rich-resource client, the global model of the rich-resource client, the local model of the low-resource client, and the global model of the low-resource client all participate in the training; the aggregation method performs weighted aggregation on the global anchor points and global models uploaded by each client (including the low-resource client) according to the current block data set size of each client, and then pulls down the aggregation results to each client; Step 3.2, a four-stage life cycle mechanism is designed; the life cycle of FedEvent includes four stages: rich-resource client pre-training (Stage I), low-resource client pre-training (Stage II), individual client detection (Stage III) and maintenance (Stage IV); In the first stage, an initial weighted isomorphic message graph is constructed using M0 on the rich resource client message block and the initial model is trained using a specific algorithm; In the second stage, the model trained in the first stage is used to assist the low-resource client in training the initial model with the central server as the medium of knowledge transfer; in the third stage, a new graph is constructed for each incoming block, and then each incoming message block is directly detected using the trained model; In the fourth stage, the model is continuously trained with the latest message blocks, and the federated co-distillation mechanism is used to implement online learning of each client, so that the model can learn new knowledge; among them, stages one and two are used for offline learning, and stage four is used for online learning; stages three and four are carried out alternately.
6. The cross-language social media event detection method based on federated knowledge distillation according to claim 5 is characterized in that: The specific steps of Step 3.1 are: Step 3.1.1, after the local model training is completed, the anchor point (cluster center vector) of the current message block of the current client will be calculated; the local anchor point is the message block M on the current client. i It is represented by the mean of all sample representations in each cluster; At round t, the local anchor point representation of event cluster c in client k The calculation is as follows: in, represents the number of samples of event cluster c on client k, f k,l Represents the output of the local model; Step 3.1.2, after the anchor point calculation of each client is completed, the central server will accept the local anchor point representation from each client, and aggregate the local message cluster anchor point representations on $M_i$ from different clients. The aggregation method is weighted average according to the number of messages in each client message block, that is: Among them, S is the set of clients that meet the aggregation conditions. The set S is different at different stages of the life cycle mechanism. The global anchor point is obtained by the above formula The global anchor point will be broadcasted to all shared clients. At this time, the obtained global anchor point can comprehensively reflect the characteristics of the same event cluster and is used to guide the model training of each client. Step 3.1.3: After the global anchor aggregation is completed, the global model is aggregated; the central server receives and summarizes the global models from all clients, and generates the next round of updated global models through aggregation processing. Right now: in, represents the number of samples in client k, are the parameters of the global model in the tth round in the kth client; Step 3.1.4: After the central server completes the aggregation, it will pull the aggregation results down to each client, and then a new round of training will begin. The process of uploading and pulling down will repeat until the model converges.
7. The cross-language social media event detection method based on federated knowledge distillation according to claim 5 is characterized in that: The specific steps of Step 3.2 are: Step 3.2.
1. In the first phase of the life cycle, a robust local model W is trained using the initial message block M0 on the resource-rich client. k,l ; Use the paired learning method to ensure inter-cluster compactness and intra-cluster separation; the task-specific loss and the total loss are in, is the first stage loss, {Pos} is a pair of samples from the same event cluster, and {Neg} is a pair of samples from different event clusters. a is the boundary distance hyperparameter, D(,) calculates the Euclidean distance, and h is the message representation learned by the GNN encoder; after training, the model is tested; Step3.2.2, in the second stage of the life cycle, the local model trained in the first stage is used to assist the low-resource client in training the initial model; the process supervision guided by the global model and the result supervision guided by the global anchor point are proposed to realize the knowledge transfer; specifically, for the rich-resource client, the local model is frozen, and the local model is used as the teacher model, and the global model is used as the student model; while the student model learns the data characteristics of the rich-resource client, it will also learn the hidden layer output of the teacher model; for the low-resource client, the global model is frozen, and the global model is used as the teacher model, and the local model is used as the student model. While the student model learns general knowledge from the teacher model, it uses local data to learn knowledge suitable for local data characteristics; the above two strategies are used as process-oriented supervision, and the result supervision guided by the global anchor point is introduced to unify the cluster centers of each client, and knowledge transfer is carried out from both result-oriented and process-oriented aspects; On client k, the distillation loss of each client student model It is expressed as: Among them, MSE represents the mean square error, I represents the number of hidden layers that the student model needs to learn from the teacher model, Represent the output of the i-th hidden layer of the teacher model and the student model respectively; When training on the local client, contrastive learning is used to coordinate the local centers of all clients to exchange information between clients; the global anchor point and the client-side model are represented as right For the data sample x of the i-th block, the anchor point alignment loss for: in is the cross entropy loss, s = [s1, s2, ..., s c ] is a similarity vector, $s_n$ represents the similarity between the current feature and each anchor point, α determines the level of concentration, (,) is the inner product; minimizing the cross entropy loss maximizes the feature and its corresponding anchor point The similarity between them, and minimize the feature and The similarity between each non-corresponding anchor point in ; In stage 2, the client set S=H participating in the aggregation, that is, only the rich resource clients participate in the aggregation; on client k, this stage only trains the student model on each client, and the total loss in this stage is It is expressed as: After the second phase of the life cycle training is completed, the trained model begins to be tested; Step 3.2.3, in the third stage of the life cycle, according to the trained model [M i , M i+w ] The message blocks in the window are clustered; the messages are clustered based on the distance clustering algorithm or the density clustering algorithm; among them, HDBSCAN does not need to specify the total number of categories, which is very suitable for incremental detection needs, and the HDBSCAN algorithm is used for message detection; Step 3.2.4, In the fourth stage of the life cycle, incremental training begins, and a co-distillation mechanism guided by task-specific loss is designed to adapt to online scenarios; in this process, the local models of each client and the global model participate in model training, learn from each other and adapt to the data distribution and pattern changes in online scenarios; a co-distillation mechanism guided by task-specific loss is designed to enable the local model and the global model to learn useful knowledge from each other. For the global model and the local model, the distillation loss is expressed as: The client set S = {L∪H} participating in the aggregation in this stage, that is, all clients participate in the aggregation; the total loss in this stage includes task-specific loss, co-distillation loss based on task-specific loss, and anchor alignment loss. The losses of the local model and the global model in this stage can be expressed as Step 3.2.5, Step 3.2.4 and Step 3.2.3 are performed alternately, so that the model can continuously adapt to social media event detection in online scenarios and learn new knowledge.
Citation Information
Patent Citations
Machine translation-based construction method for Chinese semantic knowledge base
CN105677913A
Event detection and abstraction method based on pre-trained language model
CN111966917A
Event knowledge integrated Chinese-cross cross-language event retrieval method
CN117009458A
Methods, devices and media for re-weighting to improve knowledge distillation
US20220343175A1
Cited By
Big federal model fine tuning method and device based on mutual learning and medium
CN119443209A
A Fine-Tuning Method, Device, and Medium for Federal Large Models Based on Mutual Learning
CN119443209B
Cross-language news core event analysis method based on graph knowledge distillation
CN120492635A
Cross-language news core event analysis method based on graph knowledge distillation
CN120492635B
