CountGD: Multi-Modal Open-World Counting

Authors: niki  amini-naieni
tengda  han
andrew  zisserman
Venue: NeurIPS_cc_2024_Conference
Published: 2024-05-13 20:48:53

Abstract: The goal of this paper is to improve the generality and accuracy of open-vocabulary object counting in images. To improve the generality, we repurpose an open-vocabulary detection foundation model (GroundingDINO) for the counting task, and also extend its capabilities by introducing modules to enable specifying the target object to count by visual exemplars. In turn, these new capabilities -- being able to specify the target object by multi-modalites (text and exemplars) -- lead to an improvement in counting accuracy. We make three contributions: First, we introduce the first open-world counting model, CountGD,  where the prompt can be specified by a text description or visual exemplars or both; Second, we show that the performance of the model significantly improves the state of the art on multiple counting benchmarks -- when using text only, CountGD outperforms all previous text-only works, and when using both text and visual exemplars, we outperform all previous models; Third, we carry out a preliminary study into different interactions between the text and visual exemplar prompts, including the cases where they reinforce each other and where one restricts the other. The code and an app to test the model are available at https://www.robots.ox.ac.uk/vgg/research/countgd/.

Main paper: 
 introduction: 
 Open-world object counting methods aim to enumerate all the instances of any category of object in an image. The 'open-world' refers to the model's ability to count objects beyond the set of categories seen at training, thus enabling the user to specify categories of interest at inference without the need for model retraining. Recent techniques allow the user to specify the target object with only visual exemplars -bounding boxes around a few example objects in the image - [32, 35] , or only text descriptions [1, 22] . By accepting either visual exemplars or text as prompts, open-world object counting methods can adapt to the specific object at inference time. This enables these techniques to count arbitrary classes of objects as specified by the user.Methods that use visual exemplars to specify the object currently significantly outperform text-based counting methods on multiple benchmarks. This is because visual exemplars provide more detailed information than text -it can take many words to precisely describe an object; and perhaps more importantly, they provide intrinsic information on the object's appearance -because the exemplars are from the same image they already 'factor in' the viewpoint and lighting, variables that significantly affect the object's appearance. However, while visual exemplar-based approaches are more accurate, they limit the capabilities and generality of the counting model.In this paper we introduce a counting model that is able to specify the target object using visual exemplars, a text description, or both together. The model, named COUNTGD, has superior accuracy to previous methods, but is also more general. In addition to the performance boost obtained by specifying the target object using both visual exemplars and text, the interaction of the exemplars and text can be used to select a sub-set of those objects in the image. These capabilities are illustrated in Figure 1 . This flexible combination of visual exemplars and text description thus provides the model with more capabilities and information than prior approaches.To achieve this multi-modal prompt capability, we follow prior work on open-world text-specified object counting [1] , and build on and extend a pre-trained vision-language foundation model, Ground-ingDINO [33] . We introduce new modules to embed the visual exemplars, and to enable the model to count, rather than detect. Within the model we cast the additional visual exemplars as text tokens, and the model first learns to fuse the visual exemplars with text tokens through self-attention, and then interacts with the image through cross-attention. Because the text tokens are naturally variable in length, the number of provided visual exemplars are as well. As a result, the model allows users to specify the object to count with text only, visual exemplars only, or text and any number of visual exemplars.In summary, we make the following three contributions: First, we introduce COUNTGD, the first openworld object counting model that accepts either text or visual exemplars or both simultaneously, in a single-stage architecture; Second, we evaluate the model on multiple standard counting benchmarks, including FSC-147 [42] , CARPK [20] and CountBench [39] , and show that COUNTGD significantly improves on the state-of-the-art performance by specifying the target object using both exemplars and text. It also meets or improves on the state-of-the-art for text-only approaches when trained and evaluated using text-only; Third, we investigate how the text can be used to refine the visual information provided by the exemplar, for example by filtering on color or relative position in the image, to specify a sub-set of the objects to count. In addition we make two minor improvements to the inference stage: one that addresses the problem of double counting due to self-similarity, and the other to handle the problem of a very high count. 
related work: 
 Prior work on object counting has developed along three axes: (1) the density map versus detection axis, (2) the class-specific versus open-world (also referred to as "class-agnostic") axis, and (3) the visual exemplar versus text axis. The pattern is that detection, open-world, and text-based methods tend to offer more capabilities and be more general than their analogues along each axis. On the other hand, density map, class-specific, and visual exemplar-based methods tend to be more accurate at the counting tasks they apply to. COUNTGD integrates the third axis -the visual exemplar versus text axis -to achieve more general and accurate counting overall. Below, we discuss where prior work falls along each axis and where COUNTGD stands. Density Map versus Detection-based Object Counting (Axis 1). In the past, counting techniques that regress and sum density maps [3, 4, 7, 28, 29, 36, 46] , instead of detecting and enumerating bounding boxes [6, 9, 20, 38] , have proven more accurate in cluttered and dense scenes. For example, density map-based approaches like CounTX [1] , LOCA [11] , and CounTR [32] achieve lower counting errors than detection-based approaches such as Mask-RCNN [17] and RetinaNet [30] on standard counting benchmarks. Concurrent to our work, DAVE [40] , integrates density map regression with object detection to construct a more accurate and explainable two-stage counting system. Like DAVE, COUNTGD outputs explicit object locations. However, COUNTGD is a single-stage approach that achieves better counting accuracy than DAVE and other density map-based techniques. Therefore, while density map-based approaches tend to be more accurate than detectors in highly populated scenes, recent detection-based techniques, including COUNTGD, are beginning to achieve better accuracy than density map-based alternatives.Class-specific versus Open-world Object Counting (Axis 2). Object counting methods first developed as class-specific techniques [4, 5, 37, 46] , solving the counting problem for only one category of object, but recent methods have generalized these approaches to open-world settings, where counting arbitrary objects is possible. Class-specific methods have been developed to count cars [25] , humans [5] , and cells [14] . In contrast, open-world methods can count instances from all three categories [35] . Because class-specific techniques are more specialized than open-world approaches, they tend to be more accurate at counting instances from the class they were designed for. Recent advancements in Vision-Language Foundation Models (VLMs) such as CLIP [41] and GroundingDINO [33] trained on web-scale image-text pairs produce semantically rich visual and textual features. These features generalize to a wide range of open-world downstream tasks. Building on top of these pre-trained VLMs, recent open-world methods [1, 8, 11, 24, 32, 43, 49] have begun to surpass class-specific approaches in counting accuracy. COUNTGD, like these recent approaches, is an open-world object counter that achieves competitive performance in comparison to class-specific alternatives.Counting with Visual Exemplars versus Counting with Text (Axis 3). Most open-world object counters approach the problem by using visual exemplars to select the objects in the input image [11, 15, 31, 32, 35, 38, 42, 43, 48, 49] , but very recent work [1, 8, 22, 24, 47] has attempted to replace the visual exemplars with text, enabling new capabilities at the cost of reduced accuracy. The stateof-the-art text-based approaches, such as GroundingREC [8] , CounTX [1] , CLIP-Count [22] , and VLCounter [24] are built on top of vision-language foundation models pretrained on large quantities of data to relate images to textual inputs and map them to a joint embedding space. This allows these foundation models to understand general concepts learned during extensive pretraining and provides a mechanism for users to specify extrinsic object properties through text. However, text-based approaches perform significantly worse than state-of-the-art visual exemplar-based approaches such as LOCA [11] , CounTR [32] , and few-shot DAVE [40] . For example, while both GroundingREC and COUNTGD use the pretrained GroundingDINO [33] vision-language foundation model, unlike GroundingREC, COUNTGD allows the user to input both visual exemplars and text instead of just text. This enables COUNTGD to achieve superior counting accuracy in comparison to GroundingREC. Notably, DAVE [40] is a visual exemplar-based approach that also enables textual prompts, but differs from COUNTGD in three important ways: (1) it does not address the case when both text and visual exemplars are available while COUNTGD does, (2) its comparison between text features and image features is not learned as it is by COUNTGD with attention, and (3) it is a two-stage approach, while COUNTGD solves the problem in a single stage, without relying on another visual exemplar-based counting model. Very recently, A Blind Counter (ABC) that does not require text or visual exemplars was introduced in [19] . ABC discovers different objects to count and provides exemplars indicating what has been counted. While this approach is more efficient, it does not provide the user with precise control over the object to count, as exemplar and text-based methods do.Relation of Counting to other areas. Our work is related to few-shot image classification [45] and image detection [13, 21, 23] methods. These works require a few query images of novel objects, and then compare the test image with these image examples to determine its semantic content (for image classification), or to spatially localize instances (for object detection). Like these methods, COUNTGD enables us to specify the object to count with visual exemplars (i.e., "query images") but also allows for textual inputs, and then compares the test image with the multi-modal specifications to get the final count. Furthermore, we focus on the counting problem, a challenging task for object detectors.Question: Does the paper discuss the limitations of the work performed by the authors?Answer: [Yes]Justification: Limitations are discussed in the Appendix.Guidelines:• The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper. • The authors are encouraged to create a separate "Limitations" section in their paper.• The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be. • The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated. • The authors should reflect on the factors that influence the performance of the approach.For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon. • The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size. • If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness. • While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations. 
counting with visual exemplars & text: 
 Here, we describe COUNTGD, a single-stage model for open-world object counting that accepts either visual exemplars or text or both together as prompts to specify the object to count.Given a target object specified by either visual exemplars as bounding boxesB = {b 1 , • • • , b N }around example object instances in the image, or a textual description, t, or both, {B, t}, the counting model, f , counts the number of occurrences of the object in an image X ∈ R H×W ×3 , as ŷ = f (X, B, t), where ŷ is the object count estimated by the counting model f . The visual exemplar tokens are cropped out of this feature map using RoIAlign (as shown in Figure 3 ). The text is passed through the text encoder, f θ TT to obtain text tokens. In the feature enhancer, fφ, the visual exemplar tokens and text tokens are fused together with self-attention and cross-attend to the image features, producing the fused visual exemplar and text features, zv,t, and new image features, z I . The k image features z I that have the highest cosine similarity with the fused features zv,t are passed to the cross-modality decoder, f ψ , as "cross-modality queries". Finally, the similarity matrix, Ŷ between the outputs of the cross-modality decoder, f ψ , and zv,t is calculated, and outputs that achieve a maximum similarity with the zv,t above a confidence threshold σ are identified as final detections and enumerated to estimate the final count. Our model is built on top of GroundingDINO [33] architecture with the additional modules indicated by blue shading. The architecture of the model is illustrated in Figure 2 . COUNTGD is built on top of the open-world object detector GroundingDINO [33] to benefit from its pretrained open-vocabulary grounding and detection capabilities. In contrast to GroundingDINO, which only uses text queries for object detection, COUNTGD also includes visual exemplars as inputs, which increases the performance and flexibility of the model for object counting. In the following, we first describe the modules of the COUNTGD architecture, and then discuss its relation to GroundingDINO and in particular what is frozen, what is trained, and what is added to GroundingDINO.Image Encoder (f θSwinT ). The image encoder f θSwinT encodes two types of inputs: the input image X and the visual exemplars B. The image encoder itself is the Swin-B version of the Swin Transformer [34] . As shown in Figure 3 (a), for the input image X, it produces spatial feature maps at three different scales. These spatial feature maps are projected to 256 dimensions with 1x1 convolutions to produce the image tokens, feature vectors of length 256 corresponding to the image patches at different scales, which are input to the feature enhancer, f φ . As shown in Figure 3 (b), for the visual exemplars B, we reuse the spatial feature map f θSwinT (X) for the input image X, and apply aligned region-of-interest pooling, RoIAlign [16] , with the pixel coordinates specified by the visual exemplars B. The resulting visual exemplar tokens are 256-dimensional feature vectors like the image and text tokens.Text Encoder (f θTT ). For the text encoder, f θTT , we use the BERT-base [10] text transformer pretrained on detection and phrase grounding data with the image encoder, f θSwinT . The text encoder maps the input object description t to a sequence of at most 256 tokens. The encoded text tokens are 256-dimensional feature vectors. While the image encoder f θSwinT produces n image patch features when there are n multi-scale patches extracted from the input image, and the visual exemplar encoder produces p visual exemplar features when p visual exemplars are available, the text encoder produces q text features when there are q tokens, as determined by the BERT tokenizer, in the text t. The n image tokens, p visual exemplar tokens, and q text tokens are then passed to the feature enhancer f φ , which fuses the three sources of information with attention.Feature Enhancer (f φ ). The feature enhancer, f φ , is composed of 6 blocks that first fuse the visual exemplar tokens with the text tokens through self-attention and then fuse the combined features with the image patch tokens with cross-attention. More specifically, each block consists of self-attention between the concatenated visual exemplar and text tokens, deformable self-attention between the image patch tokens, and image-to-text cross-attention and text-to-image cross-attention between the fused visual exemplar and text tokens and the image patch tokens. These modules enable COUNTGD to learn to relate information from the input image, visual exemplars and text query altogether. The feature enhancer f φ outputs two sets of features denoted as z v,t and z I asEQUATIONcorresponding to the fused visual exemplar and text tokens, and the image patch tokens, respectively.Language & Visual Exemplar-guided Query Selection (Select). We select the k image patch tokens z I that achieve the highest similarity with the fused visual exemplar and text tokens z v,t . This operation is denoted by Select z I , z I z v,t T , k , where z I z v,t T ∈ R n×(p+q) represents the similarity scores between the n image patch tokens and the p + q visual exemplar and text tokens. As in GroundingDINO [33] , we set k to 900. These 900 image patch tokens with higher similarity scores serve as "cross-modality queries" input to the cross-modality decoder f ψ .Cross-modality Decoder (f ψ ). The cross-modality decoder, f ψ , uses self-attention to enhance the cross-modality queries, image cross-attention to fuse the image patch features z I to the cross-modality queries, and cross-attention to fuse the visual exemplar and text features z v,t to the cross-modality queries. In more detail, the cross-modality decoder consists of 6 of these self-attention and crossattention blocks. The cross-modality queries are dot-producted with the combined visual exemplar and text tokens z v,t and passed through an element-wise Sigmoid function to obtain the final confidence scores as:EQUATIONwhere z v,t are the fused visual exemplar and text features, z I are the image features, k is the number of queries (i.e., maximum number of detected objects), and Ŷ are the final similarity scores that are thresholded according to a confidence threshold σ and enumerated to estimate the final object count ŷ at inference.Design choices and relation to GroundingDINO. We choose GroundingDINO [33] over other VLMs due to its pretraining on visual grounding data, providing it with more fine-grained features in comparison to other VLMs such as CLIP [18] .To extend GroundingDINO to accept visual exemplars, we cast them as text tokens. Because both the visual exemplars and the text specify the object, we posit that the visual exemplars can be treated in the same way as the text tokens by GroundingDINO and integrate them into the training and inference procedures as such. In treating the visual exemplars as additional text tokens within a phrase, we add self-attention between the phrase corresponding to the visual exemplar and the visual exemplar rather than keeping them separate. This allows COUNTGD to learn to fuse the visual exemplar and text tokens to form a more informative specification of the object to count. Similarly, cross-attention between the image and text features in GroundingDINO's feature enhancer and crossmodality decoder becomes cross-attention between the image and the fused visual exemplar and text features in COUNTGD. Language-guided query selection in GroundingDINO becomes language and visual exemplar-guided query selection in COUNTGD. In this way, COUNTGD naturally extends GroundingDINO to input both text and visual exemplars to describe the object.In GroundingDINO, the image encoder f θSwinT is pre-trained on abundant detection and phrase grounding data with the text encoder, f θTT , providing it with rich region and text-aware features.Since we wish to build on this pre-trained joint vision-language embedding, we keep the image encoder f θSwinT and the text encoder f θTT frozen.We train the projection layers for extracting the visual exemplar tokens, the feature enhancer, and the cross-modality decoder of COUNTGD. The trainable parameters are updated according to a loss L, while the rest of the parameters remain unchanged. This means COUNTGD effectively leverages the large-scale pre-training of the foundation model it extends.The training loss L includes a localization term L loc and a classification term L cls . For the localization term L loc , we regress the object centers from the final cross-modality queries output by the decoder f ψ , and use the L 1 loss between the predicted box center ĉ and the ground truth c, similar to [50] .For the classification term L cls , we compute the similarity matrix Ŷ from Equation 2 and calculate the focal loss for each score. The final loss is:EQUATIONwhere λ loc and λ cls are hyperparameters optimized using a grid search on the validation set and T ∈ {0, 1} k×(l+1) represents an optimal Hungarian matching between the k predicted queries and the l ground truth object instances, and the label "no object." Refer to the finetuning strategy implemented in [51] for further details.To predict the object count with COUNTGD, the image X, text t, and visual exemplars B are inputted to the model, outputting a similarity matrix Ŷ ∈ R k×(p+q) . The maximum score over all p + q visual exemplar and text tokens is extracted for each of the k queries. Maximum scores above a confidence threshold σ are enumerated to estimate the object count.Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?Answer: [NA] Justification: The paper does not include theoretical results.Guidelines:• The answer NA means that the paper does not include theoretical results.• All the theorems, formulas, and proofs in the paper should be numbered and crossreferenced. • All assumptions should be clearly stated or referenced in the statement of any theorems.• The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide a short proof sketch to provide intuition. • Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material. • Theorems and Lemmas that the proof relies upon should be properly referenced. 
experiments: 
 COUNTGD is trained on the FSC-147 [42] object counting dataset training set, and then evaluated on the FSC-147 test set, and two other benchmark datasets (without any fine-tuning). We first describe the datasets, and then discuss the performance.FSC-147 [42] . FSC-147 contains 6135 images with 89 classes in the training set, 29 classes in the validation set, and 29 classes in the test set. The classes in the training, validation, and test sets do not overlap. Each image is annotated with at least three visual exemplars. For text descriptions, we use the singular forms of the class names in FSC-147-D [1] with any prefixes such as "the" removed. For example, we change "the donuts in the donut tray" in FSC-147-D to "donut" by removing the prefix "the," extracting the class name "donuts," and then singularizing it to "donut."CARPK [20] .CARPK contains images of parking lots captured by overhead drones with a training set and test set of 989 and 459 images respectively. Each image is annotated with at least two bounding boxes. We use the same two bounding boxes selected in [32] as the visual exemplars for each image. We use the class name "car" as the text description.CountBench [39] . CountBench contains 540 images with 2-10 objects and captions describing the image as well as the number of objects to count. We create text descriptions for a 504-image subset of CountBench, removing inappropriate images and images with links that are unavailable. We give details of how the class names are obtained from the captions accompanying each image in the Appendix.Metrics. Following prior work on object counting [1, 11, 32] , the Mean Absolute Error (MAE) and the Root Mean Squared Error (RMSE) are used to measure performance. We define these metrics in the Appendix. "green pea" "hot air balloon" "marble" 9 14"stamp" "deer" "egg" 202 21 10"lego""the miniature roses""the little girls playing with bubbles""the framed pictures arranged on the wall depicting nature, animals, and country life"2 7 8"the world's greatest magicians" "the beautiful butterfly wall stickers""the tomatoes on the wooden background""the blue peacock birds"Figure 4 : Qualitative counting results on FSC-147 [42] and CountBench [39] using the multi-modal COUNTGD.The model is trained and tested on FSC-147 visual exemplars and text. Input text is written above each image, and visual exemplars are indicated by the red boxes. On CountBench, we test the same model trained on the FSC-147 in a zero-shot way with only text (there are no visual exemplars for CountBench). Blue words indicate the subject of each caption input to the model. In both cases, COUNTGD predicts the count in all images shown with 100% accuracy. Note on the CountBench examples, the model counts the specified objects correctly when there are multiple types of objects in the image, such as the tomatoes with cucumbers, and the girls with bubbles. Detected points are filtered with a Gaussian and plotted under the input images for visualization purposes.Training. The model is trained for 30 epochs on the FSC-147 training dataset using Adam optimizer and standard augmentations. The image and text encoders, f θSwinT and f θTT , are frozen during training. Full details are given in the Appendix.Inference. At inference, each image is resized such that its shortest side length is 800 pixels, and its aspect ratio is maintained. The image is then normalized and passed to the model. The visual exemplars are passed in as bounding boxes, and the special token " ." is appended to the text description before providing it to the model. In the Appendix we give details of two important improvements: one to avoid double counting given self-similarity of the target object (like a butterfly [32] ), and the other using adaptive cropping to overcome the 900 counting quota of the the model.Here we show that COUNTGD achieves comparable or exceeds state-of-the-art performance for text-only open-world object counting when using only text, and exceeds the performance of all open-world object counting methods when using both visual exemplars and text on three benchmarks. FSC-147 [42] . In Table 1 , we test COUNTGD under two settings: (1) trained and tested with only text (denoted as COUNTGD txt ), and (2) trained and tested with both 3 visual exemplars and text (denoted as COUNTGD). COUNTGD trained and tested with both visual exemplars and text sets a new state-of-the-art for counting accuracy on FSC-147, achieving significantly lower counting errors than all prior approaches to open-world object counting. Training with only text achieves comparable counting accuracy to state-of-the-art text-only open-world object counting methods. The concurrent method GroundingREC [8] achieves slightly lower mean absolute error values than COUNTGD txt , while COUNTGD txt achieves lower root mean squared error values. The results for GroundingREC and COUNTGD txt are likely close to each other since both methods leverage the pretrained GroundingDINO [33] foundation model. However, unlike GroundingREC, COUNTGD can fuse information from both text and visual exemplars instead of using only text, enabling a significant improvement. Similarly, while a pre-trained GroundingDINO performs poorly at counting (top row of Table 1 ), a GroundingDINO model fine-tuned on FSC-147 achieves good results [8] , that match the performance of COUNTGD txt . Adding visual exemplars to COUNTGD significantly improves its performance over fine-tuned GroundingDINO ( [8] for fine-tuned GroundingDINO). Unlike COUNTGD, GroundingDINO does not allow for visual exemplars as additional inputs.In Figure 4 , we give qualitative examples of the detections that COUNTGD outputs given both visual exemplars and text from the FSC-147 test set. Note how in the first image, COUNTGD only counts the strawberries and not the white cookies. Prior work has shown that visual exemplar-only methods struggle to count only one category of object when there are repeating instances from multiple categories in an image [40] . COUNTGD handles this issue very well in this example by leveraging the generalization capabilities of the pretrained vision-language model GroundingDINO [33] .CARPK [20] . To test cross-dataset generalization, COUNTGD is trained on FSC-147 [42] , and tested on the CARPK car counting dataset zero-shot, without being trained on any images in CARPK.In Table 2 , COUNTGD is trained on the FSC-147 [42] training set with both visual exemplars and text, and tested on the CARPK car counting dataset under two settings: (1) using only the text input "car", and (2) using both the text input "car" and the same two visual exemplars as [32] . Under both settings, COUNTGD achieves state-of-the-art accuracy on CARPK for all open-world object counting methods without being trained on any images in CARPK, achieving lower counting errors than methods like CounTR [32] and SAFECount [49] that were fine-tuned on CARPK.CountBench [39] . We train COUNTGD on FSC-147, which has at least seven objects in each training image, and evaluate its generalization to counting low numbers of objects in the CountBench test set zero-shot. In Table 2 , we compare COUNTGD's performance on counting low numbers Uni-Modal vs. Multi-Modal Training. In Table 3 , we compare COUNTGD's performance using different training and inference procedures on FSC-147 [42] . Training on text only and testing with text only achieves performance comparable to state-of-the-art counting accuracy for text-only approaches, demonstrating the superiority of the GroundingDINO [33] architecture that we leverage.Training with visual exemplars only and testing with visual exemplars only results in state-of-the-art performance on two out of four of the metrics (mean absolute errors on both the validation and test sets) for visual exemplar-only approaches. This is surprising given that GroundingDINO was pretrained to relate text to images not visual exemplars to images. Despite this, COUNTGD performs remarkably well in this setting. Multi-modal training and testing with both visual exemplars and text beats both uni-modal approaches and sets a new state-of-the-art for open-world object counting. This ablation study shows that the visual exemplars provide more information than the text in FSC-147 as the performance with visual exemplars only is significantly better than the performance with text only. It also demonstrates that multi-modal training and inference is the superior strategy as it allows COUNTGD to take advantage of two sources of information about the object instead of one. In Table 5 in the Appendix, we additionally include an ablation study showing the influence of our proposed SAM Test-time normalization and adaptive cropping strategies.Up to this point we have used the text and visual exemplar prompts to specify the target object in a complementary manner; for example giving a visual exemplar of a 'strawberry' with the text 'strawberry'. It has been seen that the counting performance with prompts in both modalities is, in general, equal or superior to text alone. In this section we investigate qualitatively the case where the text refines or filters the visual information provided by the exemplars. For example, where the visual exemplar is car, but the text specifies the color, and only cars of that color are counted.In this study, unlike before, we freeze the feature enhancer in addition to the image and text encoders and finetune the rest of the model on FSC-147 [42] . We find that freezing the feature enhancer is necessary for many of these interactions to emerge. Once trained, the new model can use the text to filter instances picked out by the exemplar, and the exemplar can increase the confidence when it reinforces the text. In Figure 5 we show several examples of the interactions observed.Question: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)?Answer: [Yes] Justification: All the datasets used for evaluations in this paper are publicly available. The model is also trained on one of these datasets. In terms of the code, we start from the open source GroundingDINO code base, and give full details of the extensions we make to incorporate visual exemplars. The implementation details including hyper-parameter settings are described in the Experiment section and the Appendix, which are sufficient for reproducing our experiments. 
conclusion & future work: 
 We have extended the generality of open-world counting by introducing a model that can accept visual exemplars or text descriptions or both as prompts to specify the target object to count. The complementarity of these prompts in turn leads to improved counting performance. There are three research directions that naturally follow on from this work: (i) the performance could probably be further improved by training on larger scale datasets, for example using synthetic data as demonstrated recently for counting [27] ; (ii) a larger training set would enable a thorough investigation of freezing more of the GroundingDINO model when adding our new visual exemplar modules; and finally, (iii) the model does not currently predict the errors of its estimates like other computer vision models do [2, 44] .Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material?Answer: [Yes]Justification: As noted above, all datasets used are publicly available. All the training/testing code and the pre-trained model weights will be released after the paper's acceptance.Guidelines:• The answer NA means that paper does not include experiments requiring code. • Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted. 
experimental setting/details: 
 Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?Answer: [Yes]Justification: Training and testing details are described in the Experiment Section and the Appendix.Guidelines:• The answer NA means that the paper does not include experiments.• The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them. • The full details can be provided either with the code, in appendix, or as supplemental material. 
experiment statistical significance: 
 Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?Answer: [No] Justification: We discuss in the limitation section that our work and recent works in the counting domain do not report error bars. This is an important research problem to be addressed in the near future.Guidelines:• The answer NA means that the paper does not include experiments.• The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper. • The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions). • The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.) • The assumptions made should be given (e.g., Normally distributed errors).• It should be clear whether the error bar is the standard deviation or the standard error of the mean. Guidelines:• The answer NA means that there is no societal impact of the work performed.• If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact. • Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations. • The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster. • The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology. • If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML). 
safeguards: 
 Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)? Answer: [NA] Justification: The paper poses no such risks. Guidelines:• The answer NA means that the paper poses no such risks.• Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters. • Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images. • We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort. 12. Licenses for existing assets Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected? Answer: [Yes] Justification: We properly cited the creators or original owners of datasets and methods used in this paper. We can also confirm that our usage in this research project and for open sourcing does not violate their licenses or terms. Guidelines:• The answer NA means that the paper does not use existing assets.• The authors should cite the original paper that produced the code package or dataset.• The authors should state which version of the asset is used and, if possible, include a URL. • The name of the license (e.g., CC-BY 4.0) should be included for each asset.• For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided. • If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset. • For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided. • If this information is not available online, the authors are encouraged to reach out to the asset's creators. 
new assets: 
 Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?Answer: [NA]Justification: The paper does not release new assets.Guidelines:• The answer NA means that the paper does not release new assets.• Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc. • The paper should discuss whether and how consent was obtained from people whose asset is used. • At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file. 
crowdsourcing and research with human subjects: 
 Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?Answer: [NA] Justification: The paper does not involve crowdsourcing nor research with human subjects.Guidelines:• The answer NA means that the paper does not involve crowdsourcing nor research with human subjects. • Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper. • According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector. 
institutional review board (irb) approvals or equivalent for research with human subjects: 
 Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?Answer: [NA] Justification: The paper does not involve crowdsourcing nor research with human subjects.Guidelines:• The answer NA means that the paper does not involve crowdsourcing nor research with human subjects. • Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper. • We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution. • For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review. 
visual: 
 These examples are taken from the FSC-147 [42] and CountBench [39] test sets. The visual exemplars are shown as yellow boxes. (d) visualizes the predicted confidence map of the model, where a high color intensity indicates a high level of confidence. 
 
 Appendix: We use the Mean Absolute Error (MAE) and the Root Mean Squared Error (RMSE) to measure performance. They are defined as:EQUATIONwhere N is the number of test images, ŷi is the predicted count, and y i is the ground truth count for image X i . For both MAE and RMSE, a lower value indicates a better performance.CountBench [39] Here we explain how the descriptions and keywords for CountBench were constructed. Unlike the original CountBench captions, our text descriptions include the object to count without revealing the number of objects. For example, the caption "background photo of three light bulbs" in CountBench is replaced with "the light bulbs," which describes the object to count (the light bulbs) without giving away that there are three in the image. Because some descriptions include information about other objects in the image, we add keywords that indicate the subject in the caption. For example, the caption "the children standing on a bench at an outdoors party" includes the keyword "children" to indicate that the children, not the bench, should be counted. Providing keywords is necessary since COUNTGD has been pretrained on visual grounding data and will count both the children and the bench they are sitting on as a result. To ensure only the children are counted, text token similarity scores from the keyword "children" are thresholded to estimate the count. Because CountBench contains very few objects, we do not use visual exemplars and provide COUNTGD with just the text description.Architecture. We provide additional architectural details here. The image encoder, f θSwinT , is a Swin-B transformer with corresponding patch sizes 8 × 8, 16 × 16, and 32 × 32 and final embedding dimensions of 192, 384, and 768 respectively. To get the visual exemplar tokens, the spatial feature maps from f θSwinT (X) are first upsampled to the same height and width as the largest one with patch size 8 × 8. The upsampled feature maps are concatenated along the channel dimension and projected to 256 dimensions with a separate 1 × 1 convolution. RoIAlign is then applied to extract features corresponding to the exemplar regions, Training. Each training image is first horizontally flipped with a probability of 50%. Next, with a probability of 50%, either the minimum side length of the image is resized to a side length in {480, 512, 544, 576, 608, 640, 672, 704, 736, 768, 800} such that the aspect ratio of the image is maintained or the image is first randomly cropped such that the minimum side length is in the range [384, 600] and then resized as mentioned before. After this, the image is normalized and passed through the model. Following [33] , all the classes in the FSC-147 training set are concatenated into a single caption with " ." separating each class name. Visual exemplar tokens are appended to the end of the text tokens associated with their class name. Self-attention masks are constructed such that the text tokens attend to each other as well as to the visual exemplars that are associated with their class name. Self-attention is not applied between unrelated class names and visual exemplars. The model is optimized with the Adam Optimizer with a weight decay set to 10 -4 and an initial learning rate set to 1 × 10 -4 that reduces by a factor of ten every ten epochs. λ loc is set to 1 and λ cls is set to 5 in Equation 3. These scale factors are also used in the Hungarian Matching Cost for matching ground truth points to predicted points. The confidence threshold σ is set to 0.23. Hyperparameters are set using default values provided by [51] with the exception of selecting λ loc , λ cls , and the confidence threshold σ using a sparse grid search optimizing the mean absolute counting error on the validation set. Specifically (λ loc , λ cls ) ∈ {1, 2.5, 5} × {1, 2.5, 5} and σ ∈ {0.14, 0.17, 0.2, 0.23} are tested. In Table 4 , we conduct a sensitivity test showing that our choice of (λ loc , λ cls ) = (1, 5) achieves the best results for the validation set. Given these parameters, our choice of σ = 0.23 achieves the best validation set MAE of 7.1, while σ = 0.14 achieves the worst validation set MAE of 9.5. The model is trained for 30 epochs with early stopping with respect to the mean absolute counting error on the validation set with no SAM TT-Norm or adaptive cropping applied. We train the multi-modal model that beats all prior methods for open-world object counting using both visual exemplars and text. We train the text-only model that beats all text-only approaches to open-world object counting on only text. Finally, we additionally freeze the feature enhancer for the exemplar and text interaction study.Training Resources. Our model is trained on 1 Nvidia A6000 GPU with 48GB of graphic memory. A full training takes about 1 day.Avoiding double counting. One of the common problems for counting models is handling selfsimilarity, when an object is intrinsically repetitive. For example, sunglasses and butterflies exhibit self-similarity. In these cases, counting methods tend to double count, detecting each self-similar component. CounTR [32] has tried to address this by dividing the estimated count by the average count in the visual exemplar regions. We observe that this approach (referred to as the "TT-Norm") fails in cluttered scenes, where visual exemplar bounding boxes encapsulate more than just one instance of the object. This causes the counting model to detect self-similarities when they are not present. We show an example of this in Figure 6 (a).To address this, we propose to use segmentation masks instead of bounding boxes to more accurately check if the counting model detects more than one instance on an object inside a visual exemplar. To obtain the segmentation masks we use the visual exemplars as box prompts to the Segment Anything Model (SAM) [26] . This approach avoids the issue faced by CounTR's TT-Norm since we do not check instances outside the object's boundary, even if these instances fall within the visual exemplar regions. Figure 6 shows how our approach compares to CounTR's TT-Norm in such cases.Adaptive Cropping. We address the problem that COUNTGD can only output at most 900 queries at a time through adaptive cropping. If COUNTGD detects 900 objects, we crop the input image into multiple overlapping pieces and pass each cropped piece back to the model. The crop width and height are calculated as 4 times the average exemplar width and height. This approximately upper bounds the number of objects that can appear inside the crop window. The overlap width and height are determined to be 1.25 times the average exemplar width and height to approximately ensure each object instance appears fully in at least one crop. If visual exemplars are not provided, the image is cropped into four equal pieces. To obtain the final count, the number of detected instances in each crop window are added together while averaging the predicted count in overlapping regions.In Table 6 , we show that by adding adaptive cropping back in (unlike in Table 5 , rows 1-2), COUNTGD still achieves state-of-the-art counting accuracy even without the test-time normalization.To further investigate the effectiveness of the adaptive cropping, we split images into different groups according to the number of objects they contain, and report the percent error for each group. We find that for FSC-147 test images with more than 900 objects, the mean percent error ( |gt-pred| gt × 100%) is 10%, and for images with at most 900 objects, it is 8%. This shows that COUNTGD works well, even for images with greater than 900 objects. In Table 7 , we consider how well COUNTGD performs given text and only one visual exemplar, instead of text and three visual exemplars as in the last row of Table 1 . As expected, increasing the number of visual exemplars improves the accuracy of the estimated count. As shown in Table 8 , training with more exemplar-only data improves performance, even when testing with text only. We hypothesize this may be because training on more exemplar-only data regularizes COUNTGD's text-only performance. COUNTGD is initialized with the pretrained Ground-ingDINO [33] weights, so it already starts with a strong understanding of how text and images relate to each other. Perhaps limiting the amount of text-only training data preserves this understanding obtained through large-scale pretraining. On the other hand, GroundingDINO has not been pretrained to relate the exemplars to the image, and, thus, benefits from having more exemplar-only training data to learn this capability.In Section 4.5 we discuss a preliminary study on the interactions that emerge between the exemplars and the text. In this study, we plot the average confidence score over both the exemplar and the text tokens. When the exemplar and the text reinforce each other, the average confidence tends to increase overall.Differently, here, we carry out a preliminary investigation into what happens when the exemplar and the text conflict with each other. We define the desired behavior to be an AND operation between the exemplar and text tokens, where correctly counted objects should match both the exemplar and the text. Since this is not possible when the two conflict with each other, we expect an ideal count to be zero. We investigate to what extent this holds in practice by defining three levels of conflict.1. super-class conflict -the super class of the exemplar and the text don't match e.g., the exemplar is a tiger and the text='chair';2. sub-class conflict -the sub-class of the exemplar and text don't match e.g., the exemplar is a man and the text='woman', both of which are humans;3. attribute conflict -the exemplar and text match in terms of class but don't match in terms of attribute, e.g., the exemplar is a blue circle but the text='red'For case (1) we use an image of the butterflies from CountBench [39] . By providing visual exemplars of the butterflies and the text 'white plant pot,' we get a count of 0 as expected. For case (2) we use an image of the strawberries and blueberries from FSC-147 [42] . By providing one exemplar of a blueberry and the text 'strawberry', we obtain a count of 0. For case (3), we consider colored roses in an image from CountBench. In this case, when providing an exemplar of a red rose and the text 'yellow,' the output is (incorrectly) 9, the number of red and yellow roses. We speculate that we are limited by image-text capabilities of the original GroundingDINO [33] model (as illustrated in the fine-grained limitation example provided in Appendix I). We include qualitative results from this experiment in Figure 7 ."white plant pot" "strawberry" "yellow" In Figures 8 and 9 we include additional qualitative results from the CountBench [39] and FSC-147 [42] test sets respectively.Text is sometimes not enough to specify the object to count. Sometimes, the object to count looks uncommon and is so unique that text alone does not provide enough information to specify the object to count. For example, in Fig. 10 (b), providing the text "crystals" results in CountGD estimating an incorrect count of 2, while providing the text "crystals" together with one visual exemplar results in CountGD estimating a more accurate count in Fig. 10 (c ). This happens because the crystals in the X-ray image in Fig. 10 (b ) and (c) do not look like regular crystals such as those in Fig. 10 (a), so it is hard for CountGD to pick them out given only text. Providing the exemplar alleviates the issue, allowing CountGD to match the crystals in the X-ray image visually instead of relying on text alone.Very fine-grained counting can be challenging. CountGD sometimes struggles to count different categories of objects with text if the categories are very similar. For example, in Fig. 11 , CountGD cannot pick out the baby penguins from the adult penguins. This is because the baby penguins and adult penguins look very similar in terms of color and shape.In general, object counting is an important task with many real-world applications. A strong counting model has positive impacts on various domains such as agriculture, satellite images, microscopy and medical images. However, there are also possible negative impacts, like violating privacy in human counting for surveillance cameras, or being used for military applications. This paper focuses on "the tomatoes on the wooden background" "the windows""the little girls playing with bubbles" "the men in suits""the framed pictures arranged on the wall depicting nature, animals, and country life"EQUATION"the black silhouettes of pigeons""the world's greatest magicians""the beautiful butterfly wall stickers"EQUATION"the wine glasses" "the blue peacock birds" "the candles" "the miniature roses"EQUATION"the young women""the cats staring at the sign" "the Christmas Poinsettias" "the fairly circular small oranges"Figure 8 : CountBench [39] counting examples using the multi-modal COUNTGD. The model is trained on visual exemplars and text from FSC-147 [42] and tested zero-shot with text only on CountBench. Blue letters indicate the subject of each caption input to the model. Detected points are filtered with a Gaussian and plotted under input images for visualization purposes. COUNTGD predicts the count in all the images shown with 100% accuracy. Note how in the top row COUNTGD correctly only counts the women, not the men, in "the young women" example, and only the alive cats (not the one painted on the wall) in "the cats starting at a wall". In the bottom row, the model also correctly does not count the repeated bubbles near the little girls or the multiple balloons."egg" "apple""deer" "nail polish" 20 114 Justification: we claim that (i) we extend the capabilities of open-world object counting by introducing a model that accepts prompts from either text or visual exemplars or both simultaneously; and (ii) that the model's performance exceeds the state-of-the-art. We demonstrate these contributions quantitatively by evaluations on three different counting benchmark datasets, as well as multiple examples in the paper figures.• The answer NA means that the abstract and introduction do not include the claims made in the paper. • The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers. • The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings. • It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper.• The answer NA means that the paper does not include experiments.• If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not. • If the contribution is a dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable. • Depending on the contribution, reproducibility can be accomplished in various ways.For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g., in the case of a large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed. • While NeurIPS does not require releasing code, the conference does require all submissions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. (d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility.In the case of closed-source models, it may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers to have some path to reproducing or verifying the results. 


Decision: Both reviewers Jn2T and 44bk provided positive reviews for this paper, recognizing the significance of the new open-world counting, where counting prompts can be specified through text, visual exemplars, or a combination of both. The proposed approach, based on GroundingDINO, achieves strong empirical results, where extensive dataset validations and comparisons with multiple methods are reported.

Initially, the reviewer QCsU shared concerns about the paper, which have been addressed after the user rebuttal period. Though the reviewer still put a negative review score (Borderline Reject), according to the discussions between the authors and reviewer, no substantial concerns remain.

The AC therefore recommends to accept this paper. The authors are highly encourage to incorporate the new results reported in the rebuttal into the final version of the paper.

Reviews: review: paper_summary: paper_summary: This paper aims to improve open-vocabulary object counting in images by repurposing an existing detection model (GroundingDINO) and introducing multi-modal prompts using text descriptions and visual exemplars. The contributions include the introduction of COUNTGD, the first open-world counting model, improved performance on counting benchmarks, and a preliminary study on the interaction between text and visual prompts.
strength_weakness: strength_weakness: It would be beneficial to delve deeper into the interaction between text and visual exemplars in research. For example, studying the impact of factors such as the ratio of trainable text to visual exemplars on the model's performance.
questions: questions: 1. Could the author provide some case studies and analysis of current model failures in the text or as an appendix?
2. The NeurIPS requirement states that the abstract must be limited to one paragraph.
3. What would be the result when there is a conflict between visual exemplar and text?
limitations: limitations: Yes
paper_summary: paper_summary: The authors propose a novel object counting method CountGD that is based on GroundingDINO. It uses the strong localization and multimodal capabilities of GroundingDINO and adapts it to the task of few-shot object counting. The main architectural change is the introduction of visual exemplars to the GroundingDINO architecture by ROI pooling exemplar boxes and using the resulting features as additional visual tokens. The proposed method, CountGD, achieves excellent performance on the standard FSC-147 few-shot counting task and excels in the text-condition counting scenario, significantly outperforming the previous state-of-the-art. Additionally, it can utilize both visual exemplars and text conditioning simultaneously.
strength_weakness: strength_weakness: - The qualitative comparison is a bit confusing. The output of the method is visualized as a density map for example in Figure 4. However, CountGD outputs a similarity score for each selected query that is then thresholded to classify which queries correspond to either exemplar objects or text queries. The visualization process must therefore be hand crafted and is not a density map, so the visualization is a bit misleading. 

- The method is based heavily on GroundingDINO and is trained on object counting datasets following the training process of previous few-shot counting works. The performance is additionally boosted due to the post processing approaches, several of which have been proposed in previous works. While the combination of GroundingDINO and contributions from previous counting works are interesting, and the performance of CountGD is strong, the conceptual contributions presented in the paper are few and unconvincing. 

- There are some clarity issues in terms of the training setup (Question 1).
- The ablation study in the main paper could be expanded as currently only the impact of training/inferring with different modalities is evaluated.
questions: questions: - In Eq. 3, the L_loc is the L1 loss between ground truth centers and the predicted bounding box centers. So CountGD also outputs bounding boxes? This is not evaluated anywhere although methods like DAVE use benchmarks such as FSCD-147 for object detection performance evaluation.
- Have you run ablation experiments for individual components in the loss function?
- Have you performed experiments evaluating the generalization capability with a single exemplar? A one-shot experiment might be interesting given the strong performance in the few-shot scenario. 

- The contribution over the standard GroundingDINO architecture seems minor. Essentially, the output queries of GroundingDINO are compared to the extracted exemplar features (text+visual exemplars) and the similarity is then thresholded to obtain the detections. While this is a simple solution that seems to work well it does not seem to give a significant insight into solving conditional object counting and gives the impression that it is merely relying on the very strong features produced by GroundingDINO. A further discussion on why the proposed concepts presented in the paper are a major contribution would be beneficial. This is my main issue and the main reason for my score.
limitations: limitations: The authors have addressed the limitations.
paper_summary: paper_summary: This paper focuses on multi-modality open-world object counting, where the model can receive text or visual exemplars or both as input. To this end, the authors repurpose Grounding DINO, an open-vocabulary object detector, as an open-world object counting model. The main idea is to treat visual exemplars as additional tokens, which enables the interaction between exemplars and image/text features. Experiments on the FSC-147 dataset show that the proposed method achieves strong counting performance.
strength_weakness: strength_weakness: 1. Inaccurate claim. The authors claim that they introduce the first open-world counting model in the sense that the prompt can be specified by a text description or visual exemplars or both. However, PseCo [1] is also an open-world counting model that can receive text and/or visual exemplar as input. 
2. It is unclear whether the proposed method can properly handle dense objects. As mentioned on Page 5, the authors set the number of object queries to 900, which implies that the maximum number of predicted objects is 900. This is acceptable in object detection but not satisfactory in object counting. In real-world applications, the number of objects may exceed 1000. It is suggested to divide images into different groups based on the number of objects, and report detailed results on these groups. This can help the readers understand how the proposed method performs under different object densities.
3. The comparisons in Table 1 are somewhat unfair. As mentioned in Appendix D, the authors use test-time normalization to alleviate double counting. Without this technique, the proposed method does not show superiority over existing methods. In addition, deploying adaptive cropping significantly improves the accuracy on the test set of FSC-147. This echoes the concern regarding the capability of CountGD to tackle dense objects.
4. It appears that the proposed method can not output bounding boxes. This undermines the value of the proposed open-world counting model. As Grounding DINO is an open-set object detector, one would expect the repurposed object counting model can localize objects. For comparison, DAVE [35] and PseCo [1] can output object boxes.
5. Missing comparisons with baseline Grounding DINO. The authors propose to finetune the feature enhancer and cross-modality decoder to achieve open-world object counting. Therefore, it is necessary to compare CountGD with original Ground DINO to support the effectiveness of such operations. If Grounding DINO already excels in object counting, there is no need to finetune the model.

Reference:

[1] Point, Segment, and Count: A Generalized Framework for Object Counting. CVPR 2024.


Minor issues:
* A few methods are not properly cited. For example, DAVE [35] is published in CVPR 2024 and LOCA [9] is published in ICCV 2023. The authors should properly cite previous works.
* The ``Published`` column in Table 1 provides little information about the compared methods. It is suggested to replace this column with paper venue.
questions: questions: 1. Can the proposed method output object boxes? Considering that Ground-DINO is an open-world object detector, it would be better if CountGD could also localize objects.
2. Did the authors evaluate Grounding DINO on the FSC-147 dataset?
3. Is the proposed method sensitive to confidence threshold sigma?
limitations: limitations: The paper mentions the potential limitation of counting error estimation.

Comments: title: Adding a Comment on Fine-Tuned GroundingDINO
Addressing additional questions about FSC-147 class names and multi-modal inference
Has the rebuttal addressed your concerns?
Further questions
Addressing conflicts between text and visual exemplars
comment: Thank you for the suggestion and for recognizing that we have addressed most of your concerns. We will add the following comment to the “FSC-147” paragraph of Section 4.3 of the camera-ready as well as a new citation to the Referring Expression Counting [1] paper.

*While a pre-trained GroundingDINO performs poorly at counting, a GroundingDINO model fine-tuned on FSC-147 achieves good results [1], that match the performance of CountGD when trained and tested with text only. Adding visual exemplars to CountGD significantly improves its performance over fine-tuned GroundingDINO (main paper, Table 1, lowest row shows a test MAE of 5.74 and a test RMSE of 24.09 for multi-modal CountGD compared to the test MAE of 10.82 and test RMSE of 104 noted in [1] for fine-tuned GroundingDINO). Unlike CountGD, GroundingDINO does not allow for visual exemplars as additional inputs.*

[1] [https://openaccess.thecvf.com/content/CVPR2024/papers/Dai_Referring_Expression_Counting_CVPR_2024_paper.pdf](https://openaccess.thecvf.com/content/CVPR2024/papers/Dai_Referring_Expression_Counting_CVPR_2024_paper.pdf)
Thanks for the detailed rebuttal, it has addressed most of my concerns. I still, however am not entirely convinced about the performance of Grounding DINO on the FSC147 dataset. The authors provide the results of a pretrained Grounding DINO directly applied to FSC147, however this has not been optimized to handle the distribution of objects in the FSC147 dataset at all. In the Reffering Expression Counting paper[1] an experiment was performed, where Grounding DINO was finetuned on the FSC147 dataset. Table 4 in the paper[1]. While conditioned on text only, a finetuned Grounding DINO achieved results that match the performance of CountGD. A comment on these results would be greatly appreciated. Also I am aware that Reffering Expression Counting is concurrent work and I am not asking for a comparison to the proposed method, just a comment on the surprisingly good performance of a finetuned Grounding DINO. 

[1] https://openaccess.thecvf.com/content/CVPR2024/papers/Dai_Referring_Expression_Counting_CVPR_2024_paper.pdf
I think the authors have well addressed the concerns. I would like to raise my rating.
Thank you for the questions and for recognizing that we have addressed most of your concerns. We respond to each question below:

**RE: Is the model sensitive to input text descriptions? The authors mention that they use text descriptions from FSC-147-D [1]. What about using the class names provided by FSC-147 as input text descriptions?**

No, CountGD is **not** very sensitive to the text descriptions. By using exemplars and the class names in FSC-147 instead of the text in FSC-147-D, we achieve a 6.09 MAE and a 30.84 RMSE on FSC-147 Test, which is still state of the art. The original result using exemplars and the text in FSC-147-D is a 5.74 MAE, and a 24.09 RMSE.

**RE: Is it possible to train the model with text and visual exemplars, but inference with only one modality? I understand that the authors focus on multi-modality open-world counting, but text and visual exemplars may not be available simultaneously in real-world applications. While it is feasible to deploy two different counting models (i.e., text-only and exemplar-only models), it would be better if the model could handle different inputs.**

**Yes**, inference with one modality is possible with our multi-modal model trained with text and visual exemplars. We already show results for training on *both* text and visual exemplars and testing with *only* text on the CARPK dataset (Tab. 2, row 4 of the main paper) and the CountBench dataset (Tab. 2, row 10 of the main paper). In both cases, CountGD, trained with both text and visual exemplars, achieves state-of-the-art accuracy for open-world counting when given only text at inference. The same model given *only* visual exemplars at inference achieves 5.22 MAE and 7.14 RMSE on CARPK Test. This performance is slightly better than the visual exemplar only method CounTR [27] which was fine-tuned on CARPK. Note, our model is not fine-tuned on CARPK or CountBench.
Dear Reviewer QCsU,

Thank you again for your time to review this paper. Could you please check if the authors' rebuttal has addressed your concerns at your earliest convenience? Thank you!

Best regards,

AC
Thanks for responses. Keep my ratings. Good luck!
Thanks for the response. The rebuttal has addressed most of my concerns. I have two more questions.
1. Is the model sensitive to input text descriptions? The authors mention that they use text descriptions from FSC-147-D [1]. What about using the class names provided by FSC-147 as input text descriptions? 
2. Is it possible to train the model with text and visual exemplars, but inference with only one modality? I understand that the authors focus on multi-modality open-world counting, but text and visual exemplars may not be available simultaneously in real-world applications. While it is feasible to deploy two different counting models (i.e., text-only and exemplar-only models), it would be better if the model could handle different inputs.
We appreciate the skepticism. As we explained in the rebuttal, our ideal output for a conflict would be zero - i.e. we consider the AND operation between the text and exemplars. We investigate to what extent this holds in practice by defining three levels of conflict.

super-class conflict -- the super class of the exemplar and the text don't match e.g., the exemplar is a tiger and the text=’chair’;

sub-class conflict -- the sub-class of the exemplar and text don't match e.g., the exemplar is a man and the text=’woman’, both of which are humans;

attribute conflict -- the exemplar and text match in terms of class but don't match in terms of attribute, e.g., the exemplar is a blue circle but the text='red'

For case (1) we use the image of the butterflies in Fig. 7 of the main paper. By providing visual exemplars of the butterflies and the text ‘white plant pot,’ we get a count of 0 as expected. For case (2) we use the image of the strawberries and blueberries in Fig. 1 (b) of the main paper. By providing one exemplar of a blueberry and the text ‘strawberry, we obtain a count of 0. For case (3), we consider the colored roses in Fig. 4. In this case, when providing an exemplar of a red rose and the text ‘yellow,’ the output is (incorrectly) 9, the number of red and yellow roses. We speculate that we are limited by image-text capabilities of the original GroundingDINO model (as illustrated in the fine-grained limitation example provided to Reviewer Jn2T).  We will include the output of CountGD in these cases and detailed analysis in the camera-ready.
Dear Reviewers,

Thank you very much again for your valuable service to the NeurIPS community.

As the authors have provided detailed responses, it would be great if you could check them and see if your concerns have been addressed if you haven't done so. Your prompt feedback would provide an opportunity for the authors to offer additional clarifications if needed.

Best regards,

AC
Regarding the response to Q3, I hold a cautious attitude of skepticism. The model may not necessarily capture conflicts between text and visual examples effectively, and the article does not explicitly constrain this aspect. Therefore, confusion is highly likely to occur. More real-world testing examples need to be provided and analyzed. Of course, I understand that the authors may not be able to provide more images at this point, so presenting results and analysis of test examples would be acceptable. More importantly, I hope that the author can explore this issue carefully. If necessary, it is best to provide relevant result cases and analysis in the camera-ready version, which will help others to evaluate the article and further study.