Skip to content
oballingerPublic

About

No description, website, or topics provided.

Resources

Stars

70 stars

Watchers

3 watching

Forks

Repository files navigation

Pixel-Wise T-Test

A New Algorithm for Battle Damage Detection using Sentinel-1 Imagery

The generation of public information regarding buildings damaged by conflict has become particularly important in the context of recent, highly destructive wars in Gaza and Ukraine. This paper develops the Pixelwise T-Test (PWTT), a new algorithm for open-access battle damage estimation that is accurate, lightweight, and generalizable. The PWTT addresses many of the problems associated with expense, coverage consistency, and domain shift that affect deep-learning based approaches to building damage detection, and outperforms the state of the art deep learning model on unseen areas.

How it Works

The PWTT utilizes Synthetic Aperture Radar imagery from the Sentinel-1 satellite. The figure below demonstrates the change in backscatter amplitude (i.e., the "loudness" of the signal's echo) for a destroyed building in Mariupol, Ukraine, before and after its destruction. The corresponding Sentinel-1 pixel has a low standard deviation in both the pre-and post-war periods, but experiences a large change in mean amplitude. The T-Test is a simple signal-to-noise ratio that measures the difference between the means of two samples adjusted by the standard deviation within each sample.

The green dashed line and shaded area represent the pixel's mean backscatter amplitude $\pm$ 1 standard deviation prior to the invasion, while the red line and shaded area represent these statistics following the building's destruction.

Installation

pip install pwtt

This installs the pwtt package and its dependencies (earthengine-api, geemap).

Python Quickstart

First, import the Google Earth Engine python API and authenticate using your credentials and cloud project name.

import ee
import pwtt

project_name='<YOUR PROJECT NAME>'
ee.Authenticate()
ee.Initialize(project=project_name)

The PWTT can be deployed in one line of code. The example below conducts a damage assessment over Gaza for July 2024.

gaza = ee.Geometry.Rectangle([34.21,31.21,34.57,31.60])

pwtt.detect_damage(aoi=gaza, # the area of interest as a bounding box
                   war_start='2023-10-10', # the start of the war
                   inference_start='2024-07-01', # the beginning of the inference window
                   pre_interval=12, # the number of months before the war to use as a reference period 
                   post_interval=1, # the number of months after the war to use as an inference period 
                   viz=True) # visualize the results

By simply modifying the location, war_start date and inference_start dates, damage assessment can be carried out on a new area; below is another example for Bakhmut, Ukraine:

bakhmut = ee.Geometry.Rectangle([37.949421, 48.556181, 38.043834, 48.621584])

pwtt.detect_damage(aoi=bakhmut,
                   war_start='2022-02-22',
                   inference_start='2024-07-01',
                   pre_interval=12,
                   post_interval=1,
                   viz=True)

Choosing a Threshold

The detect_damage function returns a continuous T_statistic band and a binary damage band (default threshold T > 3.3). The choice of threshold controls the precision-recall tradeoff and should be guided by the use case. The figure below shows how precision, recall, and F1 vary across thresholds, using UNOSAT-labeled building footprints from Gaza and Ukraine(click for interactive version).

1-month inference window (interactive)

Recommended thresholds

Threshold Precision Recall F1 Use case
T > 2 39.2% 97.6% 55.9% Maximum sensitivity / screening. Useful when missing damage is more costly than false alarms.
T > 3.3 70.0% 82.4% 75.7% Balanced (default). Good tradeoff between precision and recall across most cities.
T > 4 77.7% 62.8% 69.5% High confidence. Fewer false positives, but misses less severe damage.
T > 5 82.4% 31.9% 46.0% Very high confidence. Detects only the most severe damage.

Precision-recall considerations

Precision is the fraction of buildings flagged as damaged that are actually damaged (i.e. how trustworthy is a positive prediction). Recall is the fraction of actually damaged buildings that the algorithm successfully detects (i.e. how much damage does it miss). Raising the threshold increases precision but decreases recall; lowering it does the opposite.

Precision and recall vary significantly across cities, largely driven by the proportion of damaged buildings (class imbalance). In cities with low damage rates, even a highly discriminative model produces low precision because the vast majority of buildings are undamaged. AUC is the best metric for comparing algorithm performance across cities as it is insensitive to class imbalance.

IMPORTANT: This algorithm measures significant changes in urban environments following the onset of conflict. It remains an assumption that this change corresponds to damage.

  • Damage counts and humanitarian response: use the default threshold (T > 3.3). The algorithm tends toward higher recall than precision, meaning it is more likely to over-count than under-count.
  • High-precision applications (e.g. legal evidence, journalism): raise the threshold to T > 4 or higher to minimize false positives.
  • Rapid response / early warning: lower the threshold to T > 2 for maximum coverage. The algorithm works with as few as one post-event image, with approximately a 6% reduction in AUC compared to a 1-month window.
  • Aggregate statistics: even when building-level precision is moderate, aggregate damage counts at the neighborhood or city level are robust due to error cancellation.

Validation Data

Accuracy assessments are carried out using an original dataset of 700,500 annotated building footprints, spanning 12 cities in four different countries. This dataset was compiled by spatially joining damage annotations from the United Nations Satellite Centre (UNOSAT) with data on building footprints. The dataset can be downloaded here.

Benchmark Dataset

Country City Footprints Percent Damaged Annotation Date
Palestine Gaza 228728 57.49% 2024-05-03
Ukraine Rubizhne 8899 33.67% 2022-07-09
Ukraine Mariupol 18446 31.42% 2022-05-12
Ukraine Sievierodonetsk 5970 24.32% 2022-07-27
Ukraine Hostomel 4175 14.04% 2022-03-31
Ukraine Irpin 7242 11.28% 2022-03-31
Ukraine Avdiivka 7262 8.7% 2022-09-20
Ukraine Lysychansk 20246 7.42% 2022-09-21
Ukraine Makariv 3514 4.01% 2022-03-16
Ukraine Chernihiv 29929 3.25% 2022-03-22
Ukraine Shchastia 1293 1.93% 2022-07-07
Ukraine Bucha 5739 1.6% 2022-03-31
Ukraine Kharkiv 107976 0.85% 2022-06-15
Ukraine Trostianets 8913 0.72% 2022-03-25
Ukraine Okhtyrka 15905 0.4% 2022-03-25
Ukraine Mykolaiv 60467 0.34% 2022-07-21
Ukraine Melitopol 32373 0.23% 2022-08-02
Ukraine Kramatorsk 21880 0.22% 2022-07-24
Ukraine Kremenchuk 27497 0.11% 2022-06-29
Ukraine Sumy 28265 0.08% 2022-07-08
Syria Raqqa 24689 44.67% 2017-10-21
Syria Aleppo 65870 26.65% 2016-09-18
Iraq Mosul 137794 11.51% 2017-08-04
All All 873072 12.39%

Building footprint data is sourced from the Microsoft Building Footprints dataset, which consists of over 1 billion building footprints derived from high resolution satellite imagery around the world. A building footprint is labeled as damaged if it intersects with a UNOSAT damage annotation point, and labeled undamaged otherwise. UNOSAT annotations are generated manually on the basis of high resolution optical satellite imagery.

Accuracy Assessment

The table below reports the accuracy statistics for the PWTT algorithm in 12 cities, assessed using the benchmark dataset above.

Country City AUC Accuracy F1 Precision Recall N
Palestine Gaza 83.32 75.41 78.2 70.42 87.91 228728
Ukraine Kremenchuk 92.56 98.82 2.73 2.68 2.77 27497
Ukraine Bucha 90.19 98.19 71.9 98.27 56.68 5739
Ukraine Okhtyrka 89.28 98.9 53.14 76.28 40.77 15905
Ukraine Kramatorsk 88.24 97.16 7.92 11.99 5.91 21880
Ukraine Trostianets 86.63 98.44 67.6 80.58 58.23 8913
Ukraine Chernihiv 86.61 94.47 48.29 53.48 44.03 29929
Ukraine Hostomel 84.99 80.44 68.11 63.87 72.95 4175
Ukraine Irpin 83.81 82.93 56.75 52.83 61.3 7242
Ukraine Kharkiv 83.78 97.24 29.37 30.44 28.36 107976
Ukraine Mykolaiv 83.28 98.18 21.61 18.71 25.57 60467
Ukraine Makariv 82.87 90.37 40.69 34.88 48.82 3514
Ukraine Lysychansk 77.91 82.59 50.14 47.38 53.24 20246
Ukraine Rubizhne 77.81 71.38 66.42 62.14 71.33 8899
Ukraine Mariupol 73.85 66.17 71.08 60.78 85.57 18446
Ukraine Shchastia 73.39 96.69 38.31 47.12 32.28 1293
Ukraine Sumy 69.63 99.51 4.26 4.36 4.16 28265
Ukraine Sievierodonetsk 69.18 59.3 62.53 50.71 81.54 5970
Ukraine Melitopol 66.84 96.77 2.67 1.78 5.33 32373
Ukraine Avdiivka 66.51 60.64 39.8 28.05 68.5 7262
Syria Raqqa 75.6 66.26 73.87 63.21 88.87 24689
Syria Aleppo 71.76 61.49 58.82 46.28 80.67 65870
Iraq Mosul 74.91 81.16 41.18 35.18 49.64 137794
All All 84.17 76.4 58.2 48.04 73.82 873072

Receiver-Operating Characteristic (ROC) curves for each country are also provided below.

Citation

@article{ballinger2025pwtt,
  title={Open access battle damage detection via Pixel-Wise T-Test on Sentinel-1 imagery},
  author={Ballinger, Ollie},
  journal={Remote Sensing of Environment},
  volume={331},
  pages={115025},
  year={2025},
  publisher={Elsevier},
  doi={10.1016/j.rse.2025.115025}
}

The diagram below displays the full PWTT process:

About

No description, website, or topics provided.

Resources

Stars

70 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages