---
title: "Counting Everyday Objects in Everyday Scenes (2017)"
description: "Counting Everyday Objects in Everyday Scenes tests whether adding local counts with image-wide context improves object counting in…"
canonical: "https://research.elamur.ai/free/en/papers/chattopadhyay-2017-counting-everyday-objects-everyday-scenes/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/chattopadhyay-2017-counting-everyday-objects-everyday-scenes/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2017](https://md.research.elamur.ai/free/en/papers/2017/) / Counting Everyday Objects in Everyday Scenes

# Counting Everyday Objects in Everyday Scenes

Paper · 2017 · Prithvijit Chattopadhyay, Ramakrishna Vedantam, Ramprasaath R. Selvaraju et al.

**Authors:** Prithvijit Chattopadhyay, [Ramakrishna Vedantam](https://md.research.elamur.ai/free/en/authors/ramakrishna-vedantam/), [Ramprasaath R. Selvaraju](https://md.research.elamur.ai/free/en/authors/ramprasaath-r-selvaraju/), [Dhruv Batra](https://md.research.elamur.ai/free/en/authors/dhruv-batra/) and [Devi Parikh](https://md.research.elamur.ai/free/en/authors/devi-parikh/) · **Year:** 2017 · **Venue:** IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings - IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings · **Licence:** [arXiv — non-exclusive license to distribute](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

[**151** citations OpenAlex, 2026-10-14](https://openalex.org/works?filter=cites:W2340590112) · [Cited by **17** papers in our library of more than 163,000 papers whose bibliographies we read](https://md.research.elamur.ai/free/en/papers/chattopadhyay-2017-counting-everyday-objects-everyday-scenes/cited-by/) · [IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings - IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings](https://openalex.org/S4210176548) · [licence](http://arxiv.org/licenses/nonexclusive-distrib/1.0/)

- [PDF](https://arxiv.org/pdf/1604.03505)
- [DOI 10.1109/cvpr.2017.471](https://doi.org/10.1109/cvpr.2017.471)
- [arXiv 1604.03505](https://arxiv.org/abs/1604.03505)
- [OpenAlex](https://openalex.org/W2340590112)

Citations: OpenAlex, 2026-10-14.

## Summary

A photograph can contain several chairs, a bottle partly hidden behind a plate, and a table that extends beyond the frame. How many instances of each kind are visible? Counting Everyday Objects in Everyday Scenes treats that question as a task in its own right. An object detector offers one answer by finding and tallying boxes. The authors ask whether a system trained to predict counts directly can make better use of evidence that falls short of a full detection, such as a visible part of an object or a repeated pattern in a crowded area.

The authors compare detection with a whole-image estimate and two ways of counting by region. Both regional approaches divide the image into a grid, predict a contribution from each cell, and add the contributions. A training box that crosses a cell boundary contributes a share of an object to each cell it covers, in proportion to the area of the box in that cell. The first approach estimates each cell in isolation. The second, called sequential subitizing, lets information travel across the grid before making those estimates. A crop showing the upper body of a person can then be interpreted with evidence from neighboring crops.

The clearest improvements appear on the [COCO](https://md.research.elamur.ai/free/en/papers/lin-2014-microsoft-coco-common-objects-context/) Count-test split. Mean root squared count error across categories is 0.49 for counting detections, 0.38 for independent cell estimates, and 0.35 for sequential subitizing. On PASCAL VOC 2007 Count-test, the corresponding errors are 0.50, 0.43, and 0.42. The authors report that the improvement from independent to contextual cell estimates is statistically inconclusive on PASCAL. Averaging several counting approaches helps on some measures. A simple prediction of absence can also score deceptively well on the full sets because most categories are missing from most images.

The paper tests two uses for the resulting counts. On PASCAL, using sequential subitizing to select how many detections to retain gives a reported gain of 1.74% in mean F-measure over a detector with fixed category thresholds. In [visual question answering](https://md.research.elamur.ai/free/en/topics/multimodal/), the authors test selected counting questions for which the annotated category total agrees with the recorded answer. The ensemble reaches a mean root squared error of 1.80 on that VQA subset, and sequential subitizing reaches 1.34 on the corresponding COCO-QA subset. These experiments show what a dedicated counter can contribute when the category to count has already been resolved.

## Deep dive: Counting Everyday Objects in Everyday Scenes

Counting Everyday Objects in Everyday Scenes tests whether adding local counts with image-wide context improves object counting in photographs. · about 35 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### What a count needs from an image

The paper asks for a separate count for each category in a pre-defined vocabulary. A single photograph can require estimates for furniture, appliances, and small objects, with zeroes for all the categories absent from the scene. In the paper’s kitchen example, there are three spoons, four chairs, one dining table, one oven, and one potted plant. These objects share an image while providing very different kinds of evidence. A table can occupy much of the frame. A spoon can take up a small patch. Several chairs can have similar appearances while being partly hidden by the table or by one another.

An image classifier can supply evidence that a category is present. Multiplicity asks more of the image representation. A feature that responds strongly to the presence of a chair might respond just as strongly when several chairs are visible. A detector supplies more detailed evidence by predicting a location for each instance. If all the detections were correct and each instance had a single detection, tallying them would solve the counting task. Actual detections introduce two ways to get the total wrong. A visible object can go unreported, and several boxes can be assigned to the same object. Errors of these kinds can also cancel in the total, so a correct total on its own establishes little about localization.

The paper illustrates the distinction with mugs on a table. Overlap can make it difficult to establish the full outline and position of every mug. Separate visible handles can still support an estimate of how many mugs are there. The cue serves a count even when it would be inadequate for drawing a faithful box around each instance. Small objects pose a related problem. Several weak local responses may collectively support a count even when each falls below the confidence needed to report an individual detection.

The difficulty also runs in the other direction. A local piece of evidence can look like a complete instance when isolated. A bicycle wheel could carry information about a bicycle, while a crop containing part of that bicycle could be counted again elsewhere. This is the issue the paper addresses with context across image cells. A good count needs enough spatial detail to retain small signals and enough context to tell whether spatially separated signals belong to the same evidence.

#### What earlier counting work assumed

The authors describe earlier counting systems for settings such as surveillance, dense crowds, microscopy, and images of specific animals. These settings provide reasons to estimate counts directly. In a crowded surveillance view, for example, occlusion makes individual person detection difficult. One earlier method used low-level image measurements with Bayesian Poisson regression to estimate counts in crowds. Another grouped parts of a video by similar motion and estimated a count for each region with Gaussian process regression. These approaches used a recurring subject and, in the video setting, motion evidence that a single everyday photograph cannot supply.

The paper also describes density-based counting. A density estimate expresses how much object presence is associated with each part of an image. Accumulating that estimate yields a total. The authors cite a method that learned density from low-level features and demonstrated it on people in surveillance images and on cells in microscopy images. They also discuss convolutional approaches used for crowds and penguins. That history motivates local accumulation, while leaving open what kind of visual representation works for counting many categories in varied scenes.

The contrast concerns both the distribution of totals and the appearance of the targets. In dense crowd images, a large number of people may occupy the scene together, and overlap can be the central obstacle. In everyday photographs, a category may appear in very different forms, at very different scales, and against different backgrounds. Most categories are absent from any given photograph. An approach must therefore learn to distinguish categories as well as accumulate repeated evidence. Texture can be informative in a patch of densely grouped small objects. A large object spanning several cells gives local patterns a different meaning.

Earlier work on salient object subitizing addressed another kind of count. It asked how many visually prominent objects an image contained irrespective of category. The authors ask for counts distinguished by category, which requires deciding what each piece of evidence belongs to. They also distinguish the role of counts in detection. The earlier saliency work used counts to help find prominent objects. This paper investigates whether separate counts for ordinary categories can help a generic detector decide how many boxes to retain for each category in a particular photograph.

#### Why use subitizing as the starting point?

Subitizing refers to the ability to recognize a small quantity quickly. The paper describes a typical range of 1-4 and invokes patterns such as the pips on a die. The analogy concerns the scale of the judgment. A small group can have a recognizable visual arrangement, while a larger collection is harder to assess in a single glance. If parts of an image contain smaller groups, an estimator can make several local judgments and use addition to arrive at the scene total.

A photograph complicates the analogy because the boundaries of a grid seldom align with the boundaries of objects. A cell can contain several small objects, one complete object, or a fraction of a much larger object. Breaking the image into cells reduces the number of instances that a local estimator may need to distinguish. It also creates a new task, estimating how much of an instance lies inside a cell. The paper makes that task explicit in the training targets and then uses context to give the estimator evidence about nearby parts.

The authors pursue a benchmark as well as an architecture. Counting by detection asks how much a localization system can recover. Whole-image regression asks what can be learned from a global image description. Independent regional regression asks what changes when the total is composed from local estimates. Sequential subitizing asks whether those estimates improve when each can draw on the rest of the scene. The differences among these approaches determine what evidence is available at the moment a count is made.

#### Why ask about counts in visual questions?

In the [VQA benchmark](https://md.research.elamur.ai/free/en/papers/agrawal-2015-vqa-visual-question-answering/), a system receives an image and a natural-language question about it. A question about quantity can require two decisions. The system has to resolve the objects referred to by the question and then estimate their number. A color, a location, or other wording can narrow the requested set. The paper studies whether a separate counter helps with the numerical part when the requested set can be represented by an available object category.

The authors also point to a difference in training objectives. In ordinary answer classification, alternative numerical answers act as different classes. The loss gives credit for assigning probability to the recorded answer. Numerical distance is absent from that objective. From the viewpoint of a count, how far the answer misses matters. A regression objective can express that distance directly, and the evaluation can distinguish small numerical errors from large ones. This is the basis for the paper’s comparison with general-purpose approaches to visual questions.

The interest in category-specific questions follows earlier work that diagnosed performance by question type. The paper mentions work that examines how visual question answering behaves under compositional changes and the [CLEVR](https://md.research.elamur.ai/free/en/papers/johnson-2016-clevr-diagnostic-dataset-compositional-language/) benchmark’s use of question types such as counting and attribute comparison. Here the diagnostic targets everyday photographs. Their objects have natural variation in size and appearance, and the questions have to be connected to an existing annotation vocabulary before the experiment can focus on count error.

### The method, step by step

#### From the photograph to a count

The regional methods use two levels of description. The image is divided spatially, and each crop is represented by a vector of visual features. Those vectors come from the fc7 layer of the [VGG-16 network](https://md.research.elamur.ai/free/en/papers/simonyan-2014-very-deep-convolutional-networks-large/). A vector is a collection of numerical responses to the crop. A learned count predictor turns the responses into estimates for the object categories. The authors compare features taken from a network trained for [ImageNet classification](https://md.research.elamur.ai/free/en/papers/russakovsky-2014-imagenet-large-scale-visual-recognition/) with features whose weights were subsequently adjusted for detection. They call the former `noft` and the latter `ft`.

Sequential subitizing uses the feature vectors as a spatial collection. A compact representation is learned for every cell. Each of the two traversal orders presents those representations to a recurrent network, which propagates information between cells. A cell then receives a contextual representation built from both traversals. The final regression stage predicts category contributions at the cell level, and the contributions are added by category. The stages can be understood independently of the exact order in which the recurrent networks read the grid.

Sequential subitizing for category counts The steps in order.

Training uses object annotations. Whole-image regression takes the image totals as its targets. Regional regression uses bounding boxes to distribute those totals across the grid. A bounding box is the annotated rectangle enclosing an instance. Training depends on the boxes to define local targets, while prediction uses the photograph and the learned parameters to estimate those targets.

#### Counting detections and learning to glance

The detection baseline uses Fast R-CNN. Its preliminary outputs include boxes with scores, and the final set of boxes depends on two operations. Non-maximum suppression removes likely duplicates according to their overlap. A score threshold removes low-confidence boxes. A system that reports too many overlapping boxes can overcount, while one that removes nearby true instances or rejects weak boxes can undercount. The best setting for predicting the number of instances can therefore differ from a detector’s default settings.

The tuning procedure makes these decisions category by category on Count-val. The authors start with a non-maximum suppression threshold of 0.3 and search score thresholds between 0 and 1. They then hold the selected score threshold fixed and search the suppression threshold from 0 to 1. The setting is selected for count error, and the retained boxes are tallied to give the class count. The comparison with a default detector measures what changes when the box-selection procedure is tuned for counting.

The whole-image method, called `glance`, asks what can be estimated in a single pass over a global feature vector. The vector goes into a multilayer perceptron, a sequence of learned transformations that ends in numerical outputs for the categories. The hidden layers use rectified linear units, or ReLUs, which suppress negative activations, and the architecture uses batch normalization between hidden layers. The paper reports an L2 objective for this regression. Larger deviations from the target are penalized more heavily because the error is squared.

For `glance`, the learning rate is 10⁻³ and the stated weight decay is 0.95. The authors compare 1 and 2 hidden layers and vary the width of those layers. The output depends on the whole image representation at once. The result is a direct count estimate whose training target does not assign individual pieces of the total to separate regions. This creates a useful comparison with the regional methods, where local contributions and their sum are part of the design.

#### Making the grid and assigning partial counts

The authors choose equal-sized cells and consider grid resolutions including 3 × 3, 5 × 5, and 7 × 7 for independent regional counting. In the notation below, the first equation defines the coverage of the grid and the second expresses exclusivity. The cells cover the picture together, and different cells share no counted area.

```
I = ⋃ᵢ₌₁ⁿ pᵢ
```

I is the image and pᵢ is the cell with index i. The union symbol ⋃ combines all the cell regions, with indexing beginning at 1 and ending at n, the number of cells. The equality says that their combined region is the image.

```
pᵢ ∩ pⱼ = ∅ for i ≠ j
```

Here pᵢ and pⱼ denote cells at indices i and j. The intersection symbol ∩ denotes their common region and ∅ denotes the empty set. The condition i ≠ j restricts the assertion to distinct cells.

A fixed grid makes the problem of object boundaries explicit. Consider the paper’s example of sheep and a bus. A coarse partition can leave a crowded group of sheep together in one cell, so that the local estimate still has to resolve a large quantity. A fine partition can cut the bus into small pieces, some of which contain little evidence for either its category or the share of the instance inside the crop. Grid size controls both the number of complete instances a cell can contain and the amount of an individual instance that the cell can show.

The target for a cell is built by assigning each category box to the cells it overlaps in proportion to its area. A cell containing an entire box receives a whole contribution for that instance. A cell outside the box receives zero from it. When a box crosses boundaries, each cell receives the part measured by its intersection with the box. Several boxes of one category can contribute to the same cell, so the target can include both complete objects and parts.

```
cᵏᵍᵗ(pᵢ) = Σⱼ₌₁ᴺ [area(pᵢ ∩ bⱼ) / area(bⱼ)]
```

The symbol cᵏᵍᵗ(pᵢ) denotes the ground-truth partial count in cell pᵢ for category k. The superscript gt identifies a training target. Each bⱼ is the bounding box of instance j of that category, and N is the number of such boxes in the image. The function area measures the size of the region in parentheses, so area(pᵢ ∩ bⱼ) is the area shared by the cell and the box. The slash divides that shared area by the full box area. The summation Σ adds the resulting shares over boxes j from 1 through N. With no boxes of category k, the target contribution is zero.

This construction preserves the total implied by the annotations. Across all cells, the intersection areas for a given box cover that box, and the denominator stays the same for every share. Thus the contributions of a single annotated instance add to one instance, even when spread across the image. The target measures fractions of the enclosing rectangle. What counts as a large share of a box therefore depends on geometry, even if the visual evidence inside that part of the box is ambiguous.

In the independent approach, called associative subitizing or `aso-sub`, every cell becomes a separate training example. Its input is the crop’s feature vector and its target is the vector of partial counts assigned to that crop. An image partitioned into n cells supplies n examples in place of one whole-image example. The predictor uses the same family of perceptron architectures as `glance`. All its evidence for the current prediction comes from the current cell. At evaluation time, the cell predictions are combined as follows, separately for each category.

```
c = Σᵢ₌₁ⁿ max(0, cₚᵢ)
```

The total c is the image-level estimate for the category under consideration. The prediction cₚᵢ is that category’s estimated contribution in cell pᵢ, and n is again the number of cells. The function max takes the larger of zero and the cell prediction. The sum Σ runs over cell indices i from 1 through n. Clipping each estimate before addition prevents a negative prediction in one cell from canceling positive evidence from another.

#### Giving a cell evidence from its neighbors

The paper illustrates the cost of independence with photographs containing a person. In a 2 × 1 division used for illustration, similar patches show the upper portion of a person. In one photograph the whole annotated instance is assigned to the crop, giving the cell a target of 1. In the other, the person’s annotation extends into the other cell and the illustrated crop receives 0.5. A local predictor can encounter essentially the same visible cue with two different numerical targets. The situation arises from the grid and the annotation geometry as well as from variation in appearance.

This creates a problem for a regression loss whose preferred output summarizes the targets associated with a given input. The authors discuss squared error and Huber loss in this connection. Under the interpretations they describe, the associated distributions have a single central region of high density. A cell appearance compatible with distinct targets may yield a compromise estimate. Knowing whether the rest of the object continues elsewhere in the image can change which target is appropriate. The neighboring evidence must be part of the input if the predictor is to use it.

The contextual version, `seq-sub`, first maps each visual feature vector through a learned hidden layer. Its overall prediction rule for one cell is written as follows.

```
cₚᵢ = h(f₁(x₁, θ₁), …, fₙ(xₙ, θₙ), i, θ)
```

The quantity cₚᵢ is the predicted count output for cell pᵢ and contains the estimate for each category. The vector xⱼ is the visual feature vector for cell pⱼ. The function fⱼ makes a hidden representation from xⱼ using parameters θⱼ. The subscripts run from the first cell to the nth cell, with the ellipsis standing for the intervening representations. The function h uses those representations and the index i to produce the output for the selected cell. Its parameters are denoted by θ. The equation allows the prediction at pᵢ to depend on evidence anywhere in the partition.

The implementation orders the hidden representations along two paths across the grid, called N and Z for their arrangements on a 3 × 3 grid. The paths are chosen with the spatial nearness of cells in mind. Each path is processed by a stack of 2 bidirectional long short-term memory layers. An LSTM is a recurrent network that maintains a state as it reads a sequence. Bidirectionality gives the representation at a cell access to information from positions before and after it in that order. The sequence produces an output state for each input position, so both results can be matched back to their original cells.

```
vᵢ = L₁(Hₒ₁, i, θₗ) ∥ L₂(Hₒ₂, i, θₗ)
```

The collection H consists of the hidden cell representations. Hₒ₁ and Hₒ₂ are that same collection in the two traversal orders, with o₁ and o₂ identifying the orders. L₁ and L₂ denote the stacks associated with those orders. The argument i selects the output for the same spatial cell pᵢ from each stack, and θₗ denotes the recurrent parameters in the paper’s notation. The symbol ∥ means concatenation, which joins the components of the two output vectors into one. The resulting vᵢ is the context vector for cell pᵢ.

```
cₚᵢ = g(vᵢ, θg)
```

The function g is the learned prediction stage after contextual processing. It takes the context vector vᵢ and uses parameters θg to generate the cell-count output cₚᵢ. The recurrent stacks followed by g implement the function h in the earlier equation. The hidden transformations use ReLUs. Every prediction retains an association with a particular grid cell, which makes the same area-based targets and summation rule available in both regional approaches.

Sequential subitizing is trained with Huber loss, which acts like squared error for small deviations and grows linearly for sufficiently large ones. The stated learning rate is 10⁻⁴ and weight decay is 0.95. The authors use [Adam](https://md.research.elamur.ai/free/en/papers/kingma-2014-adam-method-stochastic-optimization/) for optimization, with a mini-batch size of 64. A mini-batch groups training examples for an update. Though the two regional approaches share the target construction and the aggregation rule, their training architectures differ. The contextual version learns how to use all the cell representations to predict each contribution.

#### Combining methods and using their outputs

The ensemble, called `ens`, averages selected counting predictions. The motivation is that approaches with different views of the scene can make different errors. A global representation can be informative when a scene contains a prominent object. An independent cell estimate can preserve local repetition. The contextual approach can use both local appearance and information that crosses cell boundaries. Whether their average improves a result depends on the errors they actually make. The experiments compare several combinations.

For detection, the predicted count is used to choose how far to go down a detector’s scored list of boxes for an image and category. This gives the count a different role from the detection baseline. In the baseline, the list determines the count. In the application, a separate estimate of the count helps determine how many boxes to report. The scheme still relies on the detector to supply and rank the candidate boxes.

For visual questions, the predicted count has to be associated with the category named by the question. The authors extract a noun and match it to the annotation vocabulary using cosine similarity between [word embeddings](https://md.research.elamur.ai/free/en/concepts/word-embeddings/). These embeddings represent words as numerical vectors, and cosine similarity compares their directions. When several nouns are present, the procedure uses the first, following the authors’ observation about the typical wording of the counting questions. The appendix describes bringing nouns to singular form and training [word2vec](https://md.research.elamur.ai/free/en/papers/mikolov-2013-distributed-representations-words-phrases-their/) embeddings on Wikipedia. When the best match is to a COCO super-category, the procedure sums estimates for its member categories. An animal question can therefore be answered using counts of the categories grouped under animals.

### Experiments and results

#### The image splits and what the errors measure

PASCAL VOC 2007 has 20 object categories. Its training, validation, and test sets contain 2501, 2510, and 4952 images respectively. The validation set becomes Count-val, used for choices such as detector thresholds and which system variant to report. The test set becomes Count-test. COCO has 80 categories, a training set of 82,783 images, and a validation set reported as 40, 504 images. The authors use the first half of that validation set as Count-val and the second half as Count-test.

Zero is the most frequent count for a category in either dataset. The histogram of non-zero instances also favors small counts, although it contains a range of larger ones. The authors report an average of 1.98 annotated objects per scene on PASCAL Count-val and 7.22 on COCO Count-val. These are averages over the annotated objects in each scene. They help explain how COCO scenes can contain more annotated objects and still have many absent categories. The category vocabulary over which absence is counted is also larger. The paper reports results averaged over 10 random test samples drawn with replacement.

To calculate count error, the authors clip predictions at zero and round to the nearest integer. The metrics are first calculated for each category and then averaged across categories. RMSE is root mean squared error. Squaring gives larger misses more influence, and the square root puts the error back on the scale of a count. The formula for one category is as follows.

```
RMSEₖ = √[(1/N) Σᵢ₌₁ᴺ (ĉᵢₖ − cᵢₖ)²]
```

The subscript k selects the category. The index i identifies an image, ĉᵢₖ is its processed prediction for that category, and cᵢₖ is its ground-truth count. Their difference is the signed count error. The superscript ² squares the error, Σ adds the squared errors from image 1 through image N, and 1/N averages them over the N images. The radical √ takes the square root of that average. The mean of the category-level values is reported as mRMSE.

The relative version gives errors different weights depending on how many objects are present. The paper motivates this by comparing an error of 1 when the correct count is 2 with an error of 1 when the correct count is 25. The absolute errors are equal, while their importance as departures from the correct quantity can differ. The relative metric applies the weighting before averaging.

```
relRMSEₖ = √[(1/N) Σᵢ₌₁ᴺ ((ĉᵢₖ − cᵢₖ)² / (cᵢₖ + 1))]
```

Here relRMSEₖ is relative RMSE for category k, with i, N, ĉᵢₖ, and cᵢₖ denoting the same image index, number of images, prediction, and target as before. Each squared error is divided by the target count plus 1. The added 1 leaves the denominator positive when the target is zero. The sum, average, and square root have the same roles as in RMSE. The mean of these category-level values is m-relRMSE.

The paper also reports versions of both metrics restricted to image-category pairs with positive ground-truth counts. The suffix `nz` identifies this condition. These measures show how far predictions miss when the category really is present. The all-pairs measures also account for spurious positive predictions on absent categories. For example, a counter that always predicts 1 makes a mistake on every absent category but can give a plausible estimate on many positive examples. The two evaluation conditions give the reader a way to see the cost and benefit of that strategy.

#### Counting baselines and PASCAL results

The fixed baselines give a sense of how much a count predictor can achieve from the distribution of answers alone. `always-0` predicts the most common count, and `always-1` predicts the most common positive count. The `mean` baseline uses the average count on Count-val, while `category-mean` uses a separate validation average for each category. The `gt-class` baseline learns to classify the desired count using cross-entropy, so the comparison includes a supervised predictor with discrete count labels as well as the fixed rules. The authors also compare default and tuned detection, variants of the whole-image estimator, and several regional configurations. The main test tables show variants selected using validation results.

Counting approaches on PASCAL VOC 2007 Count-test by mean RMSE Both regional approaches improve over detection and whole-image regression, with the contextual approach matching the ensemble.

**The numbers**

| System or setting | mRMSE |
| --- | --- |
| Always predict zero | 0.66 |
| Category mean | 0.64 |
| Count classification | 0.55 |
| Detection tally | 0.50 |
| Whole-image regression | 0.50 |
| Independent cell estimates | 0.43 |
| Sequential subitizing (this paper) | 0.42 |
| Ensemble | 0.42 |

The matched mRMSE of 0.50 for detection and whole-image regression gives little reason to choose between them on that metric alone. Among positive ground-truth examples, detection has an mRMSE-nz of 1.92, while the best `glance` entry, using classification features and 2 hidden layers, has 1.83. Their m-relRMSE-nz values are 0.85 and 0.73 respectively. Whole-image regression has a slight disadvantage on all-pairs relative error, with m-relRMSE of 0.27 compared with 0.26 for detection. Which of the two appears preferable depends on whether the objective emphasizes performance when an object is present.

The most direct comparison for the regional design uses detection-adjusted features and a 3 × 3 grid in both systems. On all pairs, independent subitizing records mRMSE of 0.43 ± 0.01 and sequential subitizing records 0.42 ± 0.01. On positive pairs, each records mRMSE-nz of 1.65 ± 0.07. Their reported m-relRMSE-nz values are also equal at 0.68 ± 0.02. The authors find the change from independent to sequential estimation statistically inconclusive on this dataset. The larger numerical improvement over whole-image regression is already visible with independent estimates.

The ensemble averages the selected whole-image, independent, and sequential predictions. On PASCAL Count-test it records 0.20 ± 0.00 m-relRMSE and 0.65 ± 0.01 m-relRMSE-nz. Those values are lower than the corresponding sequential results of 0.21 ± 0.01 and 0.68 ± 0.02. Absolute error among positives favors the sequential approach, with 1.65 mRMSE-nz against 1.68 for the ensemble. The simple `always-1` baseline reports 0.96 mRMSE-nz, even though its all-pairs mRMSE is 1.14. A strong result for that baseline among positives reflects the concentration of the selected examples at small counts and the baseline’s freedom from having to predict absence on that slice.

#### COCO results and the value of context

Counting approaches on COCO Count-test by mean RMSE Sequential subitizing leads the comparison, and both regional approaches improve on the detection tally.

**The numbers**

| System or setting | mRMSE |
| --- | --- |
| Always predict zero | 0.54 |
| Category mean | 0.52 |
| Count classification | 0.47 |
| Detection tally | 0.49 |
| Whole-image regression | 0.42 |
| Independent cell estimates | 0.38 |
| Sequential subitizing (this paper) | 0.35 |
| Ensemble | 0.36 |

On COCO, the whole-image result in the chart uses detection-adjusted features and 1 hidden layer. Its mRMSE is 0.42 ± 0.00. The independent cell approach has mRMSE of 0.38 ± 0.00, followed by 0.35 ± 0.00 for sequential subitizing. Their mRMSE-nz values are 2.25 ± 0.02, 2.08 ± 0.02, and 1.96 ± 0.02, respectively. Relative error over positive examples follows the same order, with m-relRMSE-nz of 0.91 ± 0.00, 0.87 ± 0.01, and 0.82 ± 0.01. This gives a clearer picture than the all-pairs scores alone. Both regional methods improve the numerical estimates where the category is present, and the contextual method adds a further improvement.

The all-pairs relative measure on COCO puts sequential subitizing and the ensemble at 0.18 m-relRMSE. On positive pairs, the ensemble has 0.81 m-relRMSE-nz and sequential subitizing has 0.82. The order reverses for mRMSE-nz, where the ensemble records 1.98 and sequential subitizing records 1.96. Thus the strongest single approach and the averaged prediction are close enough for the choice of metric to matter. The all-zero baseline also illustrates why results from the full evaluation and the positive slice deserve separate attention. It records 0.54 mRMSE on all pairs and 3.03 mRMSE-nz on the positive ones. The authors connect its relatively low all-pairs error to the many categories absent per COCO image.

The paper also compares sequential subitizing with a recurrent instance-segmentation approach that published counts for person and zebra on COCO. For person, it reports an advantage for sequential subitizing of 1.29 RMSE and 0.24 relative RMSE. For zebra, the comparison favors the other approach by 0.4 RMSE and 0.23 relative RMSE. The authors say that a discussion with the other researchers raised questions about that evaluation setup. The comparison provides a result for each of the categories studied, with uncertainty about how directly the reported performances can be matched.

#### Using estimated counts to choose detections

In the PASCAL detection application, the decision is how many candidate boxes to report for a category in an image. The base detector uses a score threshold selected separately for each category on validation data. Each threshold is chosen to maximize that category’s F-measure, which combines precision and recall using their harmonic mean. Precision concerns the share of reported detections that match an annotated object. Recall concerns the share of annotated objects that receive a match. Averaging the F-measure over images and categories gives the metric the authors call mF.

The matching procedure starts by associating a candidate detection with the annotated box it overlaps most. A match requires an overlap greater than 0.5, and a matched detection and annotation are taken out of further consideration. This is a fixed-decision evaluation. Average precision, which the paper discusses as a standard detection measure, sweeps over score thresholds. The experiment instead asks how well the selected set of boxes works at the operating point chosen for the image. It uses mF to evaluate that choice.

The base detector gets 15.26% mF. When the actual annotated counts are available to choose how many detections to retain, the reported oracle result is 20.17% mF. The oracle shows how the existing ranked candidates perform under this count-based selection when the desired quantity is known. When predictions supply the counts, the authors use the base threshold whenever the estimate is 0. Their analysis finds undercounting more often than overcounting, and a zero can therefore conceal a missed category. Positive predictions instead guide how many boxes to keep. The paper reports gains over the base detector of 1.64% mF for the ensemble and 1.74% mF for sequential subitizing.

The result gives the counting estimates an independent use. A count trained to fit scene totals can change a localization system’s reporting decision, even though the count does not itself specify the correct boxes. The F-measure gain establishes that those changes are helpful on average in this experiment. Which location is reported still depends on the boxes and scores produced by the detector.

#### Counting on selected visual questions

The authors use both VQA, which contains free-form questions about images, and [COCO-QA](https://md.research.elamur.ai/free/en/papers/ren-2015-exploring-models-data-image-question/), whose questions are generated from captions. Both use COCO images. About 10.28% of questions in VQA and 7.07% in COCO-QA are identified as object counting questions of the how-many type. The authors keep questions with numerical answers. The appendix describes converting written numbers in COCO-QA to numeric form so that they can be used in a count comparison.

An automatic noun-to-category match can leave out a qualifier. Asking about bottles within a refrigerator, for instance, names a category and a location. A whole-image bottle count can answer that question if the photographed bottles are all inside the refrigerator. The same count can miss if other bottles in the scene fall outside the region named by the question. The authors use an oracle filter to study cases where the annotated count for the resolved category agrees with the numerical answer. This gives Count-QA subsets with 1774 questions from VQA and 513 from COCO-QA.

Counting approaches on the VQA Count-QA subset by mean RMSE The ensemble has the lowest recorded error on the shared numerical-answer evaluation.

**The numbers**

| System or setting | mRMSE |
| --- | --- |
| Detection tally | 2.72 |
| Whole-image regression | 2.19 |
| Independent cell estimates | 1.94 |
| Sequential subitizing | 1.81 |
| Ensemble (this paper) | 1.80 |
| Deeper LSTM | 2.71 |
| Multimodal compact bilinear pooling | 3.25 |

The VQA comparison uses the questions for which both general VQA systems produced a numerical answer. The Deeper LSTM system gave 11 non-numerical answers and the [multimodal compact bilinear pooling system](https://md.research.elamur.ai/free/en/papers/fukui-2016-multimodal-compact-bilinear-pooling-visual/) gave 3. The paper evaluates the systems on the shared numerical-answer slice, retaining the use of an error metric that measures numerical distance. The whole-image counter records 2.19 ± 0.05 mRMSE, sequential subitizing records 1.81 ± 0.09, and the ensemble records 1.80 ± 0.07. The two general VQA comparisons record 2.71 ± 0.23 and 3.25 ± 0.94 mRMSE, respectively.

On COCO-QA Count-QA, detection records 2.59 ± 0.12 mRMSE and the whole-image estimator records 1.86 ± 0.12. The independent regional method records 1.47 ± 0.04, followed by 1.34 ± 0.07 for sequential subitizing and 1.40 ± 0.08 for the ensemble. The paper gives no corresponding COCO-QA entries for the general VQA systems in the chart. The useful comparison on that subset is among the counting approaches. The authors describe the question experiments as a proof of concept and announce plans to make their code, data, and Count-QA subsets public.

### What the ablations show

#### Global and local predictors use different features well

The appendix examines the hidden layers and input features of `glance` and `aso-sub` on Count-val. The authors search hidden widths of 250, 500, 1000, 1500, and 2000, then compare using 1 or 2 hidden layers. On PASCAL Count-val, the whole-image estimator with detection-adjusted features and 1 hidden layer changes little with width. The version using classification features performs best at smaller widths when restricted to 1 hidden layer. Giving the classification features 2 hidden layers produces the strongest whole-image setting in this comparison. The authors suggest that features trained to describe a whole image are well suited to the global input in this case.

The local regressor shows a different ordering. With the 3 × 3 partition on PASCAL Count-val, the detection-adjusted features work better than the classification features. Adding a second hidden layer to the local estimator gives little benefit. The authors propose that detection adjustment has made the features better at describing local image regions. The comparison illustrates how a change in the input unit can alter the value of the underlying representation. A feature can be helpful for inferring presence or scene content globally while capturing less of what a crop contributes to a single category count.

A further comparison replaces fc7 with flattened conv3 features, which come from an earlier convolutional layer. The paper reports 0.63 mRMSE for that variant in its PASCAL results and says that reducing the dimensionality by principal component analysis fails to improve it. In this experiment, features more closely associated with low-level textures were less effective than fc7 for regressing category counts. The paper also uses fc7 features from a system trained to count salient objects irrespective of category. The best whole-image PASCAL setting with ImageNet classification features reaches 0.50 mRMSE on Count-test, compared with 0.51 for the salient-object features. The authors relate the comparison to whether the original training task distinguishes categories.

#### Grid size changes what a cell has to predict

The independent regressor’s grid study holds the feature type and number of hidden layers fixed while comparing 3 × 3, 5 × 5, and 7 × 7 partitions and varying the hidden width. The PASCAL Count-val curves favor 3 × 3 slightly over 5 × 5, and both are substantially better than 7 × 7. The main text also describes the deterioration at the finest grid. This resembles the tradeoff in the sheep and bus example. A coarse cell can contain a group that is difficult to count at once. A fine cell can contain too little of an object to support a stable category contribution.

A finer grid also provides more cells for training. If improvement came only from increasing that number of examples, continuing to increase grid resolution would be expected to help. In the authors’ comparison, the deterioration begins even though the local training set continues to grow. That observation supports their interpretation that the visual task within a cell matters. The experiment varies both crop size and the way annotations are distributed across crops, so the result describes the combined effect of changing the partition.

The sequential system’s grid study gives different answers on the two datasets. On PASCAL Count-val, increasing the grid from 3 × 3 to 5 × 5 slightly improves mRMSE for both feature types. On COCO Count-val, that same change worsens performance with both feature types. The main PASCAL Count-test comparison still reports the selected 3 × 3 sequential entry. The validation curves answer a narrower question about the direction of change under the settings being varied. They show that contextual processing can change the grid-size tradeoff, while the favorable resolution depends on the data and evaluation setup.

The authors additionally compare 2 bidirectional LSTM layers with 1 per traversal on a 3 × 3 grid. For the detection-adjusted features, they report no observable difference on PASCAL or COCO Count-val. With classification features, they report a degradation of 0.01 mRMSE when reducing the recurrent stack, on each dataset. This isolates recurrent depth more closely than the comparison between independent and sequential subitizing. Once the input features are adjusted for detection, the deeper tested stack appears to contribute little to the validation metric by itself.

#### Where the regional approaches help

The COCO Count-test analysis separates errors by the actual count. For each ground-truth quantity, the authors collect the examples at that quantity and examine their errors. At lower counts the approaches are comparatively close, with the ensemble doing well. Above 5, the detection and whole-image curves begin to fall behind. The paper singles out the range from 11 to 15 as one in which sequential subitizing does particularly well relative to independent estimates. This analysis reveals sensitivity that a single mRMSE can hide when small counts and absent categories dominate the evaluation.

The authors interpret the high-count results in terms of repeated local evidence. Images with many objects of one category are likely to show individual instances at smaller scales. Several parts of the picture may each contain a countable group. Adding their contributions gives the regional approaches a way to scale the estimate with the amount of repeated evidence. The sequential approach can also use its contextual state in difficult patches. The count-conditioned curves show where the errors diverge, while this proposed mechanism explains why the divergence fits the architectural design.

The size analysis asks a related question using categories as the unit of comparison. The authors estimate typical instance size from occupied pixels and the number of instances in images containing the category, using Count-val annotations. They then order categories from smaller to larger and compare their counting errors. Independent subitizing, sequential subitizing, and the ensemble perform comparatively well across the size range on PASCAL and COCO. The methods tend to become more competitive with one another for larger categories. Error generally declines with size on PASCAL, while COCO does not show a steady decline throughout the range. Since the ordering is by a typical size for each category, the plots also reflect differences among the categories themselves.

For a closer look at spatial evidence, the authors move a mask of size 4 × 4 across selected COCO Count-test images with a non-overlapping stride. They run the counter on each altered image and map how the estimate changes as different regions are covered. The examples were selected where whole-image regression and both regional approaches agreed on the original count. For a high-count image, the map for sequential subitizing looks more like that for independent subitizing. At smaller counts, it looks more like the map for whole-image regression. The authors suggest that repeated local appearance is more informative in the first case, while broader scene cues can support the smaller counts. The illustrations are consistent with that explanation and give examples of what the aggregate error curves cannot show on their own.

#### The effects of thresholds and averaging

Tuning Fast R-CNN isolates the effect of its box-selection settings. The default configuration used in the paper has a score threshold of 0.8 and a non-maximum suppression threshold of 0.3. The authors report 0.52 mRMSE for this configuration on COCO Count-test and describe a gain of 0.02 mRMSE from tuning in the detection analysis. The separate main COCO table lists 0.49 for its selected `detect` result. In PASCAL illustrations, the count-tuned settings can retain a region that provides evidence for a bottle even when the box gives an imperfect localization of the full object. The numerical comparison and the example show why the criterion used to choose a detection threshold matters for counting.

The authors also examine the direction of errors on positive examples in each Count-test split. They classify each case as an undercount, exact count, or overcount. On PASCAL, exact answers become more frequent across the comparison from detection to the ensemble, chiefly as undercounts decline. The frequency of overcounting changes comparatively little. The ensemble produces exact counts more frequently than undercounts there. On COCO, exact answers also become more frequent as the methods improve, while undercounts still occur more frequently than exact counts for every approach shown. These observations motivate the detection application’s decision to use the base score threshold when a separate counter predicts zero.

Averaging several estimates leaves room for both complementarity and shared errors. On PASCAL Count-test, the ensemble of sequential and independent subitizing gives 0.427 mRMSE, while combining sequential subitizing with `glance` gives 0.438. On COCO Count-test the corresponding errors are 0.351 and 0.363. Across both datasets, the paper reports that combining global regression with independent subitizing gives an mRMSE 0.02 worse than sequential subitizing alone. This comparison distinguishes averaging predictions made from different sources of evidence from using that evidence together inside the regional predictor.

Adding detection to the ensemble of whole-image and regional counts raises its reported mRMSE from 0.42 to 0.43 on PASCAL Count-test and from 0.36 to 0.38 on COCO Count-test. The appendix’s illustrated COCO examples are drawn from cases favorable to the ensemble. Some show substantial occlusion and poor counts from detection, alongside stronger counts from the regional approaches. These examples make the contrast concrete. The ensemble comparisons show that an additional source of predictions can worsen the overall estimate when its errors enter the average with equal weight.

### Limitations

#### Limits identified by the authors

The authors treat the PASCAL comparison between independent and sequential subitizing with caution. The contextual approach improves the best all-pairs mRMSE numerically, while the paper describes that change as statistically inconclusive. The authors hypothesize that the smaller dataset plays a role. They also describe COCO as having richer scene context, which could give the recurrent approach more information to use. The experiments vary the dataset as a whole. A contribution from training size, scene composition, or a combination of the two remains possible.

The paper also recognizes a limit in the question-answering experiment. Finding the referent of a question can require understanding a phrase that picks out only some of the objects of a category. The paper sets that problem aside by requiring agreement between the annotated category total and the recorded answer. The comparison therefore applies to the selected Count-QA questions and, in the VQA column, to the shared numerical-answer evaluation. The authors position this as a test of dedicated counting within visual question answering. Performance on unrestricted counting questions would additionally depend on resolving the target objects from the question.

The authors note that the ensemble leads in some comparisons and falls behind in others. They suggest that the weaker whole-image estimate can contribute to this result. The composition study provides concrete evidence about the tested averages, and the reporting across metrics shows why a general ranking would be misleading. A system chosen for all-pairs mRMSE can differ from one chosen for relative error on positive examples. The authors’ qualification of the person and zebra comparison likewise limits the conclusions that can be drawn from results produced in separate evaluation setups.

#### Limits visible in the experimental setup

The supervised target defines counting over a fixed category vocabulary and a particular set of boxed annotations. Its fractional labels describe parts of boxes, which can include background and occluded areas. Two visually similar pieces can receive different targets, and equally sized box shares can contain different amounts of informative evidence. The class totals are the measured outputs in the main evaluations. Correct totals can arise even when local contributions disagree with the box-derived targets, because overestimates and underestimates can offset each other across cells. Stronger image-level numbers consequently establish stronger totals under the benchmark, while the accuracy of individual fractional predictions remains a separate question.

The grid and the recurrent paths are design choices within the family tested. Cell size, the frequency of partial boxes, the visual detail in each crop, and the sequence length all change when the partition changes. The validation comparisons establish how those changes work together under the paper’s settings. The independent and sequential systems also differ in their training objective and in the transformations used to make predictions, in addition to the contextual inputs. Their common features, targets, and sum make the comparison informative. It still leaves the separate contributions of context, loss, and architecture incompletely isolated.

The positive-count results help with interpretation but change which mistakes count towards the score. Errors on absent categories are excluded from that slice. Conversely, all-pairs error can favor conservative estimates in a dataset with many absences. Results for both slices matter when deciding how effective the method is at detecting presence and how accurate it is once something is present. There is also an apparent inconsistency between the printed relative-error formula and one reported value. With a zero prediction and a positive integer target, the smallest squared term under the formula is the term for a target of 1. The reported PASCAL m-relRMSE-nz of 0.59 for `always-0` falls below the bound that follows from the printed equation. The relative-error entries are therefore best read as the paper’s reported values, with the calculation behind that entry unresolved.

The occlusion maps use examples deliberately selected for agreement among the methods. They show which image regions affect a prediction under a particular masking intervention in those cases. A mask can remove an object cue and alter neighboring context together. The maps do not separate those effects, and the selected examples provide no estimate of how often the same pattern occurs across the test set. Similarly, the size analysis groups categories by average instance size. Other properties that vary by category, such as characteristic appearance or typical count, can influence the ordering and errors.

Finally, the detector experiment changes the selection of existing candidate boxes at a chosen operating point. An accurate count can help choose the size of that set. Boxes for missed objects can enter the output only if the detector already supplied suitable candidates, and selecting the right number still leaves their ranking in the detector’s hands. The result measures mean F-measure for the tested PASCAL procedure. The oracle measures how that procedure performs with true counts. Neither quantity establishes a change in average precision over a full sweep of score thresholds.

### What came after

[Compositional Attention Networks for Machine Reasoning](https://md.research.elamur.ai/free/en/papers/hudson-2018-compositional-attention-networks-machine-reasoning/) (2018) cites the counting paper. The citation connects the work to a later study of machine reasoning, but it does not establish that the later system uses the grid, fractional labels, or recurrent counting mechanism. The connection that can be made from the two works’ stated subjects is a question about how visual evidence can support a structured answer. The counting paper studies that question in a specific form: a numerical answer can be assembled from estimates attached to parts of an image, and those estimates can be informed by the scene around them. The citing work’s title places compositional attention in the broader setting of machine reasoning. A more specific account of what it adopted or changed is unavailable from the documented citation.

## Cite

Cite as Prithvijit Chattopadhyay, Ramakrishna Vedantam, Ramprasaath R. Selvaraju, Dhruv Batra and Devi Parikh. 2017. Counting Everyday Objects in Everyday Scenes. IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings - IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.1109/cvpr.2017.471](https://doi.org/10.1109/cvpr.2017.471) · [arXiv 1604.03505](https://arxiv.org/abs/1604.03505)

```bibtex
@inproceedings{chattopadhyay2017counting,
  title = {{Counting Everyday Objects in Everyday Scenes}},
  author = {Prithvijit Chattopadhyay, Ramakrishna Vedantam, Ramprasaath R. Selvaraju, Dhruv Batra and Devi Parikh},
  booktitle = {IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings - IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings},
  year = {2017},
  doi = {10.1109/cvpr.2017.471},
  eprint = {1604.03505},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1109/cvpr.2017.471}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
