Back to Portfolio
Deep Learning

MobileNetV2 Fake News CNN

TensorFlowKeras APIMobileNetV2 BackboneFlask ServerJupyter NotebookTransfer Learning

Model Performance Metrics

0.96
ROC AUC Score
0.98
Average Precision (AP)
~94%
Training Accuracy
~82%
Validation Accuracy
5,000
Total Images (Balanced)
93/100
Confusion Accuracy

Project Overview

The MobileNetV2 Fake News CNN is a custom-trained image manipulation and authentication deep learning model. Engineered using a high-efficiency MobileNetV2 convolutional neural network backbone (transfer learning from ImageNet), it classifies whether images embedded in online news stories have been photoshopped, spliced, or digitally modified to propagate fake news.

The model was trained on a perfectly balanced dataset of 5,000 images — 2,500 Real and 2,500 Fake — preventing class-bias during optimization. The final weight checkpoint (FINAL_ROBUST_MODEL.h5) achieved an outstanding AUC of 0.96 and an Average Precision of 0.98, integrated with a Python Flask local dashboard for interactive analysis.

Training Results & Evaluation Charts

Core Features

  • MobileNetV2 Transfer Learning: Pretrained ImageNet backbone with custom top layers — GlobalAveragePooling → Dense(256, ReLU) → Dropout(0.5) → Softmax output.
  • Perfectly Balanced Dataset (5,000 images): 2,500 Real + 2,500 Fake — prevents class-bias, ensuring unbiased gradient updates throughout training.
  • AUC 0.96 / AP 0.98: Exceptional discriminative power — model cleanly separates manipulated from authentic images across all threshold values.
  • Hyperparameter Grid Search: Systematic LR × Batch Size sweeps tested 4 configurations, selecting the optimal setup (val acc 0.89) for the final model.
  • Flask Local Dashboard: Web UI where users can drag-and-drop image files or paste URLs to receive instant Fake/Real classification with softmax confidence scores.
  • Robust Data Augmentation: Horizontal flips, brightness jitter, and noise corruption applied during preprocessing to improve generalization against unseen manipulations.

Neural Network Architecture

The deep model relies on a highly optimized convolutional layer stack compiled on Keras:

📥 Input (224×224×3 RGB)
🔲 MobileNetV2 Base (ImageNet)
⊕ Global Avg Pooling
🧠 Dense 256 (ReLU)
💧 Dropout 50%
🎯 Softmax Output (Real/Fake)
  • Pretrained Base: MobileNetV2 feature extractor (excluding top classification layers, loaded with ImageNet base weights). Frozen during initial training, then fine-tuned.
  • Global Average Pooling: Reduces spatial dimensions to compress features while preventing overfitting by eliminating fully-connected flattening.
  • Dense Layer (256 nodes): ReLU activation to capture complex non-linear patterns in the extracted feature maps.
  • Dropout Layer (50%): Randomly drops half the nodes per batch — forces redundant learning and ensures high generalization on unseen images.
  • Output Layer: Softmax activation producing clean binary probability distributions — probability of Real vs. Fake per image.

Customization & Extensibility

  • Transfer Learning Fine-Tuning: Configure custom dense layers, dropout ratios, optimizer rates (Adam/SGD), and loss indicators (Binary/Categorical Cross-Entropy).
  • Alternative Backbone Swap: Easily swap MobileNetV2 for ResNet50, EfficientNetB0, or VGG16 within the TensorFlow loading pipeline — same training loop applies.
  • Dataset Expansion: Plug in custom image datasets (e.g. medical images, satellite imagery, document fraud detection) — same preprocessing pipeline adapts.
  • Flask REST API: Refactor Flask endpoints to output RESTful JSON structures, enabling integration with React, Vue, mobile apps, or browser extensions.
  • Class Expansion: Extend from binary (Real/Fake) to multi-class classification (e.g. Spliced / Copy-Move / Retouched / Authentic) with minimal architecture changes.