260204_cfd_backup / README.md
leekwoon's picture
Upload README.md with huggingface_hub
5782339 verified
# CleanFD Backup
**CleanFD** is a comprehensive modularized library for benchmarking AI-generated image detection methods. This backup includes the complete project with all detectors, datasets, pretrained models, and evaluation scripts.
## Download & Extract
```bash
# huggingface_hub 설치 (필요시)
pip install huggingface_hub
# 다운로드
huggingface-cli download leekwoon/260204_cfd_backup --repo-type dataset --local-dir ./cfd_backup
# 무결성 확인 (선택사항)
cd cleanfd_backup
md5sum -c checksums.md5
# 파일 합치기 및 압축 해제
cat data.tar.gz.part_* | tar -xzvf -
```
## Directory Structure
```
cleanfd/
├── cleanfd/ # Core library modules
│ ├── detector/ # Detector implementations (23 detectors)
│ ├── dataset/ # Dataset utilities
│ ├── nn_classifier/ # Neural network modules
│ └── utils/ # Utilities
├── configs/ # Hydra configuration files (23 configs)
├── data/ # Dataset directory
│ ├── train/ # Training data (real + fake)
│ ├── val/ # Validation data
│ ├── test/ # Test data
│ └── test_processed/ # Processed test data (JPEG, WebP, resize)
├── pretrained/ # Pretrained model weights
├── pipelines/ # Training/evaluation pipelines
├── FerretNet/ # FerretNet implementation
├── icml26_paper/ # ICML 2026 paper materials
├── notebooks/ # Jupyter notebooks
├── results/ # Experiment results
├── scripts/ # Utility scripts
└── requirements.txt # Python dependencies
```
## Supported Detectors (23 methods)
### Frequency/Reconstruction-based
- **DRCT**: Dual-Residual ConvNeXt Transformer
- **RINE**: Reconstruction-based detection
- **SAFE**: Spectral Analysis for Fake Evidence
- **Aeroblade**: Aerospace-inspired detector
### Gradient-based
- **Corvi / Corvi+ / Corvi Mask Gated / Corvi Inpaint**
- **Rajan / Rajan+ / Rajan Mask Gated / Rajan Inpaint**
### CLIP-based
- **AIDE**: CLIP-based detector
- **C2P-CLIP**: Contrastive-to-Positive CLIP
- **CLIPDet**: CLIP-based detection
- **UFD**: Universal Fake Detector
### Novel Methods
- **FerretNet**: Feature-extraction based detector
- **CoDE**: Code-based detector
- **LaDeDa**: Latent-based detector
- **BFree**: Boundary-free detector
- **DDA**: Domain Discriminative Attention
- **NPR**: Neural Pattern Recognition
- **WarpAD**: Warping-based Anomaly Detection
## Dataset Information
### Training Data
- **Real Images**: COCO, LSUN
- **Fake Images**:
- Aligned inversions (Rajan method)
- Latent Diffusion Model (LDM) generations
- Stable Diffusion v2.1 inpainted images
- LSUN inpainted images
### Test Data
- **Real Images**: RedCaps dataset
- **Fake Images** (12 generators):
- Stable Diffusion (SD)
- Midjourney
- Kandinsky
- Playground
- PixelArt
- LCM
- Flux
- Wuerstchen
- Amused
- Chameleon
- Loki
- WildRF
### Data Processing
- **test**: Original test images
- **test_processed**: Images with perturbations (JPEG, WebP, resize)
## Key Features
- **Unified Interface**: Consistent API for all detectors
- **Hydra Configuration**: Flexible experiment management
- **Comprehensive Evaluation**: Multiple metrics (AP, ACC)
- **Perturbation Testing**: Robustness evaluation with various image processing
- **Modular Design**: Easy to add new detectors and datasets
- **Reproducible**: Configuration-based experiments
## Usage Example
```bash
# Train a detector
python pipelines/corvi.py
# Evaluate on test set
python scripts/eval.py --method corvi --test_dir test
# Analyze results
python scripts/analyze_results.py --methods corvi rajan --test_dirs test test_processed
```
## Citation
This library aggregates multiple AI-generated image detection methods for research purposes. Please cite the original papers when using specific detectors.