CoolFace
Apppublic

cvikl/religious-artwork-analysis

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes
App README

Religious Artwork Analysis

Code for "Analysis of Artworks Across Different Religions" — a study of whether (and which) visual features separate religious artworks of Buddhism, Christianity, Hinduism and Islam, using a hand-verified, balanced dataset of 3,997 paintings (~1,000 per religion).

  • Dataset: Religious Artwork Dataset on Kaggle (3,997 images from 8 museum/archive sources, hand-verified labels, CC BY-NC 4.0)
  • Live demo: interactive t-SNE explorer (see `app/`)

Key result

Semantic features transfer across museums; style features largely do not. Religion-classification accuracy (chance = 0.25):

feature familydimspooled 5-foldleave-one-source-out
CLIP attribute scores270.9190.856
CLIP embedding5120.9410.828
DINOv2 embedding7680.9100.783
hand-crafted (all)3780.7410.391
pose (main figure)360.6110.369
face composition390.5010.280

The pooled–LOSO gap measures source leakage: features that encode museum reproduction style (scan texture, framing) look discriminative pooled but collapse on unseen sources. Reproduce with evaluation/family_accuracy.py.

Setup

bash
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt

# 1. data (needs a Kaggle API token)
python data/download.py

# 2. preprocessing: guarded background masks (~1 h, CPU)
python preprocessing/generate_masks.py

# 3. features (each checkpointed & resumable)
python features/extract_handcrafted.py --workers 8
python features/extract_clip.py
python features/extract_dino.py
python features/extract_faces.py
python features/extract_pose.py

# 4. evaluation table
python evaluation/family_accuracy.py

# 5. web app
uvicorn app.main:app --port 8000

Repository layout

data/           dataset download + expected layout
preprocessing/  crop_padding + guarded U^2-Net background masking
features/       one extractor per feature family (see features/README.md)
evaluation/     pooled vs leave-one-source-out accuracy per family
app/            FastAPI + Plotly interactive t-SNE explorer

Authors

Timotej Cvikl & Žiga Klun — Faculty of Computer and Information Science, University of Ljubljana. Code under MIT license; dataset under CC BY-NC 4.0 (see the Kaggle page).