MarioCicalese / SiameseNN-for-Fake-images-detection

Progetto di biometria

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SiameseNN-for-Fake-images-detection

Project Overview

The goal of this project was to develop a Siamese Neural Network capable of performing binary classification based on the Euclidean distance between embedding vectors generated by the network. This classification helps in predicting whether an image is synthetic or real. The model was trained using RGB images of size 200x200, which were converted into the frequency domain using the Fourier Transform. These images were sourced from the ArtiFact dataset, which contains a total of 2,496,738 images, including 964,989 real and 1,531,749 synthetic images. The frequency domain was chosen because prior research has indicated that generative models leave artificial imprints, often referred to as 'fingerprints', on the images they generate. These fingerprints can be leveraged to detect synthetic images. However, these fingerprints are not visible in the RGB spatial domain but can be observed in the frequency domain.

Installation Instructions

Follow these steps to set up the project locally.

  1. Cloning the repository:
    git clone <repository_url>
    cd SiameseNN-for-Fake-images-detection
    
  2. Setting Up the Environment:
    • Using Conda If you are using Conda, you can create a new environment and install all the required dependencies as follows:
      conda create --name myenv python=3.10
      conda activate myenv
      
    • Using Python venv If you prefer using venv, you can set up your environment like this:
      python -m venv myenv
      
      # On Windows:
      myenv\Scripts\activate
      
      # On Unix or MacOS:
      source myenv/bin/activate
      
  3. Installing the required Python packages:
    pip install -r requirements.txt
    

Running the Application

Once the environment is set up and activated, you can run the main script from the terminal:

cd ModelTesting
python main.py

This script will execute the testing phase of the Siamese Neural Network using the trained model in the project's files.

About

Progetto di biometria


Languages

Language:Jupyter Notebook 82.6%Language:Python 17.4%