at0m-b0mb/DeepSentinel

GitHub: at0m-b0mb/DeepSentinel

一个基于多方法取证分析与深度学习的 deepfake 检测及教育平台,支持实时摄像头和静态媒体的伪造识别。

Stars: 0 | Forks: 0

DeepSentinel Banner

[![Python](https://img.shields.io/badge/Python-3.11%2B-3776AB?style=for-the-badge&logo=python&logoColor=white)](https://python.org) [![PyQt6](https://img.shields.io/badge/PyQt6-6.6%2B-41CD52?style=for-the-badge&logo=qt&logoColor=white)](https://riverbankcomputing.com/software/pyqt/) [![OpenCV](https://img.shields.io/badge/OpenCV-4.8%2B-5C3EE8?style=for-the-badge&logo=opencv&logoColor=white)](https://opencv.org) [![License](https://img.shields.io/badge/License-MIT-a855f7?style=for-the-badge)](LICENSE) [![Platform](https://img.shields.io/badge/Platform-macOS%20%7C%20Linux%20%7C%20Windows-00d4ff?style=for-the-badge&logo=apple&logoColor=white)](#installation)
[![Educational Only](https://img.shields.io/badge/⚠%20Purpose-Educational%20%26%20Research%20Only-f59e0b?style=flat-square)](https://github.com/at0m-b0mb/DeepSentinel#ethics--legal) [![Stars](https://img.shields.io/github/stars/at0m-b0mb/DeepSentinel?style=flat-square&color=00d4ff)](https://github.com/at0m-b0mb/DeepSentinel/stargazers) [![Issues](https://img.shields.io/github/issues/at0m-b0mb/DeepSentinel?style=flat-square&color=a855f7)](https://github.com/at0m-b0mb/DeepSentinel/issues) [![Last Commit](https://img.shields.io/github/last-commit/at0m-b0mb/DeepSentinel?style=flat-square&color=10b981)](https://github.com/at0m-b0mb/DeepSentinel/commits/main)
**DeepSentinel** 是一个由 AI 驱动的 deepfake 检测和教育平台。
通过多方法取证分析,实时分析网络摄像头视频流和媒体文件——
并准确了解 deepfake 的底层工作原理。 [**入门指南**](#installation) · [**截图**](#-screenshots) · [**功能**](#-features) · [**工作原理**](#-detection-methods) · [**伦理**](#-ethics--legal)
## 📸 截图
Dashboard
◈ Session Dashboard — Live stats, analysis history & quick actions
Live Detection
🎥 Live Detection — Real-time webcam analysis with animated arc gauge
Analyze Media
🔍 Analyze Media — Drag-and-drop forensics with EXIF & visualization strip
Education
📚 How It Works — Interactive education with the original algorithm
Settings
⚙ Settings — Configure methods, thresholds, MesoNet weights & camera
## ✨ 功能

🎥 实时网络摄像头检测

  • 对网络摄像头视频流进行实时人脸检测
  • 带有流畅动画的动态 弧形置信度仪表盘
  • 滚动的 实时置信度历史图表
  • 逐帧更新的各方法得分细分
  • 截图 → 分析:定格任意帧进行全面的取证分析
  • FPS 计数器、保存帧按钮、启动/停止开关

🔍 静态媒体分析

  • 拖拽或浏览 图片与视频
  • 带有进度追踪的完整多方法 pipeline
  • 取证 可视化条:FFT 频谱、ELA 映射、噪声热图
  • 带有 AI 软件标志检测的 EXIF 元数据面板
  • 视频:抽取 20 帧,计算平均值与峰值权重得分
  • 可导出包含所有得分与解析的 文本报告

◈ 会话面板

  • 实时统计:已分析文件数、Deepfake、可疑、真实
  • 带有历史日志的会话计时器
  • 近期分析:时间戳、文件名、检测结论、得分
  • 用于在选项卡之间切换的快捷操作按钮
  • 系统信息:OpenCV、PyTorch、MPS/CUDA 状态

📚 教育选项卡

  • 什么是 deepfake?—— 历史与威胁模型
  • 2018 年原版算法,附带简化的 PyTorch 代码
  • 现代方法:GAN、diffusion、实时工具
  • 检测科学:每种方法的原理
  • 法律与伦理背景、立法、资源
## 🧠 检测方法 | 方法 | 类型 | 实时 | 静态 | 备注 | |--------|------|:----:|:------:|-------| | **FFT 频率分析** | 信号 / 取证 | ✓ | ✓ | 检查 2D 频谱中 GAN 上采样的棋盘伪影 | | **误差级别分析 (ELA)** | 信号 / 取证 | — | ✓ | 检测篡改边界处的 JPEG 重复压缩不匹配 | | **人脸几何** | 生物特征 | ✓ | ✓ | Haar 级联 + 眼睛位置与人体测量分布的对比 | | **SRM 噪声分析** | 信号 / 取证 | ✓ | ✓ | 传感器噪声统计;标记过度平滑或周期性残留 | | **MesoNet (NN)** | 神经网络 | ✓ | ✓ | Afchar 等人 2018 年提出的 156K 参数 CNN — 可选,需要 PyTorch | ## 🏗 架构 ``` Input (frame / image / video) │ ├──▶ FFT Analysis ── kurtosis + grid-periodicity score ├──▶ ELA Forensics ── JPEG re-compression mismatch score ├──▶ Face Geometry ── boundary artifact + eye-placement score ├──▶ SRM Noise ── residual kurtosis + periodicity score └──▶ MesoNet (opt.) ── CNN classification probability │ ▼ Weighted Ensemble │ ┌──────────────────────────────┐ │ score < 0.40 → REAL │ │ 0.40 – 0.65 → SUSPICIOUS │ │ score > 0.65 → DEEPFAKE │ └──────────────────────────────┘ ``` ## 📁 项目结构 ``` DeepSentinel/ ├── main.py # Entry point ├── requirements.txt │ ├── src/ │ ├── detection/ │ │ ├── detector.py # Orchestrator — ensembles all method scores │ │ ├── frequency_analysis.py # FFT artifact + ELA forensics │ │ ├── face_analyzer.py # Haar cascade + geometry + boundary checks │ │ ├── noise_analyzer.py # SRM high-pass noise residual analysis │ │ ├── mesonet.py # MesoNet Meso4 (PyTorch, optional) │ │ └── metadata.py # EXIF extraction + AI-software flag detection │ │ │ ├── education/ │ │ └── pipeline.py # HTML content for the How It Works tab │ │ │ └── gui/ │ ├── theme.py # Dark cyberpunk QSS stylesheet + palette │ ├── widgets.py # ConfidenceDial · HistoryGraph · GlowScoreBar │ │ # StatCard · PulsingDot · HistoryRow │ ├── main_window.py # Animated HexLogo · HeaderWidget · tab host │ ├── dashboard_tab.py # Session stats + history + quick actions │ ├── live_tab.py # Webcam feed + CameraWorker QThread │ ├── analyze_tab.py # Static analysis + EXIF + forensic viz strip │ ├── education_tab.py # Sidebar nav + rich-HTML content + code panel │ └── settings_tab.py # Method toggles · thresholds · MesoNet loader │ └── assets/ ├── banner.png # 1280×640 hero banner ├── logo.png # 500×500 square icon └── screenshots/ # Tab screenshots for README ``` ## 🚀 安装说明 ### 前置条件 - Python **3.11+** - macOS · Linux · Windows ### 克隆并安装 ``` git clone https://github.com/at0m-b0mb/DeepSentinel.git cd DeepSentinel pip install -r requirements.txt ``` ### 运行 ``` python main.py ``` ### 可选 — MesoNet 神经网络 ``` # 安装 PyTorch (Apple Silicon / MPS) pip install torch torchvision # 安装 PyTorch (CUDA GPU) pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121 # 下载预训练的 Meso4 weights: # https://github.com/DariusAf/MesoNet # 然后通过以下方式加载:Settings → MesoNet → Browse ``` ## ⚖ 伦理与法律 在以下规定中,未经同意制作 deepfake 是**违法的**: | 司法管辖区 | 法律法规 | |---|---| | 🇬🇧 英国 | 《2023年在线安全法》—— 最高可判处 2 年监禁 | | 🇺🇸 美国 | 《2024年DEFIANCE法案》—— 联邦民事索赔;州刑事法规 | | 🇪🇺 欧盟 | 《2024年人工智能法案》—— 强制添加水印,巨额罚款 | | 🇨🇳 中国 | 《2022年合成内容规定》—— 强制标识 + 同意 | **合法使用场景:** 安全研发 · 新闻事实核查 · 数字取证 · 学术研究 · 媒体素养教育 使用 DeepSentinel 即表示您确认您将基于合法研究或防御性安全目的,遵守道德和法律规范行事。 ## 📖 参考文献 - Afchar 等人 (2018) — *MesoNet: a Compact Facial Video Forgery Detection Network* · [arXiv:1809.00888](https://arxiv.org/abs/1809.00888) - Rössler 等人 (2019) — *FaceForensics++: Learning to Detect Manipulated Facial Images* · [arXiv:1901.08971](https://arxiv.org/abs/1901.08971) - Fridrich & Kodovský (2012) — *Rich Models for Steganalysis of Digital Images* - Li 等人 (2020) — *SimSwap: An Efficient Framework For High Fidelity Face Swapping* - Güera & Delp (2018) — *Deepfake Video Detection Using Recurrent Neural Networks*
DeepSentinel Logo
由 **[at0m-b0mb](https://github.com/at0m-b0mb)** 制作
*"看透合成。"*
标签:AI, OpenCV, PyQt6, 凭据扫描, 数字取证, 深度伪造检测, 自动化代码审查, 自动化脚本, 计算机视觉, 逆向工具