A multimodal deep learning framework that combines Transformer-based text representations, Heterogeneous Graph Neural Networks, and temporal modeling for fake news detection.
---- Overview
- Motivation
- Architecture
- Datasets
- Experimental Results
- Repository Structure
- Installation
- Usage
- Technologies
- Future Work
- Citation
- License
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.
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.
TruthLens consists of four major components.
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.
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.
Publication timestamps are encoded into learnable temporal embeddings.
Temporal information enables the model to capture evolving patterns in misinformation dissemination.
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
News Article
│
┌────────────────┴────────────────┐
│ │
Transformer Timestamp
Text Encoder Temporal Encoder
│ │
└──────────────┬──────────────────┘
│
Heterogeneous Graph
│
Heterogeneous Graph Transformer
│
Graph Embedding
│
Multimodal Feature Fusion
│
Fully Connected Layer
│
Fake / Real Prediction
TruthLens is evaluated on two publicly available fake news datasets.
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 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)
| Class | Precision | Recall | F1-score |
|---|---|---|---|
| Fake | 0.9012 | 0.7766 | 0.8343 |
| Real | 0.9746 | 0.9902 | 0.9823 |
| Metric | Score |
|---|---|
| Accuracy | 96.80% |
| Macro F1-score | 90.83% |
| Weighted F1-score | 96.70% |
| Class | Precision | Recall | F1-score |
|---|---|---|---|
| Fake | 0.8495 | 0.6864 | 0.7593 |
| Real | 0.9027 | 0.9599 | 0.9304 |
| Metric | Score |
|---|---|
| Accuracy | 89.20% |
| Macro F1-score | 84.48% |
| Weighted F1-score | 88.79% |
TruthLens uses uv for dependency management.
Clone the repository:
git clone https://github.com/CheunAnthony/TruthLens.git
cd TruthLensInstall all project dependencies:
uv syncTruthLens 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.
- Python 3.11+
- PyTorch
- PyTorch Geometric
- Hugging Face Transformers
- NumPy
- Pandas
- Scikit-learn
- uv
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
This project is licensed under the MIT License.
See the LICENSE file for details.
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.