Skip to content

GAN-Guard is a state-of-the-art forensic tool designed to detect and localize image manipulations generated by Generative Adversarial Networks (GANs). Unlike standard classifiers that provide a binary label, GAN-Guard uses Semantic Segmentation to highlight the exact pixels that have been tampered with.

Notifications You must be signed in to change notification settings

JeganVG/GANGuard

Repository files navigation

GAN-Guard: Advanced DeepFake Detection & Localization

GAN-Guard is a state-of-the-art forensic tool designed to detect and localize image manipulations generated by Generative Adversarial Networks (GANs). Unlike standard classifiers that provide a binary label, GAN-Guard uses Semantic Segmentation to highlight the exact pixels that have been tampered with.

PyTorch NodeJS Express.js MongoDB

🚀 Key Features

  • Pixel-Level Detection: Pinpoints manipulated regions (e.g., face swaps, object insertions) using a segmentation mask.
  • DeepLabV3+ Architecture: Utilizes a robust ResNet101 encoder for high-fidelity feature extraction.
  • Hybrid Stack: Combines a high-performance Python inference engine with a scalable Node.js/Express backend.
  • Visual Forensics: Outputs a heatmap overlay, making it easy for analysts to identify fake content.

🛠️ Technology Stack

  • Model: DeepLabV3+ (PyTorch) pre-trained on ImageNet.
  • Backend: Node.js & Express.
  • Database: MongoDB (for user management & logs).
  • Image Processing: OpenCV, Albumentations.

📦 Installation

Prerequisites

  • Python 3.8+
  • Node.js & npm
  • MongoDB

1. Backend Setup

Navigate to the backend directory and install dependencies:

cd Final-year-Backend
npm install

2. Python Environment

Install the required Python libraries for the inference engine:

pip install torch torchvision opencv-python albumentations segmentation-models-pytorch pandas

3. Model Configuration

Note: This system requires a pre-trained model file (best_model.pth) and a dataset configuration.

  1. Ensure best_model.pth is placed in the configured directory.
  2. Update the path references in python-scripts/FinalYearProject.py to match your local file structure (currently configured for D:/FinalContents/).

🏃‍♂️ Usage

  1. Start MongoDB: Ensure your MongoDB service is running.
  2. Run the Server:
    cd Final-year-Backend
    node server.js
  3. API: The server will start on port 5000. Post images to /api/upload to trigger the detection pipeline.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.


Developed by Jegan

About

GAN-Guard is a state-of-the-art forensic tool designed to detect and localize image manipulations generated by Generative Adversarial Networks (GANs). Unlike standard classifiers that provide a binary label, GAN-Guard uses Semantic Segmentation to highlight the exact pixels that have been tampered with.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published