{"id":20447726,"url":"https://github.com/mawg0ud/faceguard","last_synced_at":"2025-09-24T17:30:35.758Z","repository":{"id":260240606,"uuid":"879197098","full_name":"mawg0ud/FaceGuard","owner":"mawg0ud","description":"A framework to detect \u0026 localize facial image manipulation.","archived":false,"fork":false,"pushed_at":"2024-12-22T10:06:46.000Z","size":402,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-22T11:19:53.595Z","etag":null,"topics":["artificial-intelligence","cnn","cybersecurity","deeplearning","digitalforensics","facialrecognition","imagemanipulation","machinelearning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mawg0ud.png","metadata":{"files":{"readme":"ReadMe.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-27T09:11:38.000Z","updated_at":"2024-12-22T10:06:49.000Z","dependencies_parsed_at":"2024-11-23T18:31:46.714Z","dependency_job_id":null,"html_url":"https://github.com/mawg0ud/FaceGuard","commit_stats":null,"previous_names":["mawg0ud/faceguardai","mawg0ud/faceguard"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mawg0ud%2FFaceGuard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mawg0ud%2FFaceGuard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mawg0ud%2FFaceGuard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mawg0ud%2FFaceGuard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mawg0ud","download_url":"https://codeload.github.com/mawg0ud/FaceGuard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234099530,"owners_count":18779697,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["artificial-intelligence","cnn","cybersecurity","deeplearning","digitalforensics","facialrecognition","imagemanipulation","machinelearning"],"created_at":"2024-11-15T10:28:55.879Z","updated_at":"2025-09-24T17:30:35.364Z","avatar_url":"https://github.com/mawg0ud.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FaceGuard:\n# Localization of Facial Images Manipulation in Digital Forensics\n\nThis project is an implementation of the paper *[Localization of Facial Images Manipulation in Digital Forensics via Convolutional Neural Networks](https://link.springer.com/chapter/10.1007/978-981-33-6129-4_22)*. This project, named **FaceGuard**, aims to detect and localize manipulated facial images, a critical task in digital forensics, using advanced deep learning techniques. This repository includes the full code to train, evaluate, and experiment with a Y-shaped Auto-Encoder model for detecting and segmenting manipulated areas within facial images.\n\n---\n\n## Table of Contents\n\n1. [Introduction](#introduction)\n2. [Project Structure](#project-structure)\n3. [Features](#features)\n4. [Installation](#installation)\n5. [Usage](#usage)\n6. [Results](#results)\n7. [Citation](#citation)\n8. [License](#license)\n\n---\n\n## Introduction\n\n**FaceGuard** implements a model for detecting facial image manipulations, based on a Y-shaped Auto-Encoder architecture that simultaneously handles classification, segmentation, and reconstruction tasks. The model is evaluated on the **FaceForensics++** dataset and includes functionality for:\n- Training the Y-shaped Auto-Encoder to detect manipulated images and localize regions of manipulation.\n- Experimenting with various configurations and hyperparameters.\n- Evaluating the model on both seen and unseen manipulation types.\n\n### Paper Abstract\n\n\u003e The remarkable phenomenon of computer-generated spoofing images poses a societal threat and is an important concern of digital forensics. In this work, we propose a deep learning model to localize manipulated regions in facial images via a Y-shaped Auto-Encoder architecture, which simultaneously handles classification, segmentation, and reconstruction tasks. We evaluate our approach using datasets such as FaceForensics++ and achieve promising results in terms of both accuracy and localization capabilities.\n\n---\n\n## Project Structure\n\nThe repository is organized as follows:\n\n```\n.\n├── src/                        # Source code for model, data loading, and utilities\n│   ├── data_preprocessing/     # Data loading, augmentation, and preprocessing scripts\n│   ├── models/                 # Y-shaped Auto-Encoder and related model code\n│   ├── utils/                  # Utilities for logging, configuration, and plotting\n│   ├── train.py                # Main training script\n│   └── test.py                 # Main testing script\n├── experiments/                # Scripts for running different experimental configurations\n├── notebooks/                  # Jupyter notebooks for EDA and model visualization\n├── datasets/                   # Dataset downloading and preparation scripts\n├── configs/                    # YAML configuration files for different experiments\n├── results/                    # Saved models, evaluation metrics, and plots\n├── logs/                       # Training and testing log files\n└── requirements.txt            # Project dependencies\n```\n\n---\n\n## Features\n\n- **End-to-End Model Implementation**: Code for training, evaluating, and testing the Y-shaped Auto-Encoder model.\n- **Flexible Experimentation**: Configuration files for running different experiments and hyperparameter tuning.\n- **Robust Data Processing Pipeline**: Includes augmentation, data splitting, and preprocessing for facial images.\n- **Logging and Tracking**: Detailed logging setup for tracking training progress, metrics, and model checkpoints.\n\n---\n\n## Installation\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/mawg0ud/FaceGuard.git\ncd FaceGuard\n```\n\n### 2. Install Dependencies\n\nEnsure you have Python 3.7+ and `pip` installed. Install the dependencies:\n\n```bash\npip install -r requirements.txt\n```\n---\n\n## Usage\n\n### 1. Training\n\nTo train the Y-shaped Auto-Encoder model, use the following command. This command uses a configuration file for model and training settings.\n\n```bash\npython src/train.py --config configs/experiment1_baseline.yaml\n```\n\n### 2. Testing\n\nTo evaluate the trained model on the test set, run:\n\n```bash\npython src/test.py --config configs/experiment3_unseen_attacks.yaml\n```\n\n### 3. Running Experiments\n\nYou can run different experiments with configurations provided in the `configs/` directory. For example, to tune hyperparameters, use:\n\n```bash\npython experiments/experiment2_tune_hyperparameters.py\n```\n\n### 4. Visualization and Analysis\n\nExplore the results using the provided Jupyter notebooks in the `notebooks/` folder. Run:\n\n```bash\njupyter notebook notebooks/1_data_exploration.ipynb\n```\n\n---\n\n## Results\n\nThe following results were obtained using the Y-shaped Auto-Encoder model on the FaceForensics++ dataset:\n\n| Metric       | Seen Attacks   | Unseen Attacks |\n|--------------|----------------|----------------|\n| Accuracy     | 93.5%          | 85.3%         |\n| EER          | 4.7%           | 7.8%          |\n| Segmentation | 90.1%          | 82.0%         |\n\nVisualization of segmentation masks produced by the model is provided in the [notebooks/3_test_on_samples.ipynb](notebooks/3_test_on_samples.ipynb) notebook. The model effectively localizes manipulated regions and achieves high accuracy on both seen and unseen manipulation types.\n\n---\n\n## Citation\n\nIf you use this code or the model in your work, please cite the following paper:\n\n\u003e Mawgoud, A. A., Albusuny, A., Abu-Talleb, A., \u0026 Tawfik, B. S. (2021). Localization of Facial Images Manipulation in Digital Forensics via Convolutional Neural Networks. In *Enabling Machine Learning Applications in Data Science* (pp. 313-324). Springer. DOI: [10.1007/978-981-33-6129-4_22](https://link.springer.com/chapter/10.1007/978-981-33-6129-4_22)\n\n```bibtex\n@inproceedings{Mawgoud2021Localization,\n  title={Localization of Facial Images Manipulation in Digital Forensics via Convolutional Neural Networks},\n  author={Ahmed A. Mawgoud and Amir Albusuny and Amr Abu-Talleb and Benbella S. Tawfik},\n  booktitle={Enabling Machine Learning Applications in Data Science},\n  pages={313--324},\n  year={2021},\n  publisher={Springer},\n  doi={10.1007/978-981-33-6129-4_22}\n}\n```\n\n---\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmawg0ud%2Ffaceguard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmawg0ud%2Ffaceguard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmawg0ud%2Ffaceguard/lists"}