Learning to Describe Differences Between Pairs of Similar Images

Harsh Jhamtani, Taylor Berg-Kirkpatrick

Here is a concise, engaging summary of the paper, tailored for a technically literate audience.

Learning to Describe Differences Between Pairs of Similar Images

TL;DR

This paper introduces "spot-the-diff," a novel computer vision and natural language processing task aimed at automatically generating text descriptions of the differences between two similar images. The authors release a new dataset based on surveillance footage and propose DDLA (Difference Description with Latent Alignment), a model that uses discrete latent variables to align pixel-change clusters with descriptive sentences, significantly outperforming standard attention-based baselines.

What Problem Does This Paper Address?

While standard image captioning models excel at describing a static scene, they aren't designed to capture dynamics or changes over time. Tracking visual changes is crucial for applications like automated video surveillance, media asset tracking, and medical imaging.

The authors identify three core challenges in automating this task:

  1. Visual Salience: Not all pixel-level changes matter (e.g., wind moving tree leaves or camera shake). The model must learn what is worth describing.
  2. Abstraction Levels: Humans describe changes at the object level (e.g., "a row of cars moved"), not the pixel level.
  3. Multi-Sentence Generation: A pair of images might contain multiple distinct changes, requiring the generation of a coherent, multi-sentence paragraph summary.

Methods

The authors propose a pipeline called DDLA (Difference Description with Latent Alignment) that shifts the problem from raw pixel analysis to object-level cluster selection:

[Image 1, Image 2] ➔ [Pixel Diff Mask] ➔ [DBScan Clustering] ➔ [Latent Alignment Model] ➔ [LSTM Decoder]
  • Exposing Object-Level Differences: Instead of forcing the neural network to learn pixel differences from scratch, the authors pre-compute a binary pixel-difference mask using $L_2$ distance thresholds. They then apply DBScan (a density-based clustering algorithm) to group these differing pixels into spatial clusters, effectively acting as a proxy for changed objects while filtering out background noise.
  • Latent Alignment Variable ($z_i$): The model assumes each generated sentence $S_i$ corresponds to exactly one visual cluster. A discrete latent variable $z_i$ chooses which cluster the model should focus on.
  • Alignment Prior: A log-linear model calculates a prior probability over the clusters using geometric features (length, width, area of the bounding box, and number of active pixels) to predict which changes are most visually salient.
  • Masked Sentence Decoder: An LSTM decoder generates the text. Instead of using soft attention over the entire image, the attention weights are explicitly masked and restricted to the spatial region of the chosen cluster $z_i$ using pyramid reduce downsampling.
  • End-to-End Training: The model is trained by marginalizing out the latent alignment variables using stochastic gradient ascent.

Datasets

The authors introduce the "Spot-the-diff" dataset:

  • Source: 13,192 image pairs extracted from the VIRAT video surveillance dataset.
  • Annotation: Crowd-sourced via Amazon Mechanical Turk. Annotators were instructed to write complete sentences on separate lines, exhaustively describing all visible differences.
  • Stats: An average of 1.86 sentences per image pair, a vocabulary size of 2,404 words, and a low percentage (5%) of long sentences (>20 words).

Key Insights and Ideas

  • Inductive Bias via Clustering: Forcing the model to look at localized clusters rather than the entire image prevents the decoder from hallucinating or describing static background elements.
  • Latent Variables > Soft Attention: Standard soft attention mechanisms often get diluted across multiple changes. Introducing a discrete latent choice forces the model to commit to describing one specific change at a time, leading to cleaner text generation.
  • Geometry Correlates with Salience: The learned prior confirmed that simple geometric properties (like the physical area of a change cluster) are strong indicators of whether a human will bother to describe that change.

Key Results

The models were evaluated on both single-sentence and full multi-sentence paragraph generation using standard translation/captioning metrics (BLEU, CIDEr, METEOR, ROUGE-L).

  • Single-Sentence Generation: DDLA achieved a CIDEr score of 0.328, outperforming the standard soft-attention baseline (CAPT, 0.263) and a baseline that used a union of all masks (CAPT-MASKED, 0.285).
  • Multi-Sentence Generation: DDLA achieved a CIDEr score of 0.297, significantly beating the multi-sentence attention baseline (CAPT-MULTI, 0.235).
  • Perplexity Drop: DDLA demonstrated much better language modeling capabilities, dropping perplexity to 9.73 compared to CAPT's 16.78.
  • Alignment Precision: In a human validation study of 50 image pairs, DDLA predicted the correct sentence-to-cluster alignment with 54.6% precision (compared to a 27.4% random baseline).

Limitations and Future Work

  • Object Tracking Failures: The model struggles to explicitly conceptualize movement. If a truck moves across the frame, the model often describes it as two separate events: a truck disappearing from location A, and a new truck appearing at location B.
  • Attribute Errors: The model occasionally misidentifies object attributes (e.g., calling a red car "blue").
  • Fixed Sentence Constraints: During multi-sentence decoding, the model currently relies on the ground-truth number of sentences to know how many clusters to pick. Future iterations need to predict the number of changes dynamically.
  • Upgrading the Proxy: The authors suggest replacing the simple DBScan pixel-clustering step with modern, pre-trained object detection models (like Faster R-CNN) to provide cleaner semantic boundaries.

Summary updated

BibTeX
@inproceedings{jhamtani2018learning,
  author = {Harsh Jhamtani and Taylor Berg-Kirkpatrick},
  title = {{Learning to Describe Differences Between Pairs of Similar Images}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2018},
  doi = {10.18653/v1/d18-1436},
}
Figure