Spaces:
Sleeping
A newer version of the Streamlit SDK is available:
1.55.0
title: Redeepfake Demo
emoji: 🏢
colorFrom: yellow
colorTo: gray
sdk: streamlit
sdk_version: 1.31.0
app_file: app.py
pinned: false
license: mit
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
ReDeepFake Model Card
Overview
Model Name: ReDeepFake
Task: Advanced Deepfake detection model for 2D flat images.
Model Type: Convolutional Neural Network (CNN) -> EfficientNetB4 Model Architecture based.
Framework: TensorFlow
Current Version: V1.3
Key Study: Deepfake Detection Challenge (DFDC) (in 2019-2020, by Meta, AWS, Microsoft and AI’s Media Integrity Steering Committee).
Key Parthner: Microsoft Imagine Cup 2024
Kaggle Notebook: https://www.kaggle.com/code/armanzhalgasbayev/deepfake-detection-efficientnetb4-tf-cnn
Research Paper: will be here very soon..
Description
ReDeepFake is a deep learning model designed for the purpose of detecting deepfake content within 2D flat images. Leveraging EfficientNetB4 advanced CNN architecture, the model is trained to discern subtle patterns indicative of deepfake manipulation.
Key Features
- Architecture: Utilizes EfficientNetB4 model architecture with a custom-designed additional layers. ReDeepFake model architecture shown below in the figure:
Training Data: Pre-processed dataset of 224x224 resized real/fake image from DFDC competition was used for training our
ReDeepFakemodel.Performance Metrics: Evaluated based on
AccuracyandF1-score.
Dataset Source: deepfake_faces
Deepfake Detection Challenge: Deepfake Detection Challenge
Final Trained Model Link: ReDeepFake v1.4
Generation of Deepfake images based on ONNX & PyTorch: https://gist.github.com/silvermete0r/e24f35df5b9a62f03a7e73d1f3d448c3
Try using our demo: https://huggingface.co/spaces/dataflow/redeepfake-demo
Model Performance
Test Loss:
0.3455Test Accuracy:
0.8395
Usage
Prerequisites
- face_recognition<=1.3.0
- numpy<=1.23.5
- opencv_python<=4.7.0.72
- pandas<=2.0.2
- tensorflow==2.15.0.post1
- streamlit<=1.23.1 (Optional - for demo)
Areas of Usage
Media Integrity Verification:
- Verify the authenticity of images and videos in the media industry to ensure integrity and trustworthiness.
Social Media Content Moderation:
- Enhance content moderation on social media platforms by detecting and preventing the spread of deepfake content.
Security and Surveillance:
- Strengthen security and surveillance systems by identifying manipulated visuals that could compromise the accuracy of facial recognition and surveillance technologies.
Loading the Model
import tensorflow as tf
## Load the ReDeepFake model
redeepfake_model = tf.keras.models.load_model('redeepfake_model.h5')
Making Predictions
# 'image' -> preprocessed input image data
prediction = redeepfake_model.predict(image)
Model Limitations
The model's performance may be influenced by variations in lighting conditions, image quality, and diverse facial expressions.
It may not be fully robust against emerging deepfake generation techniques: Modern image generation methods use advanced descriptors to assess the quality of the image's realism, so photos of such faces are difficult to distinguish from real people.
Deepfakes made by using 3D image processing technologies and manually modified images by the authors cannot be recognized correctly by the model.
Ethics
Informed Consent:
- Ensure that individuals involved in the data used for training and testing the model have given informed consent for their images to be used. Respect privacy and obtain explicit permission when necessary.
Responsible Disclosure:
- If the model identifies potential deepfake content related to an individual, exercise responsible disclosure. Notify the concerned parties or relevant authorities in a timely and responsible manner, allowing them to address the situation appropriately.
Avoid Unlawful Use:
- Do not use the ReDeepFake model for any activities that violate laws, regulations, or ethical standards. Prohibit the use of the model for malicious purposes, such as generating harmful deepfake content or engaging in activities that infringe on privacy rights.
License
This model is provided under the LICENSE file. Please review the terms and conditions before usage.
Issues and Contributions
For issues or contributions, please visit the GitHub repository.
Acknowledgments
Special thanks to the contributors and the open-source community for their support and collaboration.