Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

An Introduction to SAR Change Detection Methods with NISAR


This notebook introduces several commonly used SAR change detection methods that can be applied to radar image time series data. We provide both time-series and pair-wise SAR change detection workflows using NISAR GCOV data products and xarray-based raster analysis.


More specifically, this notebook covers the following SAR change detection concepts:

  • Time series percentile difference and variance thresholding

  • Time series coefficient of variation thresholding

  • Log ratio-based pair-wise change detection from image pairs

  • Threshold-based SAR change mask generation

  • Exporting change detection products as GeoTIFF files

Why use SAR for change detection?

Synthetic Aperture Radar (SAR) is particularly well suited for change detection because SAR sensors operate independently of cloud cover and solar illumination conditions. As active sensors, SAR systems transmit and receive their own microwave signals, allowing repeated, consistent observations of the Earth’s surface. Differences observed between repeated SAR acquisitions can therefore often be directly related to physical surface changes.

2. Load NISAR Data Stack

If you do not have NISAR GCOV data prepared, you can prepare data via the Search and Download NISAR GCOV Data with asf_search notebook from the NISAR Cookbook.

To learn more about using NISAR data, please visit the NISAR Data User Guide. These services are provided by the Alaska Satellite Facility.

Note: This notebook requires dual-pol data

Select the directory holding your NISAR GCOV data

  • Click the Select button

  • Navigate to your data directory

  • Click the Select button

  • Confirm that the desired path appears in green text

  • Click the Change button to alter your selection

If you receive a “widget not found” message, try refreshing your browser tab

Loading...

Prepare output paths and GCOV .h5 file list

[PosixPath('/home/jovyan/NISAR_change_detection_example/NISAR_L2_PR_GCOV_004_042_A_019_2005_DHDH_A_20251101T022728_20251101T022803_X05010_N_F_J_001.h5'), PosixPath('/home/jovyan/NISAR_change_detection_example/NISAR_L2_PR_GCOV_005_042_A_019_2005_DHDH_A_20251113T022729_20251113T022803_X05009_N_F_J_001.h5'), PosixPath('/home/jovyan/NISAR_change_detection_example/NISAR_L2_PR_GCOV_006_042_A_019_2005_DHDH_A_20251125T022729_20251125T022804_X05009_N_F_J_001.h5'), PosixPath('/home/jovyan/NISAR_change_detection_example/NISAR_L2_PR_GCOV_007_042_A_019_2005_DHDH_A_20251207T022730_20251207T022804_X05009_N_F_J_001.h5'), PosixPath('/home/jovyan/NISAR_change_detection_example/NISAR_L2_PR_GCOV_008_042_A_019_2005_DHDH_A_20251219T022730_20251219T022805_X05009_N_F_J_001.h5'), PosixPath('/home/jovyan/NISAR_change_detection_example/NISAR_L2_PR_GCOV_009_042_A_019_2005_DHDH_A_20251231T022731_20251231T022805_X05009_N_F_J_001.h5')]

3. Open and Organize GCOV files

This section opens the NISAR GCOV .h5 files and organizes data of interest into a data cube.

CPU times: user 1.17 s, sys: 136 ms, total: 1.31 s
Wall time: 1.03 s
Loading...
Loading...

Select a Spatial Subset. This notebook allows you to subset via pixel index (option 1) or by coordinate values (option 2)

The full GCOV data cube is large, so this example selects a smaller subset for analysis.

Subset Option 1: Subset by Pixel Index

CPU times: user 596 μs, sys: 82 μs, total: 678 μs
Wall time: 682 μs
Loading...

Subset Option 2: Subset by Coordinate Values

Uncomment to use this option

4. Define Some Python Helper Functions for this Notebook

We are defining two helper functions for this notebook:

  • CreateGeoTiff() to write out images

  • timeseries_metrics() to compute various metrics from a data stack

5. Visualize the GCOV Time Series

This section prepares the selected GCOV backscatter stack for visualization and creates an animation to show how radar backscatter changes through time.

5.1 Convert Backscatter to dB

GCOV backscatter values are stored in linear power units. For visualization and interpretation, SAR backscatter is commonly converted to decibels (dB), which compresses the range of values and makes temporal differences easier to see.

CPU times: user 1.39 ms, sys: 197 μs, total: 1.59 ms
Wall time: 1.6 ms
Loading...

5.2 Create a Time Series Animation

The animation displays each acquisition in sequence using the selected polarization, frequency, and spatial subset. This provides a quick visual check of temporal changes and helps identify areas with strong backscatter variability before applying change detection methods.

Loading...

Save the animation (animation.gif):

6. Computation and Visualization of Time Series Metrics

Once the GCOV time series stack has been constructed, we can compute a set of temporal statistics for each pixel in the stack. These metrics summarize how radar backscatter changes through time and can help identify areas with persistent variability or anomalous temporal behavior.

The metrics computed in this section include:

  • Mean

  • Median

  • Maximum

  • Minimum

  • Range (Maximum − Minimum)

  • 5th Percentile

  • 95th Percentile

  • Percentile Range (95th − 5th Percentile)

  • Variance

  • Standard Deviation

  • Coefficient of Variation (Standard Deviation / Mean)

These statistics are computed independently for every pixel across the time dimension of the GCOV stack.

CPU times: user 17.2 s, sys: 3.53 s, total: 20.7 s
Wall time: 15.6 s
Loading...

The coefficient of variation and variance layers can now be visualized and thresholded to identify areas exhibiting stronger temporal variability within the SAR time series.

Loading...
Loading...
3000
<Figure size 900x300 with 2 Axes>
<Figure size 1600x4000 with 10 Axes>

7. Time-Series SAR Change Detection Methods

Time-series methods analyze variability across the full GCOV acquisition stack to identify pixels with persistent or statistically significant temporal changes through time. These approaches are useful for studying seasonal behavior, long-term variability, recurring disturbances, or areas that exhibit unusually dynamic radar backscatter across the observation period.

7.1 Change Detection with the Percentile Difference and the Variance Threshold Method

Time-series methods identify areas with strong temporal variability by calculating statistics across the SAR acquisition stack.

In this section, we use metrics including percentile range (p95 - p05), variance and standard deviation to identify pixels with significant temporal changes.

Now let’s look at the 95th - 5th percentile range of radar backscatter values across the designated temporal period

<Figure size 1400x400 with 2 Axes>

Here we visualize the 5% of all pixels with the largest (95th - 5th percentile) difference in the time series. We will refer to the pixels (x,y) that exceed this threshold tt as likely change pixels (cp):

cpx,y=Px,y95th−Px,y5th>t{cp}_{x,y} = P_{x,y}^{95th} - P_{x,y}^{5th} > t

If the threshold tt is set to the top 5% of pixels with the largest (p95−p05)(p95 - p05) values, the resulting change mask looks like:

<Figure size 800x800 with 1 Axes>

Thresholding other metrics
Instead of applying a threshold on the 95th - 5th percentile difference data, we can also attempt to threshold other metrics. Pixels with high standard deviation are areas where radar backscatter changes strongly throughout the time series.

Here, change pixels are defined as:

cpx,y=σ>t{cp}_{x,y} = \sigma > t

with t=CDFσ>0.95t=CDF_{\sigma} > 0.95, where the threshold tt corresponds to the top 5% of pixels with the highest standard deviation values.

<Figure size 1400x400 with 2 Axes>
<Figure size 800x800 with 1 Axes>

7.2 Change Detection with the Coefficient of Variation Method

We can apply a threshold to the coefficient of variation (CV) image to identify pixels with strong temporal variability in the SAR time series:

CVx,y=σx,yXˉx,y>tCV_{x,y} = \frac{\sigma_{x,y}}{\bar{X}_{x,y}} > t

The coefficient of variation (CV) measures the ratio of temporal variability to the mean backscatter value for each pixel.

Pixels with high CV values may indicate areas experiencing stronger temporal variability or surface change throughout the acquisition period. The coefficient of variation can be especially useful because it normalizes variability relative to the mean signal level, making it easier to compare regions with different average backscatter values.

Let’s now examine the histogram and cumulative distribution function (CDF) of the CV values.

<Figure size 1400x400 with 2 Axes>

t=CDFCV>0.95t=CDF_{CV} > 0.95

With tt defined as the top 5% of pixels with the highest CV values, the resulting change mask looks like:

<Figure size 800x800 with 1 Axes>

8. Pair-Wise SAR Change Detection

Pair-wise change detection compares two individual acquisitions to identify localized temporal changes between observation dates. In radar remote sensing, this is commonly performed using ratios in the linearly scaled power domain or differences in the logarithmic dB domain. Pair-wise approaches are useful when the objective is to isolate changes associated with a specific event or time interval, such as flooding, vegetation disturbance, snow accumulation, surface deformation or infrastructure changes.

This section identifies the dataset scenes closest to two user-defined acquisition dates within the GCOV time series. They can later be used for image differencing, visualization and threshold-based change detection analysis.

Comparing image 1 from 2025-11-13T02:27:29.000000000 with 2 from 2025-11-25T02:27:29.000000000

Compute the log ratio in dB, corresponding to the difference in dB

Loading...

Manually Select a Threshold

  • thresh sets the threshold value (for example, -2 dB)

  • thresh_type controls whether values below (lower) or above (upper) the threshold are masked

-6.177210426330566
3.5505395698547346
True
<Figure size 2000x400 with 4 Axes>

Do you think the threshold is appropriate? If not, try adjusting it.

9. Write Change Detection Results and Metrics to GeoTIFF Files

This section exports the computed change detection results as georeferenced GeoTIFF files.

Both time-series metrics and pair-wise change detection outputs can be saved as GIS-ready raster products for visualization and downstream analysis.

9.1 Determine Output Geometry

First, we define the geotransform and projection information for the output GeoTIFFs.

Because the workflow operates directly from GCOV data opened with xarray, the output geometry is derived from the dataset coordinate arrays.

[690650.0, 20.0, 0, 3851110.0, 0, -20.0]

9.2 Export Time-Series Metrics

This section exports the time-series metric rasters, such as variance and coefficient of variation, as GeoTIFF files for GIS visualization and analysis.analysis.

/home/jovyan/NISAR_change_detection_example/plots/ts_metrics
/home/jovyan/NISAR_GCOV_Cookbook/.pixi/envs/isce3/lib/python3.13/site-packages/osgeo/osr.py:424: FutureWarning: Neither osr.UseExceptions() nor osr.DontUseExceptions() has been explicitly called. In GDAL 4.0, exceptions will be enabled by default.
  warnings.warn(

9.3 Build a Virtual Raster Stack (VRT)

A Virtual Raster (VRT) can be created to combine the exported metric GeoTIFFs into a single virtual raster stack.

The VRT references the original rasters without duplicating the underlying data.

gdalbuildvrt -separate -overwrite -vrtnodata nan /home/jovyan/NISAR_change_detection_example/plots/ts_metrics/HVHV.vrt /home/jovyan/NISAR_change_detection_example/plots/ts_metrics/min_HVHV.tif /home/jovyan/NISAR_change_detection_example/plots/ts_metrics/max_HVHV.tif /home/jovyan/NISAR_change_detection_example/plots/ts_metrics/range_HVHV.tif /home/jovyan/NISAR_change_detection_example/plots/ts_metrics/mean_HVHV.tif /home/jovyan/NISAR_change_detection_example/plots/ts_metrics/var_HVHV.tif /home/jovyan/NISAR_change_detection_example/plots/ts_metrics/std_HVHV.tif /home/jovyan/NISAR_change_detection_example/plots/ts_metrics/CV_HVHV.tif /home/jovyan/NISAR_change_detection_example/plots/ts_metrics/p05_HVHV.tif /home/jovyan/NISAR_change_detection_example/plots/ts_metrics/p50_HVHV.tif /home/jovyan/NISAR_change_detection_example/plots/ts_metrics/p95_HVHV.tif /home/jovyan/NISAR_change_detection_example/plots/ts_metrics/prange_HVHV.tif
0...10...20...30...40...50...60...70...80...90...100 - done.

9.4 Export Pair-Wise Change Detection Masks

This section writes the threshold-based pair-wise change detection masks to GeoTIFF files. These rasters identify pixels that met the selected change threshold between the two acquisitions and preserve the spatial reference information needed for GIS visualization and downstream analysis.

/home/jovyan/NISAR_change_detection_example/plots/prange_thresholds.tif
/home/jovyan/NISAR_change_detection_example/plots/std_thresholds.tif
/home/jovyan/NISAR_change_detection_example/plots/CV_thresholds.tif
/home/jovyan/NISAR_change_detection_example/plots/logratio_2025-11-13_2025-11-25_thresholds.tif

10. Summary

This notebook demonstrated several common SAR change detection methods using a NISAR GCOV time series opened and analyzed with xarray.

The workflow included:

  • loading and subsetting NISAR data

  • visualizing temporal changes

  • calculating time-series statistics

  • applying threshold-based change detection methods

  • performing a pair-wise analysis

  • exporting the resulting products as georeferenced GeoTIFF files

11. Resources and references

Author: Alex Lewandowski, Julia White