A Cross-Language Social Media Event Detection Method Based on Federated Knowledge Distillation
By employing cross-linguistic word embedding pre-training and a four-stage lifecycle mechanism, the federated distillation framework addresses the challenge of social media event detection in low-resource languages, enabling cross-linguistic knowledge transfer and incremental detection, thereby improving detection efficiency and effectiveness.
Patent Information
- Application Number
- CN202410639047.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2044-05-22
AI Technical Summary
Existing federated distillation frameworks for social media event detection in low-resource language scenarios face challenges such as the lack of low-resource data, the difficulty of language transfer, and the continuous emergence of social media events, resulting in insufficient model performance and difficulty in effective detection.
We adopt a cross-language social media event detection method based on federated knowledge distillation. Through cross-language word embedding pre-training, weighted isomorphic message graph construction, and a four-stage lifecycle mechanism, we utilize efficient parameter fine-tuning techniques and three sets of contrastive losses to achieve effective transfer of knowledge from resource-rich clients to low-resource clients. We also extract features through graph neural networks and design federated network message distillation with process supervision and result supervision to adapt to event detection in both online and offline scenarios.
It improves the performance of low-resource language models, enables efficient and incremental detection of cross-language social media events, significantly enhances detection results, and adapts to the continuous emergence of social media events.
Smart Images

Figure CN118586431B_ABST
Abstract
Description
Technical Field
[0001] This invention discloses a cross-language social media event detection method based on federated distillation, which relates to the field of real-time event detection technology. Background Technology
[0002] Social media platforms play a crucial role in today's information age, providing us with a wealth of real-time information resources. These platforms encompass various data types, including text, images, and videos, and cover events, trends, and topics across a wide range of fields. Therefore, effectively identifying events from social media platforms and making cross-domain decisions is essential for businesses, governments, and individuals.
[0003] Graph Neural Networks (GNNs) have made significant progress in social media event detection, successfully addressing several problems inherent 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. Currently, advanced GNN methods are widely used for social media event detection. These methods represent social media messages as nodes and construct heterogeneous social media message graphs by establishing relationships between additional elements, subsequently transforming them into homogeneous social media message graphs. GNN-based social media event detection methods have achieved significant results in resource-rich language scenarios (such as English), but there is still considerable room for improvement in low-resource language scenarios (such as Vietnamese). Therefore, how to effectively utilize resource-rich language knowledge to improve the performance of social media event detection models for low-resource languages has become a recent research hotspot. Furthermore, in practical applications, resource-rich and low-resource data are often distributed across different social media platforms. Existing methods use a data-centric approach to transfer data from resource-rich to low-resource languages, clearly ignoring this characteristic. Due to privacy and legal restrictions, large amounts of high-quality data cannot flow between different platforms. Federated learning, as a decentralized learning architecture, offers a possible solution to this problem. Notably, when dealing with large amounts of social media event data, federated learning can also reduce data transmission and storage costs, making it more suitable for display needs.
[0004] However, existing frameworks based on federated distillation still face many challenges:
[0005] Low-resource data shortage: Due to issues such as data scarcity, it is difficult to build a low-resource language model on its own, and its performance in social media event detection in low-resource scenarios does not meet expectations.
[0006] Language transfer is challenging: due to differences in grammar and expression across languages, and significant variations in data distributed across different clients, model drift occurs, impacting the effectiveness of knowledge distillation. Furthermore, the limitations on data sharing between resource-rich and resource-poor languages are also a pressing issue that needs to be addressed.
[0007] Social events continue to emerge: In real-world scenarios, social media events are characterized by large data volumes and rapid growth rates, placing higher demands on the model's ability to receive and process new information. Summary of the Invention
[0008] To address the above issues, this invention proposes a cross-language social media event detection method based on federated knowledge distillation. This method effectively distills knowledge from resource-rich clients to low-resource clients while protecting data privacy, thereby improving the performance of low-resource language models.
[0009] This invention addresses the problem of scarce low-resource data by proposing a knowledge distillation strategy within a federated learning framework. This strategy enables data from resource-rich clients to be effectively transferred to low-resource clients, guiding the training of models on those clients. Simultaneously, we train a cross-lingual word embedding model using efficient parameter fine-tuning techniques and three sets of contrastive losses to capture semantic differences between languages, overcoming the difficulty of semantic space inconsistencies. Furthermore, to address the ever-increasing volume of social media event data, this invention introduces an incremental lifecycle within the federated framework, designing a four-stage lifecycle mechanism that allows the model to continuously adapt to new data and detect new events, thereby achieving data increment.
[0010] The technical solution of this 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 issue of inconsistent input features under the federated framework caused by different client languages, we utilize efficient parameter fine-tuning techniques and three sets of contrastive losses to map non-English languages into the English semantic space.
[0012] Step 2: Weighted Isomorphic Message Graph Construction: Build a weighted isomorphic message graph using the relationships between entities, users, and hashtags in existing social data, and use a graph neural network as a feature extractor.
[0013] Step 3, Federated Network Message Distillation: Within the federated framework, local and global models are introduced to enable customized private models. Effective knowledge distillation is achieved through process supervision guided by the global model and result supervision guided by global anchors. A four-stage lifecycle mechanism is designed to enable incremental event detection within the federated framework.
[0014] Specifically, in terms of overall architecture, we followed a traditional server-client design based on knowledge distillation. On the server side, we designed a global model W. g and global anchor point A g This is used for communication between resource-rich clients and resource-poor clients. Each client contains a local model W. k,l A global model W is used to adapt to local data. k,g Used for feature distillation, a global anchor point A k,g This is used to align the feature spaces of various clients. We utilize a global model as process supervision and global anchors as outcome supervision to achieve effective knowledge transfer. Local models are updated based on local data to adapt to its characteristics. The global model is shared among all clients with the same architecture and initial parameters for collaborative learning. We leverage a lifecycle mechanism to adapt to both online and offline scenarios.
[0015] As a preferred embodiment of the present invention, the specific steps of Step 1 are as follows:
[0016] Step 1.1: The cross-lingual word embedding model trained in this invention utilizes a dataset from huntingface. We map the semantic space of non-English texts to the semantic space of English texts; therefore, our dataset is a non-English-English parallel corpus.
[0017] Step 1.2 The cross-lingual word embedding model consists of a frozen multilingual pre-trained language model and a multilingual pre-trained model incorporating LoRa.
[0018] Step 1.3 This invention utilizes 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. These are: non-English to English similarity contrastive loss, English self-similarity contrastive loss, and non-English intra-language similarity contrastive loss.
[0019] As a preferred embodiment of the present invention, in step 1.2:
[0020] Step 1.2.1: Due to the different languages used on different clients, we fine-tuned the pre-trained language model to train a cross-lingual word embedding module to ensure a consistent input feature space across all clients. We trained a cross-lingual word embedding model using parallel corpora from non-English to English, aiming to achieve semantic space mapping from non-English text to English text. By leveraging the low-rank adaptive strategy of LoRA, an efficient parameter fine-tuning technique, we captured the semantic differences between different languages.
[0021] Step 1.2.2: To ensure that the introduced LoRA module does not lose English semantics, this invention introduces a guiding model (M′), which is a frozen multilingual pre-trained model. M′ is used to guide M in its learning process. The cross-lingual word embedding module (M) designed in this invention is the attention calculation matrix W in the multilingual pre-trained model. q and W v Add a side branch. Specifically, the original W q and W v The calculation is as follows:
[0022] Q origin =X·W q V origin =X·W v
[0023] The following improvements have been made:
[0024] Q lora =X·(W q +scale·BA),V lora =X·(W v +scale·BA)
[0025] In this process, A was initialized using a random Gaussian initialization, while B was initialized with zero; therefore, the initial value of BA was 0. Subsequently, as the downstream task data was learned, only the values of B and A were fine-tuned to achieve the desired adaptation to the downstream task.
[0026] As a preferred embodiment of the present invention, in step 1.3:
[0027] Step 1.3.1: During the training phase, this invention introduces three sets of contrastive losses: non-English to English similarity comparison loss, English self-similarity comparison loss, and non-English intra-text similarity comparison loss. Non-English to English similarity comparison measures the similarity between non-English text and its corresponding English text, aiming to ensure the model can identify and match the correct language pairs. English self-similarity comparison focuses on the similarity between different representations within English text, which helps the model maintain consistency within the same language. Non-English intra-text similarity comparison evaluates the similarity between non-English text and its corresponding English representation, ensuring that semantic relationships within non-English text are properly expressed. In summary, these loss functions work together on the model to achieve effective cross-linguistic 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 semantic space alignment 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 The three sets of comparative learning losses are specifically in the following form:
[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 semantic information between cross-language texts, thereby achieving effective semantic alignment.
[0035] As a preferred embodiment of the present invention, the specific steps of step 2 are as follows:
[0036] Step 2.1: Divide the social media message streams of resource-rich clients and resource-poor clients into different message blocks; for each message block, divide it into training set, test set and validation set according to a certain ratio, and construct heterogeneous message graphs between messages respectively, taking message content as message nodes, and topic entities, users and hashtag elements between messages as relationship nodes; at the same time, use the co-occurrence number of the three types of elements as the edge weight, thereby constructing a weighted isomorphic message graph; we construct an initial message block and a streaming message block for each client respectively.
[0037] Step 2.2, Regarding model selection, we chose the GNN model as the feature extractor for the following two main reasons: 1) GNN retains strong structural and semantic information and can fully utilize user, entity, and hashtag information from social media. 2) Graph neural networks have fewer parameters, allowing for more flexible adaptation to various clients and reducing federated communication time. The constructed weighted isomorphic message graph can learn the result information and semantic information from social media text through a graph neural network.
[0038] As a preferred embodiment of the present invention, the specific steps of step 2.1 are as follows:
[0039] Step 2.1.1, Define social flow: S = M0, M1, ..., M i-1 M i ...a set of continuous time series social media message blocks, M i It is composed of time block = [t i ,t i+1 A social media message block consisting of all messages; M i Represented as: M i ={m j |1≤j≤|M i |}, where |M i |For M i The total number of messages in m j Each message is a single message; each social media message belongs to only one category; M0 and {M_i|i≠0} are message blocks in offline and online scenarios, respectively.
[0040] For federated cross-language social media event detection, our goal is to distill the knowledge learned by resource-rich clients into low-resource clients. Let H be the set of resource-rich clients, L be the set of low-resource clients, and M be the set of low-resource clients. k,i Let C(M) be the i-th message block on the k-th client, where each message block on each client is in a single language. Let C(M) be the event set C(M) in the i-th message block on the resource-rich client. k,i |k∈H) contains the low-resource client event set C(M) k,i |k∈L), that is In the t-th round on the k-th client, message block M k,i The global model output for the medium sample x is Output the corresponding local model. The global model f on each client. g The architecture is consistent, while the local models of each client are different. k,l The design can be customized to be private based on the characteristics of the local dataset.
[0041] Step 2.1.2: Encoding Information Combining Semantic and Temporal Information. For temporal information, we convert the timestamp to an OLE date, thus obtaining a two-dimensional temporal feature. For semantic information, we use a cross-language word embedding model to uniformly encode the message, obtaining a semantic representation. The final message representation is the concatenation of the message's semantic representation and temporal feature in the last dimension.
[0042] Step 2.1.3: Construct a message graph from the encoded dataset. Specifically, on each client, use one week's worth of data to construct an initial message block M0, and then divide the data from the following 21 days into message blocks M1, M2, ..., M... 21 For each message block, the initial message block is divided into training, testing, and validation sets in a 7:2:1 ratio. A heterogeneous message graph will be constructed between the messages, with message content as message nodes and topic hashtags, entities, and users as relationship nodes. The co-occurrence count of these three elements will be used as the edge weights, thus transforming 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 as follows:
[0044] Step 2.2.1: To deeply integrate rich semantic and relational information, the GNN encoder learns node representations by iteratively summarizing information from its one-hop neighbors. Formally, the message m of layer l... i Represented as Its update at level l+1 can be represented as:
[0045]
[0046] in, Representative message m i A neighbor who jumped. Representative feature aggregation method,
[0047] The aggregator and extractor differ across different GNN models. Different clients can design different GNNs based on their local data, enabling customized local models.
[0048] As a preferred embodiment of the present invention, the specific steps of step 3 are as follows:
[0049] Step 3.1: To enable the framework to adapt to social media event detection in both online and offline scenarios, we introduce a four-stage lifecycle mechanism. The federated aggregation method differs slightly at each stage of the lifecycle, but there are also some commonalities. Specifically, in the first stage of the lifecycle, only the rich-resource client's local model is used. In the second stage, the rich-resource client's local model, the rich-resource client's global model, and the low-resource client's local model participate in training. Aggregation only aggregates and pulls down the rich-resource client's global model and global anchors. In the fourth stage of the lifecycle, the rich-resource client's local model, the rich-resource client's global model, the low-resource client's local model, and the low-resource client's global model all participate in training. The aggregation method weights and aggregates the global anchors and global models uploaded by each client based on the current block dataset size of each client (including low-resource clients), and then pulls the aggregation result down to each client.
[0050] Step 3.2: To enable the framework to adapt to the streaming nature of social media, we designed a four-stage lifecycle mechanism. The lifecycle diagram is as follows: Figure 2 As shown, the FedEvent lifecycle comprises 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 Stage I, we construct an initial weighted isomorphic message graph using M0 on rich-resource client message blocks and train an initial model using a specific algorithm. In Stage II, we use the model trained in Stage I, with a central server as the knowledge transfer medium, to assist low-resource clients in training their initial models. In Stage III, a new graph is constructed for each arriving block, and the pre-trained model is used to directly detect each arriving message block. In Stage IV, the model is continuously trained with the latest message blocks, and a federated co-distillation mechanism is used to enable online learning for each client, allowing the model to learn new knowledge. Stages I and II are used for offline learning, while Stage IV is used for online learning. Stages III and IV alternate, allowing the model to continuously adapt to incoming data, detect new events, and update its knowledge. Through this lifecycle mechanism, FedEvent can better adapt to streaming media characteristics.
[0051] As a preferred embodiment of the present invention, the specific steps of step 3.1 are as follows:
[0052] Step 3.1.1: After local model training is complete, the anchor point (cluster center vector) of the current message block on the current client will be calculated. The local anchor point is determined by message block M on the current client. i The local anchor is represented by the mean of all samples within each cluster. Therefore, the local anchor is a comprehensive reflection of the characteristics of the same event message cluster on the current client. At round t, the local anchor representation of event cluster c in client k... The calculation is as follows:
[0053]
[0054] in, f represents the number of samples in event cluster c on client k. k,l This represents the output of the local model.
[0055] Step 3.1.2: After the anchor point calculation for each client is completed, the central server will receive the local anchor point representations from each client and connect the different clients in M... i The local message cluster anchor representations are aggregated, and the aggregation method is a weighted average based on the number of messages in each client message block, that is:
[0056]
[0057] Here, S represents the set of clients that satisfy the aggregation condition; the set S varies at different stages of the lifecycle mechanism. The global anchor point is obtained through the above formula. The global anchor points will be broadcast to all shared clients. The resulting global anchor points then comprehensively reflect the characteristics of the same event cluster and can be used to guide model training on each client.
[0058] Step 3.1.3: After global anchor point aggregation is completed, global model aggregation begins. The central server receives and aggregates global models from all clients, and generates the next round of updated global models through aggregation processing. Right now:
[0059]
[0060] in, This represents the number of samples in client k. These are the parameters of the global model in the t-th round of the k-th client.
[0061] Step 3.1.4: After the central server completes the aggregation, the aggregation results are pushed down to each client, and a new round of training begins. This process of uploading and pushing is repeated iteratively until the model converges.
[0062] As a preferred embodiment of the present invention, the specific steps of step 3.2 are as follows:
[0063] Step 3.2.1: In the first stage of the lifecycle, the purpose of this invention is to train a robust local model W on a resource-rich client using the initial message block M0. k,l As new events continuously emerge, the total number of events is difficult to know in advance. Considering that cross-entropy loss is only applicable when the total number of events is known and fixed, it is difficult to handle streaming data. Therefore, we turn to pairwise learning methods to ensure inter-cluster compactness and intra-cluster segregation. Due to this characteristic, in the subsequent second and third stages, the clear inter-cluster boundary information from resource-rich clients can be distilled to low-resource clients. The task-specific loss and total loss for this stage are as follows:
[0064]
[0065] in, This is the first-stage loss, where {Pos} represents sample pairs from the same event cluster, and {Neg} represents sample pairs 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 used for detection.
[0066] Step 3.2.2: In the second stage of the lifecycle, this invention utilizes the local model trained in Stage 1 to assist low-resource clients in training the initial model. We propose process supervision guided by the global model and result supervision guided by the global anchor point to achieve knowledge transfer. Specifically, for resource-rich clients, the local model is frozen and used as the teacher model, while the global model serves as the student model. The student model learns the data features of the resource-rich client while also learning the hidden layer outputs of the teacher model (Local-To-Global strategy). For low-resource clients, the global model is frozen and used as the teacher model, while the local model serves as the student model. The student model learns general knowledge from the teacher model while simultaneously learning knowledge suitable for local data features using local data (Global-To-Local strategy). We use these two strategies as process-oriented supervision and introduce result supervision guided by the global anchor point to unify the clustering of various clients. Knowledge transfer is achieved from both result-oriented and process-oriented perspectives.
[0067] In process-oriented supervised learning, student models can flexibly learn the outputs of specific or several hidden layers in the teacher model based on the characteristics of local data. On client k, the distillation loss of each client student model... It can be represented as:
[0068]
[0069] Where MSE represents the mean squared error, and I represents the number of hidden layers that the student model needs to learn from the teacher model. These represent the outputs of the i-th hidden layer of the teacher model and the student model, respectively.
[0070] During local client training, we expect each feature to align more closely with its corresponding global anchor while moving away from non-corresponding global anchors. We utilize contrastive learning to reconcile the local centers across all clients, facilitating information exchange between them. The global anchor and the model on the client can be represented as follows: right
[0071] For the data sample x in the i-th block, the anchor alignment loss for:
[0072]
[0073]
[0074] in For cross-entropy loss, s = [s1, s2, ..., s c ] is a similarity vector, s n This can represent the similarity between the current feature and each anchor point, where α determines the concentration level, and <,> are the inner products. Minimizing the cross-entropy loss maximizes the similarity between the feature and its corresponding anchor points. The similarity between them, and minimizing the similarity between this feature and Similarity between each non-corresponding anchor point.
[0075] In Phase 2, the set of clients participating in aggregation is S = H, meaning only clients with abundant resources participate in aggregation. On client k, this phase only trains the student model on each client, and the total loss for this phase is... It can be represented as:
[0076]
[0077] After the second phase of training in the lifecycle is completed, the trained model is then tested.
[0078] Step 3.2.3: In the third stage of the lifecycle, we adjust [M] based on the trained model. i M i+w The message blocks within the window are clustered. Distance-based clustering algorithms (such as K-Means) or density-based algorithms (such as HDBSCAN) can both cluster messages. Among them, HDBSCAN does not require specifying the total number of categories, making it very suitable for incremental detection needs. Therefore, we use the HDBSCAN algorithm for message detection.
[0079] Step 3.2.4: The above two steps are for offline learning. In the fourth stage of the lifecycle, incremental training begins. We designed a co-distillation mechanism guided by task-specific loss to adapt to the online scenario. During this process, both the local and global models on each client participate in model training, learning from each other and adapting to the data distribution and pattern changes in the online scenario. Since the local model is more adapted to local data than the global model, the useful knowledge encoded by the local model can help guide the global model. Furthermore, 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. Thus, the local and global models can learn from each other. Based on this, in this stage, we designed a co-distillation mechanism guided by task-specific loss, enabling the local and global models to learn each other's useful knowledge. For the global and local models, the distillation loss can be expressed as:
[0080]
[0081] In this phase, the set of clients participating in aggregation is S = {L∪H}, meaning all clients participate in aggregation. The total loss in this phase 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 phase can be expressed as follows:
[0082]
[0083]
[0084] Steps 3.2.5, 3.2.4, and 3.2.3 are performed alternately, allowing the model to continuously adapt to social media event detection in online scenarios and learn new knowledge.
[0085] Beneficial effects of this invention:
[0086] 1. This invention uses a lifecycle mechanism to adapt to the event detection needs in both online and offline scenarios, and achieves effective knowledge transfer through process supervision and result supervision; it effectively alleviates the challenges of dealing with low-resource languages through knowledge distillation technology, and realizes semantic space mapping between different languages by utilizing a cross-language word embedding module; this technology effectively improves the efficiency of social media event detection and realizes incremental event detection.
[0087] 2. Based on the large, publicly available English dataset Events2012, this invention supplements it with Chinese and Vietnamese event samples according to its topic descriptions, constructing a private dataset on a low-resource client. Compared with the traditional baseline model, the experimental group's evaluation metrics are significantly improved compared with all baseline models. Attached Figure Description
[0088] Figure 1 An overall framework diagram of the cross-language social media event detection method based on federated knowledge distillation provided in this embodiment of the invention;
[0089] Figure 2 A lifecycle diagram of the cross-language social media event detection method based on federated knowledge distillation provided in this embodiment of the invention. Detailed Implementation
[0090] The embodiments of the present invention will now be described with reference to the accompanying drawings. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0091] like Figure 1 The diagram shown is an overall framework diagram of the cross-language social media event detection method based on federated knowledge distillation provided in this embodiment of the invention. Figure 2 As shown in the framework lifecycle diagram, 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 issue of inconsistent input features under the federated framework caused by different client languages, we utilize efficient parameter fine-tuning techniques and three sets of contrastive losses to map non-English languages into the English semantic space.
[0093] Step 2: Construction of weighted isomorphic message graphs for each client: Construct weighted isomorphic message graphs for each client's dataset based on the relationships between entities, users, and hashtags in the dataset, and use graph neural networks as feature extractors.
[0094] Step 3, Federated Network Message Distillation: Within the federated framework, local and global models are introduced to enable customized private models. Effective knowledge distillation is achieved through process supervision guided by the global model and result supervision guided by global anchors. A four-stage lifecycle mechanism is designed to enable incremental event detection within the federated framework.
[0095] The detection system corresponding to this invention includes:
[0096] The cross-linguistic word embedding module trains a cross-linguistic word embedding model using parallel corpora from non-English to English, aiming to achieve semantic space mapping from non-English text to English text. It captures semantic differences between different languages through a low-rank adaptive strategy that utilizes efficient parameter fine-tuning techniques.
[0097] The message representation graph learning module is used to construct a weighted isomorphic message graph by utilizing the relationships between users, entities, and hashtags in social media, and to extract features from social information using a two-layer GAT.
[0098] The Federated Network Message Distillation Module is used to introduce local and global models under the federated framework to achieve private model customization, and to achieve effective knowledge distillation by using process supervision based on the global model and result supervision based on the global anchor. A four-stage lifecycle mechanism is designed to achieve incremental event detection under the federated framework.
[0099] The cross-language word embedding module includes: an attention calculation matrix W in the multilingual pre-trained model. q and W v We add a side branch. To ensure that the introduced LoRA module does not lose English semantics, we use the frozen multilingual pre-trained model as the guiding model; we align the semantic space by introducing three sets of contrasts; specifically, the non-English to English similarity contrast loss measures the similarity between non-English text and its corresponding English text, aiming to ensure that the model can identify and match the correct language pairs; the English self-similarity contrast loss focuses on the similarity between different representations within English text, which helps the model maintain consistency within the same language; the non-English intra-text similarity contrast loss is used to narrow the similarity between non-English text and its corresponding English representation, ensuring that the semantic relationships within non-English text are properly expressed.
[0100] The message representation graph learning module includes a method for constructing a weighted isomorphic message graph based on three elements: user, entity, and hashtag. Specifically, when two messages share any one of these three elements, an edge is added between them in the graph. Intuitively, the more elements shared, the closer the relationship between the two messages. Therefore, the number of co-occurring elements is used as the weight of the edge to construct the weighted isomorphic message graph. Then, the semantic and structural information of the messages is learned through a graph neural network.
[0101] The federated network message distillation module includes a four-stage lifecycle strategy to enable online and offline learning within the federated framework, while distilling knowledge from resource-rich clients to low-resource clients.
[0102] As a preferred embodiment of the present invention, the specific steps of Step 1 are as follows:
[0103] Step 1.1, Dataset: The cross-lingual word embedding model trained in this invention utilizes a dataset derived from hunting faces. We map the semantic space of non-English text to the semantic space of English text; therefore, our dataset consists of non-English-English parallel corpora. This invention searches for the required non-English-English parallel sentence pairs from hunting faces.
[0104] Step 1.2, Model Construction: The cross-lingual word embedding model consists of a frozen multilingual pre-trained language model and a multilingual pre-trained model with LoRa added.
[0105] Step 1.3, Model Training: This invention utilizes 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. These are: non-English to English similarity contrastive loss, English self-similarity contrastive loss, and non-English intra-language similarity contrastive loss.
[0106] As a preferred embodiment of the present invention, in step 1.2:
[0107] Step 1.2.1: Due to the different languages used on different clients, we fine-tuned the pre-trained language model to train a cross-lingual word embedding module to ensure a consistent input feature space across all clients. We trained a cross-lingual word embedding model using parallel corpora from non-English to English, aiming to achieve semantic space mapping from non-English text to English text. By leveraging the low-rank adaptive strategy of LoRA, an efficient parameter fine-tuning technique, we captured the semantic differences between different languages.
[0108] Step 1.2.2: To ensure that the introduced LoRA module does not lose English semantics, this invention introduces a guiding model (M′), which is a frozen multilingual pre-trained model. M′ is used to guide M in its learning process. The cross-lingual word embedding module (M) designed in this invention is the attention calculation matrix W in the multilingual pre-trained model. q and W v Add a side branch. Specifically, the original W q and W v The calculation is as follows:
[0109] Q origin =X·W q V origin =X·W v
[0110] The following improvements have been made:
[0111] Q lora =X·(W q +scale·BA),Vlora =X·(W v +scale·BA)
[0112] In this process, A was initialized using a random Gaussian initialization, while B was initialized with zero; therefore, the initial value of BA was 0. Subsequently, as the downstream task data was learned, only the values of B and A were fine-tuned to achieve the desired adaptation to the downstream task.
[0113] As a preferred embodiment of the present invention, in step 1.3:
[0114] Step 1.3.1: During the training phase, this invention introduces three sets of contrastive losses: non-English to English similarity comparison loss, English self-similarity comparison loss, and non-English intra-text similarity comparison loss. Non-English to English similarity comparison measures the similarity between non-English text and its corresponding English text, aiming to ensure the model can identify and match the correct language pairs. English self-similarity comparison focuses on the similarity between different representations within English text, which helps the model maintain consistency within the same language. Non-English intra-text similarity comparison evaluates the similarity between non-English text and its corresponding English representation, ensuring that semantic relationships within non-English text are properly expressed. In summary, these loss functions work together on the model to achieve effective cross-linguistic 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 semantic space alignment 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 The three sets of comparative learning losses are specifically in the following form:
[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 semantic information between cross-language texts, thereby achieving effective semantic alignment.
[0122] As a preferred embodiment of the present invention, the specific steps of step 2 are as follows:
[0123] Step 2.1: Divide the social media message streams of resource-rich clients and resource-poor clients into different message blocks; for each message block, divide it into training set, test set and validation set according to a certain ratio, and construct heterogeneous message graphs between messages respectively, taking message content as message nodes, and topic entities, users and hashtag elements between messages as relationship nodes; at the same time, use the co-occurrence number of the three types of elements as the edge weight, thereby constructing a weighted isomorphic message graph; we construct an initial message block and a streaming message block for each client respectively.
[0124] Step 2.2, Regarding model selection, we chose the GNN model as the feature extractor for the following two main reasons: 1) GNN retains strong structural and semantic information and can fully utilize user, entity, and hashtag information from social media. 2) Graph neural networks have fewer parameters, allowing for more flexible adaptation to various clients and reducing federated communication time. The constructed weighted isomorphic message graph can learn the result information and semantic information from social media text through a graph neural network.
[0125] As a preferred embodiment of the present invention, the specific steps of step 2.1 are as follows:
[0126] Step 2.1.1, Define social flow: S = M0, M1, ..., M i-1 M i ...a set of continuous time series social media message blocks, M i It is composed of time block = [t i ,t i+1 A social media message block consisting of all messages; M i Represented as: M i ={m j |1≤j≤|M i |}, where |M i |For M i The total number of messages in m j Each message is a single message; each social media message belongs to only one category; M0 and {M_i|i≠0} are message blocks in offline and online scenarios, respectively.
[0127] For federated cross-language social media event detection, our goal is to distill the knowledge learned by resource-rich clients into low-resource clients. Let H be the set of resource-rich clients, L be the set of low-resource clients, and M be the set of low-resource clients. k,i Let C(M) be the i-th message block on the k-th client, where each message block on each client is in a single language. Let C(M) be the event set C(M) in the i-th message block on the resource-rich client. k,i |k∈H) contains the low-resource client event set C(M) k,i |k∈L), that is In the t-th round on the k-th client, message block M k,i The global model output for the medium sample x is Output the corresponding local model. The global model f on each client. g The architecture is consistent, while the local models of each client are different. k,l The design can be customized to be private based on the characteristics of the local dataset.
[0128] Step 2.1.2: Encoding Information Combining Semantic and Temporal Information. For temporal information, we convert the timestamp to an OLE date, thus obtaining a two-dimensional temporal feature. For semantic information, we use a cross-language word embedding model to uniformly encode the message, obtaining a semantic representation. The final message representation is the concatenation of the message's semantic representation and temporal feature in the last dimension.
[0129] Step 2.1.3: Construct a message graph from the encoded dataset. Specifically, on each client, use one week's worth of data to construct an initial message block M0, and then divide the data from the following 21 days into message blocks M1, M2, ..., M... 21 For each message block, the initial message block is divided into training, testing, and validation sets in a 7:2:1 ratio. A heterogeneous message graph will be constructed between the messages, with message content as message nodes and topic hashtags, entities, and users as relationship nodes. The co-occurrence count of these three elements will be used as the edge weights, thus transforming 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 as follows:
[0131] Step 2.2.1: To deeply integrate rich semantic and relational information, the GNN encoder learns node representations by iteratively summarizing information from its one-hop neighbors. Formally, the message m of layer l... i Represented as Its update at level l+1 can be represented as:
[0132]
[0133] in, Representative message m i A neighbor who jumped. Representative feature aggregation method,
[0134] The aggregator and extractor differ across different GNN models. Different clients can design different GNNs based on their local data, enabling customized local models.
[0135] As a preferred embodiment of the present invention, the specific steps of step 3 are as follows:
[0136] Step 3.1: To enable the framework to adapt to social media event detection in both online and offline scenarios, we introduce a four-stage lifecycle mechanism. The federated aggregation method differs slightly at each stage of the lifecycle, but there are also some commonalities. Specifically, in the first stage of the lifecycle, only the rich-resource client's local model is used. In the second stage, the rich-resource client's local model, the rich-resource client's global model, and the low-resource client's local model participate in training. Aggregation only aggregates and pulls down the rich-resource client's global model and global anchors. In the fourth stage of the lifecycle, the rich-resource client's local model, the rich-resource client's global model, the low-resource client's local model, and the low-resource client's global model all participate in training. The aggregation method weights and aggregates the global anchors and global models uploaded by each client based on the current block dataset size of each client (including low-resource clients), and then pulls the aggregation result down to each client.
[0137] Step 3.2: To enable the framework to adapt to the streaming nature of social media, we designed a four-stage lifecycle mechanism. The lifecycle diagram is as follows: Figure 2As shown, the FedEvent lifecycle comprises 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 Stage I, we construct an initial weighted isomorphic message graph using M0 on rich-resource client message blocks and train an initial model using a specific algorithm. In Stage II, we use the model trained in Stage I, with a central server as the knowledge transfer medium, to assist low-resource clients in training their initial models. In Stage III, a new graph is constructed for each arriving block, and the pre-trained model is used to directly detect each arriving message block. In Stage IV, the model is continuously trained with the latest message blocks, and a federated co-distillation mechanism is used to enable online learning for each client, allowing the model to learn new knowledge. Stages I and II are used for offline learning, while Stage IV is used for online learning. Stages III and IV alternate, allowing the model to continuously adapt to incoming data, detect new events, and update its knowledge. Through this lifecycle mechanism, FedEvent can better adapt to streaming media characteristics.
[0138] As a preferred embodiment of the present invention, the specific steps of step 3.1 are as follows:
[0139] Step 3.1.1: After local model training is complete, the anchor point (cluster center vector) of the current message block on the current client will be calculated. The local anchor point is determined by message block M on the current client. i The local anchor is represented by the mean of all samples within each cluster. Therefore, the local anchor is a comprehensive reflection of the characteristics of the same event message cluster on the current client. At round t, the local anchor representation of event cluster c in client k... The calculation is as follows:
[0140]
[0141] in, f represents the number of samples in event cluster c on client k. k,l This represents the output of the local model.
[0142] Step 3.1.2: After the anchor point calculation for each client is completed, the central server will receive the local anchor point representations from each client and connect the different clients in M... i The local message cluster anchor representations are aggregated, and the aggregation method is a weighted average based on the number of messages in each client message block, that is:
[0143]
[0144] Here, S represents the set of clients that satisfy the aggregation condition; the set S varies at different stages of the lifecycle mechanism. The global anchor point is obtained through the above formula. The global anchor points will be broadcast to all shared clients. The resulting global anchor points then comprehensively reflect the characteristics of the same event cluster and can be used to guide model training on each client.
[0145] Step 3.1.3: After the global anchor point 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, This represents the number of samples in client k. These are the parameters of the global model in the t-th round of the k-th client.
[0148] Step 3.1.4: After the central server completes the aggregation, the aggregation results are pushed down to each client, and a new round of training begins. This process of uploading and pushing is repeated iteratively until the model converges.
[0149] As a preferred embodiment of the present invention, the specific steps of step 3.2 are as follows:
[0150] Step 3.2.1: In the first stage of the lifecycle, the purpose of this invention is to train a robust local model W on a resource-rich client using the initial message block M0. k,l As new events continuously emerge, the total number of events is difficult to know in advance. Considering that cross-entropy loss is only applicable when the total number of events is known and fixed, it is difficult to handle streaming data. Therefore, we turn to pairwise learning methods to ensure inter-cluster compactness and intra-cluster segregation. Due to this characteristic, in the subsequent second and third stages, the clear inter-cluster boundary information from resource-rich clients can be distilled to low-resource clients. The task-specific loss and total loss for this stage are as follows:
[0151]
[0152] in, This is the first-stage loss, where {Pos} represents sample pairs from the same event cluster, and {Neg} represents sample pairs 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 used for detection.
[0153] Step 3.2.2: In the second stage of the lifecycle, this invention utilizes the local model trained in Stage 1 to assist low-resource clients in training the initial model. We propose process supervision guided by the global model and result supervision guided by the global anchor point to achieve knowledge transfer. Specifically, for resource-rich clients, the local model is frozen and used as the teacher model, while the global model serves as the student model. The student model learns the data features of the resource-rich client while also learning the hidden layer outputs of the teacher model (Local-To-Global strategy). For low-resource clients, the global model is frozen and used as the teacher model, while the local model serves as the student model. The student model learns general knowledge from the teacher model while simultaneously learning knowledge suitable for local data features using local data (Global-To-Local strategy). We use these two strategies as process-oriented supervision and introduce result supervision guided by the global anchor point to unify the clustering of various clients. Knowledge transfer is achieved from both result-oriented and process-oriented perspectives.
[0154] In process-oriented supervised learning, student models can flexibly learn the outputs of specific or several hidden layers in the teacher model based on the characteristics of local data. On client k, the distillation loss of each client student model... It can be represented as:
[0155]
[0156] Where MSE represents the mean squared error, and I represents the number of hidden layers that the student model needs to learn from the teacher model. These represent the outputs of the i-th hidden layer of the teacher model and the student model, respectively.
[0157] During local client training, we expect each feature to align more closely with its corresponding global anchor while moving away from non-corresponding global anchors. We utilize contrastive learning to reconcile the local centers across all clients, facilitating information exchange between them. The global anchor and the model on the client can be represented as follows: right
[0158] For the data sample x in the i-th block, the anchor alignment loss for:
[0159]
[0160]
[0161] in For cross-entropy loss, s = [s1, s2, ..., s c ] is a similarity vector, s nThis can represent the similarity between the current feature and each anchor point, where α determines the concentration level, and <,> are the inner products. Minimizing the cross-entropy loss maximizes the similarity between the feature and its corresponding anchor points. The similarity between them, and minimizing the similarity between this feature and Similarity between each non-corresponding anchor point.
[0162] In Phase 2, the set of clients participating in aggregation is S = H, meaning only clients with abundant resources participate in aggregation. On client k, this phase only trains the student model on each client, and the total loss for this phase is... It can be represented as:
[0163]
[0164] After the second phase of training in the lifecycle is completed, the trained model is then tested.
[0165] Step 3.2.3: In the third stage of the lifecycle, we adjust [M] based on the trained model. i M i+w The message blocks within the window are clustered. Distance-based clustering algorithms (such as K-Means) or density-based algorithms (such as HDBSCAN) can both cluster messages. Among them, HDBSCAN does not require specifying the total number of categories, making it 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 for offline learning. In the fourth stage of the lifecycle, incremental training begins. We designed a co-distillation mechanism guided by task-specific loss to adapt to the online scenario. During this process, both the local and global models on each client participate in model training, learning from each other and adapting to the data distribution and pattern changes in the online scenario. Since the local model is more adapted to local data than the global model, the useful knowledge encoded by the local model can help guide the global model. Furthermore, 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. Thus, the local and global models can learn from each other. Based on this, in this stage, we designed a co-distillation mechanism guided by task-specific loss, enabling the local and global models to learn each other's useful knowledge. For the global and local models, the distillation loss can be expressed as:
[0167]
[0168] In this phase, the set of clients participating in aggregation is S = {L∪H}, meaning all clients participate in aggregation. The total loss in this phase 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 phase can be expressed as follows:
[0169]
[0170]
[0171] Steps 3.2.5, 3.2.4, and 3.2.3 are performed alternately, allowing the model to continuously adapt to social media event detection in online scenarios and learn new knowledge.
[0172] To illustrate the effectiveness of this invention, it is compared with existing methods and tested on an expanded dataset. The clustering algorithm is unified as the HDBSCAN clustering algorithm, and the evaluation metrics are consistent with the comparison methods, using NMI and AMI as metrics to evaluate the clustering results. Specifically, Normalized Mutual Information (NMI) and Adjusted Mutual Information (AMI) are used. NMI, as a metric, aims to measure clustering quality and assess the similarity between the clustering results generated by our model and the actual ground truth categories. AMI is an improved version of NMI, which considers the errors introduced by random clustering and provides a more robust metric. The experimental results of the dataset 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 divided the initial message block M0 on that client into training, test, and validation sets at 70%, 20%, and 10% respectively. As shown in Table 1 (with subscript c), the experimental results demonstrate that in offline scenarios, multi-machine environments (FedEvent, FedKP, etc.) outperform single-machine event detection methods, proving that multi-machine environments can improve the performance of models in single-machine environments. This is because the federated framework can integrate knowledge from various clients. Specifically, on Chinese clients, the multi-machine environment showed significant improvements in NMI and AMI of 1.6%-204.3% and 2.0%-342.9% respectively compared to the single-machine environment. On Vietnamese clients, the improvements were 2.3%-6200% and 0%-4400% respectively. While FedKP and FedQS methods also showed improvement after introducing federation, the improvement was not significant due to the inconsistency of feature spaces on different clients and differences between different languages. FedEvent utilizes global anchors to unify the feature spaces across various clients, leverages local models to adapt to the characteristics of local private data, and utilizes a global model to transfer global knowledge. Therefore, FedEvent is more suitable for migrating knowledge from resource-rich clients to low-resource clients when handling distributed social event detection tasks. Specifically, compared to FedKP and FedQS, FedEvent improves NMI and AMI metrics by 11.1%-34.0% and 17.0%-28.6% respectively, demonstrating the effectiveness of our framework.
[0176] Table 2. Results of the Chinese Online Evaluation (NMI)
[0177]
[0178]
[0179] Table 3. Chinese Online Assessment Results (AMI)
[0180]
[0181] Table 4. Results of the Online Vietnamese Language Assessment (NMI)
[0182]
[0183] Table 5. Results of the Online Vietnamese Language Assessment (AMI)
[0184]
[0185] Online evaluation: In online scenarios, the experimental results are shown in Tables 2, 3, 4, and 5. Our method outperforms all methods in both single-machine and multi-machine environments in most online scenarios.
[0186] Ablation Experiments: To further verify the effectiveness of our proposed method, we conducted two sets of ablation experiments: the impact of the cross-lingual word embedding module and the anchor alignment loss on model performance. By comparing the experimental results marked with subscript 'a' in Tables 2, 3, 4, and 5, we observed that both the cross-lingual word embedding module and the anchor alignment loss significantly improved model performance in both offline and online scenarios. Cross-lingual word embedding module Compared to mBERT, This significantly alleviates the shortcomings of mBERT in representing low-resource language texts. Specifically, on Chinese clients, the cross-language word embedding module... Compared to mBERT, FedEvent achieved an average improvement of 149.4% in both NMI and AMI metrics, and an average improvement of 322.3% on Vietnamese clients. Furthermore, by introducing cross-lingual word embeddings, FedEvent achieved an average improvement of 2.4% on Chinese clients and 4.3% on Vietnamese clients compared to methods without this module (i.e., w / oNC). Because the introduction of the cross-lingual word embedding module ensures the consistency of the input feature space across different clients, FedEvent enhances the distillation effect. Specifically, it can be observed that the cross-lingual word embedding module… Its performance is particularly outstanding on Vietnamese-language clients, possibly because mBERT's representation ability for Vietnamese is not as strong as its representation ability for Chinese. The effect is even more pronounced after characterizing the messages. Furthermore, across various clients, FedEvent showed an average decrease of 5.3% in both NMI and AMI compared to the method without anchor alignment loss (i.e., without NA), further confirming the importance of anchor alignment loss. Without anchor alignment loss, low-resource clients struggle to capture anchor alignment information, resulting in poor distillation performance. In the online evaluation, we observed significant performance differences between different blocks, possibly due to the large variations in the number of messages within different blocks and the long-tail distribution of data within message blocks.
[0187] In the description of this specification, references to terms such as "an embodiment," "example," "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0188] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The 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-linguistic word embedding pre-training: Utilize 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: Utilize the relationships between entities, users, and hashtags in existing social data to construct a weighted isomorphic message graph, and use a graph neural network as a feature extractor; Step 3, Message Distillation in the Federated Network: Local and global models are introduced under the federated framework to achieve private model customization, and process supervision based on the global model and result supervision based on the global anchor are used to achieve effective knowledge distillation; and a four-stage lifecycle mechanism is designed to achieve incremental event detection under the federated framework. The specific steps of Step 3 are as follows: Step 3.1: Introduce a four-stage lifecycle mechanism to enable online and offline learning under the federated framework while distilling knowledge from resource-rich clients to low-resource clients; In the first phase of the lifecycle, only the local model of the rich resource client is used. In the second phase of the lifecycle, 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 are all trained. Aggregation only aggregates and pulls down the global model and global anchor points of the rich resource client. In the fourth phase of the lifecycle, 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 are all trained. The aggregation method is to perform weighted aggregation of the global anchor points and global models uploaded by each client according to the current block dataset size of each client, and then pull down the aggregation result to each client. Step 3.2: A four-stage lifecycle mechanism was designed; The lifecycle of FedEvent includes four stages: rich resource client pre-training, low resource client pre-training, detection of each client, and maintenance. In the first phase, utilizing rich resource client message blocks Construct an initial weighted isomorphic message graph and train an initial model using a specific algorithm; In the second stage, the model trained in the first stage is used with the central server as the medium for knowledge transfer to assist low-resource clients in training the initial model; in the third stage, a new graph is constructed for each incoming block, and then the pre-trained model is used to directly detect each incoming message block. In the fourth stage, the model is continuously trained with the latest message blocks, and the federated co-distillation mechanism is used to enable online learning for each client, so that the model can learn new knowledge; among them, the first and second stages are used for offline learning, and the fourth stage is used for online learning; the third and fourth stages are carried out alternately. The specific steps of Step 3.1 are as follows: Step 3.1.1: After local model training is complete, the anchor point of the current message block on the current client will be calculated; the local anchor point is determined by the message block on the current client. It is represented by the mean of all samples within each cluster; During the round, the client Local anchor point representation of event cluster c The calculation is as follows: ; in, Indicates client Upper event cluster The number of samples, Represents the output of the local model; Step 3.1.2, after each client anchor point calculation, the central server will accept the local anchor representation from each client, and aggregate the local message cluster anchor representations from different clients on M i , the aggregation method is weighted average according to the number of messages in each client message block, that is: ; in, For a collection of clients that satisfy the aggregation conditions, the collection is defined at different stages of the lifecycle mechanism. The difference is slight; the global anchor point is obtained through the above formula. The global anchor will be broadcast to all shared clients; at this time, the obtained global anchor can comprehensively reflect the characteristics of the same event cluster and be used to guide the model training of each client. Step 3.1.3: After the global anchor point 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: ; in, Indicates client Number of samples For the first The first client Parameters of the round-robin global model; Step 3.1.4: After the central server completes the aggregation, the aggregation results are pushed down to each client, and a new round of training begins; this process of uploading and pushing is repeated iteratively until the model converges. The specific steps of Step 3.2 are as follows: Step 3.2.1: In the first stage of the lifecycle, the resource-rich client utilizes the initial message block. Training a robust local model ; Pairwise learning is used to ensure inter-cluster compactness and intra-cluster segregation; Task-specific loss and total loss are respectively : ; in, This is the first phase of losses. They are sample pairs from the same event cluster. They are sample pairs from different event clusters. It is the boundary distance hyperparameter. Calculate the Euclidean distance. It is the message representation learned by the GNN encoder; after training is complete, the model is tested. Step 3.2.2: In the second stage of the lifecycle, the local model trained in Stage 1 is used to assist low-resource clients in training the initial model. A process supervision approach guided by the global model and an outcome supervision approach guided by the global anchor are proposed to achieve knowledge transfer. Specifically, for rich-resource clients, the local model is frozen and used as the teacher model, while the global model is used as the student model. The student model learns the data features of the rich-resource client while also learning the hidden layer outputs of the teacher model. For low-resource clients, the global model is frozen and used as the teacher model, while the local model is used as the student model. The student model learns general knowledge from the teacher model while also learning knowledge suitable for local data features using local data. These two strategies are used as process-oriented supervision, and an outcome supervision approach guided by the global anchor is introduced to unify the clustering of various clients, enabling knowledge transfer from both outcome-oriented and process-oriented perspectives. Client Above, the distillation loss of student models on each client side. Represented as: ; Where MSE represents the mean squared error, and I represents the number of hidden layers that the student model needs to learn from the teacher model. Representing the teacher model and student model respectively The output of each hidden layer; During local client training, contrastive learning is used to coordinate the local centers of all clients to facilitate information exchange between them; the global anchor and the model on the client are represented as follows: ,right At the Block data sampling Anchor point alignment loss for: ; ; in For cross-entropy loss, It is a similarity vector, s n This represents the similarity between the current feature and each anchor point, with α determining the concentration level. It is the inner product; minimizing the cross-entropy loss maximizes the relationship between the feature and its corresponding anchor. The similarity between them, and minimizing the similarity between this feature and Similarity between each non-corresponding anchor point; In Phase Two, the set of clients participating in the aggregation is S=H, meaning only clients with rich resources participate in the aggregation; clients In this stage, only the student models on each client are trained, and the total loss in this stage is... Represented as: ; After the second phase of training in the lifecycle is completed, the trained model is then tested. Step 3.2.3: In the third stage of the lifecycle, based on the trained model... Clustering of message blocks within a window; clustering of messages using distance-based or density-based algorithms; among them, HDBSCAN does not require specifying the total number of categories, making it very suitable for incremental detection needs, and message detection is performed using the HDBSCAN algorithm; Step 3.2.4: In the fourth stage of the lifecycle, incremental training begins. A co-distillation mechanism guided by task-specific loss is designed to adapt to online scenarios. During this process, both the local and global models on each client participate in model training, learning from each other and adapting to the data distribution and pattern changes in online scenarios. The co-distillation mechanism guided by task-specific loss enables the local and global models to learn useful knowledge from each other. For both the global and local models, the distillation loss is expressed as: ; The set of clients participating in the aggregation during this phase This means that 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 follows: , ; ; ; Steps 3.2.5, 3.2.4, and 3.2.3 are performed alternately, allowing the model to continuously adapt to social media event detection in online scenarios and learn new knowledge.
2. The cross-language social media event detection method based on federated knowledge distillation according to claim 1, characterized in that, The specific steps of Step 1 are as follows: Step 1.1: The cross-linguistic word embedding model trained uses a dataset from hunting faces; it maps the semantic space of non-English text to the semantic space of English text, and the dataset is a non-English-English parallel corpus. Step 1.2: The cross-lingual word embedding model consists of a frozen multilingual pre-trained language model and a multilingual pre-trained model with LoRa added. Step 1.3: Use contrastive learning to train a cross-lingual word embedding model. Specifically, introduce three sets of contrastive losses to enable the added LoRa to learn the differences between different languages: non-English to English similarity contrast loss, English self-similarity contrast loss, and non-English internal similarity contrast loss.
3. The cross-language social media event detection method based on federated knowledge distillation according to claim 1, characterized in that, The specific steps of Step 2 are as follows: Step 2.1: Divide the social media message streams of resource-rich clients and resource-poor clients into different message blocks; for each message block, divide it into training, testing, and validation sets according to a certain ratio, and construct heterogeneous message graphs between messages respectively, treating message content as message nodes, and topic entities, users, and hashtag elements between messages as relationship nodes; at the same time, use the co-occurrence number of the three types of elements as the edge weights, thereby constructing a weighted isomorphic message graph; construct an initial message block and a streaming message block for each client respectively; Step 2.2, Regarding model selection, the GNN model was chosen 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, characterized in that, The specific steps of Step 2.1 are as follows: Step 2.1.1, Define social flow: A set of continuous time-series social media message blocks, It is composed of time blocks = [ , A social media message block consisting of all messages; Will Represented as: | |}, where for The total number of messages in the message. Each message is a single post; each social media post belongs to only one category. , These 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 resource-rich clients into low-resource clients; assuming H is the set of resource-rich clients and L is the set of low-resource clients. For the first The first on the client The message block is in a single language on each client; the message block on the rich resource client is in a single language. The event set in a message block Includes a low-resource client event set ,Right now ;No. On the first client Rounds, message blocks medium sample The global model output is , Output the corresponding local model; the global model on each client. The architecture is consistent, while each client has its own local model. The design is customized to be private based on the characteristics of the local dataset; Step 2.1.2: Encode information by combining semantic and temporal information; for temporal information, convert the timestamp into an OLE date to obtain a two-dimensional time feature; For semantic information, a cross-language word embedding model is used to uniformly encode the message to obtain a semantic representation; the final message representation is the concatenation of the message's semantic representation and temporal features in the last dimension. Step 2.1.3: Construct a message graph from the encoded dataset. Specifically, on each client, use one week's worth of data to construct initial message blocks. The data from the following 21 days was then divided into message blocks. For each message block, the initial message block is divided into training set, test set and validation set in a ratio of 7:2:
1. Heterogeneous message graphs between messages will be constructed respectively. The message content is used as message nodes, and the topic hashtag, entity and user elements between messages are used as relationship nodes. The number of co-occurrences of the above three elements is used as the weight of the edge, thereby transforming the heterogeneous message graph into a homogeneous message graph.
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
