--- title: Religious Artwork Analysis emoji: 🕌 colorFrom: yellow colorTo: purple sdk: docker app_port: 7860 short_description: Interactive t-SNE explorer for religious artworks --- # 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](https://www.kaggle.com/datasets/zigaklun/religious-artwork-dataset) (3,997 images from 8 museum/archive sources, hand-verified labels, CC BY-NC 4.0) - **Live demo**: interactive t-SNE explorer (see [`app/`](app/)) ## Key result Semantic features transfer across museums; style features largely do not. Religion-classification accuracy (chance = 0.25): | feature family | dims | pooled 5-fold | leave-one-source-out | |-----------------------|-----:|--------------:|---------------------:| | CLIP attribute scores | 27 | 0.919 | **0.856** | | CLIP embedding | 512 | 0.941 | 0.828 | | DINOv2 embedding | 768 | 0.910 | 0.783 | | hand-crafted (all) | 378 | 0.741 | 0.391 | | pose (main figure) | 36 | 0.611 | 0.369 | | face composition | 39 | 0.501 | 0.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).