scieee AI-readable full text Open interactive document viewer

Centroid based person detection using pixelwise prediction of the position

Doležel, Petr; Škrabánek, Pavel; Štursa, Dominik; Baruque Zanon, Bruno; Cogollos Adrian, Hector; Krýda, Pavel

Abstract

Implementations of person detection in tracking and counting systems tend towards processing of orthogonally captured images on edge computing devices. The ellipse-like shape of heads in orthogonally captured images inspired us to predict head centroids to determine positions of persons in images. We predict the centroids using a fully convolutional network (FCN). We combine the FCN with simple image processing operations to ensure fast inference of the detector. We experiment with the size of the FCN output to further decrease the inference time. We compare the proposed centroid-based detector with bounding box-based detectors on head detection task in terms of the inference time and the detection performance. We propose a performance measure which allows quantitative comparison of the two detection approaches. For the training and evaluation of the detectors, we form original datasets of 8000 annotated images, which are characterized by high variability in terms of lighting conditions, background, image quality, and elevation profile of scenes. We propose an approach which allows simultaneous annotation of the images for both bounding box-based and centroid-based detection. The centroid-based detector shows the best detection performance while keeping edge computing standards.

Full text

Journal of Computational Science 63 (2022) 101760 Available online 6 July 2022 1877-7503/© 2022 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/). Contents lists available at ScienceDirect Journal of Computational Science journal homepage: www.elsevier.com/locate/jocs Centroid based person detection using pixelwise prediction of the position Petr Dolezel a,Pavel Skrabanek b,∗,Dominik Stursa a,Bruno Baruque Zanon c, Hector Cogollos Adrian c,Pavel Kryda d aUniversity of Pardubice, Faculty of Electrical Engineering and Informatics, Studentska 95, 532 10 Pardubice, Czech Republic bBrno University of Technology, Institute of Automation and Computer Science, Technicka 2896/2, 601 90 Brno, Czech Republic cUniversity of Burgos, Edificio A, Avda. Cantabria s/n, 09006 Burgos, Spain dMikroelektronika spol. s r. o., Draby 849, 566 01 Vysoke Myto, Czech Republic ARTICLE INFO Keywords: Person detection Fully convolutional networks Performance measure Edge computing Computer vision ABSTRACT Implementations of person detection in tracking and counting systems tend towards processing of orthogonally captured images on edge computing devices. The ellipse-like shape of heads in orthogonally captured images inspired us to predict head centroids to determine positions of persons in images. We predict the centroids using a fully convolutional network (FCN). We combine the FCN with simple image processing operations to ensure fast inference of the detector. We experiment with the size of the FCN output to further decrease the inference time. We compare the proposed centroid-based detector with bounding box-based detectors on head detection task in terms of the inference time and the detection performance. We propose a performance measure which allows quantitative comparison of the two detection approaches. For the training and evaluation of the detectors, we form original datasets of 8000 annotated images, which are characterized by high variability in terms of lighting conditions, background, image quality, and elevation profile of scenes. We propose an approach which allows simultaneous annotation of the images for both bounding box-based and centroid-based detection. The centroid-based detector shows the best detection performance while keeping edge computing standards. 1. Introduction Automatic tracking and counting of persons using computer vision systems is an important task in surveillance of public and private places [1], and specifically in public transport [2]. Various imaging technologies including radar sensors [3], laser scanners [4], 3D laser scanners [5], infra-red sensors [6], and cameras operating in the visible spectrum of light [2] can be used for this purpose. Selection of the imaging technology is mainly driven by economic interests of manufacturers (low price of a final solution). Cameras operating in the visible spectrum of light are preferred in practice. However, their utilization often faces legal obstacles which must be reflected in final solutions. For example, orthogonal scanning of a scene (camera placed above a scene, looking directly down on the scene) is preferred at public places as it prevents unwanted identification of individuals from their faces (Fig. 1) [2]. One of the key operations performed within person tracking and counting systems is detection of persons in images [2]. The person detection is a variant of a computer vision task known as object detection. It comprises localization and class recognition of objects (individuals) within the images. The localization is the task of determining the ∗Corresponding author. E-mail address: [email protected] (P. Skrabanek). position of an object in the image. The object class recognition is a classification problem where a class is assigned to each localized object. Object localization is usually addressed as prediction of a bounding box around a detected object [7]. However, other closed plane figures such as octagon [8] and circle [9] can be used as well. Such an approach gives us information about the approximate position and dimensions of the object. Another option is localization of objects using semantic or instance segmentation [10]. Segmentation maps give us an accurate notion of the shape and position of each recognized object. The knowledge of shapes allows us to implement various localization methods, including the bounding figure-based localization. Information about the position of one characteristic point of an object is sufficient for applications such as object tracking and object counting. Therefore, we can reduce the localization into an estimation of its centroid position [11]. State-of-the-art bounding figure-based object detection systems, as well as instance segmentation systems, rely on deep convolutional networks (deep ConvNets). Deep ConvNets typically consist of convolutional and pooling layers which convert an input image into a series of three-dimensional feature maps. The maps can be transformed into https://doi.org/10.1016/j.jocs.2022.101760 Received 21 September 2021; Received in revised form 10 June 2022; Accepted 28 June 2022 Journal of Computational Science 63 (2022) 101760 2 P. Dolezel et al. Fig. 1. Examples of orthogonally acquired images for person detection. An image with a small number of persons where the persons are sharply differentiated from the background (a) promises a higher probability of correct person detection than a crowded image (b). Incomplete heads and variable distances of the heads from a camera lens (b) also complicate the head detection. In extreme cases, a head can be very close to the lens and cover a large part of the image area (c). If the colour of the head blends significantly with other objects in the scene and the lack of light makes the overall image unclear (c), the head detection becomes challenging. a desired output by implementing a fully connected layer at the end of a network. A network which does not contain any fully connected layer is referred to as the fully convolutional network (FCN). As FCNs consist purely of convolutional and pooling layers, they are faster than ConvNets with fully connected layers. This property of FCNs is advantageous for dense pixelwise prediction tasks such as instance [10] and semantic segmentation [12], where outputs of the networks are generally three-dimensional cubes. The bounding figure-based object detection methods can either predict bounding figures directly (one-stage methods) [7,8,13–15] or they can generate regions of interests at first stage. This is followed by sending the region proposals to the second stage for object classification and bounding figure regression (two-stage methods) [16–20]. Twostage methods typically reach higher accuracy rates but are slower than one-stage methods. The well-established one-stage methods such as YOLO [7] or single shot multibox detector (SSD) [13] use fix-sized anchor boxes as region candidates. The main drawbacks of the anchorbased methods are the need of ad-hoc heuristics (determining the number and dimension of anchor boxes), and the large set of anchor boxes to be evaluated, which slows down the training of models [14]. These drawbacks are overcome by key-point based methods such as ExtremeNet [8], CornerNet [14], and CenterNet [15]. CornerNet predicts two key-points for each object of interest: the top-left and the bottomright corners of a rectangular bounding box. CenterNet improves the CornerNet idea by adding a centre of gravity of the object to the prediction of the bounding box coordinates. ExtremeNet predicts coordinates of four extreme points and of one centre point for each object. These five coordinates determine an irregular octagon which determines the position of a detected object in the image. Dense pixelwise prediction FCNs transform an input image into a map (segmentation map [10], saliency map [21], optical flow map [22], etc.). They consist of an encoder (contracting path) and a decoder module (expansive path), respectively. Convolutional and pooling layers of the encoder module gradually reduce the resolution of feature maps (pooling layers) while learning semantic information (convolutional layers). The down-sampling ensured by the pooling layers increases local receptive fields of neurons in deeper convolutional layers, thus allowing the learning of more complex features. Once dilated (atrous) convolution layers are used instead of pooling layers, the receptive fields are increased without decreasing the resolution. Note that the processing of high-resolution feature maps results in high time and space-complexities of such modified networks [23]. The decoder module, which consists of inverse layers (up-convolution and up-sampling layers), ensures recovering of output spatial dimensions. The decoder can be designed either as a mirror of the encoder [24] or it can be asymmetric to the encoder [12]. The state-of-the-art dense pixelwise prediction FCNs are directed acyclic graphs with skip connections to transfer pooling indices (Seg- Net [25]) or feature maps from the encoder to the decoder. The combination of feature maps from the encoder with feature maps produced by corresponding up-convolution or up-sampling layers can be ensured, for example, by concatenative skip connections (U-Net [26]), by attention gates (attention U-Net [27]), by adding an extra fullresolution stream (full-resolution residual networks (FRRNs) [28]), and by improving skip connections with higher number or complicated convolutional units (squeeze U-Net [29], gated feedback refinement network (G-FRNet) [30], global convolutional network [31] (GCN)). The bounding figure-based object detectors, likewise dense pixelwise prediction FCNs, are trained end-to-end on a set of annotated images. Annotation of a sufficiently representative dataset is always time consuming. In the case of the bounding box-based object detection, an annotator (a domain expert) draws a rectangular boundary around each object of interest in each image in the dataset, and assigns them class labels [7]. The annotation of images for dense pixelwise prediction tasks is even more challenging. For example, in the case of the instance segmentation, the annotator creates a segmentation map for each image in the dataset. He/she must assign to each element of the map a value corresponding to the class of the object which is associated with the element. Performance measures such as intersection over union and generalized intersection over union are commonly used for evaluation of bounding box-based object detectors [32]. These measures take into account areas defined by ground truth bounding boxes and bounding boxes predicted by an evaluated detector. The practical implementation of tracking and counting systems tends towards data processing on edge computing devices. Their limited computing power requires the use of time efficient and yet accurate object detectors. Herein, we propose an approach ensuring fast and precise detection of persons in orthogonally captured images. We assume that the position of an object centroid is sufficient for person counting and tracking. Instead of bounding figure prediction, we predict object centroids using localization maps. We expect that generation of smaller localization maps will result in smaller time complexity of the centroidbased detector, while keeping detection performance at the level of its full resolution variant. To confirm our hypothesis, we propose two dense pixelwise prediction FCNs: the first generates localization maps of spatial resolution equal to spatial resolution of input images, and the second produces maps of quarter resolution. We compare the proposed centroid-based person detector for both map resolutions with YOLO and CenterNet detectors in terms of inference time and detection performance. We choose YOLO as it is a generally accepted baseline for real-time bounding box-based object detection, and CenterNet as it is promising keypoint-based detector with object centroid coordinates as one of its outputs. As our centroid-based object detector predicts only points (coordinates of centroids), the commonly used performance measures cannot be used for its comparison with bounding box-based person detectors. We propose a total localization error ∑𝑒which allows quantitative assessment of detection performance of both the centroid Journal of Computational Science 63 (2022) 101760 3 P. Dolezel et al. and the bounding box-based detectors. For the training and evaluation of the detectors, we form new datasets which consist of images with orthogonally captured persons in various scenes and with variable head–lens distances. While annotation of the datasets for bounding box-based detection requires only delamination of bounding boxes, pixel-wise annotation is needed in the case of the proposed detector. To simplify the annotation, we propose an approach which allows simultaneous annotation of the images for both bounding box-based and centroid-based detection. The key contributions of this article are as follows: •A centroid based person detection technique in visual data is proposed. •The technique aims at orthogonal scanning of the scene with variable head–lens distances. •An efficient approach to transformation of the scene image into a localization map is introduced. The positions and sizes of the persons’ heads are coded into gradient ellipses. These ellipses afterwards provide centroid locations of each head in the scene image. A localization map also includes heads that are only partially represented in the scene image. •A metric suitable for evaluation of both the centroid and bounding box predictions is proposed. This metric includes inaccuracies in determining head positions, as well as false positive and false negative detections. •New datasets are formed for the training and evaluation of the detectors. 7000 images at seven different places are acquired for the training and validation. Additionally, another 1000 images are captured at a different place from the previous locations in order to test the generalization capabilities of the proposed person detection technique. 2. Materials and methods 2.1. Bounding box-based object detection Let an image 𝐼contain 𝑛objects of 𝑘recognized classes, where 𝑛∈Z0+, and 𝑘∈Z+. A rectangle boundary with edges parallel to the edges of the image, tightly enveloping the 𝑖th recognized object, delimits position and dimensions of the object within 𝐼. The ground truth bounding box of the 𝑖th object is a 5-tuple 𝑏𝑖=(𝑥𝑖, 𝑦𝑖, 𝑤𝑖, ℎ𝑖, 𝑐𝑖), where 𝑥𝑖and 𝑦𝑖are 𝑥and 𝑦coordinates of the left-top rectangle corner respectively, 𝑤𝑖and ℎ𝑖are width and height of the rectangle respectively, 𝑐𝑖is the class of the object, and 𝑐𝑖∈ {1,…, 𝑘}. A bounding box-based object detector predicts for 𝐼a set  𝐵of 𝑚 bounding box predictions  𝑏, where 𝑚∈Z0+. In the case of YOLO, the 𝑖th prediction is a 5-tuple  𝑏𝑖=( 𝑥𝑖, 𝑦𝑖, 𝑤𝑖, ℎ𝑖, 𝑐𝑖),(1) where  𝑥𝑖, 𝑦𝑖, 𝑤𝑖, ℎ𝑖, and 𝑐𝑖are predictions of 𝑥𝑖,𝑦𝑖,𝑤𝑖,ℎ𝑖, and 𝑐𝑖, respectively. In the case of CenterNet, the 𝑖th prediction is a 7- tuple  𝑏𝑖=( 𝑥𝑖, 𝑦𝑖, 𝑥𝑖, 𝑦𝑖, 𝑥𝑖, 𝑦𝑖, 𝑐𝑖),(2) where  𝑥𝑖, 𝑦𝑖, 𝑥𝑖, 𝑦𝑖are predictions of 𝑥𝑖,𝑦𝑖,𝑥𝑖,𝑦𝑖respectively, 𝑥𝑖 and 𝑦𝑖are 𝑥and 𝑦coordinates of the right-bottom rectangle corner respectively, and 𝑥𝑖and 𝑦𝑖are 𝑥and 𝑦coordinates of the object centroid. It holds that 𝑤𝑖=𝑥𝑖−𝑥𝑖and ℎ𝑖=𝑦𝑖−𝑦𝑖. 2.2. Centroid-based object detection In the case of the centroid-based object detection, the position of the 𝑖th object in 𝐼is given by 𝑥and 𝑦coordinates of its centroid 𝑥𝑖and 𝑦𝑖, respectively. Let the ground truth centroid of the 𝑖th object be the 3-tuple 𝛾𝑖= ( 𝑥𝑖, 𝑦𝑖, 𝑐𝑖), where 𝑐𝑖∈ {1,…, 𝑘}. A centroid-based object detector predicts for 𝐼a set  𝛤of 𝑝object centroids 𝛾, where 𝑝∈Z0+. The 𝑖th centroid prediction is the 3-tuple 𝛾𝑖= (  𝑥𝑖, 𝑦𝑖, 𝑐𝑖), where  𝑥𝑖, 𝑦𝑖, and 𝑐𝑖are predictions of 𝑥𝑖,𝑦𝑖, and 𝑐𝑖, respectively. 2.3. Proposed centroid-based object detector Dense pixelwise prediction FCNs are theoretically capable of transforming an image 𝐼of width 𝑤𝐼and height ℎ𝐼into a three-dimensional centroid map 𝛯of width 𝑤𝛯, height ℎ𝛯and depth 𝑘(depth given by the number of recognized classes). Elements of the map are given as 𝛯(𝑥, 𝑦, 𝑐) = {1,if a centroid of the 𝑐-th class is at (𝑥, 𝑦)coordinates, 0,otherwise, (3) where 𝑥∈𝑋𝛯,𝑦∈𝑌𝛯,𝑐∈𝐶𝛯,𝑋𝛯= {0,…, 𝑤𝛯− 1},𝑌𝛯= {0,…, ℎ𝛯− 1}, and 𝐶𝛯= {1,…, 𝑘}. The centroid maps 𝛯are theoretically the ideal source for a centr oid-based object detector. In such a detector, a dense pixelwise prediction FCN acts as a map generator. The generator must be complemented by a localization module which searches for centroid predictions 𝛾 in map predictions  𝛯. We implement the search, as search for positions of maxima in 𝛾. A set of the 𝑝centroid predictions 𝛾 is for the image 𝐼 given as  𝛤=(ℎ𝐼 ℎ𝛯 ,𝑤𝐼 𝑤𝛯 ,1)⊙arg max (𝑥,𝑦,𝑐)∈𝑆𝛯{ 𝛯(𝑥, 𝑦, 𝑐)},(4) where ⊙denotes an element-wise product, and 𝑆𝛯=𝑋𝛯×𝑌𝛯×𝐶𝛯. Due to the limited approximation capability of real FCN models, values of  𝛯elements can be assigned incorrectly which can result in false positive and false negative detections, and in incorrect localizations. We expect that the localization performance of the proposed approach can be improved once the mass of objects is considered. Rather than training a pixelwise prediction FCN to predict centroid maps 𝛯, we train it to predict three-dimensional localization maps of width 𝑤, height ℎand depth 𝑘. Elements of can take any real value from the interval [0,1]. The values correspond to the probability of occurrence of object centroids at corresponding locations. Elements of the map are given as (𝑥, 𝑦, 𝑐) = {𝜆(𝑥, 𝑦, 𝑐),for (𝑥, 𝑦)associated with a 𝑐-th class object, 0,otherwise, (5) where 𝜆∶→(0,1],(𝑥, 𝑦, 𝑐) = 1 indicates presence of the centroid of an object of the 𝑐-th class at the location (𝑥, 𝑦), and the values decrease towards 0 with increasing distances of the elements from their centroids. To take the advantage of localization maps , we must transform predictions of localization maps  into predictions of centroid maps  𝛯. Thus, an object detector based on the localization maps must consist of a localization map generator (a pixelwise prediction FCN), a centroid counterpoint module, and the localization module (4), respectively (Fig. 2), where the centroid counterpoint module ensures the transformation of  into  𝛯. 2.3.1. Centroid counterpoint module The module emphasizes centroids and suppresses false detections by a series of operations. At first, we process each layer of  using a maximum filter with kernel of size ℎ𝐾×𝑤𝐾. We get a map  𝑀with elements  𝑀(𝑥, 𝑦, 𝑐) = max (𝑠,𝑡)∈𝑆𝑥𝑦 { (𝑠, 𝑡, 𝑐)},(6) where 𝑆𝑥𝑦 is a set of spatial coordinates in a rectangular sub-window of size ℎ𝐾×𝑤𝐾, centred at point (𝑥, 𝑦). We compare  𝑀and  to highlight local maxima. The result of this operation is a binary map  𝑀1with elements  𝑀1(𝑥, 𝑦, 𝑐) = {1,if  𝑀(𝑥, 𝑦, 𝑐) =  (𝑥, 𝑦, 𝑐), 0,otherwise.(7) Journal of Computational Science 63 (2022) 101760 4 P. Dolezel et al. Fig. 2. A pipeline of the centroid-based object detector by head detection. A FCN in the localization map generator transforms the input image 𝐼into a localization map prediction  , where objects of interest (heads) are represented as gradient ellipses. The centroid counterpoint module converts  into a centroid map prediction  𝛯, where local maxima are highlighted. The localization module identifies and localizes positions of the objects (heads) using the maxima (white spots) and returns a set of centroid predictions  𝛤. Fig. 3. Pipeline of the centroid counterpoint module by head detection. The predicted localization map  for an image 𝐼of five heads contains six continuous areas with nonzero values, where the bottom-right area contains two local maxima, and the maximum of the middle-bottom area is noticeably smaller than one. The exclusive disjunction ⊕of the eroded mask  𝛺⊖and of the binary map  𝑀1eliminates the redundance in the bottom-right area. The last operation of the pipeline removes the middle-bottom area which does not correspond to any head. The map  𝑀1contains the centroids as well as local maxima caused by noise of background. To suppress irrelevant regions in the map  𝑀1, we form a mask  𝛺with elements  𝛺(𝑥, 𝑦, 𝑐) = {1,if  (𝑥, 𝑦, 𝑐)=0, 0,otherwise.(8) To suppress artefacts in the map  𝑀1caused by the local maximum filter (6), we erode each layer of the mask  𝛺using a rectangular structuring element 𝜀of size ℎ𝐾×𝑤𝐾with the origin in its centre. We pad the  𝛺by ones to keep the dimensions of the eroded mask  𝛺⊖the same as dimensions of  𝑀1. Elements of  𝛺⊖are given as  𝛺⊖(𝑥, 𝑦, 𝑐) = min (𝑠,𝑡)∈𝜀{ 𝛺(𝑥+𝑠, 𝑦 +𝑡, 𝑐)}.(9) Application of the eroded mask  𝛺⊖on  𝑀1results in a map  𝑀𝛺with elements  𝑀𝛺(𝑥, 𝑦, 𝑐) =  𝑀1(𝑥, 𝑦, 𝑐)⊕ 𝛺⊖(𝑥, 𝑦, 𝑐),(10) where ⊕denotes exclusive disjunction. We identify centroids among the maxima highlighted in the map  𝑀𝛺by considering their values in the localization map prediction  . Each element of the predicted localization map  associated with a centroid must be greater or equal to a threshold value 𝑡𝑚, where 𝑡𝑚∈ (0,1]. This operation results in the centroid map prediction  𝛯with elements  𝛯(𝑥, 𝑦, 𝑐) = {1,if  𝑀𝛺(𝑥, 𝑦, 𝑐) = 1 ∧  (𝑥, 𝑦, 𝑐)≥𝑡𝑚, 0,otherwise.(11) The setting of 𝑡𝑚is problem dependent and must reflect the quality of localization map predictions. We summarize the pipeline of the centroid counterpoint module in Fig. 3. 2.4. Detection of persons in orthogonally captured images Orthogonal scanning of a scene results in images where individuals are presented by their heads and shoulders. Their sizes are subject to the focal length of a camera lens and to distances of individuals from a pupil of the lens. The distances depend, for example, on heights of the individuals, elevation profile of the scene (Fig. 4), and the camera altitude. The detection of persons in the orthogonally captured images can be treated as detection of heads and shoulders [33] or as detection of heads [2]. Detection of heads has proven to be specifically accurate on datasets with high variability in the sizes [2]. In both cases, any bounding figure-based object detector can be used for person detection. In tracking and counting applications, individuals are usually considered to be members of the same class (𝑘= 1). Great emphasis is put on correct localization of individuals in images with minimum overlooked individuals and with minimum false detections. Dimensions of persons are not essential unless they predetermine accuracy of the localization. Considering these facts, we propose using the centroidbased object detector for the detection of persons. To ensure high robustness of the person detector, we view the person detection as a problem of determining positions of heads. 2.4.1. Centroid-based person detection Our goal is to develop a person detector allowing real time detection on devices with a single-board computer architecture. To reduce time complexity of the detector, we consider 288 ×288 pixel (px) images to be inputs of the detector. Given that heads are defined by shape and brightness gradient rather than by colour, we use greyscale images for processing. The only component of the proposed detector which allows optimization of its inference time is the localization map generator. Considering this fact, we propose two FCN topologies to Journal of Computational Science 63 (2022) 101760 5 P. Dolezel et al. Fig. 4. Influence of scene elevation profile on variability in size, shape and general appearance of individuals in orthogonally captured images. Stairs in the scene cause the change of head size. The rotation of the head affects its shape. be implemented in the person detector as a generator. We base them on the U-Net architecture [26]. The first topology (full resolution U- Net) generates localization maps of spatial resolution equal to spatial resolution of input images (288 ×288). The second one (reduced U-Net) aims at generation of quarter size localization maps (72 ×72). The U-Net is a symmetric dense pixelwise prediction FCN (decoder is the mirror of encoder). U-Net modules (UMs) ensure feature extraction at four levels of the network. UM consists of five consecutive operations: convolution (Conv), rectified linear unit (ReLU), dropout (DO), Conv, and ReLU, respectively. Using a short notation, UM can be written as Conv(ℎ𝑐×𝑤𝑐, 𝑓, 𝑠𝑐)→ReLU →DO(𝑑)→Conv(ℎ𝑐×𝑤𝑐, 𝑓, 𝑠𝑐)→ReLU, (12) where 𝑑is probability of dropout, 𝑠𝑐is stride of convolutional filters, 𝑓 is the number of the filters, and ℎ𝑐and 𝑤𝑐are their height and width, respectively. Each UM in the encoder module is followed by maxpooling (MP) with pools of height and width ℎ𝑝and 𝑤𝑝, respectively, and stride 𝑠𝑝(shortly MP(ℎ𝑝×𝑤𝑝, 𝑠𝑝)). Feature maps produced by UMs in the encoder module are concatenated with feature maps produced in the decoder module. The transfer of the maps from the encoder to the decoder is ensured by skip connections. We summarize topologies of the full resolution and the reduced U-Nets in Table 1 and Table 2, respectively. The columns outline operations performed within the encoder and decoder modules. The operations are arranged in rows with respect to skip connections. The data flow is symbolized using arrows, where their orientations indicate data flow directions. Simple arrows denote the main flow of data, and double ones symbolize skip connections (skip connections are numbered for clarity). We denote a concatenation of two feature maps as [⋅,⋅]. For all UMs in both topologies, we use following setting: ℎ𝑐= 3, 𝑤𝑐= 3, 𝑠𝑐= 1 and 𝑑= 0.2. As the only changing parameter is the number of filters 𝑓, we use notation UM(𝑓) for the description of the topologies. In the full resolution U-Net, up-sampling (US) precedes each UM in the decoder module. In the reduced U-Net, we remove the last two USs. We implement US as the Kronecker product of each input feature map with ℎ𝑢×𝑤𝑢matrix of all ones (US(ℎ𝑢×𝑤𝑢)), where ℎ𝑢and 𝑤𝑢are height and width of the matrix, respectively. In the full resolution U-Net, feature maps are directly transferred between corresponding parts of the encoder and decoder. In the reduced U-Net, feature maps produced by the first and the second UMs in the encoder are reduced using max-pooling to a quarter and half of their size respectively, before their concatenations with feature maps produced within the decoder module. In both variants, the networks are closed by Conv(1 × 1, 𝑘, 1) followed by a sigmoid activation function (sig), where 𝑘is the number of recognized classes. To achieve the required output dimensions (288 ×288 or 72 ×72 px), we zero-pad inputs of operations, if necessary. 2.4.2. YOLO person detection We compare the proposed centroid-based person detector with a detector based on YOLOv2 architecture [34]. The YOLO-based person detector expects 288 ×288 px greyscale images at its input, and it returns, for each image, a set  𝐵of bounding box predictions  𝑏, Table 1 Topology of the full resolution U-Net. Encoder Decoder ↓UM(64)↓ 1 ⇒[↑, 1 ⇒]→UM(64)→Conv(1 × 1, 𝑘, 1)→sig↑ ↓MP(2 × 2,2)→UM(128)↓ 2 ⇒[↑, 2 ⇒]→UM(128)→US(2 × 2)↑ ↓MP(2 × 2,2)→UM(256)↓ 3 ⇒[↑, 3 ⇒]→UM(256)→US(2 × 2)↑ ↓MP(2 × 2,2)→UM(512)↓ 4 ⇒[↑, 4 ⇒]→UM(512)→US(2 × 2)↑ ↓MP(2 × 2,2)→ →US(2 × 2)↑ The table summarizes operations performed within the encoder and decoder modules. The operations are arranged in rows with respect to skip connections, where simple arrows denote the main flow of data, and double arrows symbolize skip connections (skip connections are numbered). UM(𝑓) denotes the U-Net module (12) of 𝑓filters. US(ℎ𝑢×𝑤𝑢) symbolizes up-sampling, where 𝑤𝑢and ℎ𝑢are up-sampling factors in x and y directions, respectively. We use MP(ℎ𝑝×𝑤𝑝, 𝑠𝑝)for max-pooling with pools of height and width ℎ𝑝and 𝑤𝑝, stride 𝑠𝑝. Conv(ℎ𝑐×𝑤𝑐, 𝑓, 𝑠𝑐)represents convolution of 𝑓filters of height ℎ𝑐and width 𝑤𝑐, stride 𝑠𝑐. We use sig for the sigmoid activation function. Table 2 Topology of the reduced U-Net. Encoder Decoder ↓UM(64)↓→MP(4 × 4,4) 1 ⇒[↑, 1 ⇒]→UM(64)→Conv(1 × 1, 𝑘, 1)→sig↑ ↓MP(2 × 2,2)→UM(128)↓→MP(4 × 4,2) 2 ⇒[↑, 2 ⇒]→UM(128)↑ ↓MP(2 × 2,2)→UM(256)↓ 3 ⇒[↑, 3 ⇒]→UM(256)→↑ ↓MP(2 × 2,2)→UM(512)↓ 4 ⇒[↑, 4 ⇒]→UM(512)→US(2 × 2)↑ ↓MP(2 × 2,2)→ →US(2 × 2)↑ Table layout and the abbreviations are identical with Table 1. where the predictions are 5-tuples (1). As our aim is to compare the centroid-based person detector with a similar competitor in terms of inference time, we consider GoogLeNet [35], MobileNet-v2 [36], and SqueezeNet [37] as backbone models of the YOLO-based person detector. All the networks have proven to be successful in various time-critical computer vision applications. 2.4.3. CenterNet person detection The second competitor of the proposed detector is CenterNet. The inputs of the CenterNet-based detector are 288 ×288 px greyscale images. The outputs are sets  𝐵of bounding box predictions  𝑏, where the predictions are 7-tuples (2). To remain consistent with the original paper [15], we use ResNet101 as the backbone. We also consider EfficientDET D0 [38], which promises high computational efficiency. 2.5. Datasets 2.5.1. Data acquisition Quality of datasets predetermines performance of deep ConvNetbased computer vision systems. To ensure robustness of the person detectors in the intended setting, we collect data in diverse environments which include staircases, corridors, and entries into means of transport. We capture video streams with the RealSense camera D435 orthogonally placed above walking persons at eight different locations. The walking persons are adults with and without headgear. The head–lens distance varies between 25 and 100 cm depending on the environment and situation in the scene. This setting results in a Journal of Computational Science 63 (2022) 101760 6 P. Dolezel et al. Fig. 5. Samples of cut-outs from individual locations 1–8. Backgrounds, lighting conditions, and elevation profiles vary among the scenes. The bottom-right image shows the location which we use by forming the blind test dataset 𝐷𝐵. The remaining locations are included in the training and test datasets 𝐷𝑇and 𝐷𝐸. large variance in the size of the heads and their sharpness. The lighting conditions differ among the experiments. 2.5.2. Dataset creation We extract frames from the captured videos to create a set of 8- bit RGB images. From the frames of seven locations, we cut out 7000 square images with up to nine persons. We randomly split the set of images in the ratio 6:1 to create training and test datasets 𝐷𝑇 and 𝐷𝐸, respectively. From the eighth location, we form a blind test dataset 𝐷𝐵of 1000 square image crops (Fig. 5). As these images are captured under different lighting conditions at a different place from the previous locations, 𝐷𝐵allows testing the generalization capabilities of the detectors. We resize images in all datasets to 288 ×288 px. 2.5.3. Data analysis The images capture persons of various heights at locations of various elevation profile. Both these aspects contribute to a high variability in sizes of heads in the images. The shape of heads is elliptical (Fig. 5). The smallest width and height of the ellipses is about 20 px. The largest ellipse dimension reaches 200 px. The number of heads in a scene varies from 0 to 10. Some images contain incomplete heads (persons near edges of the images in Fig. 5). As the camera has fixed focus, some of the heads are blurred. 2.5.4. Image annotation Training and evaluation of the proposed centroid-based person detector requires extension of the image datasets with localization maps and ground truth centroids. We must create a localization map for each image, and we must assign a real value from the interval [0,1] to each pixel of each localization map, where the non-zero values must be associated with objects of interests (heads). To simplify the annotation process, it is reasonable to approximate the positions of objects in the maps using an appropriate geometric shape. Considering the elliptic shape of heads, we approximate the heads by gradient ellipses. We consider ellipse centroids to be identical with head centroids and ellipse circumferences to be borders between heads and background. We draw rectangles tightly enveloping complete heads within an image 𝐼. To ensure correct approximation of protruding heads, we estimate shapes of rectangles so that they include visible and invisible parts of the heads (Fig. 6). In such a way, we create for 𝐼a set Rof 𝑛rectangles r. The 𝑖th rectangle is an ordered four tuple r𝑖= (x𝑖,y𝑖,w𝑖,h𝑖), where x𝑖, and y𝑖are 𝑥and 𝑦coordinates of the left top rectangle corner respectively, and w𝑖, and h𝑖are width and height of the rectangle respectively. The ellipse defining border of the 𝑖th head in the image 𝐼is given as 4(𝑥−x𝑖)2 w2 𝑖 +4(𝑦−y𝑖)2 h2 𝑖 = 1.(13) Fig. 6. Annotation of an image. For each head in the scene image 𝐼(left), an annotator draws a rectangle tightly enveloping the head (red rectangles). He/she estimates shapes of rectangles for the protruding heads. The rectangles define ground truth centroids and bounding boxes of the heads, as well as the localization map for 𝐼. We approximate the heads by gradient ellipses that are delimited by the rectangles. Filling the ellipse areas with non-zero values results in , where head centroids are represented by values close to 1, background by 0, and values in the ellipse areas linearly decrease to 0 with increasing distances from the centroids (right). We use the canonical ellipse equation (13) to define a piecewise linear function which assigns real values from the interval (0,1] to elements of associated with areas of the ellipses. When applied to (5), we get (𝑥, 𝑦, 1) = ⎧ ⎪ ⎨ ⎪ ⎩ 1 − √4(𝑥−x𝑖)2 w2 𝑖 +4(𝑦−y𝑖)2 h2 𝑖 ,for (𝑥, 𝑦) ∈ 𝑆r𝑖, 0,otherwise, (14) where 𝑆r𝑖is a set of spatial coordinates in an ellipse sub-window defined by r𝑖∈R. The ground truth centroid of the 𝑖th head 𝛾𝑖= (𝑥𝑖, 𝑦𝑖, 𝑐𝑖)is given as 𝑥𝑖=x𝑖+ 0.5w𝑖, 𝑦𝑖=y𝑖+ 0.5h𝑖, 𝑐𝑖= 1.(15) We form a set 𝐵of ground truth bounding boxes 𝑏for the image 𝐼using the set of rectangles R. The 𝑖th ground truth bounding box 𝑏𝑖= (𝑥𝑖, 𝑦𝑖, 𝑤𝑖, ℎ𝑖, 𝑐𝑖)is given as 𝑥𝑖=x𝑖, 𝑦𝑖=y𝑖, 𝑤𝑖=w𝑖, ℎ𝑖=h𝑖, 𝑐𝑖= 1.(16) We make the annotated datasets to be freely available at Kaggle [39]. 2.6. Evaluation measures 2.6.1. Total localization error Positions of objects in images are determined by coordinates of object centroids. Evaluation of the detection performance of centroidbased object detectors must consider distances of centroids predictions Journal of Computational Science 63 (2022) 101760 7 P. Dolezel et al. to the nearest ground truth centroid. Therefore, each prediction must be associated exactly with one ground truth label, and each ground truth label must be associated exactly with one prediction. If the number of predictions does not match the number of the ground truth labels, we can add a corresponding number of virtual predictions or ground truth labels to ensure equality of their numbers. Herein, we expect the coordinates of the virtual predictions and virtual ground truth labels to be infinity. Using the above stated principle, we define the total localization error (a single class detection performance measure) as follows. Let a dataset 𝐷consist of 𝑁annotated images 𝐼. The 𝑙th image 𝐼𝑙is associated with a set 𝛤𝑙of 𝑛𝑙ground truth centroids 𝛾, where 𝑛𝑙∈Z0+. Let the detector predict for 𝐼𝑙a set  𝛤𝑙of 𝑝𝑙object centroids 𝛾, where 𝑝𝑙∈Z0+. The total localization error ∑𝑒of the detector on 𝐷is given as ∑𝑒=1 𝑁 𝑁 ∑ 𝑙=1 𝑒𝑙,(17) where 𝑒𝑙is the localization error of the detector on 𝐼𝑙. Let the localization error of the 𝑙th image be given as a sum of the smallest relative distances 𝛿between ground truth coordinates and their closest predictions, where each prediction is associated exactly with one ground truth label, and simultaneously, each ground truth label is associated exactly with one prediction. The error is given as 𝑒𝑙= 𝑀 ∑ 𝑟=1 min 𝛾𝑗∈ 𝛤𝑟 𝑙{min  𝛾𝑗∈  𝛤𝑟 𝑙 𝛿𝑙(𝛾𝑗, 𝛾𝑖)},(18) where 𝛾𝑗is the 𝑗th ground truth centroid,  𝛾𝑖is the 𝑖th predicted centroid, 𝛿𝑙(𝛾𝑗, 𝛾𝑖)is a relative distance between 𝛾𝑗and  𝛾𝑖,𝛾𝑗∈ 𝛤𝑟 𝑙,  𝛾𝑖∈  𝛤𝑟 𝑙, 𝛤𝑟 𝑙and   𝛤𝑟 𝑙are multisets of cardinality 𝑀−𝑟+ 1, and 𝑀= max {𝑛𝑙, 𝑝𝑙}. For 𝑟= 2,…, 𝑀,  𝛤𝑟 𝑙={𝛾𝑖|𝛾𝑖∈ 𝛤𝑟−1 𝑙∧𝛾𝑖≠(𝑥∗, 𝑦∗, 𝑐∗)𝑟−1 𝑙},(19) where (𝑥∗, 𝑦∗, 𝑐∗)𝑟−1 𝑙=arg min 𝛾𝑗∈ 𝛤𝑟−1 𝑙{min  𝛾𝑖∈  𝛤𝑟−1 𝑙 𝛿𝑙(𝛾𝑗, 𝛾𝑖)},(20) Similarly,   𝛤𝑟 𝑙={ 𝛾𝑖| 𝛾𝑖∈  𝛤𝑟−1 𝑙∧ 𝛾𝑖≠( 𝑥∗, 𝑦∗, 𝑐∗)𝑟−1 𝑙},(21) where ( 𝑥∗, 𝑦∗, 𝑐∗)𝑟−1 𝑙=arg min  𝛾𝑖∈  𝛤𝑟−1 𝑙{min 𝛾𝑗∈ 𝛤𝑟−1 𝑙 𝛿𝑙(𝛾𝑗, 𝛾𝑖)}.(22) For 𝑟= 1, the multisets  𝛤𝑟 𝑙and   𝛤𝑟 𝑙contain, with multiplicity one, all elements of the sets 𝛤𝑙and  𝛤𝑙, respectively; and the element (∞,∞,0) with multiplicity max {0, 𝑝𝑙−𝑛𝑙}and max {0, 𝑛𝑙−𝑝𝑙}, respectively. The relative distance between the 𝑗th ground truth centroid 𝛾𝑗= (𝑥𝑗, 𝑦𝑗, 𝑐𝑗)and the 𝑖th centroid prediction  𝛾𝑖= (  𝑥𝑖, 𝑦𝑖, 𝑐𝑖)in 𝐼𝑙is given as 𝛿𝑙(𝛾𝑗, 𝛾𝑖) = min {𝑤𝐼𝑙,|||𝑥𝑗− 𝑥𝑖|||} 2𝑤𝐼𝑙 + min {ℎ𝐼𝑙,|||𝑦𝑗− 𝑦𝑖|||} 2ℎ𝐼𝑙 ,(23) where 𝑤𝐼𝑙and ℎ𝐼𝑙are width and height of the 𝑙th image 𝐼𝑙, respectively. In other words, if the number of predictions 𝑝𝑙is equal to the number of ground truth labels 𝑛𝑙for the 𝑙th image (Fig. 7(a)), the error (18) can be directly calculated as the sum of the smallest relative distances of the ground truth label–prediction pairs designed according to (19)–(22). If 𝑝𝑙> 𝑛𝑙(Fig. 7(b)), we add (𝑝𝑙−𝑛𝑙)virtual ground truth labels (∞,∞,0) to allow calculation of the error (18). If 𝑝𝑙< 𝑛𝑙 (Fig. 7(c)), we add (𝑛𝑙−𝑝𝑙)virtual predictions (∞,∞,0). 2.6.2. Relative inference time Let a relative inference time of a detector be given as 𝜏=𝑡𝐷 𝑡𝐵 ,(24) where 𝑡𝐷is the total inference time of the detector on a set of images, and 𝑡𝐵is the total inference time of a baseline detector of this set. 2.7. Experiment conditions We implement the centroid-based detector in Python 3.6 with TensorFlow 2.0. We train the full resolution U-Net and the reduced U-Net map generators from scratch, minimizing a binary cross entropy function. We use normal distribution initialization with mean and standard deviation set to 0 and 0.05, respectively. When training the reduced U-Net, we resize the localization maps to 72 ×72 px (dimensions of localization maps produced by the reduced U-Net). For both variants of U-Nets, we rescale values of the images and of the localization maps to the range [0,1]. In the centroid counterpoint module, we set the threshold value 𝑡𝑚and the size of the maximum filter ℎ𝑘×𝑤𝑘at 0.65 and 10 ×10 px, respectively. The threshold value was estimated experimentally. The filter size is set with respect to the most common size of heads in the images. Since the Computer Vision Toolbox in Matlab offers a YOLO implementation wrapped in a very user-friendly interface including the possibility of deployment to Jetson NANO, we implement the YOLO detector (the bounding box-based detector) in MATLAB instead of the original Darknet framework. We use models pre-trained on the Imagenet for its training on the person detection task. We replace the layers after ’out_relu’, ’inception_5b-output’, and ’relu_conv10’ (naming according MATLAB) in GoogLeNet, MobileNet-v2, and SqueezeNet, respectively, by the last YOLOv2 layers. Moreover, since these backbone architectures expect a three-channel RGB image as input, we add a convolutional layer with three trainable filters (3, 3) in front of these base models to transform a single-channel input into a three-channel input. We empirically find that the overlap threshold in non-maximum suppression at 0.75 gives good results, and 7 anchor boxes are a good balance between performance and time to process. We estimate widths and heights of the anchor boxes on the dataset 𝐷𝑇using a 𝑘-means clustering algorithm and the IoU distance metric [34]. We use PyTorch implementation of CenterNet from GitHub [40] with its initial setting of all parameters. As backbones, we use ResNet- 101 and EfficientDET D0 models pre-trained on the COCO dataset for its training on the person detection task. We modify the backbones to process 288 ×288 px images analogously to the YOLO detector, and we adjust the CenterNet outputs for the one class problem. For both the centroid-based and bounding box-based detectors, we convert the input images into greyscale. We carry out 5 training sessions. Within each session, we train the localization map generators and all variants of the bounding box-based detectors on an identical training subset. For each training session, we randomly split up the dataset 𝐷𝑇 at the ratio 17:3 into training and validation subsets, respectively. We train the generators and the bounding box-based detectors with mini batches of 8 samples for 300 and 30 epochs, respectively. We save and validate the models on a validation subset in every epoch. We shuffle samples in every epoch. We use the Adam optimizer for the training of the map generators and of the bounding box-based person detectors. We set up an exponential decay rate for first and second moment estimates at 0.9 and 0.999, respectively. For the generators and for the CenterNet detectors, we use an initial learning rate of 10−3. In the case of CenterNet detectors, we multiply the learning rate by a factor of 0.96 every 10 epochs. For the YOLO detectors, we set up the learning rates for the last (the YOLOv2) layers at 10−3, the preceding layers are not modified during learning. These settings are adapted from the sources of the individual architectures, i.e., Computer Vision Toolbox in Matlab for the YOLO detector, and GitHub source [40] for the CenterNet. Journal of Computational Science 63 (2022) 101760 8 P. Dolezel et al. Fig. 7. Calculation of the localization error for the 𝑙th image (black solid lines) with two ground truth centroids (black crosses) in the case of (a) two, (b) three, and (c) zero centroid predictions (red circles). In the case of two predictions (a), the number of ground truth and the number of predicted coordinates are equal, and the localization error 𝑒𝑙 is simply the sum of the smallest distances between the ground truth and the predictions (dashed black lines), i.e. the localization error of the 𝑙th image 𝑒𝑙= 0.20. In the case of three predictions (b), one of the predictions is redundant. When calculating the localization error, we first find for each ground truth centroid the nearest prediction and calculate the distance between the prediction and the ground truth. The remaining prediction is the redundant one (in this case  𝛾2), and we consider its ground truth 𝛾3to be in infinity, which corresponds to the highest possible distance in the image (i.e. 𝛿𝑙(𝛾3, 𝛾2) = 1). Thus, the localization error 𝑒𝑙= 1.15 in this case. In the case of zero predictions (c), two predictions are missing. We expect the predictions to be in infinity which results in 𝑒𝑙= 2.00. We use data augmentation to avoid overfitting by the training of the map generators. Specifically, we use random rotation (range of a rotation angle: ±20 degree), random horizontal and vertical flipping with probability 0.5, random horizontal and vertical translation (up to ±20 % of image height and width, respectively), random rescaling (zoom range 0.2) and random horizontal and vertical shear (shear intensity 0.2). We perform the augmentation in filling mode set to nearest. We evaluate performance of the person detectors on the test and blind datasets 𝐷𝐸and 𝐷𝐵, respectively. For both variants of the centroid-based and all five variants of the bounding box-based detectors, we select the best performing model (a model with the smallest value of a loss function over a validation subset obtained within the five training sessions). We calculate the total localization error (17) of the models on 𝐷𝐸and 𝐷𝐵. For each image in a dataset, we convert a set  𝐵of YOLO predictions  𝑏into a set  𝛤of centroid predictions 𝛾. The coordinate of the 𝑖th centroid prediction in an image 𝐼is given as  𝑥𝑖=𝑥𝑖+ 0.5 𝑤𝑖, 𝑦𝑖=𝑦𝑖+ 0.5 ℎ𝑖.(25) In the case of CenterNet, we use the centroid coordinate predictions by its evaluation. For each person detector, we detect persons in one identical image 𝐼 a thousand times, while measuring total inference time of the detector 𝑡𝐷. We calculate for the detectors frame rates 𝐹=𝑡−1 𝐷and the relative inference time (24), where the total inference time of the centroidbased detector with the reduced U-Net map generator is the baseline 𝑡𝐵. We train and evaluate detection performance of the detectors on a personal computer with Intel Core i5-8600K (3.6 GHz) CPU, internal memory 16 GB DDR4 (2666 MHz), video card NVIDIA PNY Quadro P5000 16 GB GDDR5 PCIe 3.0. For evaluation of the inference time, we use a NVIDIA Jetson NANO single-board computer with Quadcore ARM A57 1.43 GHz CPU and 4 GB RAM. To allow the unbiased comparison of the inference times, we export all detectors into the TensorRT NVIDIA CUDA parallel programming models. 3. Results We train the centroid-based detectors as well as the competitive bounding box-based detectors with the datasets described in Section 2.5 according to the procedure addressed in Section 2.7. In order to show the performance capabilities of the detectors, we summarize the resulting values of the evaluation measures described in Section 2.6 in Table 3. Additionally, we demonstrate absolute frequencies of differences between numbers of ground truth labels and numbers of predictions Table 3 Evaluation results. Measure ∑𝑒, −𝜏, −𝐹, FPS Dataset 𝐷𝐸𝐷𝐵𝐼× 1000 𝐼× 1000 Full resolution U-Net 0.1472 0.3712 1.4148 8.62 Reduced U-Net 0.1352 0.3378 1.0000 12.19 CenterNet-D0 1.4659 1.7200 3.9260 3.10 CenterNet-ResNet101 1.2080 1.7090 4.0215 3.03 YOLO-GoogleNet 0.6755 1.2159 1.2074 10.10 YOLO-MobileNetv2 0.3497 1.0016 1.43779 8.48 YOLO-SqueezeNet 1.9441 1.5899 0.93549 13.03 Total localization errors ∑𝑒, relative inference times 𝜏, and framerates 𝐹(first row) of the best performing models (third to ninth rows), on the test and blind datasets 𝐷𝐸 and 𝐷𝐵(second row), respectively. 𝐼symbolizes an image which we used a thousand times within measurement of inference times of the models, and FPS stands for frame per second. The best result is for each measure in bold. Table 4 Absolute frequencies of differences between numbers of ground truth labels and numbers of predictions for the test dataset 𝐷𝐸. <−2−2−1 0 1 2 >2 Full resolution U-Net 0 9 95 876 19 1 0 Reduced U-Net 0 4 84 885 24 3 0 CenterNet-D0 97 101 148 328 179 50 97 CenterNet-ResNet101 55 68 159 385 218 55 60 YOLO-GoogleNet 27 75 259 503 124 10 2 YOLO-MobileNetv2 1 22 172 700 97 8 0 YOLO-SqueezeNet 317 194 223 248 18 0 0 The test dataset consists of 1000 samples. The frequencies of multiple detections (columns for negative numbers in the first row), overlooks (columns for positive numbers in the first row), and correct detections (the column for zero in the first row) are arranged with respect to the detectors (the first column). The highest value for the correct detections indicates the best performing detector (in bold). of the detectors for the test dataset (Table 4) and for the blind dataset (Table 5). A graphical representation of these differences is depicted in Fig. 8. 4. Discussion The evaluation results presented in Table 3 speak in favour the centroid-based person detection. On both the test dataset 𝐷𝐸and the blind dataset 𝐷𝐵, the localization errors of both variants of the centroids-based detector are less than half of the localization errors of the best performing bounding box-based detector (YOLOv2 with the MobileNetv2 backbone). The centroid-based detector with the reduced U-Net map generator shows even 2.6 and 2.9-times smaller error Journal of Computational Science 63 (2022) 101760 9 P. Dolezel et al. Fig. 8. Absolute frequencies of differences between numbers of ground truth labels and numbers of predictions for the test dataset 𝐷𝐸(left column) and for the blind dataset 𝐷𝐵 (right column). The abbreviations are identical with Table 4. on 𝐷𝐸and on 𝐷𝐵, respectively, compared to the YOLOv2 with the MobileNetv2 backbone. The high localization errors of YOLO detectors (Table 3, YOLO- GoogleNet and YOLO-SqueezeNet on 𝐷𝐸and 𝐷𝐵, and YOLO-Mobi- leNetv2 on 𝐷𝐵) indicate predispositions of the detectors to multiple detections or to marginalization of persons in the images. The results summarized in Tables 4–5and in Fig. 8 confirm this suspicion. The YOLO-SqueezeNet, which has the highest errors on both datasets (Table 3), shows a clear tendency to overlook persons (Fig. 8). The YOLO-GoogleNet with the second highest errors on both datasets inclines to false detections on the blind dataset 𝐷𝐵. On the test dataset 𝐷𝐸, it leans rather to overseeing persons (Fig. 8). The high error of YOLO-MobileNetv2 on 𝐷𝐵and the small error on 𝐷𝐸indicates low generalization capability of the detector. The decline in the number of images with the correct number of detections confirms this assumption (compare the histograms for YOLO-MobileNetv2 on 𝐷𝐸and 𝐷𝐵in Fig. 8, or the results in Tables 4–5). The tendency of multiple detections and marginalization of persons is even greater in the case of the CenterNet detectors. This is most apparent in the results in Tables 4–5; however, this property of the detectors naturally emerges in the localization errors too. The CenterNet with the EfficientDET D0 and ResNet101 backbones have the first and second highest localization errors among the tested detectors on both the test and the blind datasets. The low values of the error for both variants of the centroid-based detector point to low numbers of false and miss-detections which also confirm the histograms shown in Fig. 8 (see Full resolution U-Net and Reduced U-Net). The values of the error on the blind dataset 𝐷𝐵(Table 3, Full resolution U-Net and Reduced U-Net) indicate good generalization capability of the centroid-based detector. The detector