AI Image De-Fingerprinting Skill
Comprehensive CLI for removing AI detection patterns from AI-generated images. Transforms detectable AI images into human-camera-like photographs using multiple processing techniques.
Supported Models: Midjourney, DALL-E 3, Stable Diffusion, Flux, Firefly, Leonardo, and more.
Quick Start
CODEBLOCK0
How It Works
AI-generated images contain multiple detection layers:
Detection Vectors
1. Metadata : EXIF tags revealing generation tool, C2PA watermarks Frequency Domain : DCT coefficient patterns unique to diffusion modelsPixel Patterns : Over-smoothness, unnatural noise distributionVisual Features : Perfect lighting, repetitive textures
Processing Pipeline
Our de-fingerprinting pipeline applies 7 transformation stages :
CODEBLOCK1
Stage Details
Stage Purpose Technique Metadata Strip Remove EXIF/C2PA/JUMBF tags ExifTool Grain Addition
Add camera sensor noise | Poisson/Gaussian noise overlay |
|
Color Adjustment | Break color distribution patterns | Contrast/saturation/brightness tweak |
|
Blur/Sharpen | Disrupt edge detection patterns | Gaussian blur + unsharp mask |
|
Resize Cycle | Introduce resampling artifacts | Downscale → upscale with Lanczos |
|
JPEG Recompress | Add compression artifacts | Quality 75 → 95 cycle |
|
Final Clean | Ensure no metadata leakage | ExifTool re-run |
Processing Strength
Choose strength based on detection risk vs quality tradeoff:
Strength Description Success Rate Quality Loss INLINECODE0 Minimal processing, preserve quality 35-45% Very low INLINECODE1
Balanced (default) | 50-65% | Low |
|
heavy | Aggressive processing | 65-80% | Medium |
Success rate = percentage of images passing common AI detectors (Hive, Illuminarty, AI or Not)
Usage Examples
Single Image Processing
CODEBLOCK2
Batch Processing
CODEBLOCK3
Metadata-Only Mode
CODEBLOCK4
Using Bash Version
CODEBLOCK5
Dependencies
Required
- ImageMagick (7.0+) — Image processing engine ExifTool — Metadata manipulationPython 3.7+ (for deai.py)Pillow (Python imaging library)NumPy (for deai.py)
Check Installation
CODEBLOCK6
This will verify all dependencies and provide installation commands if missing.
Manual Installation
Debian/Ubuntu:
CODEBLOCK7
macOS:
CODEBLOCK8
Fedora/RHEL:
sudo dnf install -y ImageMagick perl-Image-ExifTool python3-pip
pip3 install Pillow numpy
Command Reference
deai.py (Python Version)
CODEBLOCK10
deai.sh (Bash Version)
CODEBLOCK11
Understanding Detection
Common AI Detectors
Detector Method Bypass Rate Hive Moderation Deep learning model 50-70% (medium) Illuminarty
Computer vision analysis | 60-75% (medium) |
|
AI or Not | Binary classification | 55-70% (medium) |
|
SynthID | Pixel-level watermark | 35-50% (heavy) |
|
C2PA Verify | Metadata check | 100% (metadata strip) |
What This Skill Cannot Do
❌ Not a Silver Bullet:
- Cannot guarantee 100% bypass of all detectors Advanced detectors (SynthID) require more aggressive processing New detection methods may emerge
❌ Limitations:
- Processing reduces image quality (tradeoff necessary) Some detectors use multiple layers (metadata + pixel + frequency) Extremely aggressive processing may introduce visible artifacts
✅ What It DOES Do:
- Significantly reduces detection probability (40-80%) Removes metadata watermarks (100% effective) Maintains reasonable visual quality Batch processes entire collections
Verification Workflow
1. Process Image:
CODEBLOCK12
2. Test on Multiple Detectors:
-
Hive Moderation
-
Illuminarty
-
AI or Not
3. If Still Detected:
- Increase strength:
--strength heavy
- Try multiple passes
- Manual touch-ups (add slight noise in photo editor)
4. Quality Check:
- Compare original vs processed
- Ensure no visible artifacts
- Verify colors/details preserved
Advanced Usage
Custom Processing Pipeline
Edit scripts/deai.py to adjust parameters:
CODEBLOCK13
Combining with External Tools
CODEBLOCK14
Best Practices
For Social Media
- Use medium strength (good balance) Output as JPEG (universal compatibility) Test on platform's upload flow before posting
For Professional Use
- Start with light (preserve quality) Manual review each output Keep originals in secure storage Document processing steps
For Research/Testing
- Use heavy for stress testing Compare multiple detectors Document success/failure patterns
Legal & Ethical Notice
⚠️ Use Responsibly:
This tool is intended for:
- ✅ Personal creative projects ✅ Academic research on AI detection ✅ Security testing (authorized) ✅ Understanding detection mechanisms
DO NOT use for:
- ❌ Fraud or deception ❌ Impersonating human creators ❌ Bypassing platform policies without authorization ❌ Creating misleading content
Legal Risks:
- Some jurisdictions (e.g., COPIED Act 2024) may restrict watermark removal Platform terms of service often prohibit AI content masking Commercial use may have additional legal requirements
You are responsible for compliance with applicable laws and terms of service.
Troubleshooting
"Command not found: exiftool"
CODEBLOCK15
"ImportError: No module named PIL"
CODEBLOCK16
"ImageMagick policy.xml blocks operation"
CODEBLOCK17
Processing is slow on large images
CODEBLOCK18
Output looks too grainy/noisy
# Use light strength
python scripts/deai.py input.png --strength light
Development
Running Tests
CODEBLOCK20
Contributing
Improvements welcome! Focus areas:
- New detection bypass techniques Quality preservation algorithms Support for more image formats (HEIC, AVIF) Integration with detection APIs
References
Detection Research:
- Hu, Y., et al. (2024). "Stable signature is unstable: Removing image watermark from diffusion models." arXiv:2405.07145 IEEE Spectrum: UnMarker tool analysis
Open Source Projects:
Detection Tools:
Version: 1.0.0
License: MIT (for educational/research use)
Maintainer: voidborne-d
Last Updated: 2026-02-23
AI图像去指纹技能
用于从AI生成图像中移除AI检测模式的综合命令行工具。通过多种处理技术,将可检测的AI图像转换为类似人眼拍摄的照片。
支持模型: Midjourney、DALL-E 3、Stable Diffusion、Flux、Firefly、Leonardo等。
快速开始
bash
基础处理(中等强度)
python scripts/deai.py input.png
指定输出文件
python scripts/deai.py input.png -o output.jpg
调整处理强度
python scripts/deai.py input.png --strength heavy
仅剥离元数据(最快)
python scripts/deai.py input.png --no-metadata
批量处理目录
python scripts/deai.py input_dir/ --batch
纯Bash版本(无需Python)
bash scripts/deai.sh input.png output.jpg
工作原理
AI生成图像包含多个检测层:
检测向量
1. 元数据 :显示生成工具的EXIF标签、C2PA水印 频域 :扩散模型特有的DCT系数模式像素模式 :过度平滑、不自然的噪声分布视觉特征 :完美光照、重复纹理
处理流程
我们的去指纹流程包含7个转换阶段 :
输入 → 元数据剥离 → 颗粒添加 → 色彩调整 →
模糊/锐化 → 缩放循环 → JPEG重新压缩 → 最终元数据清理 → 输出
阶段详情
阶段 目的 技术 元数据剥离 移除EXIF/C2PA/JUMBF标签 ExifTool 颗粒添加
添加相机传感器噪声 | 泊松/高斯噪声叠加 |
|
色彩调整 | 打破色彩分布模式 | 对比度/饱和度/亮度微调 |
|
模糊/锐化 | 干扰边缘检测模式 | 高斯模糊 + 反锐化掩膜 |
|
缩放循环 | 引入重采样伪影 | 缩小 → 使用Lanczos放大 |
|
JPEG重新压缩 | 添加压缩伪影 | 质量75 → 95循环 |
|
最终清理 | 确保无元数据泄露 | 重新运行ExifTool |
处理强度
根据检测风险与质量权衡选择强度:
强度 描述 成功率 质量损失 light 最小处理,保持质量 35-45% 极低 medium
平衡(默认) | 50-65% | 低 |
| heavy | 激进处理 | 65-80% | 中等 |
成功率 = 通过常见AI检测器(Hive、Illuminarty、AI or Not)的图像百分比
使用示例
单张图像处理
bash
默认中等强度
python scripts/deai.py ai_portrait.png
高质量图像的轻度处理
python scripts/deai.py artwork.png --strength light -o clean_artwork.jpg
顽固检测的重度处理
python scripts/deai.py midjourney_out.png --strength heavy
批量处理
bash
处理整个目录
python scripts/deai.py ./ai_images/ --batch -o ./cleaned/
指定强度的批量处理
python scripts/deai.py ./gallery/*.png --batch --strength heavy
仅元数据模式
bash
仅剥离元数据(即时完成,无质量损失)
python scripts/deai.py image.jpg --no-metadata
使用Bash版本
bash
无需Python/Pillow,纯ImageMagick + ExifTool
bash scripts/deai.sh input.png output.jpg
指定强度
bash scripts/deai.sh input.png output.jpg heavy
依赖项
必需
- ImageMagick (7.0+)— 图像处理引擎 ExifTool — 元数据操作Python 3.7+ (用于deai.py)Pillow (Python图像库)NumPy (用于deai.py)
检查安装
bash
bash scripts/check_deps.sh
这将验证所有依赖项,并在缺失时提供安装命令。
手动安装
Debian/Ubuntu:
bash
sudo apt update
sudo apt install -y imagemagick libimage-exiftool-perl python3 python3-pip
pip3 install Pillow numpy
macOS:
bash
brew install imagemagick exiftool python3
pip3 install Pillow numpy
Fedora/RHEL:
bash
sudo dnf install -y ImageMagick perl-Image-ExifTool python3-pip
pip3 install Pillow numpy
命令参考
deai.py(Python版本)
python scripts/deai.py [options]
参数:
input 输入图像文件或目录(批量模式)
选项:
-o, --output FILE 输出文件路径(默认:input_deai.jpg)
--strength LEVEL 处理强度:light|medium|heavy(默认:medium)
--no-metadata 仅剥离元数据,跳过图像处理
--batch 处理整个目录
-q, --quiet 抑制进度输出
-v, --verbose 显示详细处理步骤
示例:
python scripts/deai.py image.png
python scripts/deai.py image.png -o clean.jpg --strength heavy
python scripts/deai.py folder/ --batch
deai.sh(Bash版本)
bash scripts/deai.sh [strength]
参数:
input 输入图像文件
output 输出文件路径
strength light|medium|heavy(默认:medium)
示例:
bash scripts/deai.sh input.png output.jpg
bash scripts/deai.sh input.png output.jpg heavy
理解检测
常见AI检测器
检测器 方法 绕过率 Hive Moderation 深度学习模型 50-70%(中等) Illuminarty
计算机视觉分析 | 60-75%(中等) |
|
AI or Not | 二分类 | 55-70%(中等) |
|
SynthID | 像素级水印 | 35-50%(重度) |
|
C2PA Verify | 元数据检查 | 100%(元数据剥离) |
此技能无法做到的事项
❌ 非万能解决方案:
- 无法保证100%绕过所有检测器 高级检测器(SynthID)需要更激进的处理 可能出现新的检测方法
❌ 限制:
- 处理会降低图像质量(必要的权衡) 某些检测器使用多层检测(元数据+像素+频率) 极度激进的处理可能引入可见伪影
✅ 它能做到:
- 显著降低检测概率(40-80%) 移除元数据水印(100%有效) 保持合理的视觉质量 批量处理整个集合
验证工作流程
1. 处理图像:
bash
python scripts/deai.py ai_image.png -o clean.jpg --strength medium
2. 在多个检测器上测试:
-
Hive Moderation
-
Illuminarty
-
AI or Not
3. 如果仍被检测到:
- 增加强度:--strength heavy
- 尝试多次处理
- 手动修饰(在照片编辑器中添加轻微噪声)
4. 质量检查:
- 比较原始图像与处理后的图像
- 确保无可见伪影
- 验证颜色/细节是否保留
高级用法
自定义处理流程
编辑scripts/deai.py以调整参数:
python
噪声强度(约第80行)
noise = np.random.normal(0, 3, img_array.shape) # 将3改为5以增加颗粒感
对比度调整(约第95行)
enhancer.enhance(1.05) # 将1.05改为1.08以增强效果
JPEG质量(约第120行)
img.save(temp_path, JPEG, quality=80) # 将80改为70以增加压缩
结合外部工具
bash
步骤1:去指纹
python scripts/deai.py ai_gen.png -o step1.jpg
步骤2:添加微妙纹理叠加(GIMP/Photoshop)
(手动步骤)
步骤3:重新剥离元数据
exiftool -all= step1_edited.jpg
最佳实践
社交媒体使用