## 🧠 Background

The generation and detection of deepfake images offer valuable insights for stakeholders across computer vision, machine learning, and cybersecurity domains. For instance, researchers and developers participating in deepfake image competitions can use detection rate predictions to refine their generative models and improve robustness against evolving threats.

Furthermore, analyzing trends in deepfake generation techniques can help organizers design more challenging benchmarks that reflect real-world scenarios. Detection predictions also support the development of automated systems to safeguard digital platforms from synthetic image manipulation, thereby helping to ensure the integrity of online content.

Ultimately, understanding both generation and detection trends can illuminate emerging challenges in digital media security and contribute to the formulation of forward-looking strategies and policies. In summary, predicting deepfake generation and detection outcomes plays a crucial role in driving technological innovation and advancing security measures in the era of generative media.

---

## 🎯 Goal

In this competition, your task is to **detect deepfake video**.

To achieve this, you are required to build a binary classification model that predicts whether a given video is real or fake.

- Your model must output a binary prediction (0: real, 1: fake) for each video dataset.

---

## 📂 Dataset

The dataset used in this competition is based on FaceForensics++, a widely-used benchmark dataset for training deepfake generation models. (FaceForensics++ Github: https://github.com/ondyari/FaceForensics)

**- Training Set: FaceForensics++ dataset, containing labels for the target, is available for download outside of Kaggle for competitors to build their models.**

**- Private Test Set: This dataset is privately held outside of Kaggle’s platform, and is used to compute the private leaderboard.**


---

## 🧪 Workflow

This is a walk-through of how to make a submission to this code competition.

**Train your models (Your choice - Local Machine, VM).** 
You should be training your models outside of Kaggle using local or other resources.
 
**Use Kaggle Notebooks (Notebook or Script) to create your submission (Kaggle).** 
Submissions must be made through Kaggle. You can upload any pre-trained or locally-trained models as data sources to your submission notebook. 

**Select final submissions by the Submission Deadline (Kaggle).** After the submission deadline, Kaggle will transfer your selected submissions’ code to the host. They will re-run your code against their Private Test Set and return prediction submissions back to Kaggle for computing your final private leaderboard scores. For the private test set evaluation, the time constraint for your code’s run time will scale with that private test set's size.

---

## 📤 Submission

- Teams can use the public test dataset to ensure their Kaggle notebook and submission code run properly.
- Make sure that the team name shown in the code section is consistent with your official team name.
- Please make sure that your submission code using the public test dataset correctly generates the output in the submission.csv.

**Submission File**

The file should contain a header and have the following format:

**Example of submission.csv**
| ID     | label |
|--------|-------|
| 100.mp | 0     |
| 101.mp | 1     |
| 102.mp | 0     |
• ID- test sample in the test set
• label- predicted label (0: real, 1: fake)
• Label column must be in integer type

---

## 🧮 Scoring & Evaluation

- **The final ranking will be based on Private Test Set**.

Submissions will be scored based on the F1 score.
$$F1 = 2 \cdot \frac{Precision \cdot Recall}{Precision + Recall}$$
Where

- *Precision*: measures how many predicted deepfakes are actually deepfakes  
- *Recall*: measures how many actual deepfakes are correctly identified

Higher F1 Score is better. It indicates that the model performs well in both precision and recall. The F1 Score is particularly useful when there is an imbalance between the number of real and fake samples.

---

## 📄 Report Requirement

There is no single correct solution in machine learning.  
You are encouraged to explore a variety of creative approaches to improve your model.  
However, you must be able to:
- Clearly explain the rationale behind your approach
- Justify your method choices
- Analyze the dataset preprocessing, modeling steps, and results

A detailed technical **report** must be submitted that outlines your methodology and experimental process.

---

## 🕒 Timeline

June 3 - June 21, 2025 - Preliminary round period. 

June 21, 2025 - Final submission deadline.

June 25, 2025 - Finalist teams announcement (Private leaderboard revealed).

July 2, 2025 - Final round & Award ceremony

Note: Because the private test set is held outside of Kaggle's platform, the private leaderboard will not be revealed immediately. We have estimated the scoring timeframe, but this is subject to revision.

All deadlines are at 11:59:00 PM UTC on the corresponding day unless otherwise noted. The competition organizers reserve the right to update the contest timeline if they deem it necessary.

---

## 🏆 Prizes

| **Award**        | **Prize**     | **Number of Teams** |
| ---------------- | ------------- | ------------------- |
| Grand Prize      | KRW 2,500,000 | 1 team              |
| Excellence Award | KRW 1,500,000 | 1 team              |
| Merit Award      | KRW 1,000,000 | 3 teams             |

---

## 💻 Code Requirements

Submissions to this competition must be made through Notebooks. In order for the "Submit to Competition" button to be active after a commit, the following conditions must be met:

CPU Notebook <= 9 hours run-time
GPU Notebook <= 9 hours run-time on Kaggle's P100 GPUs
No internet access enabled
No using other Kaggle notebooks or utility scripts as inputs to your submission notebook. External data also cannot be externally-referenced (i.e. via BigQuery, Github, external URL). Instead, load external models or datasets directly as an external data source.
Submission file must be named "submission.csv"
Please see the [Code Competition FAQ](https://www.kaggle.com/docs/competitions#kernels-only-FAQ). 

---

## ❓ Q&A

If you have any questions, please write them in the [Discussion](https://www.kaggle.com/competitions/Deepfake_Detection_and_Generation_Challenge_Blue_Team/discussion)