This repository contains a Convolutional Neural Network (CNN)-based model fine-tuned for deepfake detection. The model has been trained to classify images as either "real" or "fake" (deepfake) using a custom dataset of processed images.
This model is a custom CNN architecture built specifically for deepfake detection. It has been designed to efficiently distinguish between real and fake images through a series of convolutional and pooling layers, followed by fully connected layers for classification.
The model was trained on a custom dataset of real and deepfake images, using data augmentation techniques to improve generalization. The training process involved the following components:
The model was evaluated on a held-out test set. Below is the key performance metric:
This accuracy reflects the model's ability to correctly identify real and deepfake images.
You can use this model for inference by loading the model and running predictions on new images. Below is an example using TensorFlow/Keras:
1from tensorflow.keras.models import load_model
2from tensorflow.keras.preprocessing import image
3import numpy as np
4
5# Load the trained model
6model = load_model('cnn_model.h5')
7
8# Load and preprocess the image
9img_path = 'path_to_your_image.jpg'
10img = image.load_img(img_path, target_size=(128, 128))
11img_array = image.img_to_array(img) / 255.0
12img_array = np.expand_dims(img_array, axis=0)
13
14# Make a prediction
15prediction = model.predict(img_array)
16print('Real' if prediction[0][0] < 0.5 else 'Fake')
-
Clone the repository:
1git clone https://huggingface.co/MaanVad3r/DeepFake-Detector
2cd DeepFake-Detection-model.git
-
Run Inference:
Use the provided script or the sample code above to run inference on your images.
This project is licensed under the MIT License. Feel free to use and modify the model as needed.