Deepfake Authenticator commited on
Commit Β·
f5a4957
1
Parent(s): 60842c5
fix: Lower threshold by 0.10 when temporal detects high-confidence artifacts
Browse files- backend/detector.py +11 -1
backend/detector.py
CHANGED
|
@@ -881,7 +881,17 @@ class ReportGeneratorAgent:
|
|
| 881 |
|
| 882 |
# ββ Adaptive threshold ββββββββββββββββββββββββββββββββββββββββββββ
|
| 883 |
threshold = self.BASE_THRESHOLD
|
| 884 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 885 |
threshold -= 0.06
|
| 886 |
elif consistency >= 0.55:
|
| 887 |
threshold -= 0.03
|
|
|
|
| 881 |
|
| 882 |
# ββ Adaptive threshold ββββββββββββββββββββββββββββββββββββββββββββ
|
| 883 |
threshold = self.BASE_THRESHOLD
|
| 884 |
+
|
| 885 |
+
# Check if temporal analysis detected strong artifacts
|
| 886 |
+
temporal = analysis.get("temporal_analysis", {})
|
| 887 |
+
temporal_score = temporal.get("temporal_fake_score", 0.5)
|
| 888 |
+
temporal_conf = temporal.get("confidence", 0.0)
|
| 889 |
+
|
| 890 |
+
# If temporal detected strong artifacts, lower threshold
|
| 891 |
+
if temporal_score > 0.65 and temporal_conf > 0.85:
|
| 892 |
+
threshold -= 0.10 # Lower threshold when temporal is confident
|
| 893 |
+
logger.info(f"Strong temporal artifacts detected β threshold lowered to {threshold:.3f}")
|
| 894 |
+
elif consistency >= 0.70 and coverage >= 0.50:
|
| 895 |
threshold -= 0.06
|
| 896 |
elif consistency >= 0.55:
|
| 897 |
threshold -= 0.03
|