As already seen in sec:back:visual-counting, counting by density estimation is a supervised learning approach that tries to establish a direct mapping from the image features to a corresponding density map (i.e., a continuous-valued function), skipping the challenging task of detecting instances of the objects. This approach is particularly effective in very crowded scenarios where the instances of the objects are sometimes not clearly visible due to occlusions. Recently, cnns have been heavily exploited for learning non-linear functions from crowd images to their corresponding density maps, and a multitude of methods have been proposed in the literature. One of the first works that employed a pure cnn to estimate the density and count people in crowded contexts is presented by [1]}. A more efficient structure is proposed by [2]} introducing a Multi-Column cnn-based architecture (MCNN) for crowd counting. A similar idea is developed by [3]} with a scale-aware, multi-column counting model named Hydra-CNN able to estimate traffic densities in congested scenes. More recently, the authors of [4]} introduced CSRNet. This cnn-based algorithm uses dilated kernels to deliver larger reception fields and replace pooling operations. We employ this network as the baseline in our work, and we briefly review its architecture in the next sections. The main limitations of these approaches are due to the scarcity of data. As a result, existing methods often suffer from overfitting, which leads to performance degradation while transferring them to other scenes. Besides, there is another inherent problem: the labels of these datasets are not very accurate. Most of the existing datasets are dot-annotated. Consequently, the ground truth density maps are just an approximation in which the sizes of the objects are estimated using some heuristics. In this chapter, we address both problems by proposing an uda technique that exploits unlabeled data and by introducing two new datasets with per-pixel annotations that allow the creation of precise ground truth density maps.
