Abstract
Unsupervised image segmentation using topic models like Latent Dirichlet Allocation (LDA) often results in "salt-and-pepper" noise due to the models' inherent lack of spatial awareness. This paper introduces Topic Masks, a post-processing framework designed to improve spatial consistency in categorical topic assignments. We propose the Connection Mask (C-mask), which utilizes local connectivity thresholds to selectively apply frequency-based filtering. Evaluated on the MSRC dataset, the C-mask significantly enhances segmentation accuracy, raising the F1 score of a standard LDA model from 0.27 to 0.33 and providing a stable refinement for more advanced spatial models.
Introduction
Image segmentation is a fundamental task in computer vision, yet obtaining large-scale labeled datasets remains a bottleneck. Unsupervised approaches, particularly those leveraging topic models like LDA, treat image patches as visual words and regions as latent topics. While effective at capturing global themes, these models frequently produce noisy segmentations where isolated patches are incorrectly assigned. Traditional smoothing filters are inapplicable because topic labels are categorical rather than numerical, meaning they cannot be averaged or smoothed using standard Gaussian or Median filters.
Methodology
The authors propose two filtering mechanisms that operate on an $S \times S$ neighborhood of patches:
Frequency Mask (F-mask)
The F-mask is a majority-vote system that reassigns the center patch to the most frequent topic within its neighborhood. While it effectively reduces isolated noise, the authors found that iterative application can lead to "over-smoothing," where small but correct details are eventually erased.
Connection Mask (C-mask)
To address the instability of the F-mask, the C-mask introduces a connectivity constraint. It acts as a "smart" filter by first evaluating whether a patch is part of a "mass"—a connected group of patches sharing the same topic. If the connectivity (the proportion of connected neighbors) exceeds a threshold $P$, the assignment is preserved as likely correct. If the patch is isolated, the F-mask logic is triggered to find a more suitable assignment.
Results
The researchers evaluated these masks using a subset of 140 images from the MSRC dataset. The masks were applied to segmentations generated by both standard LDA and Spatial LDA (SLDA).
- LDA Performance: Applying the C-mask raised the F1 score from approximately 0.27 to 0.33.
- SLDA Performance: Even for SLDA, which already incorporates spatial priors during training, the C-mask provided a performance boost from 0.62 to 0.66.
- Parameter Sensitivity: Optimal results were generally achieved with a mass proportion $P \approx 0.3$ and mask sizes $S$ between $9 \times 9$ and $17 \times 17$.
Discussion and Conclusion
A key finding of this work is the stability of the C-mask compared to the F-mask. While F-mask performance eventually degrades with repeated iterations, the C-mask reaches a performance plateau, making it more reliable for practical applications. However, the method remains sensitive to parameter tuning. Future research will focus on automated parameter discovery to allow the system to adapt dynamically to different image contents and complexities.
Summary updated