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.

Deep learning architectures for comparing image pairs, such as Siamese networks

The previous page’s methods compared pixels one at a time, with no sense of the surrounding scene. This page explains, at a decision-oriented level, how deep learning models overcome that limitation, before the next page runs one such model, ChangeStar, on real imagery.


1. Motivation

geoai’s ChangeStar workflow, used for the rest of this lesson, is built on the architecture family introduced here. Understanding the general idea, comparing learned features rather than raw pixels, is what will make ChangeStar’s behavior and outputs make sense two pages from now, rather than feeling like an unexplained black box.


2. Core idea

The dominant architecture for deep-learning change detection is the siamese network: two parallel encoder branches, with identical, shared weights, process the two input images separately, extracting feature representations that capture spatial context, not just individual pixel values. A comparison module then identifies differences between the two feature maps at corresponding spatial locations. Because both branches share weights, they produce features in the same representation space, which is what makes a direct comparison between them meaningful in the first place.


3. How the comparison works

A. Why spatial context helps

A pixel-wise method (previous page) cannot tell a genuinely changed rooftop from an isolated noisy pixel; both look the same to it. A siamese network’s encoder branches extract features that incorporate surrounding context, edges, textures, and shapes nearby, which helps the model learn to distinguish a real, spatially coherent change from scattered radiometric noise, the exact limitation flagged at the end of the previous page.

B. Weight sharing

Both encoder branches in a siamese network have identical parameters. This is a deliberate design choice: it guarantees that a feature vector at a given position in the pre-change image lives in the same representation space as the feature vector at the same position in the post-change image, so a direct comparison between them is meaningful rather than comparing two unrelated feature spaces.

C. Comparing features

The comparison module varies across specific architectures. Some compute a straightforward difference between the two feature maps; FC-Siam-diff, for example, uses element-wise subtraction. Others concatenate the two feature maps and let subsequent layers learn how to compare them, as FC-Siam-conc does. More recent variants use transformer-based attention to model long-range spatial dependencies between the two time steps; BIT (Binary change detection with a Transformer) is a named example of this approach. You do not need to memorize these specific architectures; the pattern to recognize is that the comparison step itself, not just the feature extraction, is a design choice that varies across models.


4. Python reactivation

No new Python here. The next page runs a specific, pre-trained implementation of these ideas; this page is conceptual preparation for interpreting what that model is doing internally.


5. Common pitfalls


6. Mini task

A classmate says, “deep learning change detection works by training on pairs of images and just learning to predict the difference image, so it is basically the same idea as image differencing.” Identify what this description misses.

Sample solution

It misses that a siamese network compares learned feature representations, which incorporate spatial context (nearby edges, shapes, texture patterns), not raw pixel values directly. Image differencing has no way to distinguish an isolated noisy pixel from a genuine, spatially coherent change, since it treats every pixel independently; a siamese network’s shared-weight encoders are specifically designed to capture that surrounding context before any comparison happens, which is the actual source of its advantage, not simply “learning to predict a difference” in the pixel-arithmetic sense.


7. Key takeaways

Further reading