1 Introduction
Nowadays, density estimation and counting the number of people in a crowded scene is a desirable application especially in restricted, public event places such as train stations. Incidents, traffic delay and even terrible stampedes may be caused by overcrowding in such a scene. Generally, there is an urgent need for realtime decision making corresponding to crowd changes. To deal with this situation, there exist various challenges caused by occlusions, size and shape variations of people, perspective distortion, etc. Thus, correctly counting in crowded areas is very necessary in many real world applications including visual surveillance, traffic monitoring and crowd analysis.
The existing approaches for crowd density estimation can be divided into two main groups, i.e., detection based methods and feature regression based methods [1]
. Detection based methods (also called direct methods) segment and detect every individual people or objects in a scene with pretrained classifiers and then simply count them. However, in complex scenes with serious occlusions and extremely crowded scenes, these approaches often fail to detect individuals and therefore produce inaccurate countings. In the feature regression based approaches (also called indirect approaches), learning algorithms or statistical methods are utilized to analyze the image appearance features of a crowded scene, and then estimate the number of people or objects based on image appearance. Thus, these methods are more suitable for dealing with highly crowded scenes where detecting individuals often fails.
In this paper, based on the recent advance of Counting Convolutional Neural Network (CCNN) [2], we propose a new adaptive CCNN architecture, abbreviated as ACCNN, that processes each part of an input image using an optimally trained CCNN model in order to estimate the corresponding density map accurately. As illustrated in Fig. 1, to tackle the counting problem, our ACCNN model is able to regress the density function corresponding to a specified section. This allows our model to accurately localize density maps for unseen images.
The most noticeable properties that make the proposed model outstanding for crowd analysis are: (1) the ability to handle large scale variations in people’s sizes when appearing in images; and (2) the facility to generate local density maps within a crowd scene. Therefore, the proposed model can give a complete view about the scattering of a crowd. Compared to the prior works, our approach does not use different CCNN architectures, and only tries to select the most effective Hyper Parameters (HPs) for generating a CCNN model. Thus, it can learn to address scale variations in an image with a simple and effective way.
2 Related Works
In recent years, many researchers [3, 4, 5]
have developed deep learning models for image segmentation, classification and recognition, and achieved very good results. Inspired by these, Convolutional Neural Network (CNN) models have been proposed to learn to count people and produce density maps in images simultaneously, and they have worked well for objects of approximately the same size in an image or a video. Sindagi and Patel
[6] proposed an endtoend cascaded network of CNNs that can learn globally relevant and discriminative features to estimate highly refined density maps with low count errors. OnoroRubio and LopezSastre proposed a regression model called Counting CNN (CCNN) [2], which can map the appearances of input image patches to corresponding density maps. They also proposed a Hydra CNN based on the idea of multiscaling crowd counting and achieved a sufficient advantages in comparison with the previous models.Inspired by the Hydra CNN method, some researchers have tried to utilize more complex deep models to solve the problem caused by the significant variance of crowd’s appearance in a captured image/video. Deepak et al.
[5] proposed a switching CNN to select the best CNN regressor for each of different receptive fields and achieved better results than the stateofthearts for crowd counting. Kumagai1 et al. [7] proposed a mixture of CCNNs and adaptively selected multiple CNNs according to the appearance of a test image for predicting the number of people. Zhang et al. proposed a multicolumn network and three independent CNN architectures, and then used the combined features of these three networks to get a density map [3].Our work presented in this paper is based on the CCNN architecture [2]. The CCNN approach takes a small patch of the input image as input and generates the corresponding density map for the image patch. By utilizing the sliding window technique, it extracts patches and applies a CNN model to regress the density function. Therefore, CCNN is formulated as a regression model that generates object density maps based on the corresponding appearances of image patches.
Formally, in the original CCNN model, the ground truth density map D_I is defined as,
(1) 
where represents the number of annotated points in the image , and (; ; ) represents a normalized 2D Gaussian function with a mean of and a covariance of , evaluated at each pixel position .
The CCNN utilizes two important HPs for generating models, i.e., the patch size and the value of in the Gaussian function. Through careful analysis of CCNN, we have noticed that it has a major problem in producing a correct density map, because CCNN treats the whole parts of the input image in the same way. Therefore, CCNN cannot achieve an acceptable accuracy in density estimation when a scene has a large scale variation in the sizes of objects. We have observed that more accurate density maps can be produced when the values of the above mentioned two HPs are optimally and properly chosen.
3 Adaptive CCNN
In our work, in order to handle crowd images with large varieties in targets’ appearances, we propose a new ACCNN model for crowd counting. As shown in Fig. 1, our ACCNN architecture takes an image as input and equally divides the image to 16 parts and then determines the average of heads’ sizes and position in different parts of an image. Then, by utilizing a Fuzzy Inference System (FIS), it feeds each image section with the same FIS linguistic output value to an appropriate CCNN model with a proper HP to obtain the corresponding density map for each section. In the end, it merges the output of different parts to obtain the final density map output.
In reality, the sizes of people who are closer to the camera appear to be bigger than those of the people who are further from the camera. Based on our observation from expriments, we find that there is a relationship between HPs and the scales of people. Thus, we use smaller (and larger) ’s and patch sizes for the areas containing smaller (and larger) targets. Then, we train CCNN models to create density maps for different sizes of patches. For each image in the testing stage, our ACCNP model extracts image patches from it, and generates their corresponding object density maps by utilizing the relative CCNN models according to their sizes. Then, the density maps of these patches are assembled into the density map of the testing image.
Compared with CCNN, we have made the following improvement in the proposed ACCNN. Firstly, we use different patch sizes in ACCNN according to the sizes of people in the patches, different from using the same patch size for all patches in the original CCNN. Secondly, we have utilized different values to generate the training patches. The of the Gaussian function in Eq. 1 is changed to adapt the size of a patch. In comparison with the SwitchCNN, our proposed ACCNN uses only one wellknown CCNN model with adaptive HPs, so it has less complexity than the SwitchCNN with different CNN architectures.
The process of the proposed ACCNN is summarized as follows and detailed in the following subsections. First, we perform tinyface detection
[8] to estimate the sizes of heads in each patch of an image. Then, by feeding the head sizes and the corresponding head positions to a fuzzy inference system (FIS), we generate the appropriate HPs corresponding to the patches. Finally, these HPs are used to train CCNNs that can adaptively generate the density maps for various patches.3.1 Head Detection
To obtain the most suitable values of HPs, we need to know the sizes of people or objects in different parts of an image. Therefore, the tinyface detection approach [8] is used to detect faces in each part of the input image. It creates a coarse image pyramid of the input image, and then feeds the scaled inputs into a CNN to get the template responses. Finally, the final detection results are produced by applying the nonmaximum suppression (NMS) at the original resolution.
3.2 Adaptive HP Selection by FIS
As shown in the Fig. 1, in order to obtain the values of the HPs, an FIS is designed to adaptively select the values of HPs according to the sizes and the positions of heads. As shown in Fig. 2, the FIS receives the fuzzy information about head sizes and positions, and outputs the fuzzy linguistic variables in the form of fuzzy. We choose the same Gaussian membership function for all input and output variables. Small, Average and Big are the fuzzy linguistic variables according to head sizes, and Up, Middle and Down are the fuzzy linguistic values according to head positions. The output linguistic variables are HighPred, MidPred, and LowPred.
Based on the Gaussian membership function, the input values are converted into fuzzy linguistic variable in FIS. Then, the fuzzy ifthen rules developed based on the Mamdani method [9] are used to map the input variables to appropriate fuzzy output variables. In total, nine fuzzy ifthen rules are presented in Table 1. In general, higher (and lower) values of and sliding window (patch size) produce density maps with lower (higher) counts of numbers of people. As an illustration, if an output of FIS is HighPred (MidPred, LowPred), the corresponding CCNN is trained with low (medium, big) HP values.
Input  Output  

Head Size  Position  
Small  Up  HighPred  
Small  Middle  HighPred  
Small  Down  MidPred  
Average  Middle  MidPred  
Average  Down  MidPred  
Average  Up  LowPred  
Big  Up  MidPred  
Big  Down  LowPred  
Big  Middle  LowPred 
3.3 Training Parameters
Showing the effectiveness of the proposed ACCNN, we use the same training parameters as in [2], except for two HPs, which are the patch sizes and ’s, for people counting and density estimation. These two HPs are empiracally determined on the traing data set. Similar to the approach in [2]
, a stochastic gradient decent algorithm is used during training. The momentum, the learning rate and the weight decay are set to be 0.9, 0.0001 and 0.001 respectively. After 25 epochs, the model can reach a local optimum.
4 Experimental Results
To evaluate the performance of our ACCNN algorithm, experiments are conducted on three challenging crowd counting datasets, i.e., the UCSD dataset [10], the UCFCC dataset [11], and the dataset of Sydney Trains Footage (STF) [12]. Note that the first two are public benchmark datasets.
The Mean Absolute Error (MAE) is used as the evaluation metric for comparing the performance of ACCNN against the stateoftheart methods, and it is defined as:
(2) 
where is the number of images, is the crowd count predicted by the model being evaluated, and is the crowd count from the human annotated one (i.e., ground truth).
4.1 The UCSD Dataset
The UCSD crowd counting dataset consists of 2000 frames of size 238158 from a single far distance scene. We split the dataset into four subsets of training and testing images in the same way as in [2].
Table 2 presents the MAE results for our proposed ACCNN and six stateoftheart methods. As shown in Table 2, our ACCNN performs competitively against other approaches with the lowest ever MAE of 1.04 and 1.48 for the upscale and minimal subsets respectively. Furthermore, in the other subsets, the results indicate that ACCNN outperforms the CCNN by more than 8 percent. Overall, ACCNN reaches the best ever average result with MAE of 1.35.
Methods  Max  Down  Up  Min  Avg 
Density Learning [13]  1.70  1.28  1.59  2.02  1.64 
Count Forest [14]  1.43  1.30  1.59  1.62  1.49 
Arteta et al. [15]  1.24  1.31  1.69  1.49  1.43 
Zhang et al. [16]  1.70  1.26  1.59  1.52  1.52 
SwitchCNN [5]        1.62  1.62 
CCNN [2]  1.65  1.79  1.11  1.50  1.51 
ACCNN  1.51  1.36  1.04  1.48  1.35 
4.2 The UCFCC Dataset
The UCF CC 50 [11] is a small dataset with 50 picture collections of annotated crowd scenes. We have followed the same experimental settings as those of six other stateoftheart models [5].
In Table 3, the MAE performance of our ACCNN compared with other methods is shown. As shown in Table 3, ACCNN outperforms four out of six methods and improves the MAE score by more than 24 percentage compared to the original CCNN. Considering its simplicity, ACCNN’s performance is comparable to that of SwitchCNN and HydraCCNN.
4.3 The Sydney Train Footage
To evaluate the robustness of our model on realworld problems with heavy occlusions, low resolution and large variance in people’s sizes, we have utilized CCTV footages of a train station in Sydney and created annotated data for training and testing with our proposed approach. An example is shown in Fig. 1. This dataset has two separate scenes, taken by cameras C5 and C9 with 788 and 600 frames, respectively, with crowd varying between 3 to 65. The sizes of the input frames are 576704, and the mask and annotation are provided. The huge variation in people’s sizes and heavy extreme occlusions make it a very challenging task. Generally, in this dataset, the sizes of people who are in front of the cameras are three to four times larger than the sizes of people in further areas.
Table 4 reports the MAE performance on this dataset. The crowd count of ACCNN is significantly higher than the original CCNN. This reinforces the fact that utilizing our ACCNN can efficiently manage both the difference in appearances and sizes of people. Thus, the various trained CCNNs employed by ACCNN are able to provide precise density maps, independent of the datasets.
5 Conclusion
Aiming to tackle the difficult problem of crowd counting such as scale variance and extreme collusion, we have presented an Adaptive CCNN architecture that takes a whole image as input and directly outputs its density map. The proposed method has made a full use of contextual information to generate an accurate density map. To leverage the local information, we have utilized the combination of CNNbased head detection and fuzzy inference engine to choose an optimal CCNN model adaptively to each patch of the input image. We have achieved noticeable improvements on three challenging datasets, i.e., the UCSD, UCFCC and the crowd dataset collected by ourselves from a train station in Sydney, and have demonstrated the effectiveness of the proposed approach.
6 Acknowledgment
This work was partly supported by Rail Manufacturing CRC and Sydney Trains with UTS project ID PRO173968.
References
 [1] V.A. Sindagi and V.M. Patel, “A survey of recent advances in cnnbased single image crowd counting and density estimation,” Pattern Recognition Letters, July 2017.
 [2] D. OnoroRubio and R.J. LópezSastre, “Towards perspectivefree object counting with deep learning,” in Proceedings of the ECCV. Springer, 2016, pp. 615–629.
 [3] L. Zeng, X. Xu, B. Cai, S. Qiu, and T. Zhang, “Multiscale convolutional neural networks for crowd counting,” arXiv preprint arXiv:1702.02359, February 2017.
 [4] V.A. Sindagi and V.M. Patel, “Cnnbased cascaded multitask learning of highlevel prior and density estimation for crowd counting,” in Advanced Video and Signal Based Surveillance (AVSS). IEEE, 2017, vol. 14, pp. 1–6.
 [5] D.B. Sam, S. Surya, and R.V. Babu, “Switching convolutional neural network for crowd counting,” in CVPR, 2017, vol. 1/3, p. 6.
 [6] C. Shang, H. Ai, and B. Bai, “Endtoend crowd counting via joint learning local and global count,” in Proceedings of the ICIP. IEEE, 2016, pp. 1215–1219.
 [7] S. Kumagai, K. Hotta, and T. Kurita, “Mixture of counting cnns: Adaptive integration of cnns specialized to specific appearance for crowd counting,” arXiv preprint arXiv:1703.09393, March 2017.
 [8] P. Hu and D. Ramanan, “Finding tiny faces,” in Proceedings of the CVPR. IEEE, 2017, pp. 1522–1530.
 [9] E.H. Mamdani, “Application of fuzzy logic to approximate reasoning using linguistic synthesis,” in Proceedings of the sixth international symposium on Multiplevalued logic. IEEE Computer Society Press, 1976, pp. 196–202.
 [10] A.B. Chan, Z.S.J. Liang, and N. Vasconcelos, “Privacy preserving crowd monitoring: Counting people without people models or tracking,” in Proceedings of the CVPR. IEEE, 2008, pp. 1–7.
 [11] H. Idrees, I. Saleemi, C. Seibert, and M. Shah, “Multisource multiscale counting in extremely dense crowd images,” in Proceedings of the CVPR, 2013, pp. 2547–2554.

[12]
H. Farhood, X.S. He, W. Jia, M. Blumenstein, and H. Li,
“Counting people based on linear, weighted and local random forest,”
in The International Conference on Digital Image Computing: Techniques and Applications, 2017.  [13] V. Lempitsky and A. Zisserman, “Learning to count objects in images,” in Proceedings of the NIPS, 2010, pp. 1324–1332.
 [14] V.Q. Pham, T. Kozakaya, O. Yamaguchi, and R. Okada, “Count forest: Covoting uncertain number of targets using random forest for crowd density estimation,” in Proceedings of the ICCV, 2015, pp. 3253–3261.
 [15] C. Arteta, V. Lempitsky, J.A. Noble, and A. Zisserman, “Interactive object counting,” in Proceedings of the ECCV. Springer, 2014, pp. 504–518.
 [16] C. Zhang, H. Li, X. Wang, and X. Yang, “Crossscene crowd counting via deep convolutional neural networks,” in Proceedings of the CVPR, 2015, pp. 833–841.
 [17] Y. Zhang, D. Zhou, S. Chen, S. Gao, and Y. Ma, “Singleimage crowd counting via multicolumn convolutional neural network,” in Proceedings of the CVPR, 2016, pp. 589–597.
Comments
There are no comments yet.