Skip to content

shashidharybhat/FakeImageDetectionCNN

Repository files navigation

Fake Image Detection using CNN

Overview

This is a project that focuses on developing a robust and effective system for detecting fake or manipulated images.

The project aims to differentiate between genuine and manipulated images generated by GAN models using CNNs and the CIFAKE dataset.

Features

  • Fake image detection using Convolutional Neural Networks (CNN)
  • Training and evaluation pipeline
  • Integration with PyTorch for deep learning
  • GPU accelerated training and inference

Model Architecture

PytorchCNN-01

This model has one convolutional layer, followed by max-pooling, and two fully connected layers . The final layer is a linear layer.

PytorchCNN-02

There are three sets of convolutional layers in this model. Each set includes a convolutional layer followed by a ReLU activation function and a max-pooling layer.

The fully connected layers include a hidden layer and ReLU activation, followed by dropout regularization. It ending with a final output layer with a single unit and sigmoid activation for binary classification.

Prerequisites

Before running the project, ensure you have the following dependencies installed:

  • Datasets use git-lfs for storage. Install the module if you intend to contribute
  • Python 3.x
  • PyTorch
  • torchvision
  • NumPy
  • Jupyter Notebook (optional for running the project interactively)
  • Cuda enabled GPU or Colab Access with GPU Runtime

Dataset

The project uses the CIFAKE dataset, which consists of 120,000 32x32 color images in 10 different classes, including various objects and animals. It is divided into 100,000 training images and 20,000 test images.

You can download the CIFAKE dataset from the CIFAKE at Kaggle

Usage

  1. Clone the repository:
git clone https://github.com/shashidharybhat/FakeImageDetectionCNN.git
cd FakeImageDetectionCNN
  1. Install the required dependencies
pip install -r requirements.txt
  1. Run the Jupyter notebook with jupyter-lab or jupyter-notebook

Results

There were two models tested as provided in the repository.

PytorchCNN-01 contains a simple CNN which yielded an accuracy of 93.78%

PytorchCNN-02 contains a deeper CNN which yielded an accuracy of 87.90%

Contributing

If you'd like to contribute to this project, Kindly create an issue.

License

This project is licensed under the Unlicence Licence

About

Detecting Images generated from GANs

Resources

License

Stars

Watchers

Forks