This is the only folder intended for submission and GitHub upload.
Code/
baseline/ # unified baseline: ResNet18 and frozen CLIP
new_model/ # causal FIND model
data/ # dataset download/preparation scripts and manifests
README.md
requirements.txt
The project uses Tiny-GenImage for training/validation and MNW for final testing.
Place datasets under this folder:
Code/
data/
tiny-genimage/
train/
val/
MNW/
AI_Images/
manifests/
train.csv
val.csv
test.csv
Label convention:
real = 0
fake = 1
Build CSV manifests after placing or downloading data:
python data/scripts/build_manifests.py \
--tiny-genimage-root data/tiny-genimage \
--mnw-root data/MNW/AI_Images \
--output-dir data/manifestsTraining and testing code read from data/manifests/*.csv first. The committed test.csv is intentionally empty except for its header.
Check data readiness with:
python data/scripts/check_data.pycd Code
pip install -r requirements.txtRun from inside Code/:
python baseline/train.py --model resnet18
python baseline/train.py --model clipDevice selection defaults to CUDA when available, then MPS on macOS, then CPU. You can override it with --device cuda, --device mps, or --device cpu.
MNW evaluation:
export HF_TOKEN="your_huggingface_token"
python baseline/evaluate_mnw.py \
--checkpoint baseline/outputs/resnet18_seed4210/best.ptSee baseline/README.md for more options.
Run from inside Code/:
python -m new_model.main train-causal \
--data-dir data/tiny-genimage \
--output-dir runs/causalMNW evaluation:
python -m new_model.main test-causal --output-dir runs/causalSee new_model/README.md for causal-model options and threshold settings.