Skip to content
KitploitKITPLOIT
도구익스플로잇블로그
Log in
제출
도구익스플로잇블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
ODPure — 객체 탐지기에 대한 백도어 공격을 손상, 확산 재구성, DBSCAN 합의 투표를 통해 무력화하는 블랙박스 입력 단계 정화 방어 기법. | Kitploit
도구/GitHubGitHub/alex66366/odpure
Defensive ToolsDynamic Analysis (Sandboxing)Vulnerability AnalysisMachine LearningPapers & ResearchAI SecurityAdversarial Attack
GitHubalex66366/odpure

ODPure

객체 탐지기에 대한 백도어 공격을 손상, 확산 재구성, DBSCAN 합의 투표를 통해 무력화하는 블랙박스 입력 단계 정화 방어 기법.

저장소 보기
11811일 전아직 검토되지 않음

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

ODPure: 앙상블 손상 합의를 통한 객체 탐지용 백도어 정화

객체 탐지기를 백도어 공격으로부터 방어하기 위해 특별히 설계된 최초의 입력 단계 블랙박스 정화 방어 기법.

License: MIT

📖 개요

ODPure는 객체 탐지기를 백도어 공격으로부터 방어하기 위해 특별히 설계된 최초의 입력 단계, 블랙박스 정화 프레임워크입니다. 이는 다음과 같은 새로운 손상-재구성-선택(Corruption-Reconstruction-Selection, CRS) 패러다임을 구현합니다:

  1. 손상(Corrupts): 다양한 교란으로 입력 이미지를 손상시켜 트리거 패턴을 방해
  2. 재구성(Reconstructs): 생성적 확산 사전(prior)을 사용하여 세밀한 구조적 특징을 재구성
  3. 선택(Selects): 공간적 합의 투표를 통해 높은 신뢰도의 탐지를 선택

ODPure는 다양한 백도어 공격을 효과적으로 무력화하여(공격 성공률을 최대 **0.0%**까지 감소) 깨끗한 탐지 유용성을 유지하며, 기존 방어 기법보다 우수한 방어-유용성 트레이드오프를 달성합니다.

🔑 주요 기능

  • 블랙박스 방어: 모델 내부, 그래디언트, 아키텍처가 필요하지 않음
  • 모델 독립적: 모든 객체 탐지기(YOLO, Faster R-CNN 등)와 호환
  • 다중 공격 방어: OMA, ODA, OGA 공격 유형 처리
  • 제로샷: 트리거 패턴에 대한 사전 지식이 필요하지 않음
  • 연속적 인식: 데이터를 버리지 않고 운영 스트림 연속성 유지

📋 요구 사항

시스템 요구 사항

  • Python 3.8+
  • CUDA 11.7+ (GPU 가속용)
  • 16GB+ GPU 메모리 권장

Python 의존성

root@kitploit:~
# Core dependencies
torch>=1.13.0
torchvision>=0.14.0
numpy>=1.21.0
Pillow>=9.0.0
opencv-python>=4.5.0

# Diffusion models
diffusers>=0.14.0
transformers>=4.25.0
accelerate>=0.20.0

# Evaluation
scikit-learn>=1.2.0  # For DBSCAN clustering
scipy>=1.9.0

# Data processing
pyyaml>=6.0
tqdm>=4.64.0

Conda 환경 설정 (권장)

root@kitploit:~
# Create conda environment
conda create -n odpure python=3.9 -y
conda activate odpure

# Install PyTorch with CUDA
conda install pytorch torchvision pytorch-cuda=11.7 -c pytorch -c nvidia

# Install other dependencies
pip install -r requirements.txt

📦 사전 학습된 가중치 다운로드

Reconstruction 모듈을 실행하기 전에 사전 학습된 모델 가중치를 다운로드해야 합니다:

필수 가중치

설치 단계

  1. 가중치 디렉토리 생성:
root@kitploit:~
mkdir -p Method/Reconstruction/weights
  1. 각 모델 저장소의 지침에 따라 가중치를 다운로드하고 배치합니다.

  2. Method/Reconstruction/configs/의 구성 파일을 다운로드한 가중치를 가리키도록 업데이트합니다.

🏗️ 프로젝트 구조

root@kitploit:~
ODPure/
├── attack_script/              # Backdoor attack implementations
│   ├── COCO_chessboard_29x29_OMA.py     # Object Misclassification (Chessboard)
│   ├── COCO_chessboard_29x29_ODA.py     # Object Disappearance Attack (Chessboard)
│   ├── COCO_chessboard_9x9_OGA.py      # Object Generation Attack (Chessboard)
│   ├── COCO_poke_15x15_OMA.py          # OMA (Poké Ball)
│   ├── COCO_poke_15x15_ODA.py          # ODA (Poké Ball)
│   ├── COCO_poke_15x15_OGA.py          # OGA (Poké Ball)
│   ├── COCO_white_15x15_OMA.py         # OMA (Solid White)
│   ├── COCO_white_15x15_ODA.py         # ODA (Solid White)
│   └── COCO_white_15x15_OGA.py         # OGA (Solid White)
│
├── Method/                     # Core defense methodology
│   ├── corruptions/           # Image corruption module
│   │   ├── imagecorruption.py # Corruption functions
│   │   └── multiprocess_imagecorruption.py  # Parallel processing
│   │
│   ├── Reconstruction/         # Diffusion-based restoration
│   │   ├── inference.py       # Main inference script
│   │   ├── diffbir/           # DiffBIR model implementation
│   │   ├── llava/             # LLaVA captioner
│   │   ├── ram/               # Recognition-Aware Model
│   │   ├── configs/           # Model configurations
│   │   └── weights/           # Model weights (download separately)
│   │
│   └── dbscan_vote_new.py     # DBSCAN clustering & voting
│
├── evaluation/                 # Evaluation metrics
│   ├── OMA_ASR_new.py         # OMA Attack Success Rate
│   ├── OMA_mAP.py             # OMA Mean Average Precision
│   ├── ODA_ASR_new.py         # ODA Attack Success Rate
│   ├── ODA_mAP.py             # ODA Mean Average Precision
│   ├── OGA_ASR_new.py         # OGA Attack Success Rate
│   ├── OGA_mAP.py             # OGA Mean Average Precision
│   ├── val_OMA.py             # YOLO validation for OMA
│   ├── val_ODA.py             # YOLO validation for ODA
│   └── val_OGA.py             # YOLO validation for OGA
│
├── data_format_conversion/    # Data format utilities
│   ├── voc2yolo.py            # VOC to YOLO format conversion
│   ├── cocotoyolo.py          # COCO to YOLO format conversion
│   └── select_coco_val_attack_information.py
│
├── ablation_study/            # Ablation experiments
│   ├── multiprocess_imagecorruption.py
│   ├── random_select_corruption.py
│   └── select_specific_corruption.py
│
├── run_pipeline.sh            # One-shot CRS pipeline runner
└── README.md                 # This file

🚀 빠른 시작

옵션 A: 원샷 엔드투엔드 파이프라인 (권장)

권장 진입점은 run_pipeline.sh이며, 이는 세 가지 CRS 단계를 연쇄적으로 실행합니다:

root@kitploit:~
# Defaults: GPU=0, INPUT=inputs/demo/bid, OUTPUT=results/v2.1_demo_bid, ATTACK=ODA
bash run_pipeline.sh

# Custom arguments: GPU_ID INPUT_DIR OUTPUT_DIR ATTACK
bash run_pipeline.sh 0 inputs/coco_oda results/oda ODA
bash run_pipeline.sh 1 inputs/coco_oma results/oma OMA
bash run_pipeline.sh 2 inputs/coco_oga results/oga OGA

스크립트는 다음을 수행합니다:

  1. 1단계 (손상) – 45개의 손상된 변형 생성
  2. 2단계 (재구성) – LLaVA 캡셔너를 사용한 DiffBIR v2.1
  3. 3단계 (선택) – DBSCAN 공간적 합의 투표

최종 정화된 탐지 결과는 <OUTPUT_DIR>/final/에 기록됩니다.

옵션 B: 각 단계를 수동으로 실행

중간 단계를 검사하거나 교체하려는 경우 사용하십시오.

1단계: 손상

root@kitploit:~
python Method/corruptions/multiprocess_imagecorruption.py \
    --input_dir /path/to/input/images \
    --output_dir /path/to/corrupted/images \
    --num_corruptions 45 \
    --num_workers 8

2단계: 재구성

root@kitploit:~
python Method/Reconstruction/inference.py \
    --task denoise \
    --upscale 2 \
    --version v2.1 \
    --captioner llava \
    --cfg_scale 6 \
    --noise_aug 1 \
    --input /path/to/corrupted/images \
    --output /path/to/restored/images \
    --batch_size 32 \
    --device cuda

3단계: 선택 (DBSCAN 투표)

root@kitploit:~
python Method/dbscan_vote_new.py \
    --folder_purs /path/to/restored/detections \
    --temp /path/to/temp \
    --output_path /path/to/final/detections \
    --eps 0.5 \
    --min_samples 10

📊 평가

1단계: 환경 활성화

root@kitploit:~
conda activate odpure

2단계: 세 가지 분할에서 탐지기 실행

root@kitploit:~
# Run on poisoned inputs (before defense)
python evaluation/val_ODA.py \
    --weights runs/train/exp/weights/last.pt \
    --data data/ODA_poison.yaml \
    --img 640 --iou-thres 0.65 --conf-thres 0.5 \
    --save-txt --save-conf \
    --project results/poisoned_val_txt

# Run on clean inputs
python evaluation/val_ODA.py \
    --weights runs/train/exp/weights/last.pt \
    --data data/ODA_clean.yaml \
    --img 640 --iou-thres 0.65 --conf-thres 0.5 \
    --save-txt --save-conf \
    --project results/clean_val_txt

# Run on purified inputs (after defense via ODPure)
python evaluation/val_ODA.py \
    --weights runs/train/exp/weights/last.pt \
    --data data/ODA_purified.yaml \
    --img 640 --iou-thres 0.65 --conf-thres 0.5 \
    --save-txt --save-conf \
    --project results/pur_val_txt

3단계: ASR / mAP 계산

OMA (객체 오분류 공격)

root@kitploit:~
python evaluation/OMA_ASR_new.py

스크립트 내부의 경로 구성:

root@kitploit:~
gt_folder      = "/path/to/ground_truth"
benign_folder  = "/path/to/clean_val_txt"
attack_folder  = "/path/to/pur_val_txt"
target_class   = "0"      # person class

ODA (객체 소멸 공격)

root@kitploit:~
python evaluation/ODA_ASR_new.py

OGA (객체 생성 공격)

root@kitploit:~
python evaluation/OGA_ASR_new.py

mAP 계산

root@kitploit:~
python evaluation/ODA_mAP.py
python evaluation/OGA_mAP.py
python evaluation/OMA_mAP.py

🛡️ 방어 구성

기본 ODPure 설정

손상 유형

ODPure는 4개 범주에 걸쳐 15가지 다양한 손상 함수를 사용합니다:

  • 노이즈: Gaussian, Shot, Impulse
  • 블러: Gaussian, Glass, Motion, Zoom, Defocus
  • 날씨: Snow, Frost, Fog, Brightness
  • 디지털: JPEG compression, Pixelate, Elastic transform

🔧 고급 사용법

사용자 정의 손상

root@kitploit:~
from Method.corruptions.imagecorruption import *

# Apply specific corruption
corrupted_img = gaussian_noise(image, severity=2)
corrupted_img = glass_blur(image, severity=1)
corrupted_img = jpeg_compression(image, severity=3)

다중 GPU 처리

root@kitploit:~
# Process on specific GPU
CUDA_VISIBLE_DEVICES=0 python Method/Reconstruction/inference.py \
    --task denoise --input inputs/demo --output results/demo

# Batch processing with multiple GPUs
CUDA_VISIBLE_DEVICES=0,1,2,3 python Method/Reconstruction/inference.py \
    --task denoise --batch_size 64 --input inputs/batch --output results/batch

YOLOv5와의 통합

root@kitploit:~
# Train backdoored model
CUDA_VISIBLE_DEVICES="0,1" python train.py \
    --data data/custom.yaml \
    --epochs 200 \
    --weights checkpoints/yolov5s.pt \
    --img 640 \
    --batch-size 128

# Evaluate with defense
python evaluation/val_ODA.py \
    --weights runs/train/exp/weights/last.pt \
    --data data/val.yaml \
    --img 640 \
    --iou-thres 0.65 \
    --conf-thres 0.5 \
    --save-txt --save-conf

📈 실험 결과

VOC 및 COCO에서의 방어 성능 (체스보드 트리거)

적응형 공격에 대한 견고성

🔬 위협 모델

공격자의 능력

  • 훈련 중 데이터 오염을 통해 백도어를 삽입
  • 탐지기를 조작하여 악의적인 동작(OMA, ODA, OGA)을 나타내도록 함
  • 깨끗한 입력에 대해서는 정상적인 예측을 유지

방어자의 제약

  • 공격 독립적: 트리거 패턴에 대한 사전 지식 없음
  • 엄격한 블랙박스: 입력을 쿼리하고 출력을 관찰할 뿐
  • 훈련 데이터 없음: 추론 시점의 입력에 대해서만 정화

방어 목표

  • 보안: 백도어 활성화 완화 (낮은 ASR)
  • 충실도: 깨끗한 입력과 정화된 입력에서 높은 mAP 유지

공격 유형

공격 유형설명동작
OMA객체 오분류 공격대상 객체를 강제로 오분류시킴
ODA객체 소멸 공격

📚 인용

이 연구가 유용하다고 생각되면 다음을 인용해 주십시오:

root@kitploit:~
@article{odpure2026,
  title={ODPure: Backdoor Purification for Object Detection via Ensemble Corruption Consensus},
  author={},
  journal={},
  year={2026}
}

📝 라이선스

이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여됩니다 - 자세한 내용은 LICENSE 파일을 참조하십시오.

🤝 감사의 글

  • DiffBIR - 확산 기반 이미지 복원
  • LLaVA - 대규모 언어 및 비전 어시스턴트
  • YOLOv5 - 객체 탐지 프레임워크
  • CLIP - 대조적 언어-이미지 사전 학습

📧 연락처

질문이나 협업을 원하시면 GitHub에 이슈를 열어주십시오.


ODPure - 연속적 인식을 유지하면서 객체 탐지 시스템을 백도어 공격으로부터 보호합니다.

도구 다운로드
모델설명다운로드
DiffBIR v2.1메인 복원 모델HuggingFace
Stable Diffusion잠재 확산 사전HuggingFace
LLaVA비전-언어 캡셔너HuggingFace
RAM인식 인식 모델GitHub Release
매개변수값설명
num_corruptions15 types × 3 severities = 45 variants손상 다양성
corruption_severity1, 2, 3손상 강도 수준
DBSCAN eps0.5클러스터링 반경
DBSCAN min_samples10합의 임계값
cfg_scale6.0분류기 없는 가이던스
noise_aug1노이즈 증강 수준
공격데이터셋 (모델)Clean mAP방어 전 (mAP/ASR)방어 후 (mAP/ASR)
OMAVOC (YOLO)76.4%8.2% / 87.7%80.5% / 2.0%
OMAVOC (F-RCNN)79.3%44.9% / 94.6%78.1% / 17.4%
OMACOCO (YOLO)52.8%0.4% / 94.6%52.0% / 1.5%
OMACOCO (F-RCNN)49.7%6.3% / 91.9%47.0% / 16.3%
ODAVOC (YOLO)72.0%71.6% / 96.5%76.7% / 20.8%
ODAVOC (F-RCNN)77.6%76.4% / 69.3%75.4% / 18.9%
ODACOCO (YOLO)54.0%52.4% / 99.9%54.1% / 25.4%
ODACOCO (F-RCNN)50.9%50.3% / 81.7%51.4% / 28.0%
OGAVOC (YOLO)80.4%78.0% / 65.1%82.2% / 0.0%
OGAVOC (F-RCNN)83.2%81.2% / 98.4%80.9% / 0.0%
OGACOCO (YOLO)53.0%52.8% / 99.8%54.4% / 0.0%
OGACOCO (F-RCNN)48.9%49.1% / 95.4%49.5% / 0.0%
트리거공격Clean mAP방어 전 ASR방어 후 ASR
Poké BallOMA77.3%95.5%19.8%
Poké BallODA75.3%98.5%35.1%
Poké BallOGA79.8%96.8%15.4%
Solid WhiteOMA75.5%82.0%52.9%
Solid WhiteODA71.8%71.1%44.0%
Solid WhiteOGA80.2%73.7%37.0%
대상 객체가 탐지에서 사라지게 함
OGA객체 생성 공격환각된 유령 객체를 유도함