|
Download README.md from xiaohaoy/ViewingSoundPAQ: direct link, hf CLI and curl.
- Browser
- Download file 17.6 kB
-
https://huggingface.co/xiaohaoy/ViewingSoundPAQ/resolve/main/README.md
- Command line
-
hf download hf://xiaohaoy/ViewingSoundPAQ/README.md
-
curl -L -o README.md https://huggingface.co/xiaohaoy/ViewingSoundPAQ/resolve/main/README.md
17.6 kB
| license: cc-by-nc-4.0 | |
| language: | |
| - en | |
| tags: | |
| - soundscape | |
| - acoustics | |
| - perceived-affective-quality | |
| - iso-12913 | |
| - street-view | |
| - kernel-ridge | |
| base_model: | |
| - google/siglip2-giant-opt-patch16-384 | |
| - timm/PE-Core-bigG-14-448 | |
| # ViewingSoundPAQ | |
| Predict how a place **sounds** from a **single photo**: the 8 perceived affective qualities (PAQ) of ISO/TS 12913 | |
| (pleasant, eventful, chaotic, vibrant, uneventful, calm, annoying, monotonous), each with an 80% range. | |
| The model learns from photo-sound pairs. Each photo is paired with the 10-s audio clip recorded at the same place. The training target is the PAQ that SoundAQNet assigns to that clip. Only the single photo is needed for inference. | |
| ## Model | |
| | | | | |
| |---|---| | |
| | Input | one perspective photo (panoramas: split into 4 views first, `scripts/model/inference/split_panoramas.py`) | | |
| | Features (frozen, 4,352-d) | SigLIP 2 giant (pooled + mean token, 3,072) + Perception Encoder PE-Core bigG/14 at 448 px (1,280); nothing else at prediction time | | |
| | Model | kernel ridge regression with an RBF kernel (width 0.5 x median squared distance between standardized training photos), lambda by grouped 5-fold CV on the training side | | |
| | Output | 8 AQ means + photo-dependent 80% range (a second kernel ridge on the same kernel predicts each photo's error size; calibrated on the out-of-fold residuals) | | |
| ||| | |
| **What the 80% range means:** | |
| For each AQ the model gives its best guess and a range around it, for example calm 3.1 | |
| with range 2.4-3.9 on the 1-5 scale. The range is where the AQ of the sound actually recorded at that spot is expected | |
| to fall 8 times out of 10: across many photos, about 8 in 10 real values lie inside their range, about 1 in 10 below | |
| and 1 in 10 above (the bounds are the 10th and 90th percentiles of the expected error). It is a prediction interval for | |
| one recording, not a confidence interval for an average: it covers both what the model cannot tell from the photo and | |
| how much a 10-s clip of such a place varies from moment to moment (a passing bus, a quiet spell). | |
| The width is | |
| photo-specific: narrow width = places that look like this sound consistent and the prediction is more reliable; wide width = the | |
| sound of such scenes varies a lot or the model is less sure. | |
| **10-fold CV results:** | |
| | Dimension | Spearman ρ | Pearson r | RMSE (1–5) | MAE (1–5) | 80% Coverage | 80% Width | Winkler Score | | |
| |---|---|---|---|---|---|---|---| | |
| | Eventful | 0.679 | 0.687 | 0.412 | 0.333 | 0.812 | 1.10 | 1.415 | | |
| | Uneventful | 0.661 | 0.673 | 0.385 | 0.311 | 0.811 | 1.01 | 1.320 | | |
| | Chaotic | 0.656 | 0.651 | 0.513 | 0.417 | 0.820 | 1.37 | 1.746 | | |
| | Calm | 0.641 | 0.639 | 0.571 | 0.461 | 0.815 | 1.50 | 1.935 | | |
| | Monotonous | 0.600 | 0.615 | 0.395 | 0.316 | 0.803 | 1.02 | 1.378 | | |
| | Pleasant | 0.592 | 0.588 | 0.533 | 0.431 | 0.807 | 1.39 | 1.815 | | |
| | Annoying | 0.575 | 0.576 | 0.602 | 0.488 | 0.809 | 1.60 | 2.067 | | |
| | Vibrant | 0.562 | 0.577 | 0.369 | 0.291 | 0.803 | 0.93 | 1.281 | | |
| | **Mean** | **0.621** | **0.626** | **0.472** | **0.381** | **0.810** | **1.24** | **1.620** | | |
|  | |
|  | |
| *Scene types and transient events: difference in mean AQ between photo groups (held-out photos; grey = real sound, | |
| blue = predicted from the photo). Groups come from segmentation, not a model input.* | |
| **Comparison with existing photo-only methods**: | |
| | Method | Mean of 8 AQs | Pleasant | Eventful | Chaotic | Vibrant | Uneventful | Calm | Annoying | Monotonous | Delta vs ours [95% CI] | | |
| |---|---|---|---|---|---|---|---|---|---|---| | |
| | **Ours (SigLIP 2 + PE + kernel ridge)** | **0.607** | **0.584** | **0.659** | **0.641** | **0.554** | **0.634** | **0.628** | **0.566** | **0.590** | - | | |
| | CLIP ViT-B/16 + ridge | 0.552 | 0.513 | 0.613 | 0.580 | 0.505 | 0.593 | 0.557 | 0.501 | 0.553 | -0.055 [-0.071, -0.043] | | |
| | ResNet-50 (ImageNet) + ridge | 0.492 | 0.426 | 0.576 | 0.520 | 0.451 | 0.548 | 0.481 | 0.434 | 0.499 | -0.115 [-0.135, -0.099] | | |
| | Zhao et al. 2023 [13]: gradient-boosted trees | 0.493 | 0.442 | 0.565 | 0.519 | 0.439 | 0.542 | 0.492 | 0.443 | 0.501 | -0.114 [-0.132, -0.099] | | |
| | Zhao et al. 2023 [13]: random forest | 0.489 | 0.439 | 0.567 | 0.522 | 0.433 | 0.536 | 0.490 | 0.442 | 0.482 | -0.118 [-0.139, -0.099] | | |
| | View composition (19 segmentation ratios) + linear regression | 0.351 | 0.260 | 0.460 | 0.365 | 0.338 | 0.420 | 0.327 | 0.272 | 0.369 | -0.256 [-0.286, -0.229] | | |
| | Qwen3-VL-8B zero-shot PAQ rating | 0.318 | 0.209 | 0.455 | 0.407 | 0.297 | 0.329 | 0.379 | 0.236 | 0.233 | -0.289 [-0.318, -0.261] | | |
| | Each dataset's mean training target | 0.252 | 0.169 | 0.311 | 0.216 | 0.240 | 0.310 | 0.194 | 0.211 | 0.364 | -0.355 [-0.392, -0.318] | | |
| ## Setup | |
| Two options. Both use `setup_env.sh` (conda env + PyTorch + this package); torch backend `cu126 | cu128 | cu130 | cpu` | |
| (macOS: `cpu`). | |
| ### Option A: inference only (predict new photos with the final model) | |
| ```bash | |
| ./setup_env.sh viewing-sound-paq cu126 | |
| conda activate viewing-sound-paq | |
| git lfs pull # the fitted model is stored with Git LFS | |
| python scripts/model/inference/predict_photo_aq.py --krr --model models/final/model_siglip_krr_pe.npz \ | |
| --images path/to/photos --output-dir runs/my_photos | |
| ``` | |
| ### Option B: train the model with the available datasets (evaluation included) | |
| ```bash | |
| ./setup_env.sh viewing-sound-paq cu126 --download-imagebind | |
| conda activate viewing-sound-paq | |
| python -c "from huggingface_hub import login; login()" # DINOv3 is gated: accept its licence on Hugging Face first | |
| ``` | |
| ## Usage | |
| ### 1. Data preparation | |
| Download and prepare each dataset as in [docs/DATASETS.md](docs/DATASETS.md). | |
| ```bash | |
| ./runners/run_external_av_datasets.sh --dataset tau | |
| ./runners/run_external_av_datasets.sh --dataset urban | |
| ./runners/run_external_av_datasets.sh --dataset lion | |
| ./runners/run_urbansas_whole_prepare.sh | |
| ./runners/run_singapore_prepare.sh | |
| python scripts/data_preparation/datasets/download_360x_outdoor.py | |
| python scripts/data_preparation/datasets/prepare_360x_outdoor.py | |
| python scripts/data_preparation/datasets/prepare_eth_binaural.py | |
| python scripts/data_preparation/open_sound_image_pairs/build_open_sound_image_pairs.py collect | |
| python scripts/data_preparation/open_sound_image_pairs/build_open_sound_image_pairs.py pair | |
| python scripts/data_preparation/open_sound_image_pairs/prepare_open_sound_image_pairs.py \ | |
| --output data/open_sound_image_pairs_synchronized_manifest.csv | |
| ``` | |
| ### 2. Build the dataset | |
| ```bash | |
| ./runners/build_training_revision.sh --revision urbansas_whole_yfcc_binaural_v1 | |
| ./runners/run_yfcc_expansion.sh --pool nogeo --max-videos 21105 | |
| ./runners/run_sonicurban.sh --root /data/SonicUrban/SonicUrban_clean --images-only | |
| ./runners/run_sonicurban.sh --root /data/SonicUrban/SonicUrban_clean \ | |
| --revision urbansas_whole_yfcc_binaural_v1_yfcc_nogeo_b0_21105 | |
| python scripts/data_preparation/assemble/combine_revisions.py \ | |
| --base urbansas_whole_yfcc_binaural_v1_yfcc_nogeo_b0_21105 --base-folds <base cv_folds.csv> \ | |
| --add <rev>:<dataset>:<cv_folds.csv> ... --train-exclude <train_exclude.csv> ... \ | |
| --name urbansas_whole_yfcc_binaural_v1_yfcc_nogeo_b0_21105_allnew | |
| python scripts/data_preparation/targets/relevel_reference.py | |
| python scripts/data_preparation/datasets/rebuild_usotw_views.py | |
| ``` | |
| ### 3. Features | |
| ```bash | |
| rev=urbansas_whole_yfcc_binaural_v1_yfcc_nogeo_b0_21105_allnew_ref40_usotw4 | |
| python scripts/model/features/extract_backbone_features.py \ | |
| --manifest runs_main_all_datasets/direct_aq_dataset_gain/$rev/metadata_manifest.csv \ | |
| --models siglip2_giant_384 pe_core_bigg14_448 | |
| ``` | |
| ### 4. Training and evaluation (10-fold CV) | |
| ```bash | |
| ./runners/run_final_cv.sh | |
| ``` | |
| ### 5. Comparison with existing methods | |
| ```bash | |
| ./runners/run_compare_methods.sh --images /data/Images/Images | |
| ``` | |
| ### 6. Inference | |
| ```bash | |
| python scripts/model/inference/predict_photo_aq.py --krr \ | |
| --model models/final/model_siglip_krr_pe.npz \ | |
| --images path/to/photos --output-dir runs_main_all_datasets/predictions_myphotos | |
| ``` | |
| ## Datasets | |
| Where to download each public dataset and how to prepare it: [docs/DATASETS.md](docs/DATASETS.md). | |
| Every training example is a **photo paired with a 10-s clip recorded at the same place** (synchronized video, or a | |
| recording made at the same spot); no generated or imagined sound is used. The dataset is | |
| 16,422 pairs from 13 sources (image-audio ImageBind cosine >= 0.2, the added sets' subsets, and the exclusions below). | |
| 10-fold CV: each fold trains on about 14,800 pairs (14,639-14,888) and tests on about 1,640 (1,534-1,783), holding out | |
| whole recording groups, so every pair is tested exactly once by a model that never saw its group. The final model is | |
| then trained on all 16,422. | |
| Rules used everywhere: | |
| - **Pairing:** one-to-one, highest ImageBind cosine; for videos 4/6 frames per video within +-20 s. | |
| - **Panoramas:** split into 4 perspective views (yaw 0/90/180/270). | |
| **PAQ labels (SoundAQNet).** Clips have no human ratings, so each pair's target is predicted from its own | |
| recorded 10-s clip by SoundAQNet [14] (checkpoint `SoundAQnet_ASC96_AEC94_PAQ1027`, package `soundaqnet`). SoundAQNet | |
| was trained on the ARAUS listening experiment [15] (25,440 ratings by 605 listeners of 30-s binaural urban soundscapes); | |
| it reads the clip's log-mel spectrogram and its ISO 532-1 loudness and outputs the 8 PAQ attributes on the 1-5 scale. Clips are cut to 10 s and converted to mono 16 kHz before scoring. The targets are | |
| therefore machine labels of the recorded sound, not ratings of the photo. | |
| **Loudness reference (-40 LUFS).** SoundAQNet reads absolute level (ARAUS [15] recordings were played at their measured 52-77 dB), but most recordings here are uncalibrated, so each dataset gets one gain. The gain | |
| puts the dataset's median clip at a reference loudness; it was -30 LUFS (inherited), and is now -40 LUFS, chosen on | |
| human ratings that train nothing: SoundAQNet vs listeners, mean Spearman over | |
| the 8 AQs, at -30 / -40 LUFS: SATP [16] (27 calibrated London recordings, ~830 listeners each) 0.58 / 0.72 (0.73 at the true | |
| level), Mumbai (150 clips, Verma et al. 2020 [17]) 0.46 / 0.49; flat from -40 to -48 on both. Moving the reference is the | |
| same -10 dB on every clip, so all level differences between and within datasets stay. | |
| | Dataset | Image | Sound | Used pairs | Public | Reference | | |
| |---|---|---|---|---|---| | |
| | YFCC100M street videos | video frame | video soundtrack | 4,151 | yes | [1] | | |
| | 360+x outdoor | 360 frame | 4-mic 360 camera | 1,202 | yes | [2] | | |
| | TAU Urban Audio-Visual Scenes 2021 (12 European cities; outdoor scenes) | video frame | binaural recording | 767 | yes | [3] | | |
| | Urban Soundscapes of the World | 360 screenshot | binaural recording | 458 | yes | [4] | | |
| | Urbansas (Urban Sound & Sight) | video frame | stereo recording | 273 | yes | [5] | | |
| | Lion City Soundscapes | video frame | binaural | 49 | yes | [6] | | |
| | Michigan recordings (Ann Arbor / Detroit field recordings) | panorama | field recorder | 1,592 | no | own recordings | | |
| | Singapore field recordings (Zhao et al. 2023) | panorama | field video recording | 163 | yes (CC BY-NC-SA 4.0) | [13] | | |
| | SonicUrban city walks (126 cities) | video frame | camera microphone | 3,692 | yes | [7] | | |
| | Open sound-image pair data | Mapillary panorama views, Mapillary and Flickr photos near the recording | Aporee / Freesound field recording | 2,723 | yes (sources) | built here from [8]-[11] | | |
| | ETH Zurich binaural 360 dataset | 360 frame | binaural recording | 660 | yes | [12] | | |
| | Taiwan sound survey | Mapillary views near the clip | phone recording | 692 | no | [10] | | |
| ||| | |
| ## Repository contents | |
| ``` | |
| setup_env.sh / environment.yml / pyproject.toml environment (Linux / macOS) | |
| runners/ shell pipelines: build_training_revision.sh (build the dataset), | |
| run_*.sh (dataset preparation, expansions, CV, comparison) | |
| docs/DATASETS.md where to download each public dataset and how to prepare it | |
| scripts/common/ shared helpers (lib.sh, dataset labels, panorama views, environment check) | |
| scripts/data_preparation/datasets/ per-dataset frames, views and screens (YFCC, 360+x, TAU, USotW, Urbansas, | |
| Lion City, SonicUrban, ETH, Singapore field) | |
| scripts/data_preparation/open_sound_image_pairs/ build the open sound-image pair data (openSIP; Mapillary / Flickr keys) | |
| scripts/data_preparation/pairing/ ImageBind photo-clip pairing (one-to-one, cosine) | |
| scripts/data_preparation/targets/ SoundAQNet PAQ labels, dataset gain, -40 LUFS reference | |
| scripts/data_preparation/assemble/ merge the datasets, training exclusions, CV folds, test list | |
| scripts/model/features/ SigLIP 2 giant + PE-Core bigG features | |
| scripts/model/train_test/ CV folds, kernel ridge + 80% range, 10-fold CV, reports | |
| scripts/model/comparison/ other photo-only methods | |
| scripts/model/evaluation/ scene-type check and figures | |
| scripts/model/inference/ predict new photos | |
| models/final/model_siglip_krr_pe.npz the fitted final model (287 MB, Git LFS) | |
| models/soundscape_models/ shared code (audio I/O, utils) | |
| models/third_party/ImageBind/ ImageBind code (CC BY-NC 4.0, see its LICENSE) | |
| models/third_party/classify_street_like_view/ street-view classifier (LORA_J) code | |
| models/third_party/models/lora_J/ its trained weights: LoRA adapter + MLP head (16 MB), metrics.json (threshold 0.687) | |
| configs/ audio target configs | |
| data/ small label files (Places365 categories, AudioSet labels) | |
| data/drop_lists/ photos left out (TAU indoor scenes, photos checked by eye) | |
| data/final_split/final_pairs.csv pairs of the public datasets with their CV folds (dataset, photo file, paired clip, group, fold) | |
| ``` | |
| ### References | |
| 1. B. Thomee, D. A. Shamma, G. Friedland, B. Elizalde, K. Ni, D. Poland, D. Borth, L.-J. Li. YFCC100M: The new data in multimedia research. *Communications of the ACM* 59(2):64-73, 2016. | |
| 2. H. Chen, Y. Hou, C. Qu, I. Testini, X. Hong, J. Jiao. 360+x: A panoptic multi-modal scene understanding dataset. *CVPR* 2024. arXiv:2404.00989. | |
| 3. S. Wang, A. Mesaros, T. Heittola, T. Virtanen. A curated dataset of urban scenes for audio-visual scene analysis. *ICASSP* 2021. Data: Zenodo, doi:10.5281/zenodo.4477542. | |
| 4. B. De Coensel, K. Sun, D. Botteldooren. Urban Soundscapes of the World: selection and reproduction of urban acoustic environments with soundscape in mind. *Inter-Noise* 2017, Hong Kong. Data: Zenodo, doi:10.5281/zenodo.10106181. | |
| 5. M. Fuentes, B. Steers, P. Zinemanas, M. Rocamora, L. Bondi, J. Wilkins, Q. Shi, Y. Hou, S. Das, X. Serra, J. P. Bello. Urban sound & sight: Dataset and benchmark for audio-visual urban scene understanding. *ICASSP* 2022. Data: Zenodo, doi:10.5281/zenodo.6658386. | |
| 6. K. Ooi, J. Goh, H.-W. Lin, Z.-T. Ong, T. Wong, K. N. Watcharasupat, B. Lam, W.-S. Gan. Lion City Soundscapes: Modified partitioning around medoids for a perceptually diverse dataset of Singaporean soundscapes. *JASA Express Letters*, 2024. hdl:10356/178828. | |
| 7. J. Wang, H. Tan, B. Liao, A. Jiang, T. Fei, Q. Huang, B. Zhou, Z. Tu, S. Ye, Y. Kang. SounDiT: Geo-contextual soundscape-to-landscape generation. *CVPR* 2026, pp. 32659-32670. arXiv:2505.12734. Data: https://huggingface.co/datasets/gisenselab/SounDiT_SoundingSVI_SonicUrban. | |
| 8. radio aporee ::: maps (U. Noll), https://aporee.org/maps/. | |
| 9. F. Font, G. Roma, X. Serra. Freesound technical demo. *ACM Multimedia* 2013, pp. 411-412. | |
| 10. Mapillary street-level imagery, https://www.mapillary.com/. | |
| 11. Flickr, https://www.flickr.com/. | |
| 12. A. B. Vasudevan, D. Dai, L. Van Gool. Semantic object prediction and spatial sound super-resolution with binaural sounds. *ECCV* 2020. | |
| 13. T. Zhao, X. Liang, W. Tu, Z. Huang, F. Biljecki. Sensing urban soundscapes from street view imagery. *Computers, Environment and Urban Systems* 99:101915, 2023. doi:10.1016/j.compenvurbsys.2022.101915. Data: https://github.com/ualsg/Visual-soundscapes (CC BY-NC-SA 4.0). | |
| 14. Y. Hou, Q. Ren, A. Mitchell, W. Wang, J. Kang, T. Belpaeme, D. Botteldooren. Soundscape captioning using sound affective quality network and large language model. *IEEE Transactions on Multimedia*, 2026. arXiv:2406.05914. | |
| 15. K. Ooi, Z.-T. Ong, K. N. Watcharasupat, B. Lam, J. Y. Hong, W.-S. Gan. ARAUS: A large-scale dataset and baseline models of affective responses to augmented urban soundscapes. *IEEE Transactions on Affective Computing*. doi:10.1109/TAFFC.2023.3247914. arXiv:2207.01078. | |
| 16. T. Oberman, A. Mitchell, F. Aletta, J. A. Almagro Pastor, K. Jambrošić, J. Kang. Soundscape Attributes Translation Project (SATP) Dataset. Zenodo, 2022. doi:10.5281/zenodo.6914434. | |
| 17. D. Verma, A. Jana, K. Ramamritham. Predicting human perception of the urban environment in a spatiotemporal urban setting using locally acquired street view images and audio clips. *Building and Environment* 186:107340, 2020. doi:10.1016/j.buildenv.2020.107340. Data: Audio and Visual Perception Dataset, Mendeley Data v2, doi:10.17632/3hrb6gsgyn.2. | |