deepguard 0.2.2__tar.gz → 0.2.4__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.2 → deepguard-0.2.4}/PKG-INFO +29 -16
- {deepguard-0.2.2 → deepguard-0.2.4}/README.md +29 -16
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard.egg-info/PKG-INFO +29 -16
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard.egg-info/SOURCES.txt +1 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard.egg-info/top_level.txt +1 -0
- deepguard-0.2.4/preprocess/yolov8n-face.pt +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/pyproject.toml +6 -2
- {deepguard-0.2.2 → deepguard-0.2.4}/LICENSE +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/__init__.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/data/__init__.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/data/dataset.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/data/dataset_cutmix.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/data/dataset_cutout.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/data/dataset_mixup.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/data/handle_imbalance.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/data/split_data.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/data/transforms.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/layers/__init__.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/layers/attention.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/layers/drop.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/layers/featextractor.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/layers/global_query.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/layers/mlp.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/layers/patch.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/layers/reducesize.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/layers/se.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/layers/transformer.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/layers/weight_init.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/layers/window.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/models/__init__.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/models/ms_eff_gcvit.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/models/ms_eff_vit.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/optimizer/__init__.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/optimizer/build_optimizer.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/scheduler/__init__.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/scheduler/fetch_scheduler.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/utils/__init__.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/utils/build_metrics.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/utils/early_stopping.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/utils/meter.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard/utils/seed.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard.egg-info/dependency_links.txt +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/deepguard.egg-info/requires.txt +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/explainability/__init__.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/explainability/cam_evaluator.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/explainability/explainer/base_explainer.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/explainability/explainer/cam_explainer.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/explainability/explainer/eigenvalue_explainer.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/explainability/explainer/gradient_explainer.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/explainability/explainer/misc_explainer.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/explainability/explainer/perturbation_explainer.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/explainability/metrics/__init__.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/explainability/metrics/cam_mult_image.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/explainability/metrics/perturbation_confidence.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/explainability/metrics/road.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/explainability/utils/image.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/explainability/utils/model_targets.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/explainability/utils/reshape_transforms.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/inference/__init__.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/inference/image_predictor.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/inference/image_predictor_prt.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/inference/predict_video.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/inference/utils.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/inference/video_predictor.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/inference/video_predictor_prt.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/__init__.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/celeb_df_v2/__init__.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/celeb_df_v2/crop_face.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/celeb_df_v2/detect_original_face.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/celeb_df_v2/split_data.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/celeb_df_v2/utils.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/face_detector.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/ff++/__init__.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/ff++/crop_face.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/ff++/detect_original_face.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/ff++/split_data.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/ff++/utils.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/frame_extractor.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/kodf/__init__.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/kodf/crop_face.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/kodf/detect_original_face.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/kodf/generate_metadata.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/kodf/split_data.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/kodf/utils.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/preprocess/landmark_detector.py +0 -0
- {deepguard-0.2.2 → deepguard-0.2.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deepguard
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.4
|
|
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
|
|
@@ -37,7 +37,7 @@ Dynamic: license-file
|
|
|
37
37
|
</p>
|
|
38
38
|
|
|
39
39
|
<p align="center">
|
|
40
|
-
<img src="docs/samples/deepfake_thumbnails.png" alt="DeepGuard Banner" width="800" height="400">
|
|
40
|
+
<img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/deepfake_thumbnails.png" alt="DeepGuard Banner" width="800" height="400">
|
|
41
41
|
</p>
|
|
42
42
|
|
|
43
43
|
<p align="center">
|
|
@@ -74,6 +74,7 @@ Dynamic: license-file
|
|
|
74
74
|
- [💻 Model Usage](#-model-usage) - How to integrate DeepGuard models into your own Python code or via timm
|
|
75
75
|
- [🔮 Predict Image & Video](#-predict-image--video) - Simple Inference examples for detecting deepfakes in image and video
|
|
76
76
|
- [🎨 DeepFake AI Explainability](#-deepfake-ai-explainability) - Visualizing model focus using Grad-CAM and attention maps
|
|
77
|
+
- [📓 Tutorials](#-tutorials) - Hands-on Colab notebooks for inference and dual-branch XAI visualization
|
|
77
78
|
- [📬 Authors](#-authors)
|
|
78
79
|
- [📝 Reference](#-reference)
|
|
79
80
|
- [⚖️ License](#-license)
|
|
@@ -169,7 +170,7 @@ Multi Scale Efficient Global Context Vision Transformer is an optimized multi-sc
|
|
|
169
170
|
|
|
170
171
|
|
|
171
172
|
<p align="center">
|
|
172
|
-
<img src="docs/architectures/ms_eff_gcvit.JPG" width="100%" height="700">
|
|
173
|
+
<img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/architectures/ms_eff_gcvit.JPG" width="100%" height="700">
|
|
173
174
|
</p>
|
|
174
175
|
|
|
175
176
|
We utilizes two distinct types of self-attention to capture both long-range and short-range information across feature maps.
|
|
@@ -180,7 +181,7 @@ We utilizes two distinct types of self-attention to capture both long-range and
|
|
|
180
181
|
|
|
181
182
|
|
|
182
183
|
<p align="center">
|
|
183
|
-
<img src=docs/architectures/window_attention.JPG width="100%" height="300">
|
|
184
|
+
<img src=https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/architectures/window_attention.JPG width="100%" height="300">
|
|
184
185
|
</p>
|
|
185
186
|
|
|
186
187
|
## 🧬 Model Zoo
|
|
@@ -359,7 +360,7 @@ Deepfake detection is only as trustworthy as its explanations. DeepGuard integra
|
|
|
359
360
|
### 🧠 How Dual-Branch XAI Works
|
|
360
361
|
|
|
361
362
|
<p align="center">
|
|
362
|
-
<img src="docs/architectures/dual_branch.gif" width="70%" height="300">
|
|
363
|
+
<img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/architectures/dual_branch.gif" width="70%" height="300">
|
|
363
364
|
</p>
|
|
364
365
|
|
|
365
366
|
|
|
@@ -413,7 +414,7 @@ explainer = EigenGradCAMExplainer(
|
|
|
413
414
|
### 🎨 Visualization Modes
|
|
414
415
|
|
|
415
416
|
<p align="center">
|
|
416
|
-
<img src="docs/xai-results/xai_demo.gif" width="80%" height=300>
|
|
417
|
+
<img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/xai_demo.gif" width="80%" height=300>
|
|
417
418
|
</p>
|
|
418
419
|
|
|
419
420
|
**1. Heatmap — Continuous activation distribution**
|
|
@@ -459,9 +460,9 @@ result = explainer.display_heatmap_bbox_on_image(
|
|
|
459
460
|
<p align="center">
|
|
460
461
|
<table>
|
|
461
462
|
<tr>
|
|
462
|
-
<td><img src="docs/architectures/low_branch.gif" width="100%"></td>
|
|
463
|
+
<td><img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/architectures/low_branch.gif" width="100%"></td>
|
|
463
464
|
<td width="20%"></td>
|
|
464
|
-
<td><img src="docs/architectures/high_branch.gif" width="100%"></td>
|
|
465
|
+
<td><img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/architectures/high_branch.gif" width="100%"></td>
|
|
465
466
|
</tr>
|
|
466
467
|
</table>
|
|
467
468
|
</p>
|
|
@@ -470,30 +471,42 @@ result = explainer.display_heatmap_bbox_on_image(
|
|
|
470
471
|
|
|
471
472
|
| Model | Branch-Level | Image | HiresCam | GradCamElementwise | LayerCam |
|
|
472
473
|
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
473
|
-
| **⚡ ms-eff-vit-b0** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b0_low_hirescam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b0_low_gradcamelementwise.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b0_low_layercam.JPG" width="100"> |
|
|
474
|
-
| **🔥 ms-eff-vit-b5** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b5_low_hirescam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b5_low_gradcamelementwise.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b5_low_layercam.JPG" width="100"> |
|
|
474
|
+
| **⚡ ms-eff-vit-b0** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b0_low_hirescam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b0_low_gradcamelementwise.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b0_low_layercam.JPG" width="100"> |
|
|
475
|
+
| **🔥 ms-eff-vit-b5** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b5_low_hirescam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b5_low_gradcamelementwise.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b5_low_layercam.JPG" width="100"> |
|
|
475
476
|
|
|
476
477
|
#### MS-Eff-ViT — High-Level Branch
|
|
477
478
|
|
|
478
479
|
| Model | Branch-Level | Image | EigenGradCam | GradCamPlusPlus | XGradCam |
|
|
479
480
|
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
480
|
-
| **⚡ ms-eff-vit-b0** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b0_high_eigengradcam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b0_high_gradcamplusplus.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b0_high_xgradcam.JPG" width="100"> |
|
|
481
|
-
| **🔥 ms-eff-vit-b5** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b5_high_eigengradcam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b5_high_gradcamplusplus.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b5_high_xgradcam.JPG" width="100"> |
|
|
481
|
+
| **⚡ ms-eff-vit-b0** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b0_high_eigengradcam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b0_high_gradcamplusplus.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b0_high_xgradcam.JPG" width="100"> |
|
|
482
|
+
| **🔥 ms-eff-vit-b5** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b5_high_eigengradcam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b5_high_gradcamplusplus.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b5_high_xgradcam.JPG" width="100"> |
|
|
482
483
|
|
|
483
484
|
#### MS-EFF-GCVIT — Low-Level Branch
|
|
484
485
|
|
|
485
486
|
| Model | Branch-Level | Image | HiresCam | GradCamElementwise | LayerCam |
|
|
486
487
|
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
487
|
-
| **⚡ ms-eff-gcvit-b0** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b0_low_hirescam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b0_low_gradcamelementwise.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b0_low_layercam.JPG" width="100"> |
|
|
488
|
-
| **🔥 ms-eff-gcvit-b5** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b5_low_hirescam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b5_low_gradcamelementwise.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b5_low_layercam.JPG" width="100"> |
|
|
488
|
+
| **⚡ ms-eff-gcvit-b0** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b0_low_hirescam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b0_low_gradcamelementwise.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b0_low_layercam.JPG" width="100"> |
|
|
489
|
+
| **🔥 ms-eff-gcvit-b5** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b5_low_hirescam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b5_low_gradcamelementwise.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b5_low_layercam.JPG" width="100"> |
|
|
489
490
|
|
|
490
491
|
#### MS-Eff-GCViT — High-Level Branch
|
|
491
492
|
|
|
492
493
|
| Model | Branch-Level | Image | EigenGradCam | GradCamPlusPlus | XGradCam |
|
|
493
494
|
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
494
|
-
| **⚡ ms-eff-gcvit-b0** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b0_high_eigengradcam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b0_high_gradcamplusplus.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b0_high_xgradcam.JPG" width="100"> |
|
|
495
|
-
| **🔥 ms-eff-gcvit-b5** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b5_high_eigengradcam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b5_high_gradcamplusplus.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b5_high_xgradcam.JPG" width="100"> |
|
|
495
|
+
| **⚡ ms-eff-gcvit-b0** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b0_high_eigengradcam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b0_high_gradcamplusplus.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b0_high_xgradcam.JPG" width="100"> |
|
|
496
|
+
| **🔥 ms-eff-gcvit-b5** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b5_high_eigengradcam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b5_high_gradcamplusplus.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b5_high_xgradcam.JPG" width="100"> |
|
|
496
497
|
|
|
498
|
+
## 📓 Tutorials
|
|
499
|
+
|
|
500
|
+
The jupyter notebooks themselves can be found under the tutorials folder in the git repository.
|
|
501
|
+
|
|
502
|
+
- [Notebook tutorial: Predict DeepFake Image with ImagePredictor](./tutorials/predict_image.ipynb)
|
|
503
|
+
- [Notebook tutorial: Predict DeepFake Video with VideoPredictor](./tutorials/predict_video.ipynb)
|
|
504
|
+
- [Notebook tutorial: Low-Level Branch XAI Visualization (HiResCAM, GradCAMElementWise, LayerCAM)](./tutorials/low_level_visualization.ipynb)
|
|
505
|
+
- [Notebook tutorial: High-Level Branch XAI Visualization (EigenGradCAM, GradCAM++, XGradCAM)](./tutorials/high_level_visualization.ipynb)
|
|
506
|
+
- [Notebook tutorial: MS-EffViT Low-Level Branch Explainability](./tutorials/ms_eff_vit_low_level.ipynb)
|
|
507
|
+
- [Notebook tutorial: MS-EffViT High-Level Branch Explainability](./tutorials/ms_eff_vit_high_level.ipynb)
|
|
508
|
+
- [Notebook tutorial: MS-EffGCViT Low-Level Branch Explainability](./tutorials/ms_eff_gcvit_low_level.ipynb)
|
|
509
|
+
- [Notebook tutorial: MS-EffGCViT High-Level Branch Explainability](./tutorials/ms_eff_gcvit_high_level.ipynb)
|
|
497
510
|
|
|
498
511
|
## 📬 Authors
|
|
499
512
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
</p>
|
|
12
12
|
|
|
13
13
|
<p align="center">
|
|
14
|
-
<img src="docs/samples/deepfake_thumbnails.png" alt="DeepGuard Banner" width="800" height="400">
|
|
14
|
+
<img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/deepfake_thumbnails.png" alt="DeepGuard Banner" width="800" height="400">
|
|
15
15
|
</p>
|
|
16
16
|
|
|
17
17
|
<p align="center">
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
- [💻 Model Usage](#-model-usage) - How to integrate DeepGuard models into your own Python code or via timm
|
|
49
49
|
- [🔮 Predict Image & Video](#-predict-image--video) - Simple Inference examples for detecting deepfakes in image and video
|
|
50
50
|
- [🎨 DeepFake AI Explainability](#-deepfake-ai-explainability) - Visualizing model focus using Grad-CAM and attention maps
|
|
51
|
+
- [📓 Tutorials](#-tutorials) - Hands-on Colab notebooks for inference and dual-branch XAI visualization
|
|
51
52
|
- [📬 Authors](#-authors)
|
|
52
53
|
- [📝 Reference](#-reference)
|
|
53
54
|
- [⚖️ License](#-license)
|
|
@@ -143,7 +144,7 @@ Multi Scale Efficient Global Context Vision Transformer is an optimized multi-sc
|
|
|
143
144
|
|
|
144
145
|
|
|
145
146
|
<p align="center">
|
|
146
|
-
<img src="docs/architectures/ms_eff_gcvit.JPG" width="100%" height="700">
|
|
147
|
+
<img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/architectures/ms_eff_gcvit.JPG" width="100%" height="700">
|
|
147
148
|
</p>
|
|
148
149
|
|
|
149
150
|
We utilizes two distinct types of self-attention to capture both long-range and short-range information across feature maps.
|
|
@@ -154,7 +155,7 @@ We utilizes two distinct types of self-attention to capture both long-range and
|
|
|
154
155
|
|
|
155
156
|
|
|
156
157
|
<p align="center">
|
|
157
|
-
<img src=docs/architectures/window_attention.JPG width="100%" height="300">
|
|
158
|
+
<img src=https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/architectures/window_attention.JPG width="100%" height="300">
|
|
158
159
|
</p>
|
|
159
160
|
|
|
160
161
|
## 🧬 Model Zoo
|
|
@@ -333,7 +334,7 @@ Deepfake detection is only as trustworthy as its explanations. DeepGuard integra
|
|
|
333
334
|
### 🧠 How Dual-Branch XAI Works
|
|
334
335
|
|
|
335
336
|
<p align="center">
|
|
336
|
-
<img src="docs/architectures/dual_branch.gif" width="70%" height="300">
|
|
337
|
+
<img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/architectures/dual_branch.gif" width="70%" height="300">
|
|
337
338
|
</p>
|
|
338
339
|
|
|
339
340
|
|
|
@@ -387,7 +388,7 @@ explainer = EigenGradCAMExplainer(
|
|
|
387
388
|
### 🎨 Visualization Modes
|
|
388
389
|
|
|
389
390
|
<p align="center">
|
|
390
|
-
<img src="docs/xai-results/xai_demo.gif" width="80%" height=300>
|
|
391
|
+
<img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/xai_demo.gif" width="80%" height=300>
|
|
391
392
|
</p>
|
|
392
393
|
|
|
393
394
|
**1. Heatmap — Continuous activation distribution**
|
|
@@ -433,9 +434,9 @@ result = explainer.display_heatmap_bbox_on_image(
|
|
|
433
434
|
<p align="center">
|
|
434
435
|
<table>
|
|
435
436
|
<tr>
|
|
436
|
-
<td><img src="docs/architectures/low_branch.gif" width="100%"></td>
|
|
437
|
+
<td><img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/architectures/low_branch.gif" width="100%"></td>
|
|
437
438
|
<td width="20%"></td>
|
|
438
|
-
<td><img src="docs/architectures/high_branch.gif" width="100%"></td>
|
|
439
|
+
<td><img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/architectures/high_branch.gif" width="100%"></td>
|
|
439
440
|
</tr>
|
|
440
441
|
</table>
|
|
441
442
|
</p>
|
|
@@ -444,30 +445,42 @@ result = explainer.display_heatmap_bbox_on_image(
|
|
|
444
445
|
|
|
445
446
|
| Model | Branch-Level | Image | HiresCam | GradCamElementwise | LayerCam |
|
|
446
447
|
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
447
|
-
| **⚡ ms-eff-vit-b0** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b0_low_hirescam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b0_low_gradcamelementwise.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b0_low_layercam.JPG" width="100"> |
|
|
448
|
-
| **🔥 ms-eff-vit-b5** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b5_low_hirescam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b5_low_gradcamelementwise.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b5_low_layercam.JPG" width="100"> |
|
|
448
|
+
| **⚡ ms-eff-vit-b0** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b0_low_hirescam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b0_low_gradcamelementwise.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b0_low_layercam.JPG" width="100"> |
|
|
449
|
+
| **🔥 ms-eff-vit-b5** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b5_low_hirescam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b5_low_gradcamelementwise.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b5_low_layercam.JPG" width="100"> |
|
|
449
450
|
|
|
450
451
|
#### MS-Eff-ViT — High-Level Branch
|
|
451
452
|
|
|
452
453
|
| Model | Branch-Level | Image | EigenGradCam | GradCamPlusPlus | XGradCam |
|
|
453
454
|
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
454
|
-
| **⚡ ms-eff-vit-b0** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b0_high_eigengradcam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b0_high_gradcamplusplus.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b0_high_xgradcam.JPG" width="100"> |
|
|
455
|
-
| **🔥 ms-eff-vit-b5** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b5_high_eigengradcam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b5_high_gradcamplusplus.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b5_high_xgradcam.JPG" width="100"> |
|
|
455
|
+
| **⚡ ms-eff-vit-b0** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b0_high_eigengradcam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b0_high_gradcamplusplus.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b0_high_xgradcam.JPG" width="100"> |
|
|
456
|
+
| **🔥 ms-eff-vit-b5** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b5_high_eigengradcam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b5_high_gradcamplusplus.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b5_high_xgradcam.JPG" width="100"> |
|
|
456
457
|
|
|
457
458
|
#### MS-EFF-GCVIT — Low-Level Branch
|
|
458
459
|
|
|
459
460
|
| Model | Branch-Level | Image | HiresCam | GradCamElementwise | LayerCam |
|
|
460
461
|
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
461
|
-
| **⚡ ms-eff-gcvit-b0** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b0_low_hirescam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b0_low_gradcamelementwise.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b0_low_layercam.JPG" width="100"> |
|
|
462
|
-
| **🔥 ms-eff-gcvit-b5** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b5_low_hirescam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b5_low_gradcamelementwise.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b5_low_layercam.JPG" width="100"> |
|
|
462
|
+
| **⚡ ms-eff-gcvit-b0** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b0_low_hirescam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b0_low_gradcamelementwise.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b0_low_layercam.JPG" width="100"> |
|
|
463
|
+
| **🔥 ms-eff-gcvit-b5** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b5_low_hirescam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b5_low_gradcamelementwise.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b5_low_layercam.JPG" width="100"> |
|
|
463
464
|
|
|
464
465
|
#### MS-Eff-GCViT — High-Level Branch
|
|
465
466
|
|
|
466
467
|
| Model | Branch-Level | Image | EigenGradCam | GradCamPlusPlus | XGradCam |
|
|
467
468
|
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
468
|
-
| **⚡ ms-eff-gcvit-b0** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b0_high_eigengradcam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b0_high_gradcamplusplus.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b0_high_xgradcam.JPG" width="100"> |
|
|
469
|
-
| **🔥 ms-eff-gcvit-b5** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b5_high_eigengradcam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b5_high_gradcamplusplus.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b5_high_xgradcam.JPG" width="100"> |
|
|
469
|
+
| **⚡ ms-eff-gcvit-b0** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b0_high_eigengradcam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b0_high_gradcamplusplus.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b0_high_xgradcam.JPG" width="100"> |
|
|
470
|
+
| **🔥 ms-eff-gcvit-b5** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b5_high_eigengradcam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b5_high_gradcamplusplus.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b5_high_xgradcam.JPG" width="100"> |
|
|
470
471
|
|
|
472
|
+
## 📓 Tutorials
|
|
473
|
+
|
|
474
|
+
The jupyter notebooks themselves can be found under the tutorials folder in the git repository.
|
|
475
|
+
|
|
476
|
+
- [Notebook tutorial: Predict DeepFake Image with ImagePredictor](./tutorials/predict_image.ipynb)
|
|
477
|
+
- [Notebook tutorial: Predict DeepFake Video with VideoPredictor](./tutorials/predict_video.ipynb)
|
|
478
|
+
- [Notebook tutorial: Low-Level Branch XAI Visualization (HiResCAM, GradCAMElementWise, LayerCAM)](./tutorials/low_level_visualization.ipynb)
|
|
479
|
+
- [Notebook tutorial: High-Level Branch XAI Visualization (EigenGradCAM, GradCAM++, XGradCAM)](./tutorials/high_level_visualization.ipynb)
|
|
480
|
+
- [Notebook tutorial: MS-EffViT Low-Level Branch Explainability](./tutorials/ms_eff_vit_low_level.ipynb)
|
|
481
|
+
- [Notebook tutorial: MS-EffViT High-Level Branch Explainability](./tutorials/ms_eff_vit_high_level.ipynb)
|
|
482
|
+
- [Notebook tutorial: MS-EffGCViT Low-Level Branch Explainability](./tutorials/ms_eff_gcvit_low_level.ipynb)
|
|
483
|
+
- [Notebook tutorial: MS-EffGCViT High-Level Branch Explainability](./tutorials/ms_eff_gcvit_high_level.ipynb)
|
|
471
484
|
|
|
472
485
|
## 📬 Authors
|
|
473
486
|
|
|
@@ -492,4 +505,4 @@ _**This project was developed as a Senior Graduation Project by the Department o
|
|
|
492
505
|
|
|
493
506
|
## ⚖️ License
|
|
494
507
|
|
|
495
|
-
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.2.
|
|
3
|
+
Version: 0.2.4
|
|
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
|
|
@@ -37,7 +37,7 @@ Dynamic: license-file
|
|
|
37
37
|
</p>
|
|
38
38
|
|
|
39
39
|
<p align="center">
|
|
40
|
-
<img src="docs/samples/deepfake_thumbnails.png" alt="DeepGuard Banner" width="800" height="400">
|
|
40
|
+
<img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/deepfake_thumbnails.png" alt="DeepGuard Banner" width="800" height="400">
|
|
41
41
|
</p>
|
|
42
42
|
|
|
43
43
|
<p align="center">
|
|
@@ -74,6 +74,7 @@ Dynamic: license-file
|
|
|
74
74
|
- [💻 Model Usage](#-model-usage) - How to integrate DeepGuard models into your own Python code or via timm
|
|
75
75
|
- [🔮 Predict Image & Video](#-predict-image--video) - Simple Inference examples for detecting deepfakes in image and video
|
|
76
76
|
- [🎨 DeepFake AI Explainability](#-deepfake-ai-explainability) - Visualizing model focus using Grad-CAM and attention maps
|
|
77
|
+
- [📓 Tutorials](#-tutorials) - Hands-on Colab notebooks for inference and dual-branch XAI visualization
|
|
77
78
|
- [📬 Authors](#-authors)
|
|
78
79
|
- [📝 Reference](#-reference)
|
|
79
80
|
- [⚖️ License](#-license)
|
|
@@ -169,7 +170,7 @@ Multi Scale Efficient Global Context Vision Transformer is an optimized multi-sc
|
|
|
169
170
|
|
|
170
171
|
|
|
171
172
|
<p align="center">
|
|
172
|
-
<img src="docs/architectures/ms_eff_gcvit.JPG" width="100%" height="700">
|
|
173
|
+
<img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/architectures/ms_eff_gcvit.JPG" width="100%" height="700">
|
|
173
174
|
</p>
|
|
174
175
|
|
|
175
176
|
We utilizes two distinct types of self-attention to capture both long-range and short-range information across feature maps.
|
|
@@ -180,7 +181,7 @@ We utilizes two distinct types of self-attention to capture both long-range and
|
|
|
180
181
|
|
|
181
182
|
|
|
182
183
|
<p align="center">
|
|
183
|
-
<img src=docs/architectures/window_attention.JPG width="100%" height="300">
|
|
184
|
+
<img src=https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/architectures/window_attention.JPG width="100%" height="300">
|
|
184
185
|
</p>
|
|
185
186
|
|
|
186
187
|
## 🧬 Model Zoo
|
|
@@ -359,7 +360,7 @@ Deepfake detection is only as trustworthy as its explanations. DeepGuard integra
|
|
|
359
360
|
### 🧠 How Dual-Branch XAI Works
|
|
360
361
|
|
|
361
362
|
<p align="center">
|
|
362
|
-
<img src="docs/architectures/dual_branch.gif" width="70%" height="300">
|
|
363
|
+
<img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/architectures/dual_branch.gif" width="70%" height="300">
|
|
363
364
|
</p>
|
|
364
365
|
|
|
365
366
|
|
|
@@ -413,7 +414,7 @@ explainer = EigenGradCAMExplainer(
|
|
|
413
414
|
### 🎨 Visualization Modes
|
|
414
415
|
|
|
415
416
|
<p align="center">
|
|
416
|
-
<img src="docs/xai-results/xai_demo.gif" width="80%" height=300>
|
|
417
|
+
<img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/xai_demo.gif" width="80%" height=300>
|
|
417
418
|
</p>
|
|
418
419
|
|
|
419
420
|
**1. Heatmap — Continuous activation distribution**
|
|
@@ -459,9 +460,9 @@ result = explainer.display_heatmap_bbox_on_image(
|
|
|
459
460
|
<p align="center">
|
|
460
461
|
<table>
|
|
461
462
|
<tr>
|
|
462
|
-
<td><img src="docs/architectures/low_branch.gif" width="100%"></td>
|
|
463
|
+
<td><img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/architectures/low_branch.gif" width="100%"></td>
|
|
463
464
|
<td width="20%"></td>
|
|
464
|
-
<td><img src="docs/architectures/high_branch.gif" width="100%"></td>
|
|
465
|
+
<td><img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/architectures/high_branch.gif" width="100%"></td>
|
|
465
466
|
</tr>
|
|
466
467
|
</table>
|
|
467
468
|
</p>
|
|
@@ -470,30 +471,42 @@ result = explainer.display_heatmap_bbox_on_image(
|
|
|
470
471
|
|
|
471
472
|
| Model | Branch-Level | Image | HiresCam | GradCamElementwise | LayerCam |
|
|
472
473
|
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
473
|
-
| **⚡ ms-eff-vit-b0** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b0_low_hirescam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b0_low_gradcamelementwise.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b0_low_layercam.JPG" width="100"> |
|
|
474
|
-
| **🔥 ms-eff-vit-b5** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b5_low_hirescam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b5_low_gradcamelementwise.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b5_low_layercam.JPG" width="100"> |
|
|
474
|
+
| **⚡ ms-eff-vit-b0** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b0_low_hirescam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b0_low_gradcamelementwise.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b0_low_layercam.JPG" width="100"> |
|
|
475
|
+
| **🔥 ms-eff-vit-b5** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b5_low_hirescam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b5_low_gradcamelementwise.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b5_low_layercam.JPG" width="100"> |
|
|
475
476
|
|
|
476
477
|
#### MS-Eff-ViT — High-Level Branch
|
|
477
478
|
|
|
478
479
|
| Model | Branch-Level | Image | EigenGradCam | GradCamPlusPlus | XGradCam |
|
|
479
480
|
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
480
|
-
| **⚡ ms-eff-vit-b0** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b0_high_eigengradcam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b0_high_gradcamplusplus.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b0_high_xgradcam.JPG" width="100"> |
|
|
481
|
-
| **🔥 ms-eff-vit-b5** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b5_high_eigengradcam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b5_high_gradcamplusplus.JPG" width="100"> | <img src="docs/xai-results/ms_eff_vit_b5_high_xgradcam.JPG" width="100"> |
|
|
481
|
+
| **⚡ ms-eff-vit-b0** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b0_high_eigengradcam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b0_high_gradcamplusplus.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b0_high_xgradcam.JPG" width="100"> |
|
|
482
|
+
| **🔥 ms-eff-vit-b5** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b5_high_eigengradcam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b5_high_gradcamplusplus.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_vit_b5_high_xgradcam.JPG" width="100"> |
|
|
482
483
|
|
|
483
484
|
#### MS-EFF-GCVIT — Low-Level Branch
|
|
484
485
|
|
|
485
486
|
| Model | Branch-Level | Image | HiresCam | GradCamElementwise | LayerCam |
|
|
486
487
|
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
487
|
-
| **⚡ ms-eff-gcvit-b0** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b0_low_hirescam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b0_low_gradcamelementwise.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b0_low_layercam.JPG" width="100"> |
|
|
488
|
-
| **🔥 ms-eff-gcvit-b5** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b5_low_hirescam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b5_low_gradcamelementwise.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b5_low_layercam.JPG" width="100"> |
|
|
488
|
+
| **⚡ ms-eff-gcvit-b0** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b0_low_hirescam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b0_low_gradcamelementwise.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b0_low_layercam.JPG" width="100"> |
|
|
489
|
+
| **🔥 ms-eff-gcvit-b5** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b5_low_hirescam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b5_low_gradcamelementwise.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b5_low_layercam.JPG" width="100"> |
|
|
489
490
|
|
|
490
491
|
#### MS-Eff-GCViT — High-Level Branch
|
|
491
492
|
|
|
492
493
|
| Model | Branch-Level | Image | EigenGradCam | GradCamPlusPlus | XGradCam |
|
|
493
494
|
| :--- | :---: | :---: | :---: | :---: | :---: |
|
|
494
|
-
| **⚡ ms-eff-gcvit-b0** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b0_high_eigengradcam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b0_high_gradcamplusplus.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b0_high_xgradcam.JPG" width="100"> |
|
|
495
|
-
| **🔥 ms-eff-gcvit-b5** |  | <img src="docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b5_high_eigengradcam.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b5_high_gradcamplusplus.JPG" width="100"> | <img src="docs/xai-results/ms_eff_gcvit_b5_high_xgradcam.JPG" width="100"> |
|
|
495
|
+
| **⚡ ms-eff-gcvit-b0** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b0_high_eigengradcam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b0_high_gradcamplusplus.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b0_high_xgradcam.JPG" width="100"> |
|
|
496
|
+
| **🔥 ms-eff-gcvit-b5** |  | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/samples/images/western/western_fake_1.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b5_high_eigengradcam.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b5_high_gradcamplusplus.JPG" width="100"> | <img src="https://raw.githubusercontent.com/HanMoonSub/DeepGuard/main/docs/xai-results/ms_eff_gcvit_b5_high_xgradcam.JPG" width="100"> |
|
|
496
497
|
|
|
498
|
+
## 📓 Tutorials
|
|
499
|
+
|
|
500
|
+
The jupyter notebooks themselves can be found under the tutorials folder in the git repository.
|
|
501
|
+
|
|
502
|
+
- [Notebook tutorial: Predict DeepFake Image with ImagePredictor](./tutorials/predict_image.ipynb)
|
|
503
|
+
- [Notebook tutorial: Predict DeepFake Video with VideoPredictor](./tutorials/predict_video.ipynb)
|
|
504
|
+
- [Notebook tutorial: Low-Level Branch XAI Visualization (HiResCAM, GradCAMElementWise, LayerCAM)](./tutorials/low_level_visualization.ipynb)
|
|
505
|
+
- [Notebook tutorial: High-Level Branch XAI Visualization (EigenGradCAM, GradCAM++, XGradCAM)](./tutorials/high_level_visualization.ipynb)
|
|
506
|
+
- [Notebook tutorial: MS-EffViT Low-Level Branch Explainability](./tutorials/ms_eff_vit_low_level.ipynb)
|
|
507
|
+
- [Notebook tutorial: MS-EffViT High-Level Branch Explainability](./tutorials/ms_eff_vit_high_level.ipynb)
|
|
508
|
+
- [Notebook tutorial: MS-EffGCViT Low-Level Branch Explainability](./tutorials/ms_eff_gcvit_low_level.ipynb)
|
|
509
|
+
- [Notebook tutorial: MS-EffGCViT High-Level Branch Explainability](./tutorials/ms_eff_gcvit_high_level.ipynb)
|
|
497
510
|
|
|
498
511
|
## 📬 Authors
|
|
499
512
|
|
|
@@ -65,6 +65,7 @@ preprocess/__init__.py
|
|
|
65
65
|
preprocess/face_detector.py
|
|
66
66
|
preprocess/frame_extractor.py
|
|
67
67
|
preprocess/landmark_detector.py
|
|
68
|
+
preprocess/yolov8n-face.pt
|
|
68
69
|
preprocess/celeb_df_v2/__init__.py
|
|
69
70
|
preprocess/celeb_df_v2/crop_face.py
|
|
70
71
|
preprocess/celeb_df_v2/detect_original_face.py
|
|
Binary file
|
|
@@ -8,7 +8,7 @@ build-backend = "setuptools.build_meta"
|
|
|
8
8
|
# ─────────────────────────────────────────────
|
|
9
9
|
[project]
|
|
10
10
|
name = "deepguard" # pip install deepguard 할 때 이 이름
|
|
11
|
-
version = "0.2.
|
|
11
|
+
version = "0.2.4" # pip install deepguard==0.2.3 으로 버전 고정 가능
|
|
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 자체를 막음
|
|
@@ -40,5 +40,9 @@ include = [
|
|
|
40
40
|
"deepguard*", # 모델, 레이어, 데이터셋 등 핵심 패키지
|
|
41
41
|
"inference*", # ImagePredictor, VideoPredictor
|
|
42
42
|
"explainability*", # CAM 기반 XAI
|
|
43
|
+
"preprocess*" # 얼굴 검출, 프레임 추출 등
|
|
43
44
|
]
|
|
44
|
-
exclude = ["App*", "client*"
|
|
45
|
+
exclude = ["App*", "client*"]
|
|
46
|
+
|
|
47
|
+
[tool.setuptools.package-data]
|
|
48
|
+
"preprocess" = ["*.pt"]
|
|
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
|