# Visuospatial Working Memory for Autonomous UAVs: A Bio-Inspired Computational Model
## 2 A Bio-Inspired Computational Model for Autonomous UAVs
### External Stimuli  
* VC module. This module represents the visual cortex. The VC is a complex system consisting of different brain areas encompassing V1, V2, V3, and V4 [25; 26]. Offering a detailed computational model of the VC is outside the scope of this paper. Therefore, the VC has been simplified as a single module within the bio-inspired VSWM computational model. Despite our limited knowledge of neuronal mechanisms and processes involved in the VC, studies have demonstrated that visual perception starts in early visual areas with the detection of diverse low-level visual features such as angles, size, orientation, motion, and color [25; 26; 27; 28]. This piecemeal analysis is very different from our subjective perception. However, these low-level visual features encoded through large distributed neuronal populations in the VC are fundamental for identifying complex objects in posterior visual processing brain areas [25]. Additionally, neuroscientific evidence suggests that the process of segmenting images into objects and background starts in the primary visual cortex (area V1) [25]. Therefore, the VC module proposed in this paper is responsible for separating relevant visual stimuli from the background and then sends visual information to the ITC, IPL, and IPS  
Figure 1: Identification of brain areas associated with the dorsal and ventral visual pathways, respectively. modules for future processes related to spatial and visual identification. Additionally, a connection from the ITC module to the VC module has been considered in order to offer feedback. This feedback allows decreasing the number of likely regions of interest (ROIs) early identified by the VC module. The VC module implements a heatmap-based visual stimuli detection method. This method is an adapted implementation of the heatmap-based object detection method used in CenterNet [29; 30]. This method was adapted for making a rough separation of visual stimuli belonging to the foreground from the background. The algorithm implemented in this module works as follows:  
The VC module processes an input RGB image \(I\) of width \(W\) and height \(H\), where \(I\in R^{W\cdot H\cdot 3}\). The VC module aims to produce a keypoint heatmap \(\hat{Y}\in[0,1]^{\frac{W}{K}\cdot\frac{H}{K}\cdot C}\) by using a stacked hourglass network that allows downsampling of the input image with an output stride \(R\) = 4, followed by two sequential hourglass modules. Each hourglass module is a symmetric 5-layer down- and up-convolutional network, as shown in Figure 3.  
Figure 2: The architectonic design of the bio-inspired VSWM computational model. A heatmap head, dimension head, and offset head are obtained for each image and each C class (our C class includes two keypoint types that represent relevant visual stimuli). Heatmap head is used for the estimation of keypoints on an input image. A heatmap focal loss is defined for training the heatmap head. Focal loss improves the keypoint detection by weighting the keypoints detections. Equation (1) shows the focal loss function, where a value 1 for \(Y_{xyc}\). represents a positive keypoint for a class and a different value represents a negative keypoint. \[L_{k}=\frac{-1}{N}\sum_{xyc} \begin{cases}\left(1-\hat{Y}_{xyc}\right)^{\alpha} \log\left(\hat{Y}_{xyc}\right)&if\ Y_{xyc}=1\\ \left(1-Y_{xyc}\right)^{\beta}\left(\hat{Y}_{xyc}\right)^{\alpha}\log\left(1- \hat{Y}_{xyc}\right),&\text{otherwise}\end{cases}  \tag{1}\]  
\(\alpha\) and \(\beta\) are hyper-parameters with values of 2 and 4, respectively, and \(\hat{Y}_{xyc}\) represents a keypoint prediction. On the other hand, the offset head is used to recover the discretization error caused by the output stride. An L1 Norm Offset Loss is defined for training the offset head. Equation (2) describes the L1 Norm Offset Loss.