kingmin's picture
Streetscape data and code 29995d930f50
80e0529 verified
|
Raw History Blame Contribute Delete
13.4 kB

Technical protocol and reproduction guide

1. Scientific scope and contents

This resource evaluates transfer of tabular streetscape descriptors between seven source cities and 19 target cities. The underlying corpus contains 1,321,985 image records from central sampling windows in 26 cities. The primary prepared benchmark contains 129,998 records. Each image has an identifier, location, capture-sequence membership, physical instance descriptors, task outcomes and a partition label. Full-population manifests preserve exclusion and sampling decisions. Read the city and feature definitions from the supplied manifests rather than inferring them from file ordering.

The three archives are complementary:

  • reproducibility_package.zip preserves a relative project layout containing model definitions, prepared neural benchmarks, spatial configurations, numerical summaries, independent census analysis and scientific scripts.
  • supplementary_tables.zip provides the associated numerical tables, counts, mapping information and scientific manifests without requiring model fitting.
  • supplementary_external_validation_data.zip is a compact standalone tract-level income case with prepared data, model scripts, predictions and source records.

Each archive has a MANIFEST.json whose files records give exact member paths, byte sizes and SHA-256 values. The manifest excludes itself from its hash list. INDEX.csv is included in that list. Hashes within execution records identify inputs and code used to generate results; the archive manifest identifies the distributed files, including portable path and documentation changes.

2. Primary targets and feature access

Scene-derived typology

An explicit crosswalk maps 81 stored scene names, corresponding to 94 official Places365 indices, to five typology classes. Names without an explicit mapping are excluded. Across the full corpus this retains 1,238,095 observations (93.654%) and excludes 83,890 (6.346%). The crosswalk includes all 365 official indices, stored-name equivalents and exclusions. This target is a scene-derived proxy, not administrative land use. The primary classifier uses 65 physical instance features and excludes all six perception dimensions.

Green-view indicator

The regression target is a segmentation-derived visible-vegetation measurement. The primary configuration uses 63 physical features, excluding Vegetation and Terrain as well as all perception dimensions. The 16 missing segmentation targets in the full corpus are unavailable observations, not zeros. An add-back analysis measures the contribution of Vegetation and Terrain to prediction. Because predictors and outcomes derive from the same imagery, correlated visual information and upstream model errors can remain.

Other outcomes

A perception composite is included only as a target-construction diagnostic. It is not an observed settlement label. The independent IBGE census-income outcomes described below are separate area-level measurements.

3. Spatial partitions and information access

Partitioning is performed on the full corpus before applying sample caps. Contiguous 1-km cell columns define held-out areas. Training and adaptation observations sharing a held-out capture sequence, or lying within the specified great-circle-distance buffer, are excluded. The primary buffer is 100 m. Before task-specific exclusions, its prepared partitions contain:

Partition Observations
Source training 14,000
Source validation 7,000
Target adaptation 31,731
Target test 77,267

Four further configurations use the opposite holdout side with a 100 m buffer, the orthogonal axis with a 100 m buffer, and the original axis/side with 50 m or 200 m buffers. The 50 m and 200 m configurations preserve the primary target-test and source-validation identifiers, while changing eligible and sampled training and adaptation records. Opposite-side and orthogonal-axis configurations change the geographic holdout. All configurations and outcomes are retained.

For cross-city fitting, imputation, transformations and scaling are estimated on eligible source-training observations. Source-validation labels select neural checkpoints. Target-test features are used only for prediction and their labels only for scoring. The information-access regimes are:

Method Source labels Target features during fitting Target labels during fitting
Direct transfer Yes No No
Source-only augmentation Yes No No
DANN Yes Adaptation pool No
Moment alignment Yes Adaptation pool No
Conditional adapter Yes Adaptation pool and declared context No
Limited-label continuation Yes Specified adaptation samples Exactly the selected valid labels
Zero-label continuation Yes Adaptation pool for BatchNorm No
Local reference Local data rather than pooled-source fitting Local training observations Local training/validation labels

Conditional context comprises latitude, Building, Road, Sidewalk and Sky; perception and vegetation features are excluded. Target-dependent BatchNorm is part of adaptation. Zero-alignment controls preserve this exposure. The local reference uses local training-fitted preprocessing and sequence-disjoint internal validation; it has no additional internal spatial buffer and is a contextual comparison rather than a guaranteed performance upper bound.

4. Neural fitting and comparisons

The encoder has 256- and 128-unit hidden layers with BatchNorm, ReLU and 0.2 dropout; the task head has a 64-unit hidden layer. All primary methods use 1,000 source-supervised updates. A source batch has 256 observations sampled with equal probability across source cities; adaptation additionally samples 256 target feature rows with replacement. Adam uses learning rate 0.001, weight decay 0.0001 and cosine decay. Every 100 updates, the equally city-weighted source validation loss is evaluated; the lowest-loss checkpoint is selected.

The recorded primary seeds are 42, 123 and 456. The runner and manifests give complete discriminator, gradient-reversal, conditioning and loss definitions. DANN uses a domain-loss coefficient of 0.5. Moment alignment compares latent means and coordinate-wise variances, with coefficients 0.3 and 0.1. It has no positive/negative-pair contrastive objective. The conditional mean-alignment coefficient is 0.2. Source augmentation uses noise scale 0.3 while retaining the same source-supervised update budget. Model selection does not access target test labels. Matching source updates does not imply identical total computation or identical target-information access.

Coefficient checks use 0, 0.01, 0.1 and 1 on Dhaka, Cape Town and Lima with seed 42. Additional controls separate zero-alignment target-BatchNorm exposure and shorter training budgets. These are specified sensitivities, not an exhaustive hyperparameter search.

5. Fixed-test local calibration

Limited-label continuation starts from saved parent checkpoints with frozen preprocessing. Nested valid target-label samples have budgets of 50, 100, 200, 500 and 1,000. Each continuation has 200 updates, learning rate 0.0001 and weight decay 0.0001, with source and target batches of 128. The comparison uses a zero-label continuation control from the same parent with the same update budget and target BatchNorm access. Test identifiers remain fixed. Compare only the same eligible cities at each budget, and retain unavailable-budget records.

The labels are the existing image-derived benchmark outcomes, not newly collected human annotations. The comparison estimates the difference between the stated continuation procedures; it does not isolate a universal causal value of each additional annotation. The eligible-city set can change with label budget.

6. Metrics and uncertainty

Report typology macro-F1 alongside weighted F1. For green view, report MAE, RMSE, R-squared and target variance. The source-training-mean constant is a transferable comparison; it differs from the target-test mean used to define R-squared.

Average the three seeds within each target city before computing city-equal means and paired method differences. City-bootstrap intervals use 10,000 resamples with seed 20261001. The 19 city identities remain the clusters when comparing five spatial settings; these are not 95 independent city samples. Intervals are descriptive and are not corrected for multiple comparisons. Changing spatial settings can change both location and training composition.

7. Independent census-income case

The IBGE case uses official 2022 census-tract outcomes for Sao Paulo and Rio de Janeiro, evaluated in both transfer directions. A tract is one observation, with physical features averaged over at least ten eligible images. The primary imagery window is 2020-2022. V06004 is mean nominal monthly income among income-earning persons responsible for occupied permanent private households; it is not total household income or settlement status. V06006 and alternative imagery windows provide sensitivity outcomes and conditions recorded in the protocol.

Ridge and random-forest models use source-fitted imputation/scaling and source-validation model selection. Source training and validation are spatially and sequence separated; the target city is held out. Ridge alpha is selected from 0.1, 1, 10, 100 and 1,000. Random forests use 200 trees and select minimum leaf size from 2, 5 and 10. Income is fitted on the log1p scale. The seeds are 42, 2025 and 2026. Repeated deterministic models across seeds are not independent replications. Target spatial-block intervals use 1,000 resamples of 500-m tract-centroid blocks. The exact feasibility criteria, source-mean baseline, all direction-specific results and negative R-squared values are retained.

Official FCU boundaries provide a separate coverage-feasibility analysis. Insufficient settlement coverage is recorded as a non-estimable classification problem; tract-income prediction is not a substitute settlement label.

8. Reproduction commands

Use Python 3.10 or newer. The recorded scientific package versions are in project/study/analysis/experiments/gpu_requirements.freeze.txt. Select a PyTorch build appropriate for the available CPU or CUDA environment. Prepared-data training does not require downloading street-view images. Reconstructing the full preparation from source does require the original metadata tables and the input paths described in the archive README and preparation scripts.

After extraction, the following example launches the primary tasks on CPU:

cd project/study/analysis/experiments
python run_benchmark.py --prepared prepared_v3 --device cpu --threads 2 \
  --run-name reproduction_run --tasks typology,greenview \
  --methods baseline,dann,moment_alignment,conditional_adapter,style_augmentation \
  --updates 1000 --eval-every 100 --batch-size 256 --lr 0.001 \
  --seeds 42,123,456

GPU workers can use --device cuda:N --shard N --shards K; assign each shard once. --help lists options. Main checkpoints must finish before continuation runs:

python run_fewshot.py --prepared prepared_v3 --base-run reproduction_run \
  --run-name reproduction_fewshot --device cpu --tasks typology,greenview \
  --budgets 50,100,200,500,1000 --updates 200 --lr 0.0001
python run_zero_label_continuation.py --prepared prepared_v3 \
  --base-run reproduction_run --run-name reproduction_zero --device cpu \
  --tasks typology,greenview --updates 200 --lr 0.0001

The four-setting launcher is in project/study/analysis/robustness_extension:

python run_extension.py --gpus 0

Run that command from the launcher's directory. Its prepared data and protocol_frozen.json are included. Individual benchmark jobs can also run on CPU with the setting's prepared path. Summary scripts use their documented run locations: check those paths before regenerating summaries from custom run names.

For the standalone income archive, extract it to a separate directory and run:

python run_income_models.py
python plot_income_results.py

Income scripts additionally require GeoPandas; geometry preparation uses the geospatial dependencies recorded with its source records. Results and predictions are already included for inspection without retraining. Scripts that regenerate outputs should run in a working copy so the distributed reference files remain available for numerical comparison.

9. Sources, reuse and interpretation

Global Streetscapes data and derivatives retain the NUS Urban Analytics Lab / Hou et al. (2024) attribution and CC BY-SA 4.0 terms. IBGE census and boundary records retain their original attribution and notices. Places365 supplies the official scene vocabulary. See source_provenance.json and LICENSES.md for URLs and component-specific terms.

The sampled central areas do not represent entire cities. Image-derived targets can share measurement errors, and image dates need not match the census year. Spatial buffers reduce immediate proximity without guaranteeing independence. The technical scope is comparison of the recorded transfer, calibration and sensitivity procedures; broader urban or socioeconomic interpretation requires appropriate coverage and independent measurements.