Papers
Topics
Authors
Recent
Search
2000 character limit reached

CLEVR Dataset for Visual Reasoning Diagnostics

Updated 10 March 2026
  • CLEVR is a synthetic benchmark featuring photorealistic 3D images, functional programs, and scene graphs to evaluate VQA models on compositional reasoning tasks.
  • It uses a domain-specific language to generate diverse, bias-minimized questions with explicit functional program annotations ensuring uniform attribute distributions.
  • Benchmark studies show that while models like Relation Networks excel in multi-step reasoning, challenges remain in handling occlusion and novel attribute combinations.

The CLEVR dataset is a synthetic benchmark designed for diagnostic evaluation of machine learning systems in compositional visual reasoning and language understanding. It consists of photorealistic 3D-rendered images, functional programs detailing compositional question semantics, ground-truth scene graphs, and a large set of natural language questions precisely annotated by reasoning type. CLEVR’s architectural neutrality and bias-minimized construction have made it a central dataset for probing VQA (Visual Question Answering) models’ capabilities and limitations, including systematic generalization, disentangled representations, and reasoning over entities and relations.

1. Dataset Specification and Construction

CLEVR images depict 3–10 rendered 3D objects, sampled independently from the Cartesian product of shapes (cube, sphere, cylinder), sizes (small, large), colors (gray, red, blue, green, brown, purple, cyan, yellow), and materials (metal, rubber), for a total of 96 attribute combinations. Objects are distributed in non-overlapping spatial layouts with uniform lighting and camera jitter to minimize learnable shortcuts based on location or illumination (Johnson et al., 2016). Each object is represented in the ground-truth scene graph as a record comprising canonical attributes and (x,y,z)(x,y,z) position. The dataset comprises 100,000 images, split into 70,000 train, 15,000 validation, and 15,000 test (Johnson et al., 2016, Bahdanau et al., 2019).

CLEVR questions are generated by instantiating functional program templates using a domain-specific language (DSL). These programs are trees of functions implementing compositional sub-tasks (e.g., filtering attributes, traversing spatial relations, counting, logical conjunction/disjunction). An example template might be:

filter_shape[cube]filter_color[red]relate[right]query_size\mathtt{filter\_shape}[cube] \rightarrow \mathtt{filter\_color}[red] \rightarrow \mathtt{relate}[right] \rightarrow \mathtt{query\_size}

which is then rendered as, “What size is the cube to the right of the red cube?” (Perez et al., 2017, Johnson et al., 2016). Each question/program pair is annotated with reasoning type (e.g., existential, counting, comparison, attribute query), topological properties (chain/tree), and program length.

To enforce maximal diagnostic utility and minimal statistical bias, the generation process uses rejection sampling to ensure near-uniform answer and attribute distributions across families, and prunes degenerate or ill-posed questions (e.g., uniqueness constraints or referential ambiguity) (Johnson et al., 2016).

2. Functional Program Grammar and Scene Graph Annotations

Every CLEVR question is paired with a functional program that operates over the explicit scene graph. This scene graph lists object IDs and all attribute values:

G={O1,,On},Oi=(shapei,sizei,materiali,colori,positioni)G = \{ O_1, \ldots, O_n \},\quad O_i = (\mathrm{shape}_i, \mathrm{size}_i, \mathrm{material}_i, \mathrm{color}_i, \mathrm{position}_i)

Question semantics are described in a context-free grammar; for example,

ProgramQueryAttrCountExistIntCmpAttrCmp QueryAttrquery_color(Obj) Countcount(ObjSet) Existexist(ObjSet) \begin{array}{rl} \langle Program\rangle &\to \langle QueryAttr\rangle \mid \langle Count\rangle \mid \langle Exist\rangle \mid \langle IntCmp\rangle \mid \langle AttrCmp\rangle \ \langle QueryAttr\rangle &\to \mathtt{query\_color}(\langle Obj\rangle) \mid \ldots \ \langle Count\rangle &\to \mathtt{count}(\langle ObjSet\rangle) \ \langle Exist\rangle &\to \mathtt{exist}(\langle ObjSet\rangle) \ \end{array}

with referents built recursively via attribute filters and relations (e.g., relate[right]\mathtt{relate}[\text{right}]). All spatial and same-attribute relationships are instantiated as program modules, allowing ground-truth execution and compositional traceability (Johnson et al., 2016, Bahdanau et al., 2019).

Scene graphs also annotate spatial relations (left, right, in front of, behind) and permit automatic derivation of attribute-matching and complex referents. The formal program–scene graph pairing enables precise analyses of reasoning steps, as well as the possibility of program-supervised model learning and introspection.

3. Reasoning Tasks and Question Taxonomy

CLEVR supports a range of diagnostic reasoning tasks:

  • Attribute queries: Identify object attributes under compositional filters (“What color is the object to the left of the yellow sphere?”).
  • Counting: Return counts of objects matching a set of compositional predicates (“How many small gray cylinders are there?”).
  • Existence: Boolean existence queries over compositional attribute-relation filters.
  • Attribute comparison: Compare attributes of different objects (“Do the large sphere and the small cylinder have the same color?”).
  • Numerical comparison: Compare counts of object sets.
  • Logical combinations: Questions requiring conjunction or disjunction (AND/OR) of filters and relations.
  • Relational chains: Multi-step, nested filters and relations, often requiring multi-hop traversal through the scene graph.

Questions are generated to balance across approximately 90 question families and six core reasoning categories, with supporting sublabels for topology and program length. Attribute and answer frequencies are controlled via rejection sampling (Johnson et al., 2016, Perez et al., 2017). The dataset provides roughly 1 million unique question–image pairs, with average question length of 18 words (Johnson et al., 2016, Salewski et al., 2022).

4. Evaluation Protocols and Model Benchmarks

CLEVR specifies answer accuracy as the primary quantitative measure, with per-type breakdowns for question categories. Human performance, as reported in controlled settings, is 92.6% (Santoro et al., 2017, Perez et al., 2017). Baseline models include “question-type” priors (trivial mode voting, e.g., 12.5% for 8-way attribute queries), LSTM-only (question text only, no image), CNN+LSTM, and CNN+LSTM variants with attention, multimodal compact bilinear pooling, or explicit relational modules (Santoro et al., 2017, Johnson et al., 2016).

Notably, Relation Networks (RN) reach 95.5% test accuracy, surpassing humans and outperforming prior models on complex relational queries. The RN architecture computes:

RN(O;q)=fϕ(i,jgθ(oi,oj,q))\mathrm{RN}(O; q) = f_\phi\Bigl(\sum_{i, j} g_\theta(o_i, o_j, q)\Bigr)

where OO is the set of object features, qq is the question embedding, gθg_\theta and fϕf_\phi are learned MLPs, and the double summation enforces permutation invariance (Santoro et al., 2017). RNs show clear advantages on multi-step chains and compositional queries, but still fail under severe occlusion and on spatially intricate tasks, mirroring human error patterns.

Evaluation for new tasks (e.g., CLEVR_X, CLEVR_HYP) extends these protocols to explanation generation (BLEU, METEOR, ROUGE, CIDEr) or mental simulation under hypothetical actions, maintaining the same fundamental structure of ground-truth program/scene-graph execution (Salewski et al., 2022, Sampat et al., 2021).

5. CLEVR Extensions and Diagnostic Benchmarks

CLEVR’s design has spawned a family of synthetic diagnostic datasets targeting broader aspects of vision–language reasoning:

  • CLEVR-X: Adds scene-graph–derived natural language explanations for each image–question pair, facilitating diagnosis of explanation faithfulness and completeness, with user studies reporting >92% explanation correctness (Salewski et al., 2022).
  • CLEVR_HYP: Introduces hypothetical actions (add, remove, move, change) to test joint vision–LLMs’ ability to simulate and reason about post-action scenarios, using paired action text, question, and ground-truth program/answer triplets (Sampat et al., 2021).
  • CLEVR-Ref+: Diagnoses referring expression segmentation and detection, leveraging the scene/program alignment for interpretable, step-wise reasoning ground-truth (Liu et al., 2019).
  • CLOSURE: Constructs zero-probability compositional splits by introducing referring expressions and relational structures never seen during training, exposing failures of models to generalize systematically beyond their training distribution (Bahdanau et al., 2019).

Additionally, libraries such as CLEVR Parser (Saqur et al., 2020) provide graph-conversion pipelines to map CLEVR image-question pairs into GNN-ready structural representations, enabling structured geometric learning, robotic grounding, and program-guided training.

6. Impact on Model Development and Limitations

CLEVR has become the canonical testbed for compositionality, systematic generalization, and interpretable vision–language reasoning. Key empirical findings include:

  • Standard attention and deep CNN architectures can excel at local attribute or single-filter tasks, but fail to generalize on multi-step, comparison, and logical queries (Johnson et al., 2016).
  • Models readily exploit statistical biases and dataset shortcuts when present. CLEVR’s bias-minimized construction exposes the necessity for explicit relational, modular, or neuro-symbolic inductive biases.
  • Systematic generalization remains short of human-level, as evidenced by performance drops on CLOSURE splits and in novel attribute–referent combinations (Bahdanau et al., 2019).

Identified limitations include restriction to synthetic, stylized imagery (lacking intra/inter-object occlusion and scene complexity of natural images), modular questions amenable to explicit functional program parsing, and a closed attribute and relational universe. Extensions to real-world scenes (e.g., via Visual Genome) require additional adaptation of parsing and representation toolkits (Saqur et al., 2020).

7. Scientific Significance and Future Directions

CLEVR’s diagnostic rigor and annotation granularity have driven advances in symbolic, modular, and graph-based reasoning models, relational architectures (e.g., RNs), and interpretable vision–language systems. The dataset is extensively used to highlight model failings, test systematic generalization, and benchmark explanation faithfulness in closed and controlled conditions (Santoro et al., 2017, Salewski et al., 2022). CLEVR’s methodology—synthetic generation with explicit program-graph alignment and answer balancing—is now a standard paradigm for reliability testing of AI models.

Future extensions focus on:

  • Scaling to richer, real-world imagery with naturalistic linguistic variation.
  • Augmenting with physically plausible dynamics (CLEVR_HYP).
  • Extending explanatory coverage and compositional generalization evaluations (CLEVR-X, CLOSURE).
  • Bridging synthetic/real bias by integrating CLEVR-style graph representations with datasets such as GQA and Visual Genome (Saqur et al., 2020, Salewski et al., 2022).

CLEVR remains a fundamental tool for dissecting and advancing the systematic reasoning capabilities of machine learning systems in vision–language domains.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to CLEVR Dataset.