Downloads · 30 days
0
MaanVad3r/DeepFake-Detector
DeepFake-Detector is a image classification model from MaanVad3r. Use it when you need a label for an image. It is set up for tf-keras. The card lists the license as mit.
Downloads · 30 days
0
Access
Public
Updated Aug 25, 2024
Repo size
313 MB
Likes
5
Public
Click a slice to open those files.
.h5313 MB · 100%
From the Hugging Face model README
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:
from tensorflow.keras.models import load_model
from tensorflow.keras.preprocessing import image
import numpy as np
# Load the trained model
model = load_model('cnn_model.h5')
# Load and preprocess the image
img_path = 'path_to_your_image.jpg'
img = image.load_img(img_path, target_size=(128, 128))
img_array = image.img_to_array(img) / 255.0
img_array = np.expand_dims(img_array, axis=0)
# Make a prediction
prediction = model.predict(img_array)
print('Real' if prediction[0][0] < 0.5 else 'Fake')
Clone the repository:
git clone https://huggingface.co/MaanVad3r/DeepFake-Detector
cd 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.