This paper, "Spatial Latent Dirichlet Allocation" by Xiaogang Wang and Eric Grimson, presents a significant evolution of the popular Latent Dirichlet Allocation (LDA) model, specifically tailored for the spatial constraints of computer vision.
The Problem with "Bag-of-Words" in Vision
In the mid-2000s, researchers began applying natural language processing (NLP) models like LDA to computer vision. In this analogy, an image is a "document," and local image patches are "visual words." LDA clusters these words into "topics," which ideally correspond to objects (e.g., a "car" topic or a "building" topic).
However, the "bag-of-words" assumption is a poor fit for vision. In text, the order of words matters, but their physical location on a page doesn't. In images, spatial structure is everything. Standard LDA often fails because:
- Co-occurrence Confusion: If "sky" and "road" always appear together in a dataset, LDA might cluster them into a single topic because they frequently co-occur, even though they are spatially distant.
- Document Definition: Treating an entire image as one document is too coarse. If a small car is surrounded by a massive building, the car patches might be "overwhelmed" by the building's topic distribution.
Introducing Spatial LDA (SLDA)
The authors propose Spatial Latent Dirichlet Allocation (SLDA). The core innovation is moving away from fixed, pre-defined documents. Standard LDA treats images as a "bag of visual words," ignoring where those words are located. SLDA introduces a hidden variable for word-document assignment, forcing visual words that are close in space to group into the same "document."
- Latent Document Assignment: In standard LDA, you know which document a word belongs to. In SLDA, the document assignment is a hidden random variable.
- Spatial Prior: The model assumes that each document is associated with a specific spatial location in the image. It uses a generative procedure where a visual word has a high probability of being assigned to a document if it is physically close to that document's center (modeled using a Gaussian kernel).
- Inference: Because the document assignment is now hidden, the authors use a modified Gibbs Sampling procedure. They use a "particle" approach where each image patch is replicated to ensure documents have enough samples to estimate distributions reliably.
Key Insights
- Spatial Proximity as a Proxy for Identity: The "aha moment" is that visual words belonging to the same object are almost always near each other. By encoding this into the document structure rather than the word values themselves, the model remains flexible.
- Overcoming the "Grid" Problem: Earlier attempts to add spatial info often divided images into a rigid grid. SLDA uses overlapping, latent documents, which allows the model to "find" the objects wherever they are, rather than being forced into a box.
Key Results: Unsupervised Segmentation
SLDA effectively performs object recognition and image segmentation simultaneously without needing any manual pixel-level labels during training. The authors evaluated SLDA on the MSRC Image Dataset (240 images featuring categories like cows, cars, faces, and bicycles) and a Tiger Video Sequence.
The quantitative jump from LDA to SLDA is substantial:
- Accuracy: For the "cows" class, LDA achieved a detection rate of 37.5% with a massive 55.7% false alarm rate. SLDA improved the detection rate to 56.6% while slashing the false alarm rate to just 3.3%.
- Video Performance: In the tiger sequence, LDA failed to segment the tiger from the background, while SLDA successfully clustered the tiger patches into a single, consistent topic across frames.
Qualitative Smoothness: Visually, standard LDA results appear "noisy" (a salt-and-pepper effect), where individual pixels are assigned to random topics. SLDA results are "smooth," with coherent regions corresponding to actual objects, resulting in significantly cleaner and more accurate unsupervised object segmentation.
Limitations and Future Work
- Computational Complexity: The use of Gibbs sampling with "particles" (replicating patches) increases the computational burden compared to standard LDA.
- Hyperparameters: The model still requires the user to pre-define the number of topics ($K$) and the size of the spatial kernel ($\sigma$).
- Temporal Extension: While the authors suggest SLDA can easily extend to video by adding a time stamp to the spatial coordinates, the paper primarily focuses on the spatial aspect. Future work could more deeply explore the "Temporal" side of the proposed Spatial-Temporal LDA.
Summary updated