Neuro-Symbolic Spatial Reasoning in Segmentation
Jiayi Lin, Jiabo Huang, Shaogang Gong
TL;DR
This work introduces RelateSeg, a neuro-symbolic approach for open-vocabulary semantic segmentation that explicitly reasons about spatial relationships. By extracting spatial triplets from VLMs, introducing pseudo categories to connect spatial regions, and enforcing these relations through first-order logic with fuzzy relaxation, RelateSeg integrates structured knowledge into a neural segmentation model. The method achieves state-of-the-art average mIoU across four OVSS benchmarks, with notable gains on images containing multiple categories, while requiring only a single auxiliary loss and no extra parameters. The approach demonstrates the value of combining perceptual learning with symbolic spatial reasoning, offering improved scene coherence and a pathway toward scalable, relational OVSS, though it faces limits in highly complex scenes and incurs additional inference time.
Abstract
Open-Vocabulary Semantic Segmentation (OVSS) assigns pixel-level labels from an open set of categories, requiring generalization to unseen and unlabelled objects. Using vision-language models (VLMs) to correlate local image patches with potential unseen object categories suffers from a lack of understanding of spatial relations of objects in a scene. To solve this problem, we introduce neuro-symbolic (NeSy) spatial reasoning in OVSS. In contrast to contemporary VLM correlation-based approaches, we propose Relational Segmentor (RelateSeg) to impose explicit spatial relational constraints by first order logic (FOL) formulated in a neural network architecture. This is the first attempt to explore NeSy spatial reasoning in OVSS. Specifically, RelateSeg automatically extracts spatial relations, e.g., <cat, to-right-of, person>, and encodes them as first-order logic formulas using our proposed pseudo categories. Each pixel learns to predict both a semantic category (e.g., "cat") and a spatial pseudo category (e.g., "right of person") simultaneously, enforcing relational constraints (e.g., a "cat" pixel must lie to the right of a "person"). Finally, these logic constraints are formulated in a deep network architecture by fuzzy logic relaxation, enabling end-to-end learning of spatial-relationally consistent segmentation. RelateSeg achieves state-of-the-art performance in terms of average mIoU across four benchmark datasets and particularly shows clear advantages on images containing multiple categories, with the cost of only introducing a single auxiliary loss function and no additional parameters, validating the effectiveness of NeSy spatial reasoning in OVSS.
