## 3 Methods and Materials: The Proposed Pipeline
### GAIA: Computer Vision Subsystem
As can be seen from Figure 3, a heat map is generated in correspondence with the presence of customers in the various sectors of the store. For the reconstruction of the space-time heat map, the CVSS uses an ad hoc designed heat map generator. Basically, this heat map generator is an algorithmic system that superimposes a visual \"heat map\" layer of equal spatial size on each input video frame. Through the deep network described below (YOLOv5 backbone [25]), the heat map generator algorithm will increase the intensity of the pixels of the \"heat map\" layer in correspondence with the spatial areas where human subjects are detected by the downstream deep YOLOv5 trained for this purpose [25]. In this way, by means of a trivial overlay, between the sampled calibrated input frames and the \"heat map\" layer thus determined, we will obtain a dynamic heat map as shown in Figure 3. Specifically, through a robust human-detection algorithm (having as input the calibrated frames \(I(x,y,t)\)), the implemented heat map generator produces a space-time assessment of the customers permanence (spatial and temporal) in the various sectors of the commercial store. As introduced, the human subject detector is based on a deep architecture with q YOLOv5 backbone [25] trained for this task. More details about the designed YOLOv5-based human detector are discussed in the next paragraphs. The output of the heat map generator consists of the same input-calibrated frames overlayed with the generated heat map associated with the tracking bounding box of the detected customer subject. For the sake of mathematical formalization, the heat map generator works as follows: given the \(i\)-th customer \(P_{i}\) falling in the (pre-)calibrated frame \(I(x,y,t)\), he/she will be identified by the following function:  
\[P_{i}(t_{k},x{(t_{k})}^{1},y{(t_{k})}^{1},x{(t_{k})}^{2},y{ (t_{k})}^{2})\ \text{with}\ k=1,2,\ldots N \tag{4}\]where \(t_{k}\) represents the time range of observation (\(N\) time instants of observation) and monitoring, while \((x(t_{k})^{1},y(t_{k})^{1},x(t_{k})^{2},y(t_{k})^{2})\) is the dynamic bounding box of the tracked subject, having initial spatial coordinates \((x(t_{k}),y(t_{k}))^{1}\). The computation of the space-time heat map and the dynamic intensity corresponding to the person \(P_{i}\) can be calculated according to the following equation:  
\[ \begin{split} I_{i}^{Map}(t_{k},x(t_{k})_{i}^{1},y(t_{k})_{i}^{1},x(t_{k})_{i}^{2},y(t_{k})_{i}^{2})=\\ \aleph(P_{i}(t_{k},x(t_{k})_{i}^{1},y(t_{k})_{i}^{1},x(t_{k})_{i}^{2 },y(t_{k})_{i}^{2}),t_{k})\text{ with }k=1,2,\ldots N\end{split}  \tag{5}\]  
where \(\aleph\) represents a space-time heat map function and \(I_{i}^{Map}\) is a dynamic intensity function of the space-time heat map. In addition to the space-time heat map, we can also generate the contextual depth map \(\Xi(x,y)\), which may be used for further applications/extensions of this contribution depending on the user's needs. The depth map generator, although it is foreseen in the design of GAIA (Figure 3), is not currently used, and there are plans to integrate it into the next extensions of the pipeline. In this way, by means of the functions \(\aleph_{i}\) (0 and \(I_{i}^{Map}\), we will be able to characterize the space-time variation (in intensity) of the heat map associated with each \(i\)-th tracked subject in the input-sampled calibrated frame \(I(x,y,t)\). As introduced, the CVSS is able to generate the heat map by means of a space-time intensity assessment of the detected and tracked customer (bounding box segmentation) embedded in the sampled calibrated video frames of the indoor market. More details about the deep backbone are embedded in the designed subject detector pipeline. The authors proposed a subject detection algorithm based on a modified version of deep architecture embedding a YOLOv5 backbone [25]. Specifically, a modified solution is implemented with respect to the backbone reported in [25].