deepguard 0.2.4__tar.gz → 0.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {deepguard-0.2.4 → deepguard-0.3.0}/PKG-INFO +28 -28
- {deepguard-0.2.4 → deepguard-0.3.0}/README.md +28 -28
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard.egg-info/PKG-INFO +28 -28
- {deepguard-0.2.4 → deepguard-0.3.0}/explainability/explainer/base_explainer.py +4 -1
- {deepguard-0.2.4 → deepguard-0.3.0}/pyproject.toml +1 -1
- {deepguard-0.2.4 → deepguard-0.3.0}/LICENSE +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/__init__.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/data/__init__.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/data/dataset.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/data/dataset_cutmix.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/data/dataset_cutout.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/data/dataset_mixup.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/data/handle_imbalance.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/data/split_data.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/data/transforms.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/layers/__init__.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/layers/attention.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/layers/drop.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/layers/featextractor.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/layers/global_query.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/layers/mlp.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/layers/patch.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/layers/reducesize.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/layers/se.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/layers/transformer.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/layers/weight_init.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/layers/window.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/models/__init__.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/models/ms_eff_gcvit.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/models/ms_eff_vit.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/optimizer/__init__.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/optimizer/build_optimizer.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/scheduler/__init__.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/scheduler/fetch_scheduler.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/utils/__init__.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/utils/build_metrics.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/utils/early_stopping.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/utils/meter.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard/utils/seed.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard.egg-info/SOURCES.txt +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard.egg-info/dependency_links.txt +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard.egg-info/requires.txt +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/deepguard.egg-info/top_level.txt +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/explainability/__init__.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/explainability/cam_evaluator.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/explainability/explainer/cam_explainer.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/explainability/explainer/eigenvalue_explainer.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/explainability/explainer/gradient_explainer.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/explainability/explainer/misc_explainer.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/explainability/explainer/perturbation_explainer.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/explainability/metrics/__init__.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/explainability/metrics/cam_mult_image.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/explainability/metrics/perturbation_confidence.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/explainability/metrics/road.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/explainability/utils/image.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/explainability/utils/model_targets.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/explainability/utils/reshape_transforms.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/inference/__init__.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/inference/image_predictor.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/inference/image_predictor_prt.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/inference/predict_video.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/inference/utils.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/inference/video_predictor.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/inference/video_predictor_prt.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/__init__.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/celeb_df_v2/__init__.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/celeb_df_v2/crop_face.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/celeb_df_v2/detect_original_face.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/celeb_df_v2/split_data.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/celeb_df_v2/utils.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/face_detector.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/ff++/__init__.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/ff++/crop_face.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/ff++/detect_original_face.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/ff++/split_data.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/ff++/utils.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/frame_extractor.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/kodf/__init__.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/kodf/crop_face.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/kodf/detect_original_face.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/kodf/generate_metadata.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/kodf/split_data.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/kodf/utils.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/landmark_detector.py +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/preprocess/yolov8n-face.pt +0 -0
- {deepguard-0.2.4 → deepguard-0.3.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deepguard
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Multi-Scale Efficient Global Context Vision Transformer for Robust Deepfake Detection
|
|
5
5
|
Author-email: seoyunje <seoyunje2001@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -55,8 +55,8 @@ Dynamic: license-file
|
|
|
55
55
|
</p>
|
|
56
56
|
|
|
57
57
|
<p align="center">
|
|
58
|
-
<a href="README_KR.md"><b>🇰🇷 한국어 버전</b></a> |
|
|
59
|
-
<a href="README_JP.md"><b>🇯🇵 日本語版</b></a> |
|
|
58
|
+
<a href="https://github.com/HanMoonSub/DeepGuard/blob/main/README_KR.md"><b>🇰🇷 한국어 버전</b></a> |
|
|
59
|
+
<a href="https://github.com/HanMoonSub/DeepGuard/blob/main/README_JP.md"><b>🇯🇵 日本語版</b></a> |
|
|
60
60
|
<a href="#-model-evaluation"><b>📈 Model Evaluation</b></a> |
|
|
61
61
|
<a href="#-predict-image--video"><b>🔮 Try Demo</b></a>
|
|
62
62
|
</p>
|
|
@@ -102,9 +102,9 @@ To evaluate the generalization and robustness of our deepfake detection model, w
|
|
|
102
102
|
|
|
103
103
|
| Dataset | Real Videos | Fake Videos | Year | Participants | Description (Paper Title) | Details |
|
|
104
104
|
| :--- | :---: | :---: | :---: | :---: | :--- | :---: |
|
|
105
|
-
| **Celeb-DF-v2** | 890 | 5,639 | 2019 | 59 | *A Large-scale Challenging Dataset for DeepFake Forensics* | [🔗 Readme](preprocess/celeb_df_v2/README.md) |
|
|
106
|
-
| **FaceForensics++** | 1,000 | 6,000 | 2019 | 1,000 | *Learning to Detect Manipulated Facial Images* | [🔗 Readme](preprocess/ff++/README.md) |
|
|
107
|
-
| **KoDF** | 62,166 | 175,776 | 2020 | 400 | *Large-Scale Korean Deepfake Detection Dataset* | [🔗 Readme](preprocess/kodf/README.md) |
|
|
105
|
+
| **Celeb-DF-v2** | 890 | 5,639 | 2019 | 59 | *A Large-scale Challenging Dataset for DeepFake Forensics* | [🔗 Readme](https://github.com/HanMoonSub/DeepGuard/blob/main/preprocess/celeb_df_v2/README.md) |
|
|
106
|
+
| **FaceForensics++** | 1,000 | 6,000 | 2019 | 1,000 | *Learning to Detect Manipulated Facial Images* | [🔗 Readme](https://github.com/HanMoonSub/DeepGuard/blob/main/preprocess/ff++/README.md) |
|
|
107
|
+
| **KoDF** | 62,166 | 175,776 | 2020 | 400 | *Large-Scale Korean Deepfake Detection Dataset* | [🔗 Readme](https://github.com/HanMoonSub/DeepGuard/blob/main/preprocess/kodf/README.md) |
|
|
108
108
|
|
|
109
109
|
<div id="data-preparation"></div>
|
|
110
110
|
|
|
@@ -154,9 +154,9 @@ DATA_ROOT/
|
|
|
154
154
|
|
|
155
155
|
Click the links below to view the specific preprocessing details for each dataset:
|
|
156
156
|
|
|
157
|
-
* [**Celeb-DF V2 Preprocess**](/preprocess/celeb_df_v2/README.md)
|
|
158
|
-
* [**FaceForensics++ Preprocess**](/preprocess/ff++/README.md)
|
|
159
|
-
* [**KoDF Preprocess**](/preprocess/kodf/README.md)
|
|
157
|
+
* [**Celeb-DF V2 Preprocess**](https://github.com/HanMoonSub/DeepGuard/blob/main/preprocess/celeb_df_v2/README.md)
|
|
158
|
+
* [**FaceForensics++ Preprocess**](https://github.com/HanMoonSub/DeepGuard/blob/main/preprocess/ff++/README.md)
|
|
159
|
+
* [**KoDF Preprocess**](https://github.com/HanMoonSub/DeepGuard/blob/main/preprocess/kodf/README.md)
|
|
160
160
|
|
|
161
161
|
## 🏗 Model Architecture
|
|
162
162
|
|
|
@@ -164,9 +164,9 @@ Multi Scale Efficient Global Context Vision Transformer is an optimized multi-sc
|
|
|
164
164
|
|
|
165
165
|
#### Explore More Details
|
|
166
166
|
|
|
167
|
-
- [Model Architecture: MS-EffViT](deepguard/MS_EffViT.md) - _**Multi Scale Efficient Vision Transformer**_
|
|
167
|
+
- [Model Architecture: MS-EffViT](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/MS_EffViT.md) - _**Multi Scale Efficient Vision Transformer**_
|
|
168
168
|
|
|
169
|
-
- [Advanced Architecture: MS-EFFGCViT](deepguard/MS_EffGCViT.md) - _**Multi Scale Efficient Global Context Vision Transformer**_
|
|
169
|
+
- [Advanced Architecture: MS-EFFGCViT](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/MS_EffGCViT.md) - _**Multi Scale Efficient Global Context Vision Transformer**_
|
|
170
170
|
|
|
171
171
|
|
|
172
172
|
<p align="center">
|
|
@@ -181,15 +181,15 @@ We utilizes two distinct types of self-attention to capture both long-range and
|
|
|
181
181
|
|
|
182
182
|
|
|
183
183
|
<p align="center">
|
|
184
|
-
<img src=
|
|
184
|
+
<img src=docs/architectures/window_attention.JPG width="100%" height="300">
|
|
185
185
|
</p>
|
|
186
186
|
|
|
187
187
|
## 🧬 Model Zoo
|
|
188
188
|
|
|
189
189
|
| Model | Resolution | # Total Params(M) | # Backbone(M) | # L-ViT(M) | # H-ViT(M) | FLOPs (G) | Model Config |
|
|
190
190
|
| ----- | ---------- | -------------- | ----------- |------------- | ------------- | -------------- | ------- |
|
|
191
|
-
| ⚡ ms_eff_gcvit_b0 | 224 X 224 | 8.7 | 3.6(41.4%) | 1.7(19.5%) | 3.3(37.9%) | 0.87 | [spec](deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
192
|
-
| 🔥 ms_eff_gcvit_b5 | 384 X 384 | 50.3 | 27.3(54.3%) | 6.6(13.1%) | 16.1(32.0%) | 13.64 | [spec](deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
191
|
+
| ⚡ ms_eff_gcvit_b0 | 224 X 224 | 8.7 | 3.6(41.4%) | 1.7(19.5%) | 3.3(37.9%) | 0.87 | [spec](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
192
|
+
| 🔥 ms_eff_gcvit_b5 | 384 X 384 | 50.3 | 27.3(54.3%) | 6.6(13.1%) | 16.1(32.0%) | 13.64 | [spec](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
193
193
|
|
|
194
194
|
## 🚀 Training
|
|
195
195
|
|
|
@@ -231,22 +231,22 @@ We provide training scripts for both `ms_eff_vit` and `ms_eff_gcvit`. We recomme
|
|
|
231
231
|
|
|
232
232
|
| Model Variant | Test@Acc | Test@Auc | Test@log_loss | Download | Train Config |
|
|
233
233
|
| ------------- | -------- | -------- | ---------- | -------- | ----- |
|
|
234
|
-
| ms_eff_gcvit_b0 | 0.9842 | 0.9965 | 0.0283 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b0_celeb_df_v2.bin) | [recipe](deepguard/config/ms_eff_gcvit_b0/celeb_df_v2.yaml) |
|
|
235
|
-
| ms_eff_gcvit_b5 | 0.9981 | 0.9984 | 0.0089 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b5_celeb_df_v2.bin) | [recipe](deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
234
|
+
| ms_eff_gcvit_b0 | 0.9842 | 0.9965 | 0.0283 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b0_celeb_df_v2.bin) | [recipe](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b0/celeb_df_v2.yaml) |
|
|
235
|
+
| ms_eff_gcvit_b5 | 0.9981 | 0.9984 | 0.0089 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b5_celeb_df_v2.bin) | [recipe](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
236
236
|
|
|
237
237
|
**FaceForensics++ Pretrained Models**
|
|
238
238
|
|
|
239
239
|
| Model Variant | Test@Acc | Test@Auc | Test@log_loss | Download | Train Config |
|
|
240
240
|
| ------------- | -------- | -------- | ---------- | -------- | ------ |
|
|
241
|
-
| ms_eff_gcvit_b0 | 0.9808 | 0.9969 | 0.0637| [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b0_ff++.bin) | [recipe](deepguard/config/ms_eff_gcvit_b0/celeb_df_v2.yaml) |
|
|
242
|
-
| ms_eff_gcvit_b5 | 0.9850 | 0.9974 | 0.0492 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b5_ff++.bin) | [recipe](deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
241
|
+
| ms_eff_gcvit_b0 | 0.9808 | 0.9969 | 0.0637| [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b0_ff++.bin) | [recipe](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b0/celeb_df_v2.yaml) |
|
|
242
|
+
| ms_eff_gcvit_b5 | 0.9850 | 0.9974 | 0.0492 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b5_ff++.bin) | [recipe](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
243
243
|
|
|
244
244
|
**KoDF Pretrained Models**
|
|
245
245
|
|
|
246
246
|
| Model Variant | Test@Acc | Test@Auc | Test@log_loss | Download | Train Config |
|
|
247
247
|
| ------------- | -------- | -------- | ---------- | -------- | ------ |
|
|
248
|
-
| ms_eff_gcvit_b0 | 0.9655 | 0.9792 | 0.1237 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.2.0/ms_eff_gcvit_b0_kodf.bin) | [recipe](deepguard/config/ms_eff_gcvit_b0/celeb_df_v2.yaml) |
|
|
249
|
-
| ms_eff_gcvit_b5 | 0.9850 | 0.9974 | 0.0492 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.2.0/ms_eff_gcvit_b5_kodf.bin) | [recipe](deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
248
|
+
| ms_eff_gcvit_b0 | 0.9655 | 0.9792 | 0.1237 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.2.0/ms_eff_gcvit_b0_kodf.bin) | [recipe](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b0/celeb_df_v2.yaml) |
|
|
249
|
+
| ms_eff_gcvit_b5 | 0.9850 | 0.9974 | 0.0492 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.2.0/ms_eff_gcvit_b5_kodf.bin) | [recipe](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
250
250
|
|
|
251
251
|
## 💻 Model Usage
|
|
252
252
|
|
|
@@ -499,14 +499,14 @@ result = explainer.display_heatmap_bbox_on_image(
|
|
|
499
499
|
|
|
500
500
|
The jupyter notebooks themselves can be found under the tutorials folder in the git repository.
|
|
501
501
|
|
|
502
|
-
- [Notebook tutorial: Predict DeepFake Image with ImagePredictor](
|
|
503
|
-
- [Notebook tutorial: Predict DeepFake Video with VideoPredictor](
|
|
504
|
-
- [Notebook tutorial: Low-Level Branch XAI Visualization (HiResCAM, GradCAMElementWise, LayerCAM)](
|
|
505
|
-
- [Notebook tutorial: High-Level Branch XAI Visualization (EigenGradCAM, GradCAM++, XGradCAM)](
|
|
506
|
-
- [Notebook tutorial: MS-EffViT Low-Level Branch Explainability](
|
|
507
|
-
- [Notebook tutorial: MS-EffViT High-Level Branch Explainability](
|
|
508
|
-
- [Notebook tutorial: MS-EffGCViT Low-Level Branch Explainability](
|
|
509
|
-
- [Notebook tutorial: MS-EffGCViT High-Level Branch Explainability](
|
|
502
|
+
- [Notebook tutorial: Predict DeepFake Image with ImagePredictor](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/predict_image.ipynb)
|
|
503
|
+
- [Notebook tutorial: Predict DeepFake Video with VideoPredictor](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/predict_video.ipynb)
|
|
504
|
+
- [Notebook tutorial: Low-Level Branch XAI Visualization (HiResCAM, GradCAMElementWise, LayerCAM)](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/low_level_visualization.ipynb)
|
|
505
|
+
- [Notebook tutorial: High-Level Branch XAI Visualization (EigenGradCAM, GradCAM++, XGradCAM)](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/high_level_visualization.ipynb)
|
|
506
|
+
- [Notebook tutorial: MS-EffViT Low-Level Branch Explainability](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/ms_eff_vit_low_level.ipynb)
|
|
507
|
+
- [Notebook tutorial: MS-EffViT High-Level Branch Explainability](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/ms_eff_vit_high_level.ipynb)
|
|
508
|
+
- [Notebook tutorial: MS-EffGCViT Low-Level Branch Explainability](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/ms_eff_gcvit_low_level.ipynb)
|
|
509
|
+
- [Notebook tutorial: MS-EffGCViT High-Level Branch Explainability](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/ms_eff_gcvit_high_level.ipynb)
|
|
510
510
|
|
|
511
511
|
## 📬 Authors
|
|
512
512
|
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
</p>
|
|
30
30
|
|
|
31
31
|
<p align="center">
|
|
32
|
-
<a href="README_KR.md"><b>🇰🇷 한국어 버전</b></a> |
|
|
33
|
-
<a href="README_JP.md"><b>🇯🇵 日本語版</b></a> |
|
|
32
|
+
<a href="https://github.com/HanMoonSub/DeepGuard/blob/main/README_KR.md"><b>🇰🇷 한국어 버전</b></a> |
|
|
33
|
+
<a href="https://github.com/HanMoonSub/DeepGuard/blob/main/README_JP.md"><b>🇯🇵 日本語版</b></a> |
|
|
34
34
|
<a href="#-model-evaluation"><b>📈 Model Evaluation</b></a> |
|
|
35
35
|
<a href="#-predict-image--video"><b>🔮 Try Demo</b></a>
|
|
36
36
|
</p>
|
|
@@ -76,9 +76,9 @@ To evaluate the generalization and robustness of our deepfake detection model, w
|
|
|
76
76
|
|
|
77
77
|
| Dataset | Real Videos | Fake Videos | Year | Participants | Description (Paper Title) | Details |
|
|
78
78
|
| :--- | :---: | :---: | :---: | :---: | :--- | :---: |
|
|
79
|
-
| **Celeb-DF-v2** | 890 | 5,639 | 2019 | 59 | *A Large-scale Challenging Dataset for DeepFake Forensics* | [🔗 Readme](preprocess/celeb_df_v2/README.md) |
|
|
80
|
-
| **FaceForensics++** | 1,000 | 6,000 | 2019 | 1,000 | *Learning to Detect Manipulated Facial Images* | [🔗 Readme](preprocess/ff++/README.md) |
|
|
81
|
-
| **KoDF** | 62,166 | 175,776 | 2020 | 400 | *Large-Scale Korean Deepfake Detection Dataset* | [🔗 Readme](preprocess/kodf/README.md) |
|
|
79
|
+
| **Celeb-DF-v2** | 890 | 5,639 | 2019 | 59 | *A Large-scale Challenging Dataset for DeepFake Forensics* | [🔗 Readme](https://github.com/HanMoonSub/DeepGuard/blob/main/preprocess/celeb_df_v2/README.md) |
|
|
80
|
+
| **FaceForensics++** | 1,000 | 6,000 | 2019 | 1,000 | *Learning to Detect Manipulated Facial Images* | [🔗 Readme](https://github.com/HanMoonSub/DeepGuard/blob/main/preprocess/ff++/README.md) |
|
|
81
|
+
| **KoDF** | 62,166 | 175,776 | 2020 | 400 | *Large-Scale Korean Deepfake Detection Dataset* | [🔗 Readme](https://github.com/HanMoonSub/DeepGuard/blob/main/preprocess/kodf/README.md) |
|
|
82
82
|
|
|
83
83
|
<div id="data-preparation"></div>
|
|
84
84
|
|
|
@@ -128,9 +128,9 @@ DATA_ROOT/
|
|
|
128
128
|
|
|
129
129
|
Click the links below to view the specific preprocessing details for each dataset:
|
|
130
130
|
|
|
131
|
-
* [**Celeb-DF V2 Preprocess**](/preprocess/celeb_df_v2/README.md)
|
|
132
|
-
* [**FaceForensics++ Preprocess**](/preprocess/ff++/README.md)
|
|
133
|
-
* [**KoDF Preprocess**](/preprocess/kodf/README.md)
|
|
131
|
+
* [**Celeb-DF V2 Preprocess**](https://github.com/HanMoonSub/DeepGuard/blob/main/preprocess/celeb_df_v2/README.md)
|
|
132
|
+
* [**FaceForensics++ Preprocess**](https://github.com/HanMoonSub/DeepGuard/blob/main/preprocess/ff++/README.md)
|
|
133
|
+
* [**KoDF Preprocess**](https://github.com/HanMoonSub/DeepGuard/blob/main/preprocess/kodf/README.md)
|
|
134
134
|
|
|
135
135
|
## 🏗 Model Architecture
|
|
136
136
|
|
|
@@ -138,9 +138,9 @@ Multi Scale Efficient Global Context Vision Transformer is an optimized multi-sc
|
|
|
138
138
|
|
|
139
139
|
#### Explore More Details
|
|
140
140
|
|
|
141
|
-
- [Model Architecture: MS-EffViT](deepguard/MS_EffViT.md) - _**Multi Scale Efficient Vision Transformer**_
|
|
141
|
+
- [Model Architecture: MS-EffViT](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/MS_EffViT.md) - _**Multi Scale Efficient Vision Transformer**_
|
|
142
142
|
|
|
143
|
-
- [Advanced Architecture: MS-EFFGCViT](deepguard/MS_EffGCViT.md) - _**Multi Scale Efficient Global Context Vision Transformer**_
|
|
143
|
+
- [Advanced Architecture: MS-EFFGCViT](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/MS_EffGCViT.md) - _**Multi Scale Efficient Global Context Vision Transformer**_
|
|
144
144
|
|
|
145
145
|
|
|
146
146
|
<p align="center">
|
|
@@ -155,15 +155,15 @@ We utilizes two distinct types of self-attention to capture both long-range and
|
|
|
155
155
|
|
|
156
156
|
|
|
157
157
|
<p align="center">
|
|
158
|
-
<img src=
|
|
158
|
+
<img src=docs/architectures/window_attention.JPG width="100%" height="300">
|
|
159
159
|
</p>
|
|
160
160
|
|
|
161
161
|
## 🧬 Model Zoo
|
|
162
162
|
|
|
163
163
|
| Model | Resolution | # Total Params(M) | # Backbone(M) | # L-ViT(M) | # H-ViT(M) | FLOPs (G) | Model Config |
|
|
164
164
|
| ----- | ---------- | -------------- | ----------- |------------- | ------------- | -------------- | ------- |
|
|
165
|
-
| ⚡ ms_eff_gcvit_b0 | 224 X 224 | 8.7 | 3.6(41.4%) | 1.7(19.5%) | 3.3(37.9%) | 0.87 | [spec](deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
166
|
-
| 🔥 ms_eff_gcvit_b5 | 384 X 384 | 50.3 | 27.3(54.3%) | 6.6(13.1%) | 16.1(32.0%) | 13.64 | [spec](deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
165
|
+
| ⚡ ms_eff_gcvit_b0 | 224 X 224 | 8.7 | 3.6(41.4%) | 1.7(19.5%) | 3.3(37.9%) | 0.87 | [spec](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
166
|
+
| 🔥 ms_eff_gcvit_b5 | 384 X 384 | 50.3 | 27.3(54.3%) | 6.6(13.1%) | 16.1(32.0%) | 13.64 | [spec](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
167
167
|
|
|
168
168
|
## 🚀 Training
|
|
169
169
|
|
|
@@ -205,22 +205,22 @@ We provide training scripts for both `ms_eff_vit` and `ms_eff_gcvit`. We recomme
|
|
|
205
205
|
|
|
206
206
|
| Model Variant | Test@Acc | Test@Auc | Test@log_loss | Download | Train Config |
|
|
207
207
|
| ------------- | -------- | -------- | ---------- | -------- | ----- |
|
|
208
|
-
| ms_eff_gcvit_b0 | 0.9842 | 0.9965 | 0.0283 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b0_celeb_df_v2.bin) | [recipe](deepguard/config/ms_eff_gcvit_b0/celeb_df_v2.yaml) |
|
|
209
|
-
| ms_eff_gcvit_b5 | 0.9981 | 0.9984 | 0.0089 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b5_celeb_df_v2.bin) | [recipe](deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
208
|
+
| ms_eff_gcvit_b0 | 0.9842 | 0.9965 | 0.0283 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b0_celeb_df_v2.bin) | [recipe](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b0/celeb_df_v2.yaml) |
|
|
209
|
+
| ms_eff_gcvit_b5 | 0.9981 | 0.9984 | 0.0089 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b5_celeb_df_v2.bin) | [recipe](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
210
210
|
|
|
211
211
|
**FaceForensics++ Pretrained Models**
|
|
212
212
|
|
|
213
213
|
| Model Variant | Test@Acc | Test@Auc | Test@log_loss | Download | Train Config |
|
|
214
214
|
| ------------- | -------- | -------- | ---------- | -------- | ------ |
|
|
215
|
-
| ms_eff_gcvit_b0 | 0.9808 | 0.9969 | 0.0637| [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b0_ff++.bin) | [recipe](deepguard/config/ms_eff_gcvit_b0/celeb_df_v2.yaml) |
|
|
216
|
-
| ms_eff_gcvit_b5 | 0.9850 | 0.9974 | 0.0492 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b5_ff++.bin) | [recipe](deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
215
|
+
| ms_eff_gcvit_b0 | 0.9808 | 0.9969 | 0.0637| [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b0_ff++.bin) | [recipe](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b0/celeb_df_v2.yaml) |
|
|
216
|
+
| ms_eff_gcvit_b5 | 0.9850 | 0.9974 | 0.0492 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b5_ff++.bin) | [recipe](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
217
217
|
|
|
218
218
|
**KoDF Pretrained Models**
|
|
219
219
|
|
|
220
220
|
| Model Variant | Test@Acc | Test@Auc | Test@log_loss | Download | Train Config |
|
|
221
221
|
| ------------- | -------- | -------- | ---------- | -------- | ------ |
|
|
222
|
-
| ms_eff_gcvit_b0 | 0.9655 | 0.9792 | 0.1237 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.2.0/ms_eff_gcvit_b0_kodf.bin) | [recipe](deepguard/config/ms_eff_gcvit_b0/celeb_df_v2.yaml) |
|
|
223
|
-
| ms_eff_gcvit_b5 | 0.9850 | 0.9974 | 0.0492 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.2.0/ms_eff_gcvit_b5_kodf.bin) | [recipe](deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
222
|
+
| ms_eff_gcvit_b0 | 0.9655 | 0.9792 | 0.1237 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.2.0/ms_eff_gcvit_b0_kodf.bin) | [recipe](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b0/celeb_df_v2.yaml) |
|
|
223
|
+
| ms_eff_gcvit_b5 | 0.9850 | 0.9974 | 0.0492 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.2.0/ms_eff_gcvit_b5_kodf.bin) | [recipe](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
224
224
|
|
|
225
225
|
## 💻 Model Usage
|
|
226
226
|
|
|
@@ -473,14 +473,14 @@ result = explainer.display_heatmap_bbox_on_image(
|
|
|
473
473
|
|
|
474
474
|
The jupyter notebooks themselves can be found under the tutorials folder in the git repository.
|
|
475
475
|
|
|
476
|
-
- [Notebook tutorial: Predict DeepFake Image with ImagePredictor](
|
|
477
|
-
- [Notebook tutorial: Predict DeepFake Video with VideoPredictor](
|
|
478
|
-
- [Notebook tutorial: Low-Level Branch XAI Visualization (HiResCAM, GradCAMElementWise, LayerCAM)](
|
|
479
|
-
- [Notebook tutorial: High-Level Branch XAI Visualization (EigenGradCAM, GradCAM++, XGradCAM)](
|
|
480
|
-
- [Notebook tutorial: MS-EffViT Low-Level Branch Explainability](
|
|
481
|
-
- [Notebook tutorial: MS-EffViT High-Level Branch Explainability](
|
|
482
|
-
- [Notebook tutorial: MS-EffGCViT Low-Level Branch Explainability](
|
|
483
|
-
- [Notebook tutorial: MS-EffGCViT High-Level Branch Explainability](
|
|
476
|
+
- [Notebook tutorial: Predict DeepFake Image with ImagePredictor](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/predict_image.ipynb)
|
|
477
|
+
- [Notebook tutorial: Predict DeepFake Video with VideoPredictor](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/predict_video.ipynb)
|
|
478
|
+
- [Notebook tutorial: Low-Level Branch XAI Visualization (HiResCAM, GradCAMElementWise, LayerCAM)](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/low_level_visualization.ipynb)
|
|
479
|
+
- [Notebook tutorial: High-Level Branch XAI Visualization (EigenGradCAM, GradCAM++, XGradCAM)](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/high_level_visualization.ipynb)
|
|
480
|
+
- [Notebook tutorial: MS-EffViT Low-Level Branch Explainability](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/ms_eff_vit_low_level.ipynb)
|
|
481
|
+
- [Notebook tutorial: MS-EffViT High-Level Branch Explainability](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/ms_eff_vit_high_level.ipynb)
|
|
482
|
+
- [Notebook tutorial: MS-EffGCViT Low-Level Branch Explainability](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/ms_eff_gcvit_low_level.ipynb)
|
|
483
|
+
- [Notebook tutorial: MS-EffGCViT High-Level Branch Explainability](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/ms_eff_gcvit_high_level.ipynb)
|
|
484
484
|
|
|
485
485
|
## 📬 Authors
|
|
486
486
|
|
|
@@ -505,4 +505,4 @@ _**This project was developed as a Senior Graduation Project by the Department o
|
|
|
505
505
|
|
|
506
506
|
## ⚖️ License
|
|
507
507
|
|
|
508
|
-
This project is licensed under the terms of the MIT license.
|
|
508
|
+
This project is licensed under the terms of the MIT license.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deepguard
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0
|
|
4
4
|
Summary: Multi-Scale Efficient Global Context Vision Transformer for Robust Deepfake Detection
|
|
5
5
|
Author-email: seoyunje <seoyunje2001@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -55,8 +55,8 @@ Dynamic: license-file
|
|
|
55
55
|
</p>
|
|
56
56
|
|
|
57
57
|
<p align="center">
|
|
58
|
-
<a href="README_KR.md"><b>🇰🇷 한국어 버전</b></a> |
|
|
59
|
-
<a href="README_JP.md"><b>🇯🇵 日本語版</b></a> |
|
|
58
|
+
<a href="https://github.com/HanMoonSub/DeepGuard/blob/main/README_KR.md"><b>🇰🇷 한국어 버전</b></a> |
|
|
59
|
+
<a href="https://github.com/HanMoonSub/DeepGuard/blob/main/README_JP.md"><b>🇯🇵 日本語版</b></a> |
|
|
60
60
|
<a href="#-model-evaluation"><b>📈 Model Evaluation</b></a> |
|
|
61
61
|
<a href="#-predict-image--video"><b>🔮 Try Demo</b></a>
|
|
62
62
|
</p>
|
|
@@ -102,9 +102,9 @@ To evaluate the generalization and robustness of our deepfake detection model, w
|
|
|
102
102
|
|
|
103
103
|
| Dataset | Real Videos | Fake Videos | Year | Participants | Description (Paper Title) | Details |
|
|
104
104
|
| :--- | :---: | :---: | :---: | :---: | :--- | :---: |
|
|
105
|
-
| **Celeb-DF-v2** | 890 | 5,639 | 2019 | 59 | *A Large-scale Challenging Dataset for DeepFake Forensics* | [🔗 Readme](preprocess/celeb_df_v2/README.md) |
|
|
106
|
-
| **FaceForensics++** | 1,000 | 6,000 | 2019 | 1,000 | *Learning to Detect Manipulated Facial Images* | [🔗 Readme](preprocess/ff++/README.md) |
|
|
107
|
-
| **KoDF** | 62,166 | 175,776 | 2020 | 400 | *Large-Scale Korean Deepfake Detection Dataset* | [🔗 Readme](preprocess/kodf/README.md) |
|
|
105
|
+
| **Celeb-DF-v2** | 890 | 5,639 | 2019 | 59 | *A Large-scale Challenging Dataset for DeepFake Forensics* | [🔗 Readme](https://github.com/HanMoonSub/DeepGuard/blob/main/preprocess/celeb_df_v2/README.md) |
|
|
106
|
+
| **FaceForensics++** | 1,000 | 6,000 | 2019 | 1,000 | *Learning to Detect Manipulated Facial Images* | [🔗 Readme](https://github.com/HanMoonSub/DeepGuard/blob/main/preprocess/ff++/README.md) |
|
|
107
|
+
| **KoDF** | 62,166 | 175,776 | 2020 | 400 | *Large-Scale Korean Deepfake Detection Dataset* | [🔗 Readme](https://github.com/HanMoonSub/DeepGuard/blob/main/preprocess/kodf/README.md) |
|
|
108
108
|
|
|
109
109
|
<div id="data-preparation"></div>
|
|
110
110
|
|
|
@@ -154,9 +154,9 @@ DATA_ROOT/
|
|
|
154
154
|
|
|
155
155
|
Click the links below to view the specific preprocessing details for each dataset:
|
|
156
156
|
|
|
157
|
-
* [**Celeb-DF V2 Preprocess**](/preprocess/celeb_df_v2/README.md)
|
|
158
|
-
* [**FaceForensics++ Preprocess**](/preprocess/ff++/README.md)
|
|
159
|
-
* [**KoDF Preprocess**](/preprocess/kodf/README.md)
|
|
157
|
+
* [**Celeb-DF V2 Preprocess**](https://github.com/HanMoonSub/DeepGuard/blob/main/preprocess/celeb_df_v2/README.md)
|
|
158
|
+
* [**FaceForensics++ Preprocess**](https://github.com/HanMoonSub/DeepGuard/blob/main/preprocess/ff++/README.md)
|
|
159
|
+
* [**KoDF Preprocess**](https://github.com/HanMoonSub/DeepGuard/blob/main/preprocess/kodf/README.md)
|
|
160
160
|
|
|
161
161
|
## 🏗 Model Architecture
|
|
162
162
|
|
|
@@ -164,9 +164,9 @@ Multi Scale Efficient Global Context Vision Transformer is an optimized multi-sc
|
|
|
164
164
|
|
|
165
165
|
#### Explore More Details
|
|
166
166
|
|
|
167
|
-
- [Model Architecture: MS-EffViT](deepguard/MS_EffViT.md) - _**Multi Scale Efficient Vision Transformer**_
|
|
167
|
+
- [Model Architecture: MS-EffViT](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/MS_EffViT.md) - _**Multi Scale Efficient Vision Transformer**_
|
|
168
168
|
|
|
169
|
-
- [Advanced Architecture: MS-EFFGCViT](deepguard/MS_EffGCViT.md) - _**Multi Scale Efficient Global Context Vision Transformer**_
|
|
169
|
+
- [Advanced Architecture: MS-EFFGCViT](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/MS_EffGCViT.md) - _**Multi Scale Efficient Global Context Vision Transformer**_
|
|
170
170
|
|
|
171
171
|
|
|
172
172
|
<p align="center">
|
|
@@ -181,15 +181,15 @@ We utilizes two distinct types of self-attention to capture both long-range and
|
|
|
181
181
|
|
|
182
182
|
|
|
183
183
|
<p align="center">
|
|
184
|
-
<img src=
|
|
184
|
+
<img src=docs/architectures/window_attention.JPG width="100%" height="300">
|
|
185
185
|
</p>
|
|
186
186
|
|
|
187
187
|
## 🧬 Model Zoo
|
|
188
188
|
|
|
189
189
|
| Model | Resolution | # Total Params(M) | # Backbone(M) | # L-ViT(M) | # H-ViT(M) | FLOPs (G) | Model Config |
|
|
190
190
|
| ----- | ---------- | -------------- | ----------- |------------- | ------------- | -------------- | ------- |
|
|
191
|
-
| ⚡ ms_eff_gcvit_b0 | 224 X 224 | 8.7 | 3.6(41.4%) | 1.7(19.5%) | 3.3(37.9%) | 0.87 | [spec](deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
192
|
-
| 🔥 ms_eff_gcvit_b5 | 384 X 384 | 50.3 | 27.3(54.3%) | 6.6(13.1%) | 16.1(32.0%) | 13.64 | [spec](deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
191
|
+
| ⚡ ms_eff_gcvit_b0 | 224 X 224 | 8.7 | 3.6(41.4%) | 1.7(19.5%) | 3.3(37.9%) | 0.87 | [spec](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
192
|
+
| 🔥 ms_eff_gcvit_b5 | 384 X 384 | 50.3 | 27.3(54.3%) | 6.6(13.1%) | 16.1(32.0%) | 13.64 | [spec](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
193
193
|
|
|
194
194
|
## 🚀 Training
|
|
195
195
|
|
|
@@ -231,22 +231,22 @@ We provide training scripts for both `ms_eff_vit` and `ms_eff_gcvit`. We recomme
|
|
|
231
231
|
|
|
232
232
|
| Model Variant | Test@Acc | Test@Auc | Test@log_loss | Download | Train Config |
|
|
233
233
|
| ------------- | -------- | -------- | ---------- | -------- | ----- |
|
|
234
|
-
| ms_eff_gcvit_b0 | 0.9842 | 0.9965 | 0.0283 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b0_celeb_df_v2.bin) | [recipe](deepguard/config/ms_eff_gcvit_b0/celeb_df_v2.yaml) |
|
|
235
|
-
| ms_eff_gcvit_b5 | 0.9981 | 0.9984 | 0.0089 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b5_celeb_df_v2.bin) | [recipe](deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
234
|
+
| ms_eff_gcvit_b0 | 0.9842 | 0.9965 | 0.0283 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b0_celeb_df_v2.bin) | [recipe](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b0/celeb_df_v2.yaml) |
|
|
235
|
+
| ms_eff_gcvit_b5 | 0.9981 | 0.9984 | 0.0089 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b5_celeb_df_v2.bin) | [recipe](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
236
236
|
|
|
237
237
|
**FaceForensics++ Pretrained Models**
|
|
238
238
|
|
|
239
239
|
| Model Variant | Test@Acc | Test@Auc | Test@log_loss | Download | Train Config |
|
|
240
240
|
| ------------- | -------- | -------- | ---------- | -------- | ------ |
|
|
241
|
-
| ms_eff_gcvit_b0 | 0.9808 | 0.9969 | 0.0637| [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b0_ff++.bin) | [recipe](deepguard/config/ms_eff_gcvit_b0/celeb_df_v2.yaml) |
|
|
242
|
-
| ms_eff_gcvit_b5 | 0.9850 | 0.9974 | 0.0492 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b5_ff++.bin) | [recipe](deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
241
|
+
| ms_eff_gcvit_b0 | 0.9808 | 0.9969 | 0.0637| [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b0_ff++.bin) | [recipe](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b0/celeb_df_v2.yaml) |
|
|
242
|
+
| ms_eff_gcvit_b5 | 0.9850 | 0.9974 | 0.0492 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.1.0/ms_eff_gcvit_b5_ff++.bin) | [recipe](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
243
243
|
|
|
244
244
|
**KoDF Pretrained Models**
|
|
245
245
|
|
|
246
246
|
| Model Variant | Test@Acc | Test@Auc | Test@log_loss | Download | Train Config |
|
|
247
247
|
| ------------- | -------- | -------- | ---------- | -------- | ------ |
|
|
248
|
-
| ms_eff_gcvit_b0 | 0.9655 | 0.9792 | 0.1237 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.2.0/ms_eff_gcvit_b0_kodf.bin) | [recipe](deepguard/config/ms_eff_gcvit_b0/celeb_df_v2.yaml) |
|
|
249
|
-
| ms_eff_gcvit_b5 | 0.9850 | 0.9974 | 0.0492 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.2.0/ms_eff_gcvit_b5_kodf.bin) | [recipe](deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
248
|
+
| ms_eff_gcvit_b0 | 0.9655 | 0.9792 | 0.1237 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.2.0/ms_eff_gcvit_b0_kodf.bin) | [recipe](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b0/celeb_df_v2.yaml) |
|
|
249
|
+
| ms_eff_gcvit_b5 | 0.9850 | 0.9974 | 0.0492 | [model](https://github.com/HanMoonSub/DeepGuard/releases/download/v0.2.0/ms_eff_gcvit_b5_kodf.bin) | [recipe](https://github.com/HanMoonSub/DeepGuard/blob/main/deepguard/config/ms_eff_gcvit_b5/celeb_df_v2.yaml) |
|
|
250
250
|
|
|
251
251
|
## 💻 Model Usage
|
|
252
252
|
|
|
@@ -499,14 +499,14 @@ result = explainer.display_heatmap_bbox_on_image(
|
|
|
499
499
|
|
|
500
500
|
The jupyter notebooks themselves can be found under the tutorials folder in the git repository.
|
|
501
501
|
|
|
502
|
-
- [Notebook tutorial: Predict DeepFake Image with ImagePredictor](
|
|
503
|
-
- [Notebook tutorial: Predict DeepFake Video with VideoPredictor](
|
|
504
|
-
- [Notebook tutorial: Low-Level Branch XAI Visualization (HiResCAM, GradCAMElementWise, LayerCAM)](
|
|
505
|
-
- [Notebook tutorial: High-Level Branch XAI Visualization (EigenGradCAM, GradCAM++, XGradCAM)](
|
|
506
|
-
- [Notebook tutorial: MS-EffViT Low-Level Branch Explainability](
|
|
507
|
-
- [Notebook tutorial: MS-EffViT High-Level Branch Explainability](
|
|
508
|
-
- [Notebook tutorial: MS-EffGCViT Low-Level Branch Explainability](
|
|
509
|
-
- [Notebook tutorial: MS-EffGCViT High-Level Branch Explainability](
|
|
502
|
+
- [Notebook tutorial: Predict DeepFake Image with ImagePredictor](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/predict_image.ipynb)
|
|
503
|
+
- [Notebook tutorial: Predict DeepFake Video with VideoPredictor](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/predict_video.ipynb)
|
|
504
|
+
- [Notebook tutorial: Low-Level Branch XAI Visualization (HiResCAM, GradCAMElementWise, LayerCAM)](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/low_level_visualization.ipynb)
|
|
505
|
+
- [Notebook tutorial: High-Level Branch XAI Visualization (EigenGradCAM, GradCAM++, XGradCAM)](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/high_level_visualization.ipynb)
|
|
506
|
+
- [Notebook tutorial: MS-EffViT Low-Level Branch Explainability](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/ms_eff_vit_low_level.ipynb)
|
|
507
|
+
- [Notebook tutorial: MS-EffViT High-Level Branch Explainability](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/ms_eff_vit_high_level.ipynb)
|
|
508
|
+
- [Notebook tutorial: MS-EffGCViT Low-Level Branch Explainability](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/ms_eff_gcvit_low_level.ipynb)
|
|
509
|
+
- [Notebook tutorial: MS-EffGCViT High-Level Branch Explainability](https://github.com/HanMoonSub/DeepGuard/blob/main/tutorials/ms_eff_gcvit_high_level.ipynb)
|
|
510
510
|
|
|
511
511
|
## 📬 Authors
|
|
512
512
|
|
|
@@ -18,6 +18,7 @@ class BaseExplainer:
|
|
|
18
18
|
branch_level: Literal["low", "high"] = "high",
|
|
19
19
|
l_stage_idx: int = -1, # gcvit low branch stage index (0~3)
|
|
20
20
|
block_idx: int = -1, # vit, gcvit block index
|
|
21
|
+
model: Optional[torch.nn.Module] = None,
|
|
21
22
|
):
|
|
22
23
|
|
|
23
24
|
self.device = "cuda:0" if torch.cuda.is_available() else 'cpu'
|
|
@@ -34,7 +35,9 @@ class BaseExplainer:
|
|
|
34
35
|
self.transformer_type = model_name.split("_")[-2] # vit, gcvit
|
|
35
36
|
|
|
36
37
|
# Model & Tools setup
|
|
37
|
-
self.model = timm.create_model(
|
|
38
|
+
self.model = model if model is not None else timm.create_model(
|
|
39
|
+
model_name, pretrained=True, dataset=dataset
|
|
40
|
+
)
|
|
38
41
|
self.face_detector = FaceDetector2(conf_thres)
|
|
39
42
|
self.img_size = [224,224] if self.model_variant == "b0" else [384,384]
|
|
40
43
|
self.transforms = get_test_transforms(img_size=self.img_size)
|
|
@@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
|
|
|
8
8
|
# ─────────────────────────────────────────────
|
|
9
9
|
[project]
|
|
10
10
|
name = "deepguard" # pip install deepguard 할 때 이 이름
|
|
11
|
-
version = "0.
|
|
11
|
+
version = "0.3.0" # pip install deepguard==0.2.4 으로 버전 고정 가능
|
|
12
12
|
description = "Multi-Scale Efficient Global Context Vision Transformer for Robust Deepfake Detection"
|
|
13
13
|
readme = "README.md" # PyPI 페이지에 표시될 설명 (마크다운)
|
|
14
14
|
requires-python = ">=3.10" # 이 버전 미만이면 pip install 자체를 막음
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|