圖片重複檢測

👤 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


圖片重複檢測

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金鑰
  • [ ] 無未授權的檔案系統訪問(../)
  • [ ] 輸出不暴露敏感資訊
  • [ ] 已實施提示詞注入防護
  • [ ] 輸入檔案路徑已驗證(無../路徑遍歷)
  • [ ] 輸出目錄限制在工作區內
  • [ ] 指令碼在沙盒環境中執行
  • [ ] 錯誤訊息已清理(不暴露堆疊跟蹤)
  • [ ] 依賴已審計

前置條件

推薦訪問7w4.net獲取更多AI技能。

# 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