Change Detection
Change detection compares images of the same scene taken at different times to map what appeared, disappeared, or moved, from satellites to factories.
Change detection is the task of finding meaningful differences between images of the same scene captured at different times. It compares two or more observations and outputs where something changed, as a binary change map, as "from-to" classes such as forest to cropland, or as a list of objects that appeared, disappeared, or moved. Bitemporal change detection compares two dates, and multitemporal methods analyze a whole time series to separate lasting change from seasonal cycles and one-off noise. The task is central to remote sensing and satellite image analysis, and the same ideas drive background subtraction in fixed security cameras and reference comparisons in industrial inspection.
How Change Detection Works#
Two images only compare cleanly once corresponding pixels show the same ground. Image registration aligns them, since an offset of a single pixel creates false change along every edge, and radiometric normalization removes differences in sun angle, exposure, haze, and sensor response. A comparison step then produces a difference measure for each pixel or region, a threshold separates change from noise, and postprocessing removes isolated pixels and merges the rest into regions.
The simplest comparison is image differencing. This example compares two frames of a parking lot filmed from above, 2.7 seconds apart, and lets Otsu's method pick the threshold:
import cv2
import numpy as np
# Two frames of a parking lot filmed from above, 81 frames (2.7 seconds) apart
cap = cv2.VideoCapture("https://github.com/ultralytics/assets/releases/download/v0.0.0/solution_ci_parking_demo.mp4")
_, before = cap.read()
cap.set(cv2.CAP_PROP_POS_FRAMES, 81)
_, after = cap.read()
# Convert to grayscale and blur to suppress noise, then difference pixel by pixel
before = cv2.GaussianBlur(cv2.cvtColor(before, cv2.COLOR_BGR2GRAY), (5, 5), 0)
after = cv2.GaussianBlur(cv2.cvtColor(after, cv2.COLOR_BGR2GRAY), (5, 5), 0)
diff = cv2.absdiff(before, after)
# Otsu's method picks the change threshold, and an opening removes isolated noisy pixels
_, change_map = cv2.threshold(diff, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
change_map = cv2.morphologyEx(change_map, cv2.MORPH_OPEN, np.ones((5, 5), np.uint8))
print(f"{100 * (change_map > 0).mean():.1f}% of pixels changed")
cv2.imwrite("change_map.png", change_map)It prints 5.2% of pixels changed. The saved map marks the blue car that pulls into a parking space, both positions of a white van that drives across the lot, and a car leaving the left edge of the frame, while the parked cars, painted lines, and pavement stay black.
Pixel, Object, and Learned Approaches#
Pixel differencing works when both images come from the same sensor under similar light. Ratios replace differences for radar imagery, whose speckle noise is multiplicative, and change vector analysis treats each multispectral pixel as a vector whose change has both a magnitude and a direction. Post-classification comparison classifies each date independently and compares the labels, which yields "from-to" classes and tolerates different sensors but compounds the errors of both classifications.
Deep learning methods feed both images through a Siamese convolutional neural network with shared weights and decode the difference of their feature maps into a change map, a design popularized by the fully convolutional Siamese networks of Daudt and colleagues in 2018, and later models add attention mechanisms and transformers. A widely used benchmark is LEVIR-CD, released by Hao Chen and Zhenwei Shi in 2020 with 637 Google Earth image pairs of 1,024×1,024 pixels at 0.5 meters per pixel and 31,333 annotated building changes.
Object-level change detection compares detections instead of pixels, which ignores shadows and seasonal color shifts. An Ultralytics YOLO26 oriented bounding box model pretrained on DOTA aerial imagery returns rotated boxes for planes, ships, storage tanks, and vehicles, so matching the object detection results from two dates reveals what arrived and what left.
Change Detection vs. Related Tasks#
- Anomaly detection flags observations that depart from a learned notion of normal, often from a single image. Change detection needs a reference observation, and a change such as a new building is usually expected.
- Object tracking and optical flow follow motion between consecutive video frames. Change detection compares the state of a scene at two points in time, often months or years apart.
- Data drift describes a shift over time in the statistical distribution of the inputs a deployed model receives, which erodes its accuracy.
Real-World Applications#
- Deforestation and land-cover monitoring: Annual tree-cover loss maps from Landsat imagery at 30-meter resolution, published by the University of Maryland since 2013, are the basis of Global Forest Watch.
- Disaster damage assessment: Comparing pre- and post-event satellite or drone imagery maps flooded land, burned areas, and collapsed buildings, and the xBD dataset grades building damage on a four-level scale from before-and-after image pairs.
- Industrial inspection: A fixed camera compares each assembly with a reference image of a correct part to catch missing screws, misplaced components, or foreign objects.
- Security and surveillance: Background subtraction, the video form of change detection, models the static scene at each pixel and treats departures from it as moving foreground, the trigger behind motion alerts in fixed cameras.










