This project implements and evaluates various machine learning and deep learning models to classify news articles as fake or real, using the ISOT Fake News Dataset.
Develop robust classifiers using traditional and deep learning models to detect fake news articles with high accuracy and reliability.
- Source: ISOT Fake News Dataset
- Real News: 21,417 articles from Reuters.com
- Fake News: 23,481 articles from unreliable sources flagged by Politifact and Wikipedia
- Fields: title, text, label, date
- Final dataset size after cleaning: 39,096 articles
- Merged real and fake datasets with labels (0 = fake, 1 = real)
- Removed:
- Nulls and duplicates
- Articles with 6 or fewer words (too short to provide meaningful context)
- URLs, special characters, and extra whitespaces
- Dataset-specific patterns (e.g., datelines like "WASHINGTON (Reuters) –" and image credits using regex)
- Created two dataset variants:
- With repeated header/footer patterns
- Without repeated patterns
- Tokenized and padded sequences for model training
- Logistic Regression (Baseline)
- Bi-LSTM (Bidirectional Long Short-Term Memory)
- Bi-GRU (Bidirectional Gated Recurrent Unit)
- Transformer-based model using Multi-Head Attention
- Accuracy
- Precision
- F1-score
- AUC (Area Under the Curve)
- EER (Equal Error Rate)
| Model | Accuracy | Precision | AUC | EER | F1-Score |
|---|---|---|---|---|---|
| Logistic Regression | 0.9844 | 0.9800 | 0.9985 | 0.0144 | 0.98 |
| Bi-LSTM | 0.9830 | 0.9902 | 0.9948 | 0.0160 | 0.98 |
| Bi-GRU | 0.9884 | 0.9929 | 0.9994 | 0.0108 | 0.99 |
| Transformer | 0.9884 | 0.9904 | 0.9992 | 0.0094 | 0.99 |
git clone https://github.com/ishankkumar-007/FakeNewsDetection.git
cd FakeNewsDetection
conda env create --name tfgpu --file=env.yml
conda activate tfgpu
pip install ipykernel
python -m ipykernel install --user --name tfgpu --display-name "tfgpu (Python 3.12.3)"
Navigate to the src/final/ directory and run the desired notebook:
cd src/final/
.
├── docs
│ ├── FAKE NEWS DETECTION.pdf
│ ├── Fake_News_Detection_Report.pdf
│ └── ISOT_Fake_News_Dataset_ReadMe.pdf
├── env.yml
├── README.md
├── requirements.txt
└── src
├── final
└── hyperparameter tuning notebooks
This project was developed as part of a team effort. The following members contributed to various aspects of data preprocessing, model development, experimentation, and documentation:
- Use the Transformer model for a balanced performance across metrics.
- Use Bi-GRU when minimizing false positives is critical.