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.
- 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.
- Model: DeepLabV3+ (PyTorch) pre-trained on ImageNet.
- Backend: Node.js & Express.
- Database: MongoDB (for user management & logs).
- Image Processing: OpenCV, Albumentations.
- Python 3.8+
- Node.js & npm
- MongoDB
Navigate to the backend directory and install dependencies:
cd Final-year-Backend
npm installInstall the required Python libraries for the inference engine:
pip install torch torchvision opencv-python albumentations segmentation-models-pytorch pandasNote: This system requires a pre-trained model file (
best_model.pth) and a dataset configuration.
- Ensure
best_model.pthis placed in the configured directory. - Update the path references in
python-scripts/FinalYearProject.pyto match your local file structure (currently configured forD:/FinalContents/).
- Start MongoDB: Ensure your MongoDB service is running.
- Run the Server:
cd Final-year-Backend node server.js - API: The server will start on port 5000. Post images to
/api/uploadto trigger the detection pipeline.
Contributions are welcome! Please feel free to submit a Pull Request.
Developed by Jegan