Keywords

1 Introduction

Counting dense crowds is significant both from socio-political and safety perspective. At one end of the spectrum, there are large ritual gatherings such as during pilgrimages that typically have large crowds occurring in known and pre-defined locations. Although they generally have passive crowds coming together for peaceful purposes, disasters have known to occur, for instance, during Love Parade [9] and Hajj [1]. For active crowds, such as expressive mobs in demonstrations and protests, counting is important both from political and safety standpoint. It is very common for different sides to claim divergent numbers for crowd gathering, inclined towards their political standing on the concerned issue. Beyond subjectivity and preference for certain political or social outcomes, the disparate counting estimates from opposing parties have a basis in numerical cognition as well. In humans, the results on subitizing [21] suggest that once the number of observed objects increases beyond four, the brain switches from the exact Parallel Individuation System (PIS) to the inaccurate but scalable Approximate Number System (ANS) to count objects [11]. Thus, computer vision based crowd counting offers alternative fast and objective estimation of the number of people in such events. Furthermore, crowd counting is extendable to other domains, for instance, counting cells or bacteria from microscopic images [17, 27], animal crowd estimates in wildlife sanctuaries [2], or estimating the number of vehicles at transportation hubs or traffic jams [19].

Fig. 1.
figure 1

This figure highlights the problems due to low resolution images from two existing dense crowd datasets: (a) shows a case where the annotations were not done on parts of the images as it is virtually impossible to distinguish heads of neighboring people, while (b) shows a case where some of the locations/counts are erroneous and therefore not suitable for localization. The UCF-QNRF dataset proposed in this paper overcomes such issues. (Color figure online)

In this paper, we propose a novel approach to crowd counting, density map estimation and localization of people in a given crowd image. Our approach stems from the observation that these three problems are very interrelated - in fact, they can be decomposed with respect to each other. Counting provides an estimate of the number of people/objects without any information about their location. Density maps, which can be computed at multiple levels, provide weak information about location of each person. Localization does provide accurate location information, nevertheless, it is extremely difficult to estimate directly due to its very sparse nature. Therefore, we propose to estimate all three tasks simultaneously, while employing the fact that each is special case of another one. Density maps can be ‘sharpened’ till they approximate the localization map, whose integral should equal to the true count.

Furthermore, we introduce a new and the largest dataset to-date for training and evaluating dense crowd counting, density map estimation and localization methods, particularly suitable for training very deep Convolutional Neural Networks (CNNs). Though counting has traditionally been considered the primary focus of research, density map estimation and localization have significance and utility beyond counting. In particular, two applications are noteworthy: initialization/detection of people for tracking in dense crowds [13]; and rectifying counting errors from an automated computer vision algorithm. That is, a real user or analyst who desires to estimate the exact count for a real image without any error, the results of counting alone are insufficient. The single number for an entire image makes it difficult to assess the error or the source of the error. However, the localization can provide an initial set of dot locations of the individuals, the user then can quickly go through the image and remove the false positives and add the false negatives. The count using such an approach will be much more accurate and the user can get \(100\%\) precise count for the query image. This is particularly important when the number of image samples are few, and reliable counts are desired.

Prior to 2013, much of the work in crowd counting focused on low-density scenarios. For instance, UCSD dataset [4] contains 2, 000 video frames with 49, 885 annotated persons. The dataset is low density and low resolution compared to many recent datasets, where train and test splits belong to a single scene. WorldExpo’10 dataset [29], contains 108 low-to-medium density scenes and overcomes the issue of diversity to some extent. UCF dataset [12] contains 50 different images with counts ranging between 96 and 4, 633 per image. Each image has a different resolution, camera angle, and crowd density. Although it was the first dataset for dense crowd images, it has problems with annotations (Fig. 1) due to limited availability of high-resolution crowd images at the time. The ShanghaiTech crowd dataset [30] contains 1, 198 annotated images with a total of 330, 165 annotations. This dataset is divided into two parts: Part A contains 482 images and Part B with 716 images. The number of training images are 300 and 400 in both parts, respectively. Only the images in Part A contain high-density crowds, with 482 images and 250K annotations.

Table 1. Summary of statistics of different datasets. UCF_CC_50 (44 MB); WorldExpo’10 (325 MB); ShanghaiTech_A (67 MB); and the proposed UCF-QNRF Dataset (4.33 GB).
Fig. 2.
figure 2

(a) This graph shows the relative distribution of image counts among the four datasets. The proposed UCF-QNRF dataset has a fair number of images from all five count ranges. (b) This graph shows a 2D histogram of image resolution for all the images in the new dataset. The x-axis shows the number of rows, while y-axis is the number of columns. Each bin (\(500 \times 500\) pixels) is color-coded with the number of images that have the corresponding resolution. (Color figure online)

Table 1 summarizes the statistics of the multi-scene datasets for dense crowd counting. The proposed UCF-QNRF dataset has the most number of high-count crowd images and annotations, and a wider variety of scenes containing the most diverse set of viewpoints, densities and lighting variations. The resolution is large compared to WorldExpo’10 [29] and ShanghaiTech [30], as can be seen in Fig. 2(b). The average density, i.e., the number of people per pixel over all images is also the lowest, signifying high-quality large images. Lower per-pixel density is partly due to inclusion of background regions, where there are many high-density regions as well as zero-density regions. Part A of Shanghai dataset has high-count crowd images as well, however, they are severely cropped to contain crowds only. On the other hand, the new UCF-QNRF dataset contains buildings, vegetation, sky and roads as they are present in realistic scenarios captured in the wild. This makes this dataset more realistic as well as difficult. Similarly, Fig. 2(a) shows the diversity in counts among the datasets. The distribution of proposed dataset is similar to UCF_CC_50 [12], however, the new dataset is 30 and 20 times larger in terms of number of images and annotations, respectively, compared to UCF_CC_50 [12]. We hope the new dataset will significantly increase research activity in visual crowd analysis and will pave way for building deployable practical counting and localization systems for dense crowds.

The rest of the paper is organized as follows. In Sect. 2 we review related work, and present the proposed approach for simultaneous crowd counting, density map estimation and localization in Sect. 3. The process for collection and annotation of the UCF-QNRF dataset is covered in Sect. 4, while the three tasks and evaluation measures are motivated in Sect. 5. The experimental evaluation and comparison are presented in Sect. 6. We conclude with suggestions for future work in Sect. 7.

2 Related Work

Crowd counting is active an area of research with works tackling the three aspects of the problem: counting-by-regression [4, 12, 17, 23, 28], density map estimation [7, 17, 20, 29, 30] and localization [18, 22].

Earlier regression-based approaches mapped global image features or a combination of local patch features to obtain counts [5, 6, 12, 15]. Since these methods only produce counts, they cannot be used for density map estimation or localization. The features were hand-crafted and in some cases multiple features were used [4, 12] to handle low resolution, perspective distortion and severe occlusion. On the other hand, CNNs inherently learn multiple feature maps automatically, and therefore are now being extensively used for crowd counting and density map estimation.

CNN based approaches for crowd counting include [2, 16, 19, 29, 30]. Zhang et al. [29] train a CNN alternatively to predict density map and count in a patch, and then average the density map for all the overlapping patches to obtain density map for the entire image. Lebanoff and Idrees [16] introduce a normalized variant of the Euclidean loss function in a deep network to achieve consistent counting performance across all densities. The authors in [30] use three column CNN, each with different filter sizes to capture responses at different scales. The count for the image is obtained by summing over the predicted density map. Sindagi and Patel [26] presented a CNN-based approach that incorporates global and local contextual information in an image to generate density maps. The global and local contexts are obtained by learning to classify the input image patches into various density levels, later fused with the output of a multi-column CNN to obtain the final density map. Similarly, in the approach by Sam et al. [24], image patches are relayed to the appropriate CNN using a switching mechanism learnt during training. The independent CNN regressors are designed to have different receptive fields while the switch classifier is trained to relay the crowd scene patch to the best CNN regressor.

For localization in crowded scenes, Rodriguez et al. [22] use density map as a regularizer during the detection. They optimize an objective function that prefers density map generated on detected locations to be similar to predicted density map [17]. This results in both better precision and recall. The density map is generated by placing a Gaussian kernel at the location of each detection. Ma et al. [18] first obtain density map using sliding window over the image through [17], and then use integer programming to localize objects on the density maps. Similarly, in the domain of medical imaging, Sirinukunwattana et al. [27] introduced spatially-constrained CNNs for detection and classification of cancer nuclei. In this paper, we present results and analysis for simultaneous crowd counting, density map estimation, and localization using Composition Loss on the proposed UCF-QNRF dataset.

Fig. 3.
figure 3

The figure shows the proposed architecture for estimating count, density and localization maps simultaneously for a given patch in an image. At the top is the base DenseNet which regresses only the counts. The proposed Composition Loss is implemented through multiple dense blocks after branching off the base network. We also test the effect of additional constraint on the density and localization maps (shown with amber and orange blocks) such that the count after integral in each should also be consistent with the groundtruth count. (Color figure online)

3 Deep CNN with Composition Loss

In this section, we present the motivation for decomposing the loss of three interrelated problems of counting, density map estimation and localization, followed by details about the deep Convolutional Neural Network which can enable training and estimation of the three tasks simultaneously.

3.1 Composition Loss

Let \(\mathbf {x} = [x,y]\) denote a pixel location in a given image, and N be the number of people annotated with \(\{\mathbf {x}_i : i = 1,2,\ldots N\}\) as their respective locations. Dense crowds typically depict heads of people as they are the only parts least occluded and mostly visible. In localization maps, only a single pixel is activated, i.e., set to 1 per head, while all other pixels are set to 0. This makes localization maps extremely sparse and therefore difficult to train and estimate. We observe that successive computation of ‘sharper’ density maps which are relatively easier to train can aid in localization as well. Moreover, all three tasks should influence count, which is the integral over density or localization map. We use the Gaussian Kernel and adapt it for our problem of simultaneous solution for the three tasks.

Due to perspective effect and possibly variable density of the crowd, a single value of bandwidth, \(\sigma \), cannot be used for the Gaussian kernel, as it might lead to well-defined separation between people close to the camera or in regions of low density, while excess blurring in other regions. Many images of dense crowds depict crowds in their entirety, making automatic perspective rectification difficult. Thus, we propose to define \(\sigma _i\) for each person i as the minimum of the \(\ell _2\) distance to its nearest neighbor in spatial domain of the image or some maximum threshold, \(\tau \). This ensures that the location information of each person is preserved precisely irrespective of default kernel bandwidth, \(\tau \). Thus, the adaptive Gaussian kernel is given by,

$$\begin{aligned} D(\mathbf {x,\; \textit{f}(\cdot )}) = \sum _{i=1}^{N} \frac{1}{{ \sqrt{2\pi } \textit{f}(\sigma _i) }} \mathrm {exp}\bigg ({{{ - \frac{ (x - x_i)^2 + (y - y_i)^2 }{2 \textit{f}(\sigma _i) ^2 }}}}\bigg ), \end{aligned}$$
(1)

where the function \(\textit{f}\) is used to produce a successive set of ‘sharper’ density maps. We define \(\textit{f}_k(\sigma )=\sigma ^{1/k}\). Thus, \(D_k = D(\mathbf {x},\; \textit{f}_k(\cdot ))\). As can be seen when \(k=1\), \(D_k\) is a very smoothed-out density map using nearest-neighbor dependent bandwidth and \(\tau \), whereas as \(k\longrightarrow \infty \), \(D_k\) approaches the binary localization map with a Dirac Delta function placed at each annotated pixel. Since each pixel has a unit area, the localization map assumes a unit value at the annotated location. For our experiments we used three density levels with last one being the localization map. It is also interesting to note that the various connections between density levels and base CNN also serve to provide intermediate supervision which aid in training the filters of base CNN towards counting and density estimation early on in the network.

Hypothetically, since integral over each estimated \(\hat{D}_k\) yields a count for that density level, the final count can be obtained by taking the mean of counts from the density and localization maps as well as regression output from base CNN. This has two potential advantages: (1) the final count relies on multiple sources - each capturing count at a different scale. (2) During training the mean of four counts should equal the true count, which implicitly enforces an additional constraint that \(\hat{D}_k\) should not only capture the density and localization information, but that each of their counts should also sum to the groundtruth count. For training, the loss function of density and localization maps is the mean square error between the predicted and ground truth maps, i.e. , where \(k=1,2,\;\text {and}\; \infty \), and regression loss, , is Euclidean loss between predicted and groundtruth counts, while the final loss is defined as the weighted mean all four losses.

Table 2. This table shows the filter dimensions and output of the three density layer blocks appended to the network in Fig. 3.

3.2 DenseNet with Composition Loss

We use DenseNet [10] as our base network. It consists of 4 Dense blocks where each block has a number of consecutive \(1 \times 1\) and \(3 \times 3\) convolutional layers. Each dense block (except for the last one) is followed by a Transition layer, which reduces the number of feature-maps by applying \(1 \times 1\) convolutions followed by \(2 \times 2\) average pooling with stride 2. In our experiments we used DenseNet-201 architecture. It has \(\{6, 12, 48, 32\}\) sets of \(1 \times 1\) and \(3 \times 3\) convolutional layers in the four dense blocks, respectively.

For density map estimation and localization, we branch out from DenseBlock2 and feed it to our Density Network (see Table 2). The density network introduces 2 new dense blocks and three \(1 \times 1\) convolutional layers. Each dense block has features computed at the previous step, concatenated with all the density levels predicted thus far as input, and learns features aimed at computing the current density/localization map. We used \(1 \times 1\) convolutions to get the output density map from these features. Density Level 1 is computed directly from DenseBlock2 features.

We used Adam solver with a step learning rate in all our experiments. We used 0.001 as initial learning rate and reduce the learning rate by a factor of 2 after every 20 epochs. We trained the entire network for 70 epoch with a batch size of 16.

4 The UCF-QNRF Dataset

Dataset Collection. The images for the dataset were collected from three sources: Flickr, Web Search and the Hajj footage. The Hajj images were carefully selected so that there are multiple images that capture different locations, viewpoints, perspective effects and times of the day. For Flickr and Web Search, we manually generated the following queries: crowd, hajj, spectator crowd, pilgrimage, protest crowd and concert crowd. These queries were then passed onto the Flickr and Google Image Search APIs. We selected desired number of images for each query to be 2000 for Flickr and 200 for Google Image Search. The search sorted all the results by relevance incorporating both titles and tags, and for Flickr we also ensured that only those images were downloaded for which original resolutions were permitted to be downloaded (through the url_o specifier). The static links to all the images were extracted and saved for all the query terms, which were then downloaded using the respective APIs. The images were also checked for duplicates by computing image similarities followed by manual verification and discarding of duplicates.

Initial Pruning. The initial set of images were then manually checked for desirability. Many of the images were pruned due to one or more of the following reasons:

  • Scenes that did not depict crowds at all or low-density crowds

  • Objects or visualizations of objects other than humans

  • Motion blur or low resolution

  • Very high perspective effect that is camera height is similar to average human height

  • Images with watermarks or those where text occupied more than 10% of the image.

In high-density crowd images, it is mostly the heads that are visible. However, people who appear far away from the camera become indistinguishable beyond a certain distance, which depends on crowd density, lighting as well as resolution of the camera sensor. During pruning, we kept those images where the heads were separable visually. Such images were annotated with the others, however, they were cropped afterwards to ensure that regions with problematic annotations or those with none at all due to difficulty in recognizing human heads were discarded.

We performed the entire annotation process in two stages. In the first stage, un-annotated images were given to the annotators, while in the second stage, the images were given to verifiers who corrected any mistakes or errors in annotations. There were 14 annotators and 4 verifiers, who clocked 1, 300 and 200 h respectively. In total, the entire procedure involved 2, 000 human-hours spent through to its completion.

Statistics. The dataset has 1, 535 jpeg images with 1, 251, 642 annotations. The train and test sets were created by sorting the images with respect to absolute counts, and selecting every 5th image into the test set. Thus, the training and test set consist of 1201 and 334 images, respectively. The distribution of images from [Flickr, Web, Hajj] for the train and test are [1078, 84, 39] and [306, 21, 7], respectively. In the dataset, the minimum and maximum counts are 49 and 12, 865, respectively, whereas the median and mean counts are 425 and 815.4, respectively.

5 Definition and Quantification of Tasks

In this section, we define the three tasks and the associated quantification measures.

Counting: The first task involves estimation of count for a crowd image i, given by \(\mathbf {c}_i\). Although this measure does not give any information about location or distribution of people in the image, this is still very useful for many applications, for instance, estimating size of an entire crowd spanning several square kilometers or miles. For the application of counting large crowds, Jacob’s Method [14] due to Herbert Jacob is typically employed which involves dividing the area \(\mathbf {A}\) into smaller sections, finding the average number of people or density \(\mathbf {d}\) in each section, computing the mean density \(\bar{\mathbf {d}}\) and extrapolating the results to entire region. However, with automated crowd counting, it is now possible to obtain counts and density for multiple images at different locations, thereby, permitting the more accurate integration of density over entire area covered by crowd. Moreover, counting through multiple aerial images requires cartographic tools to map the images onto the earth to compute ground areas. The density here is defined as the number of people in the image divided by ground area covered by the image. We propose to use the same evaluation measures as used in literature for this task: the Mean Absolute Error (C-MAE), Mean Squared Error (C-MSE) with the addition of Normalized Absolute Error (C-NAE).

Density Map Estimation amounts to computing per-pixel density at each location in the image, thus preserving spatial information about distribution of people. This is particularly relevant for safety and surveillance, since very high density at a particular location in the scene can be catastrophic [1]. This is different from counting since an image can have counts within safe limits, while containing regions that have very high density. This can happen due to the presence of empty regions in the image, such as walls and sky for mounted cameras; and roads, vehicles, buildings and forestation in aerial cameras. The metrics for evaluating density map estimation are similar to counting, except that they are per-pixel, i.e., the per-pixel Mean Absolute Error (DM-MAE) and Mean Squared Error (DM-MSE). Finally, we also propose to compute the 2D Histogram Intersection (DM-HI) distance after normalizing both the groundtruth and estimated density maps. This discards the effect of absolute counts and emphasizes the error in distribution of density compared to the groundtruth.

Localization: The ideal approach to crowd counting would be to detect all the people in an image and then count the number of detections. But since dense crowd images contain severe occlusions among individuals and fewer pixels per person for those away from the camera, this is not a feasible solution. This is why, most approaches to crowd counting bypass explicit detection and perform direct regression on input images. However, for many applications, the precise location of individuals is needed, for instance, to initialize a tracking algorithm in very high-density crowd videos.

To quantify the localization error, estimated locations are associated with the ground truth locations through 1–1 matching using greedy association, followed by computation of Precision and Recall at various distance thresholds (\(1,2,3, \ldots , 100\) pixels). The overall performance of the localization task is then computed through area under the Precision-Recall curve, \(\text {L-AUC}\).

6 Experiments

Next, we present the results of experiments for the three tasks defined in Sect. 5.

6.1 Counting

For counting, we evaluated the new UCF-QNRF dataset using the proposed method which estimates counts, density maps and locations of people simultaneously with several state-of-the-art deep neural networks [3, 8, 10] as well as those specifically developed for crowd counting [24, 25, 30]. To train the networks, we extracted patches of sizes 448, 224 and 112 pixels at random locations from each training image. While deciding on image locations to extract patch from, we assigned higher probability of selection to image regions with higher count. We used mean square error of counts as the loss function. At test time, we divide the image into a grid of \(224 \times 224\) pixel cells - zero-padding the image for dimensions not divisible by 224 - and evaluate each cell using the trained network. Final image count is given by aggregating the counts in all cells. Table 3 summarizes the results which shows the proposed network significantly outperforms the competing deep CNNs and crowd counting approaches. In Fig. 4, we show the images with the lowest and highest error in the test set, for counts obtained through different components of the Composition Loss.

Table 3. We show counting results obtained using state-of-the-art methods in comparison with the proposed approach. Methods with ‘*’ regress counts without computing density maps.
Fig. 4.
figure 4

This figure shows pairs of images where the left image in the pair has the lowest counting error while the right image has the highest counting error with respect to the four components of the Composition Loss.

6.2 Density Map Estimation

For density map estimation, we describe and compare the proposed approach with several methods that directly regress crowd density during training. Among the deep learning methods, MCNN [30] consists of three columns of convolution networks with different filter sizes to capture different head sizes and combines the output of all the columns to make a final density estimate. SwitchCNN [24] uses a similar three column network; however, it also employs a switching network that decides which column should exclusively handle the input patch. CMTL [25] employs a multi-task network that computes a high level prior over the image patch (crowd count classification) and density estimation. These networks are specifically designed for crowd density estimation and their results are reported in first three rows of Table 4. The results of proposed approach are shown in the bottom row of Table 4. The proposed approach outperforms existing approaches by an order of magnitude.

Table 4. Results for density map estimation: we show results on histogram intersection (HI), obtained using existing state-of-the-art methods compared to the proposed approach.

6.3 Localization

For the localization task, we adopt the same network configurations used for density map estimation to perform localization. To get the accurate head locations, we post-process the outputs by finding the local peaks/maximums based on a threshold, also known as non-maximal suppression. Once the peaks are found, we match the predicted location with the ground truth location using 1–1 matching, and compute precision and recall. We use different distance thresholds as the pixel distance, i.e., if the detection is within the a particular distance threshold of the groundtruth, it is treated as True Positive, otherwise it is a False Positive. Similarly, if there is no detection within a groundtruth location, it becomes a False Negative.

The results of localization are reported in Table 5. This table shows that DenseNet [10] and Encoder-Decoder [3] outperform ResNet [8] and MCNN [30], while the proposed approach is superior to all the compared methods. The performance on the localization task is dependent on post-processing, which can alter results. Therefore, finding optimal strategy for localization from neural network output or incorporating the post-processing into the network is an important direction for future research. We also show some qualitative results of localization in Fig. 5. The red dots represent the groundtruth while yellow circles are the locations estimated by the our approach.

Table 5. This table shows the localization results averaged over four distance thresholds for different methods. We show Average Precision, Average Recall and AUC metrics.
Fig. 5.
figure 5

Two examples of localization using the proposed approach. Ground truth is depicted in red and predicted locations after threshold are shown in yellow. (Color figure online)

6.4 Ablation Study

We performed an ablation study to validate the efficacy of composition loss introduced in this paper, as well as various choices in designing the network. These results are shown in Table 6. Next, we describe and provide details for the experiment corresponding to each row in the table.

Table 6. This table shows the results of ablation study. \(D_\infty \) corresponds to the results of counting using localization map estimation, while \(D_2\) and \(D_1\) represent results from the two density maps, respectively.

BaseNetwork: This row shows the results with base network of our choice, which is DenseNet201. A fully-connected layer is appended to the last layer of the network followed by a single neuron which outputs the count. The input patch size is 224 \(\times \) 224.

DenseBlock4: This experiment studies the effect of connecting the Density Network (Table 2) containing the different density levels with DenseBlock4 of the base DenseNet instead of DenseBlock2. Since DenseBlock4 outputs feature maps of size 7 \(\times \) 7, we therefore used deconvolution layer with stride 4 to upsample the features before feeding in to our Density Network.

DenseBlock3: This experiment is similar to DenseBlock4, except that we connect our Density Network to Denseblock3 of the base network. DenseBlock3 outputs feature maps which are 14 \(\times \) 14 in spatial dimensions, whereas we intend to predict density maps of spatial dimension 28 \(\times \) 28, so we upsample the feature maps by using deconvolution layer before feeding them to the proposed Density Network.

\(D_1\) only: This row represents the results if we use Density Level 1 only in the Density Network along with regression of counts in the base network. The results are much worse compared to the proposed method which uses multiple levels in the Composition Loss.

\(D_1\) and \(D_2\) only: Similar to \(D_1\) only, this row represents the results if we use Density Levels 1 and 2 and do not use the \(D_\infty \) in the Density Network. Incorporation of another density level improves results slightly in contrast to a single density level.

Concatenate: Here, we take the sum of the two density and one localization map to obtain 3 counts. We then concatenate these counts to the output of fully-connected layer of the base network to predict count from the single neuron. Thus, we leave to the optimization algorithm to find appropriate weights for these 3 values along with the rest of 1920 features of the fully-connected layer.

Mean: We also tested the effect of using equal weights for counts obtained from the base network and three density levels. We take sum of each density/localization map and take the mean of 4 values (2 density map sums, one localization sum, and one count from base network). We treat this mean value as final count output - both during training and testing. Thus, this imposes the constraint that not only the density and localization map correctly predict the location of people, but also their counts should be consistent with groundtruth counts irrespective of predicted locations.

Proposed: In this experiment, the Density Network is connected with the DenseBlock2 of base network, however, the Density Network simply outputs two density and one localization maps, none of which are connected to count output (see Fig. 3).

In summary, these results show that the Density Network contributes significantly to performance on the three tasks. It is better to branch out from the middle layers of the base network, nevertheless the idea of multiple connections back and forth from the base network and Density Network is an interesting direction for further research. Furthermore, enforcing counts from all sources to be equal to the groundtruth count slightly worsens the counting performance. Nevertheless, it does help in estimating better density and localization maps. Finally, the decrease in error rates from the right to left in Table 6 highlights the positive influence of the proposed Composition Loss.

7 Conclusion

This paper introduced a novel method to estimate counts, density maps and localization in dense crowd images. We showed that these three problems are interrelated, and can be decomposed with respect to each other through Composition Loss which can then be used to train a neural network. We solved the three tasks simultaneously with the counting performance benefiting from the density map estimation and localization as well. We also proposed the large-scale UCF-QNRF dataset for dense crowds suitable for the three tasks described in the paper. We provided details of the process of dataset collection and annotation, where we ensured that only high-resolution images were curated for the dataset. Finally, we presented extensive set of experiments using several recent deep architectures, and show how the proposed approach is able to achieve good performance through detailed ablation study. We hope the new dataset will prove useful for this type of research, with applications in safety and surveillance, design and expansion of public infrastructures, and gauging political significance of various crowd events.