Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TruthLens: A Hybrid Transformer–Graph Neural Network Framework for Temporal Fake News Detection

A multimodal deep learning framework that combines Transformer-based text representations, Heterogeneous Graph Neural Networks, and temporal modeling for fake news detection.

---

Table of Contents

Overview

Fake news has become one of the most pressing challenges in today's digital ecosystem. Traditional fake news detection methods often rely solely on textual content, overlooking valuable relational and temporal information that can significantly improve classification performance.

TruthLens is a hybrid deep learning framework designed to detect fake news by jointly learning from:

  • Textual semantics extracted using Transformer language models.
  • Relational information modeled through a Heterogeneous Graph Neural Network (HGNN).
  • Temporal information captured from publication timestamps.

By integrating these complementary modalities, TruthLens produces richer representations of news articles and achieves strong performance across multiple benchmark datasets.


Motivation

Online misinformation spreads through complex interactions among users, publishers, and entities while evolving over time. Models based solely on article content often fail to capture these relationships.

TruthLens addresses this challenge by combining:

  • semantic understanding,
  • heterogeneous graph reasoning,
  • temporal awareness

within a unified neural architecture capable of learning from multiple information sources simultaneously.

Architecture

TruthLens consists of four major components.

1. Text Encoder

Each news article is converted into a dense semantic representation using a pre-trained Transformer language model.

The encoder captures contextual and linguistic information that helps distinguish fake from legitimate news.


2. Graph Encoder

The graph encoder models the structural relationships between different entities using a Heterogeneous Graph Transformer (HGT).

The heterogeneous graph contains four node types:

  • News
  • Users
  • Sources
  • Entities

and three relation types:

  • User → Shares → News
  • News → Published By → Source
  • News → Mentions → Entity

It propagates information across heterogeneous node and edge types, allowing the model to learn rich graph-aware representations.

3. Temporal Encoder

Publication timestamps are encoded into learnable temporal embeddings.

Temporal information enables the model to capture evolving patterns in misinformation dissemination.


4. Fusion Network

The embeddings generated by the three encoders are fused into a shared latent representation.

The fused representation is then passed through a classification head to predict whether a news article is:

  • Fake
  • Real

Overall Pipeline

                      News Article
                           │
          ┌────────────────┴────────────────┐
          │                                 │
     Transformer                      Timestamp
     Text Encoder                 Temporal Encoder
          │                                 │
          └──────────────┬──────────────────┘
                         │
              Heterogeneous Graph
                         │
           Heterogeneous Graph Transformer
                         │
                 Graph Embedding
                         │
               Multimodal Feature Fusion
                         │
                 Fully Connected Layer
                         │
                 Fake / Real Prediction

Datasets

TruthLens is evaluated on two publicly available fake news datasets.

CoAID

The CoAID (COVID-19 Healthcare Misinformation Dataset) contains COVID-19-related news articles together with social media interactions and metadata.

The dataset includes:

  • News articles
  • User interactions
  • News publishers
  • Publication timestamps
  • Binary labels (Fake / Real)

FakeNewsNet

FakeNewsNet is a benchmark dataset that combines news content with rich social context collected from Twitter.

It includes:

  • News content
  • User engagements
  • Publishers
  • Social interactions
  • Labels (Fake / Real)

Experimental Results

CoAID Dataset

Classification Report

Class Precision Recall F1-score
Fake 0.9012 0.7766 0.8343
Real 0.9746 0.9902 0.9823

Overall Performance

Metric Score
Accuracy 96.80%
Macro F1-score 90.83%
Weighted F1-score 96.70%

FakeNewsNet Dataset

Classification Report

Class Precision Recall F1-score
Fake 0.8495 0.6864 0.7593
Real 0.9027 0.9599 0.9304

Overall Performance

Metric Score
Accuracy 89.20%
Macro F1-score 84.48%
Weighted F1-score 88.79%

Installation

TruthLens uses uv for dependency management.

Clone the repository:

git clone https://github.com/CheunAnthony/TruthLens.git

cd TruthLens

Install all project dependencies:

uv sync

Explainability

TruthLens includes explainability support using PyTorch Geometric's Explainer API.

The framework can generate explanations highlighting:

  • Important graph nodes
  • Important node features

This allows users to better understand the reasoning behind model predictions.


Technologies

  • Python 3.11+
  • PyTorch
  • PyTorch Geometric
  • Hugging Face Transformers
  • NumPy
  • Pandas
  • Scikit-learn
  • uv

Future Work

Potential future improvements include:

  • Dynamic heterogeneous graph construction
  • Temporal graph neural networks
  • Multi-platform misinformation detection
  • Large Language Model (LLM) integration
  • Explainability improvements
  • Cross-domain fake news detection

License

This project is licensed under the MIT License.

See the LICENSE file for details.


Acknowledgements

This work builds upon several outstanding open-source projects, including:

  • PyTorch
  • PyTorch Geometric
  • Hugging Face Transformers
  • Scikit-learn

We also acknowledge the authors of the CoAID and FakeNewsNet datasets for making their resources publicly available and supporting research in misinformation detection.

About

A hybrid Transformer–Graph Neural Network framework for temporal fake news detection, integrating DeBERTa-v3, Heterogeneous Graph Transformers, and temporal modeling for robust misinformation detection.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages