Be Precise or Fuzzy: Learning the Meaning of Cardinals and Quantifiers from Vision

Sandro Pezzelle, Marco Marelli, Raffaella Bernardi

TL;DR

Humans process exact numbers ("three") and fuzzy quantities ("most") using distinct cognitive pathways. This paper demonstrates that AI models can mirror this distinction: quantifiers are best learned through "fuzzy" cosine similarity, while exact cardinals require magnitude-aware metrics like the dot product.

What Problem Does This Paper Address?

When we look at a group of animals, we might say there are "three dogs" or that "most are dogs." While both describe quantity, they represent different mental operations. Exact numbers (cardinals) require precise counting or "subitizing" (instantly recognizing small groups), whereas quantifiers like few or most describe proportions or set relations.

In computer vision and NLP, quantity is often treated as a simple classification task. However, this ignores the underlying semantics. The authors investigate whether a model can learn the "objective meaning" of these terms through a language-to-vision mapping. They specifically tackle the challenge of learning these meanings in scenes containing both target objects (e.g., dogs) and distractors (e.g., cats), as seen in Figure 1.

Figure 1: How many are dogs? Three/Most.

Methods

The researchers proposed a cross-modal mapping framework where each quantity word (e.g., "two," "most") is learned as a separate function. This function maps a linguistic representation of an object to a visual representation of a scene containing that object in the specified quantity.

  • Visual Representation: They used VGG-19 features (from the fc7 layer) of ImageNet objects, reduced to 100-dimensional vectors via PCA. Scenarios were created by summing the vectors of target and distractor objects.
  • Linguistic Representation: Words were represented using 400-dimensional word2vec (CBOW) embeddings, also reduced to 100-d via PCA.
  • The Models: They compared three architectures:
  • Linear (lin): A simple linear mapping.
  • Cosine Neural Network (nn-cos): A network that maximizes the cosine similarity between the predicted and actual visual vectors. This ignores magnitude, focusing only on the "direction" or proportion of the target object in the scene.
  • Dot-Product Neural Network (nn-dot): A network that approximates a dot product of 1. Because the dot product accounts for vector magnitude, it theoretically encodes how many times a target object is repeated.

Datasets

Because existing datasets rarely contain the specific mixtures of targets and distractors needed to isolate these concepts, the authors built a new synthetic benchmark:

  • Source: 188 concepts from ImageNet.
  • Scenarios: 4,512 synthetic "patchwork" scenes. Each scene contains at most 9 objects.
  • Quantifiers (Qs): no, few, most, all (defined by target-to-total ratios).
  • Cardinals (Cs): one, two, three, four (the "subitizing range" typically learned first by children).
  • Split: The data was split by "combinations" (e.g., 2 targets out of 5 total) to ensure the models had to generalize to unseen proportions during testing.

Key Insights and Ideas

  • Geometry Matters: The core "aha" moment is the geometric interpretation of quantity. Cosine similarity is inherently "fuzzy" because it measures the orientation of a vector—perfect for identifying the proportion of "dog-ness" in a scene regardless of the total number of animals. Conversely, the dot product captures magnitude, making it the natural choice for counting individual instances.
  • Ordered Scales: The models don't just learn labels; they learn a scale. As shown in the boxplots of Figure 2, the similarity measures naturally order the quantities (e.g., few sits between no and most).
  • Plausible Errors: When the models fail, they fail gracefully. They are much more likely to confuse "three" with "four" than "three" with "one." This suggests the learned representations encode the relative position of the word on a numerical scale.
Left: quantifiers against cosine distance. Right: cardinals against dot product.

Key Results

The results strongly supported the initial hypothesis:

  • Quantifiers: The nn-cos model was the clear winner for quantifiers. It achieved a Mean Average Precision (mAP) of 1.0 for the word "all" and significantly outperformed the dot-product model on "no" and "few."
  • Cardinals: The nn-dot model was superior for all exact numbers. For example, for the word "one," nn-dot achieved an mAP of 0.61 compared to just 0.38 for the cosine-based model.
  • Qualitative Success: Confusion matrices (Table 3 in the paper) showed that the nn-cos model for quantifiers primarily confounded most with all, while the nn-dot model for cardinals primarily confounded adjacent numbers like three and four.

Limitations and Future Work

The authors acknowledge several areas for growth:

  • Synthetic Data: The current work uses "summed" vectors in a controlled environment. Moving to real-world natural images is the next logical step.
  • Limited Vocabulary: The study only looked at four quantifiers and four cardinals. Future work should explore higher numbers (beyond the subitizing range) and more nuanced quantifiers like some or almost all.
  • Pragmatics: In real life, "some" and "most" often overlap. The current model uses rigid ratio definitions that don't yet account for the flexible way humans use these words in conversation.

Summary updated

BibTeX
@inproceedings{pezzelle2017be,
  author = {Sandro Pezzelle and Marco Marelli and Raffaella Bernardi},
  title = {{Be Precise or Fuzzy: Learning the Meaning of Cardinals and Quantifiers from Vision}},
  booktitle = {EACL},
  year = {2017},
}
Figure