cvikl/religious-artwork-analysis
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):
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
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 8000Repository 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 explorerAuthors
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).
