A fake news detection method for unbalanced samples

By combining the RoBERTa model and Transformer encoder with the semantic interaction module and gating mechanism of Bi-GRU, the problem of insufficient global and local feature capture in fake news detection is solved, achieving higher classification accuracy, especially a significant improvement on imbalanced datasets.

CN118760880BActive Publication Date: 2026-12-01JILIN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410878678.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2026-12-01
Estimated Expiration
2044-07-02

AI Technical Summary

Technical Problem

Existing fake news detection methods cannot effectively capture local dependencies when faced with imbalanced samples, resulting in decreased model performance when understanding articles that use rhetorical devices, and the imbalanced dataset leads to insufficient classification accuracy.

Method used

The RoBERTa model is used for word embedding. Global features are extracted by combining the Transformer encoder and the semantic interaction module of Bi-GRU. Local features are captured by the gating mechanism module, and the data imbalance problem is alleviated by the weight resampling module, thereby improving the classification accuracy of the model.

Benefits of technology

It captures both global and local features, improving the classification accuracy of fake news detection, especially performing better on imbalanced datasets, with an accuracy improvement of 4.6%-15% compared to traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760880B_ABST
    Figure CN118760880B_ABST
Patent Text Reader

Abstract

The application is suitable for the technical field of fake news detection, and provides a fake news detection method for unbalanced samples, which comprises the following steps: word embedding; using a RoBERTa model for word embedding, the RoBERTa comprising three embedding encodings, namely token embedding, segment embedding and position embedding; a semantic interaction module; composed of RoBERTa embedding encoding, a Transformer encoder and a Bi-GRU, and used for extracting global features; a gate mechanism module; composed of a ConvID, a BatchNorm, a CGU, a sigmoid activation function and a Dropout layer, and used for extracting local features; a weight resampling module; setting a weight and a sampling rate.The application proposes a weight resampling method for the unbalanced phenomenon of a data set, which can not only capture global features and local features at the same time, but also improve the accuracy of classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of fake news detection technology, and in particular relates to a fake news detection method for imbalanced samples. Background Technology

[0002] With the widespread adoption of social media and the rapid development of the internet, misinformation has proliferated online, undermining credibility and causing serious negative impacts on the public. Fake news is deceptive and misleading; it often uses eye-catching headlines, exaggerated facts, and inaccurate data to quickly attract public attention and sharing. This phenomenon can lead to misunderstandings of the facts. To combat the proliferation of fake news, researchers have focused on developing fake news detection methods to help users determine the veracity of information. Fake news detection aims to verify the truthfulness of facts stated in a text and assess the veracity of claims contained within it. A claim is a statement or assertion made in the text; it can be a statement about an event, fact, opinion, or argument, covering various fields and topics. By verifying and assessing the veracity of these claims, fake news detection can help the public and policymakers accurately understand the truth and avoid being misled by false information.

[0003] Existing fake news detection methods primarily utilize natural language processing and machine learning techniques. However, because fake news often spreads faster than real news on social media platforms, imbalanced datasets sometimes occur. Current mainstream methods use attention-based models for fake news detection. Attention mechanisms, with their strong semantic understanding and ability to capture long-distance dependencies, help improve classification performance. However, attention-based models focus more on capturing global dependencies and are weaker at capturing local dependencies, making them unable to understand articles using rhetorical devices (such as metaphors, similes, and puns). To address these issues, the model's ability to understand news can be improved by appropriately reducing or adjusting attention weights or introducing external evidence. Therefore, this paper proposes a fake news detection method for imbalanced samples. Summary of the Invention

[0004] The purpose of this invention is to provide a fake news detection method for imbalanced samples, aiming to solve the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides the following technical solution: A method for detecting fake news based on imbalanced samples includes the following steps: Step S1: Word embedding; Words are embedded using the RoBERTa model, which includes three types of embedding encoding: token embedding, segment embedding, and position embedding. Step S2, Semantic Interaction Module; The semantic interaction module consists of RoBERTa embedding encoder, Transformer encoder and Bi-GRU, used to facilitate semantic interaction between Claim and Article and extract global features; Step S3, Gating Mechanism Module; The gating mechanism module consists of ConvID, BatchNorm, CGU, sigmoid activation function and Dropout layer, used to extract local features; Step S4, Weighted Resampling Module: Set the weights and sampling rate.

[0006] Furthermore, the token embedding is a word vector obtained by pre-training RoBERTa based on WordPiece embedding.

[0007] Furthermore, when processing input text, the RoBERTa model adds a [CLS] flag at the beginning of each word and a [SEP] flag at the end, and converts each word into a corresponding token embedding vector to segment the sentence.

[0008] Furthermore, the specific process of step S2 is as follows: First, Consider it as a set of n claim sequences, where , The maximum sequence length, The feature size; each Claim consists of a set of m related articles. The report included A set of source articles, The embedding encoding is extracted from the pre-trained language model RoBERTa and passed through a Transformer encoder; the m-th vector of the input text. Through the Transformer encoder and the nth vector Interact:

[0009] Where, vector As input for the query The inputs, serving as keys and values, undergo deep semantic interaction within the Transformer encoder block. Queries, keys, and values ​​are obtained by projecting h times through different learnable linear layers. Each Transformer encoder consists of a module unit and two sub-layers. After the input vectors interact with other vectors, the relevant modules are connected.

[0010] in, The linear transformation is as follows ,in The output vector after concatenation. H 1,…, H h These are the multi-head attention mechanisms within the Transformer encoder. , , A As the query input of the Transformer encoder (i.e. Figure 3 Input Q in the middle). C As key and value inputs to the Transformer encoder (i.e. Figure 3 (inputs K and V) and These are the parameters for linear transformation; Bi-GRU is used to extract semantic features, vectors The material is fed into a Bi-GRU layer that undergoes three iterations and is normalized. After passing through a Dropout layer, it is then subjected to dimensionality reduction through a nonlinear transformation.

[0011] Furthermore, the specific process of step S3 is as follows: Given an input sequence After processing with ConvID, normalization is performed using BatchNorm: Normalized feature sequence Divided into hidden state sequences and gated state sequence : ; for the gated state sequence Perform one-dimensional convolution and batch normalization operations to obtain a normalized gated sequence. : Normalized gating sequence The gated sequence is obtained by performing a nonlinear mapping using the sigmoid activation function. Gated sequences With hidden state sequence To avoid overfitting, the gated feature sequences are multiplied and fed into a Dropout layer to obtain the final classification label result. .

[0012] Furthermore, in step S4, the batch size is set to 128. Within a batch, negative samples are sampled sequentially, and positive samples are sampled randomly in a ratio of 7:3. The class weights are set to [0: 0.5, 1:0.55] using grid search parameters.

[0013] Compared with the prior art, the beneficial effects of the present invention are: This invention proposes a weighted resampling method to address the problem of imbalanced datasets. This method can capture both global and local features simultaneously and improve classification accuracy. Attached Figure Description

[0014] Figure 1 This is a flowchart of the present invention.

[0015] Figure 2 This is a structural diagram of the embedded layer in this invention.

[0016] Figure 3 This is a structural diagram of the semantic interaction module in this invention.

[0017] Figure 4 This is a framework diagram of CPMLP in this invention. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0019] The specific implementation of the present invention will be described in detail below with reference to specific embodiments.

[0020] like Figure 1 The image shows a method for detecting fake news based on imbalanced samples, provided in one embodiment of the present invention. This method includes the following steps: Step S1: Word embedding; Words are embedded using the RoBERTa model, which includes three types of embedding encoding: token embedding, segment embedding, and position embedding. Step S2, Semantic Interaction Module; The semantic interaction module consists of RoBERTa embedding encoder, Transformer encoder and gated recurrent unit (Bi-GRU), used to facilitate semantic interaction between Claim and Article and extract global features; Step S3, Gating Mechanism Module; The gating mechanism module consists of a one-dimensional convolutional layer (ConvID), a batch normalization layer (BatchNorm), a convolutional gate unit (CGU), a sigmoid activation function, and a Dropout layer, and is used to extract local features; Step S4: Weighted resampling module; set weights and sampling rates to alleviate data imbalance.

[0021] In a preferred embodiment of the present invention, in step S1, we use RoBERTa for word embedding, such as... Figure 2 The diagram shows the embedding layer structure. The tokenized embedding is a word vector pre-trained on the model based on WordPiece embeddings. When inputting text, RoBERTa, in addition to inserting special flags (CLS and SEP) at the beginning and end of words, maps each word to a tokenized embedding vector to segment the sentence. Using WordPiece embeddings can handle combinations of unknown words and subwords better than traditional word vectors.

[0022] In a preferred embodiment of the present invention, in step S2, we designed a semantic interaction module to facilitate deeper semantic interaction between Claim and Article, with the following architecture: Figure 3 As shown.

[0023] This invention employs a method of inputting different queries, keys, and values, and adds auxiliary data (Articles) to encourage the model to focus on the most important phrases in the Claim. This attention-guided approach enables deep semantic interaction between the two inputs, thereby improving model performance. First, [the following steps are taken]. Consider it as a set of n claim sequences, where , The maximum sequence length, The feature size; each Claim consists of a set of m related articles. The report included A set of source articles, At the same time, each It also has a binary label indicating its authenticity. Related. express It's not a rumor. express It's a rumor. We define the dataset as... Each data point is a tuple. The training instances consist of tuples representing the claims, related articles, and their veracity. Given the data, our goal is to predict claims. The authenticity of the data. The embedding encoding is extracted from the pre-trained language model RoBERTa and passed through a Transformer encoder; the m-th vector of the input text. Through the Transformer encoder and the nth vector Interact:

[0024] Where, vector As input for the query The inputs, serving as keys and values, undergo deep semantic interaction within the Transformer encoder block. Queries, keys, and values ​​are obtained by projecting h times through different learnable linear layers. Each Transformer encoder consists of one module unit and two sub-layers. After the input vectors interact with other vectors, the relevant modules are connected.

[0025] in, The linear transformation is as follows ,in The output vector after concatenation. H 1,…, H h These are the multi-head attention mechanisms within the Transformer encoder. , , A As the query input of the Transformer encoder (i.e. Figure 3 Input Q in the middle). C As key and value inputs to the Transformer encoder (i.e. Figure 3 (inputs K and V) and These are the parameters for linear transformation; Using Bi-GRU to extract semantic features, compared with traditional RNN and LSTM, GRU has lower computational cost, faster execution speed, fewer parameters, better prevention of gradient vanishing, and better handling of long sequence data. The material is fed into a Bi-GRU layer that undergoes three iterations and is normalized. After passing through a Dropout layer, it is then subjected to dimensionality reduction through a nonlinear transformation.

[0026] In a preferred embodiment of the present invention, in step S3, the present invention proposes a gating mechanism module for capturing local dependencies in the input sequence, which is implemented by CPMLP. This module can process both sequential and non-sequence features simultaneously, exhibiting better generalization performance. The structure of CPMLP is as follows: Figure 4 As shown. Specifically, given an input sequence After processing with ConvID, normalization is performed using BatchNorm: Normalized feature sequence Divided into hidden state sequences and gated state sequence : ; for the gated state sequence Perform one-dimensional convolution and batch normalization operations to obtain a normalized gated sequence. : Normalized gating sequence The gated sequence is obtained by performing a nonlinear mapping using the sigmoid activation function. Gated sequences With hidden state sequence Multiplying them together yields the gated feature sequence: To avoid overfitting, the gated feature sequences are fed into the Dropout layer to obtain the final classification label results. .

[0027] In a preferred embodiment of the present invention, in step S4, when the samples in the dataset are severely imbalanced, it becomes more difficult for the model to predict the minority classes. To address the impact of noise interference on the model's prediction accuracy, we designed an anti-noise interference experiment (ATI), an adjustable weight resampling method. Given that the number of positive samples in our dataset is far less than the number of negative samples (as shown in Table 1), we divide the weight range into two categories based on the ratio of positive to negative samples and allocate them using category weights. When calculating the loss function, different categories are weighted to improve the model's classification performance for the minority classes. Specifically, we use the following weight and sampling ratio settings. First, the batch size is set to 128. Within a batch, negative samples are sampled sequentially, and positive samples are sampled randomly, with a ratio of 7:3. The category weights are set to [0: 0.5, 1: 0.55] using grid search parameters.

[0028] Table 1. Dataset Statistics

[0029] To evaluate the performance of our method, we used appropriate evaluation metrics to assess the classification results: accuracy, F1 score, precision, and recall. Tables 2 and 3 list the results of our method and traditional methods on each evaluation metric across four datasets.

[0030] Table 2. Experimental results of our method and traditional methods on the Snopes and Mocheg datasets.

[0031] Table 3. Experimental results of our method and traditional methods on the MultiFC and PolitiFact datasets.

[0032] As shown in Tables 2 and 3, traditional CNN and LSTM models based on word embeddings exhibit the worst classification performance. When switching from classic deep learning language models to attention-based Transformer and Longformer models, significant improvements are observed across all metrics on each dataset, ranging from approximately 8% to 13%. Among these methods, Longformer excels at handling long sequences, achieving a 15% accuracy improvement compared to classic deep learning language models on the MultiFC dataset. However, our proposed method outperforms all of them, achieving a 4.6% accuracy improvement across all four datasets. This indicates that our method's structure better captures both global and local information. Furthermore, while BERT and RoBERTa both achieve high accuracy, our proposed method improves accuracy by approximately 2.9% on the Snopes and MultiFC datasets and by approximately 3.3% on the Mocheg and Politifact datasets. This demonstrates the effectiveness of our proposed method.

[0033] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present invention, and these should also be considered within the scope of protection of the present invention. These modifications and improvements will not affect the effectiveness of the implementation of the present invention or the practicality of the patent.

Claims

1. A method for detecting fake news based on imbalanced samples, characterized in that, Includes the following steps: Step S1: Word embedding; Word embedding is performed using the RoBERTa model, which includes three types of embedding encoding: token embedding, segment embedding, and position embedding. Step S2, Semantic Interaction Module; The semantic interaction module consists of RoBERTa embedding encoder, Transformer encoder and gated recurrent unit Bi-GRU, used to facilitate semantic interaction between Claim and Article and extract global features; Step S3, Gating Mechanism Module; The gating mechanism module consists of a one-dimensional convolutional layer Conv1D, a batch normalization layer BatchNorm, a convolutional gate unit CGU, a sigmoid activation function, and a Dropout layer, and is used to extract local features; Step S4, Weighted Resampling Module: Set weights and sampling rate; The specific process of step S2 is as follows: First, Consider it as a set of n claim sequences, where , The maximum sequence length, The feature size; each Claim consists of a set of m related articles. The report included A set of source articles, The embedding encoding is extracted from the pre-trained language model RoBERTa and passed through a Transformer encoder; the m-th vector of the input text. Through the Transformer encoder and the nth vector Interact: ; Where, vector As input for the query The inputs, serving as keys and values, undergo deep semantic interaction within the Transformer encoder block. Queries, keys, and values ​​are obtained by projecting h times through different learnable linear layers. Each Transformer encoder consists of a module unit and two sub-layers. After the input vectors interact with other vectors, the relevant modules are connected. ; in, The linear transformation is as follows ,in The output vector after concatenation. H 1,…, H h These are the multi-head attention mechanisms within the Transformer encoder. , , A As the query input for the Transformer encoder, C As key and value inputs to the Transformer encoder, and These are the parameters for linear transformation; Bi-GRU is used to extract semantic features, vectors The material is fed into a Bi-GRU layer that undergoes three iterations and is normalized. After passing through a Dropout layer, it is then subjected to dimensionality reduction through a nonlinear transformation. The specific process of step S3 is as follows: Given an input sequence After processing with Conv1D, normalization is performed using BatchNorm: Normalized feature sequence Divided into hidden state sequences and gated state sequence : ; for the gated state sequence Perform one-dimensional convolution and batch normalization operations to obtain a normalized gated sequence. : Normalized gating sequence The gated sequence is obtained by performing a nonlinear mapping using the sigmoid activation function. Gated sequences With hidden state sequence Multiplying them together yields the gated feature sequence: The gated feature sequence is fed into the Dropout layer to obtain the final classification label result. .

2. The fake news detection method for imbalanced samples according to claim 1, characterized in that, The token embedding is a word vector obtained by pre-training RoBERTa based on WordPiece embedding.

3. The fake news detection method for imbalanced samples according to claim 1, characterized in that, The RoBERTa model adds a [CLS] flag at the beginning of each word and a [SEP] flag at the end when processing input text, and converts each word into a corresponding token embedding vector to segment the sentence.

4. The fake news detection method for imbalanced samples according to claim 1, characterized in that, In step S4, the batch size is set to 128. Within a batch, negative samples are sampled sequentially, and positive samples are sampled randomly in a ratio of 7:

3. The class weights are set to [0: 0.5, 1: 0.55] using grid search parameters.