Abstract
Semantic Web technology has successfully facilitated many RDF models with rich data representation methods. It also has the potential to represent and store multimodal knowledge bases such as multimodal scene graphs. However, most existing query languages, especially SPARQL, barely explore implicit multimodal relationships like semantic similarity and spatial relations. We first explored this issue by organizing a large-scale scene graph dataset, Visual Genome, in an RDF graph database. Based on the proposed RDF-stored multimodal scene graph, we extended SPARQL queries to answer questions containing relational reasoning about color, spatial orientation, and more. Our implementation, VGStore, demonstrates the effectiveness of customized queries and the display of multimodal data.
Introduction
While multimodal models—such as those used for Visual Question Answering (VQA)—have become increasingly powerful, they often operate as "black boxes." Researchers have observed that these models frequently rely on memorizing statistical correlations within datasets rather than achieving a true understanding of underlying visual relationships.
To improve interpretability, some researchers have turned to Knowledge Base Question Answering (KBQA), which parses natural language into structured queries like SPARQL. However, standard SPARQL is designed for text-based RDF data and lacks the native vocabulary to handle multimodal concepts. It cannot inherently process queries such as "Is this object to the left of that one?" or "How similar is this image to a cat?" VGStore addresses this lack of expressiveness by extending SPARQL to handle these implicit multimodal relationships, bridging the gap between structured knowledge bases and raw image data.
Methodology
VGStore is an extension built on top of the gStore graph database. The system architecture is defined by three primary components:
1. Ontology Design
The authors mapped the complex annotations of the Visual Genome dataset into a formal RDF ontology. This structure connects images, regions, objects, and WordNet synsets, providing a rigorous framework for multimodal data.
2. Custom Multimodal Predicates
The system introduces "virtual" predicates (prefixed with ?mm) that represent specific multimodal operations:
?mm.sim: Calculates semantic similarity between entities.?mm.pos: Determines relative spatial positions (e.g., left, right, above).?mm.color: Extracts and compares primary color information.
3. Query Execution Pipeline
When a user submits a query containing these custom predicates, VGStore employs a specialized execution pipeline:
- Interception: The system uses the
pyparsinglibrary to intercept non-standard patterns. - Replacement: It recursively replaces multimodal predicates with standard SPARQL syntax.
- External Execution: The "heavy lifting"—such as image processing or vector mathematics—is pushed to external plugins including OpenCV, PyTorch, and NumPy.
- Restoration: Once the external tools return a result, the engine restores the original query intent to provide a final, human-readable answer.
Datasets and Implementation
The primary dataset utilized is Visual Genome (VG), which contains over 100,000 images with dense annotations of objects, attributes, and relationships. The authors converted this into RDF-VG, a graph-based version of the dataset. They also integrated WordNet synsets to provide a lexical bridge between different scene graphs. The system was validated against the 1.4 million questions included in the original Visual Genome dataset.
Key Insights
- Explainability through Structure: By forcing the reasoning process into a structured SPARQL query, the system provides a clear "paper trail" of how it arrived at an answer, offering a more transparent alternative to end-to-end deep learning models.
- Decoupling Logic from Computation: A major innovation of VGStore is the "replacement and execution" strategy. The database engine handles the graph logic, while specialized computer vision tools handle pixel-level data. This modularity allows the system to remain flexible as new computer vision models are developed.
- Querying the Implicit: Standard databases only recognize explicitly stored triples. VGStore allows users to query implicit data—relationships that are not stored but can be computed on-the-fly from visual evidence.
Results and Performance
The researchers demonstrated that their extended query patterns cover significant portions of the Visual Genome QA dataset: 15.0% of questions involve color, 11.4% involve counting, and 7.0% involve relative spatial positioning.
A functional web-based interface was developed, allowing users to write custom SPARQL queries and view the results visualized with bounding boxes on the original images. This integration successfully merged traditional graph querying with modern machine learning frameworks (Torch/OpenCV) without requiring a total rewrite of the underlying database engine.
Limitations and Future Work
Despite its effectiveness, VGStore faces challenges regarding performance latency. Because the extension is implemented in Python and relies on external tool calls, there is a noticeable runtime penalty. Future iterations aim to move these features into the native C++ core of the SPARQL engine to improve speed.
Additionally, the authors plan to address scalability issues that arise when complex queries involve multiple multimodal predicates. Future work will focus on making the system "dataset-agnostic" and implementing parallel processing for third-party tool calls to handle large-scale data more efficiently.
Summary updated