Scalable Query Answering under Uncertainty to Neuroscientific Ontological Knowledge: The NeuroLang Approach

Gaston Zanitti, Yamil Soto, Valentin Iovene, Maria Vanina Martinez, Ricardo Rodriguez, Gerardo Simari, Demian WassermannarXiv 2022 · arXiv

This paper introduces NeuroLang, a probabilistic logic programming language designed to unify the messy, heterogeneous world of neuroscientific data. By combining formal ontologies, large-scale literature databases, and spatial brain imaging data into a single framework, the authors enable researchers to perform complex queries that account for both uncertainty and "open-world" knowledge—tasks that were previously impossible with standard tools.

TL;DR

NeuroLang is a new probabilistic ontology language that allows neuroscientists to query massive, noisy datasets using first-order logic. It bridges the gap between raw brain imaging data and high-level cognitive concepts, enabling scalable and mathematically sound meta-analyses that handle spatial uncertainty and complex anatomical relationships.

What Problem Does This Paper Address?

Neuroscience is currently "data-rich but framework-poor." Researchers have access to thousands of brain imaging studies, text-mined databases like Neurosynth, and formal ontologies like the Cognitive Atlas (CogAt). However, these resources are often siloed.

Current meta-analysis tools generally rely on simple propositional logic. This creates two major hurdles:

  1. Limited Expressivity: You can’t easily ask "segregation queries," such as "Which terms are associated only with the amygdala and no other region?"
  2. Uncertainty & Incompleteness: Brain scans have inherent spatial uncertainty (voxels vs. actual anatomy), and literature databases are incomplete. Standard tools struggle with the "Open World Assumption"—the idea that just because a study doesn't mention a concept doesn't mean that concept isn't relevant.

Methods

The authors propose NeuroLang, a language based on Datalog+/- (a family of logic languages that allow for "existential rules," meaning they can infer the existence of entities not explicitly named in the data).

Key technical innovations include:

  • Probabilistic Semantics: NeuroLang treats facts as random variables. It uses a "possible worlds" approach to calculate the probability that a query is true across all potential states of the data.
  • NeuroLangQA Algorithm: A multi-step pipeline (see Figure 1) that rewrites queries to incorporate ontological knowledge, materializes deterministic facts, and then performs probabilistic inference using either "lifted" techniques (which are very fast) or model counting.
  • Aggregation and Negation: Unlike many logic frameworks, NeuroLang allows for stratified negation and aggregation functions (like max, avg, or percentile). This is crucial for neuroimaging, where researchers often need to threshold probability maps to create visual overlays.
Overview of the NeuroLangQA algorithm, showing the flow from raw data and rules to final probabilistic answers.

Datasets

The authors evaluated NeuroLang using several massive, real-world datasets:

  • Neurosynth: A database of ~14,000 functional MRI studies, including ~3,000 terms and over 1 million term-to-study associations.
  • CogAt (Cognitive Atlas): An ontology of cognitive processes containing over 56,000 rules.
  • IOBC (International Organization for Biological Control): Used for its hierarchical structure of biological terms, adding ~11,000 rules.
  • Destrieux Atlas: A standard anatomical parcellation of the human brain into 112 regions.

Key Insights and Ideas

  • Logic as a Bridge: The core "aha moment" is that first-order logic is the perfect "glue" for neuroscience. It can represent a voxel's coordinates, a study's findings, and an ontology's hierarchy all in the same syntax.
  • Handling the "Unknown": By using existential rules, NeuroLang can reason about sub-processes. For example, if CogAt says "spatial attention" is a part of "visual awareness," NeuroLang can find studies relevant to visual awareness even if the authors only wrote about spatial attention.
  • Reification of Probability: NeuroLang introduces "Probability Encoding Rules" (PERs). These allow the system to calculate a probability and then treat that number as a piece of data that can be further filtered or aggregated (e.g., "Show me only the top 5% most probable voxels").

Key Results

The authors demonstrated NeuroLang’s power through several use cases:

  • Open World Reasoning: They successfully mapped activations for "visual awareness" by automatically traversing the CogAt hierarchy, a task Neurosynth cannot perform natively.
  • Reverse Inference: When querying for terms associated with the "short insular gyrus," NeuroLang was able to filter out noisy, non-specific terms (like "magnetic resonance") by leveraging ontological labels, leaving behind relevant cognitive terms like "memory" and "emotion."
  • Scalability: Despite the complexity, most queries on datasets with millions of atoms were resolved in under 60 seconds on a standard laptop. A complex query involving the IOBC ontology and spatial co-activation took roughly 55 seconds.

Limitations and Future Work

  • User Responsibility: The authors note that because NeuroLang allows users to manipulate probabilities via aggregation, the burden is on the researcher to ensure their custom post-processing remains statistically valid.
  • Negation Constraints: To keep the system scalable (tractable), negation and recursion are restricted to specific parts of the program.
  • Future Directions: The authors suggest that future versions could incorporate even more complex spatial models and a wider variety of neuroscientific ontologies to further refine the accuracy of meta-analyses.

Summary updated

Abstract

Researchers in neuroscience have a growing number of datasets available to study the brain, which is made possible by recent technological advances. Given the extent to which the brain has been studied, there is also available ontological knowledge encoding the current state of the art regarding its different areas, activation patterns, key words associated with studies, etc. Furthermore, there is an inherent uncertainty associated with brain scans arising from the mapping between voxels -- 3D pixels -- and actual points in different individual brains. Unfortunately, there is currently no unifying framework for accessing such collections of rich heterogeneous data under uncertainty, making it necessary for researchers to rely on ad hoc tools. In particular, one major weakness of current tools that attempt to address this kind of task is that only very limited propositional query languages have been developed. In this paper, we present NeuroLang, an ontology language with existential rules, probabilistic uncertainty, and built-in mechanisms to guarantee tractable query answering over very large datasets. After presenting the language and its general query answering architecture, we discuss real-world use cases showing how NeuroLang can be applied to practical scenarios for which current tools are inadequate.
BibTeX
@misc{zanitti2022scalable,
  author = {Gaston Zanitti and Yamil Soto and Valentin Iovene and Maria Vanina Martinez and Ricardo Rodriguez and Gerardo Simari and Demian Wassermann},
  title = {{Scalable Query Answering under Uncertainty to Neuroscientific Ontological Knowledge: The NeuroLang Approach}},
  year = {2022},
  eprint = {2202.11333},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2202.11333},
}
Figure