图片重复检测

👤 AIPOCH 📦 v1.0.2 ⭐ 4.4 ⬇️ 748 下载
💻 开发编程 免费

📖 技能介绍


name: image-duplication-detector description: 利用计算机视觉算法检测论文手稿图片中的重复使用和篡改行为 version: "1.0.2" category: Integrity tags: [] author: AIPOCH license: MIT status: Draft risk_level: Medium skill_type: Tool/Script owner: AIPOCH reviewer: '' last_updated: '2026-02-06' displayName: "图片重复检测" slug: image-duplication-detector


图片重复检测

小葱技能7w4.net有完整的技能分类。

ID: 195

描述

利用计算机视觉(CV)算法扫描论文手稿中的所有图片,检测潜在的图片重复使用或局部篡改(PS痕迹)。

使用方法

# Scan single PDF file
python scripts/main.py --input paper.pdf --output report.json

# Scan image folder
python scripts/main.py --input ./images/ --output report.json

# Specify similarity threshold (default 0.85)
python scripts/main.py --input paper.pdf --threshold 0.90 --output report.json

# Enable tampering detection
python scripts/main.py --input paper.pdf --detect-tampering --output report.json

# Generate visualization report
python scripts/main.py --input paper.pdf --visualize --output report.json

参数

参数 类型 默认值 必填 描述
--input string - 输入PDF文件或图片文件夹路径
--output string report.json 输出报告路径
--threshold float 0.85 相似度阈值(0-1),越高越严格
--detect-tampering flag false 启用篡改/PS痕迹检测
--visualize flag false 生成可视化对比图像
--temp-dir string ./temp 临时文件目录

输出格式

{
  "summary": {
    "total_images": 12,
    "duplicates_found": 2,
    "tampering_detected": 1,
    "processing_time": "3.5s"
  },
  "duplicates": [
    {
      "group_id": 1,
      "similarity": 0.98,
      "images": [
        {"page": 2, "index": 1, "path": "..."},
        {"page": 5, "index": 3, "path": "..."}
      ]
    }
  ],
  "tampering": [
    {
      "image": "page_3_img_2.png",
      "suspicious_regions": [
        {"x": 120, "y": 80, "width": 50, "height": 50, "confidence": 0.92}
      ]
    }
  ]
}

依赖要求

opencv-python>=4.8.0
numpy>=1.24.0
Pillow>=10.0.0
PyPDF2>=3.0.0
pdf2image>=1.16.0
imagehash>=4.3.0
scikit-image>=0.21.0
matplotlib>=3.7.0

算法详情

重复检测

  • 感知哈希: 使用pHash、dHash、aHash组合检测视觉相似图片
  • 特征匹配: ORB特征点匹配以验证相似性
  • SSIM: 结构相似性指数作为辅助验证

篡改检测

  • ELA (Error Level Analysis): 检测JPEG压缩级别不一致性
  • 噪声分析: 噪声模式异常检测
  • Copy-Move检测: 复制-移动伪造检测
  • 光照不一致性: 光照一致性分析

示例

from scripts.main import ImageDuplicationDetector

detector = ImageDuplicationDetector(
    threshold=0.85,
    detect_tampering=True
)

results = detector.scan("paper.pdf")
detector.save_report(results, "report.json")

注意事项

  • 支持PDF、PNG、JPG、TIFF格式
  • 大文件推荐批量处理
  • 篡改检测可能产生误报,建议人工复核

风险评估

风险指标 评估 级别
代码执行 Python/R脚本在本地执行
网络访问 无外部API调用
文件系统访问 读取输入文件,写入输出文件
指令篡改 标准提示词规范
数据暴露 输出文件保存到工作区

安全检查清单

  • [ ] 无硬编码凭证或API密钥
  • [ ] 无未授权的文件系统访问(../)
  • [ ] 输出不暴露敏感信息
  • [ ] 已实施提示词注入防护
  • [ ] 输入文件路径已验证(无../路径遍历)
  • [ ] 输出目录限制在工作区内
  • [ ] 脚本在沙盒环境中执行
  • [ ] 错误消息已清理(不暴露堆栈跟踪)
  • [ ] 依赖已审计

前置条件

# Python dependencies
pip install -r requirements.txt

评估标准

成功指标

  • [ ] 成功执行主要功能
  • [ ] 输出符合质量标准
  • [ ] 优雅处理边缘情况
  • [ ] 性能可接受

测试用例

  1. 基本功能: 标准输入 → 预期输出
  2. 边缘情况: 无效输入 → 优雅错误处理
  3. 性能: 大数据集 → 可接受的处理时间

生命周期状态

  • 当前阶段: 草稿
  • 下次审核日期: 2026-03-06
  • 已知问题: 无
  • 计划改进:
  • 性能优化
  • 新增功能支持

🤖 AI 评测

这个工具质量不错,能检测图片是否重复或被PS过,功能比较全面。文档写得很清楚,代码结构也清晰。主要问题是有些地方容易报错(异常被忽略了),而且文档和实际需要的依赖对不上,安装时可能会出问题。总体适合使用,但建议等开发者修复这些问题后再用。

📊 多维度评分

适应性4.3
规范性4.2
有效性4.4
可靠性4.3
可信度4.9

📁 包含文件 (4 个)

📄 SKILL.md 4.5 KB
📄 _meta.json 145 B
📄 requirements.txt 57 B
📄 scripts/main.py 24.3 KB