Title: EGOCENTRIC SPATIAL MEMORY NETWORK

Abstract: Inspired by neurophysiological discoveries of navigation cells in the mammalian brain, we introduce the first deep neural network architecture for modeling Egocentric Spatial Memory (ESM). It learns to estimate the pose of the agent and progressively construct top-down 2D global maps from egocentric views in a spatially extended environment. During the exploration, our proposed ESM network model updates belief of the global map based on local observations using a recurrent neural network. It also augments the local mapping with a novel external memory to encode and store latent representations of the visited places based on their corresponding locations in the egocentric coordinate. This enables the agents to perform loop closure and mapping correction. This work contributes in the following aspects: first, our proposed ESM network provides an accurate mapping ability which is vitally important for embodied agents to navigate to goal locations.
In the experiments, we demonstrate the functionalities of the ESM network in random walks in complicated 3D mazes by comparing with several competitive baselines and state-of-the-art Simultaneous Localization and Mapping (SLAM) algorithms. Secondly, we faithfully hypothesize the functionality and the working mechanism of navigation cells in the brain. Comprehensive analysis of our model suggests the essential role of individual modules in our proposed architecture and demonstrates efficiency of communications among these modules. We hope this work would advance research in the collaboration and communications over both fields of computer science and computational neuroscience.

1. INTRODUCTION:

Egocentric spatial memory (ESM) refers to a memory system that encodes, stores, recognizes and recalls the spatial information about the environment from an egocentric perspective Madl et al. (2015) . Such information is vitally important for embodied agents to construct spatial maps and reach goal locations in navigation tasks.

For the past decades, a wealth of neurophysiological results have shed lights on the underlying neural mechanisms of ESM in mammalian brains. Mostly through single-cell electrophysiological recordings studies in mammals Madl et al. (2014) , there are four types of cells identified as specialized for processing spatial information: head-direction cells (HDC), border and boundary vector cells (BVC), place cells (PC) and grid cells (GC). Their functionalities are: (1) According to Taube (2007) , HDC, together with view cells Ekstrom et al. (2003) , fires whenever the mammal's head orients in certain directions. (2) The firing behavior of BVC depends on the proximity to environmental boundaries Lever et al. (2009) and directions relative to the mammals' heads Burgess (2008) . (3) PC resides in hippocampus and increases firing rates when the animal is in specific locations independent of head orientations Burgess (2008) . (4) GC, as a metric of space Rowland et al. (2016) , are regularly distributed in a grid across the environment Hafting et al. (2005) . They are updated based on animal's speed and orientation Burgess (2008) . The corporation of these cell types enables mammals to navigate and reach goal locations in complex environments; hence, we are motivated to endow artificial agents with the similar memory capability but a computational architecture for such ESM is still absent.

Inspired by neurophysiological discoveries, we propose the first computational architecture, named as the Egocentric Spatial Memory Network (ESMN), for modeling ESM using a deep neural network. ESMN unifies functionalities of different navigation cells within one end-to-end trainable framework and accurately constructs top-down 2D global maps from egocentric views. To our best knowledge, we are the first to encapsulate the four cell types respectively with functionally similar neural networkbased modules within one integrated architecture. In navigation tasks, the agent with the ESMN takes one egomotion from a discrete set of macro-actions. ESMN fuses the observations from the agent over time and produces a top-down 2D local map using a recurrent neural network. In order to align the spatial information at the current step with all the past predicted local maps, ESMN estimates the agent's egomotion and transforms all the past information using a spatial transformer neural network. ESMN also augments the local mapping module with a novel spatial memory capable of integrating local maps into global maps and storing the discriminative representations of the visited places. The loop closure component will then detect whether the current place was visited by comparing its observation with the representations in the external memory which subsequently contributes to global map correction.

Neuroscience-inspired AI is an emerging research field Hassabis et al. (2017) . Our novel deep learning architecture to model ESMN in the mammalian navigation system attempts to narrow the gap between computer science (CS) and computational neuroscience (CN) and bring interests to both communities. On one hand, our novel ESMN outperforms several competitive baselines and the state-of-the-art monocular visual SLAMs. Our outstanding performance in map construction brings great advancements in robotics and CS. It could also have many potential engineering applications, such as path planning for robots. (2) In CN, the neuroplausible navigation system with four types of cells integrated is still under development. In our work, we put forward bold hypothesis about how these navigation cells may cooperate and perform integrated navigation functions. We also faithfully propose several possible communication links among them in the form of deep architectures.

We evaluate ESMN in eight 3D maze environments where they feature complex geometry, varieties of textures, and variant lighting conditions. In the experiments, we demonstrate the acquired skills of ESMN in terms of positional inference, free space prediction, loop closure classification and map correction which play important roles in navigation. We provide detailed analysis of each module in ESMN as well as their functional mappings with the four cell types. Lastly, we conduct ablation studies, compare with state-of-the-art Simultaneous Localization And Mapping (SLAM) algorithms and show the efficacy of our integrated framework on unifying the four modules.

2. RELATED WORKS:

There is a rich literature on computational models of egocentric spatial memory (ESM) primarily in cognitive science and AI. For brevity, we focus on the related works in machine learning and robotics.

Reward-based learning is frequently observed in spatial memory experiments Hok et al. (2005) . In machine learning, reinforcement learning is commonly used in attempts to mathematically formalize the reward-based learning. Deep Q-networks, one of the reinforcement learning frameworks, have been employed in the navigation tasks where the agent aims to maximize the rewards while navigating to the goal locations Mirowski et al. (2016) ; Mnih et al. (2015; 2016) . The representation of spatial memory is expressed implicitly using long short term memory (LSTM) Hochreiter & Schmidhuber (1997) . In one of the most relevant works Gupta et al. (2017) , Gupta et al.introduced a mapper-planner pipeline where the agent is trained in a supervised way to produce a top-down belief map of the world and thus plans path; however, the authors assume that the agents perform mapping tasks in an ideal scenario where the agent knows which macro-action to take and takes the macro-action without control errors at each time step. Different from their work, our ESM network takes into account the action uncertainty and predicts the agent's pose based on egocentric views. Moreover, we propose the mechanism of loop closure and map correction for long-term exploration.

Apart from reinforcement learning, there are works on navigation in the domain of robotics where the spatial memory is often explicitly represented in the form of grid maps or topological structuresElfes (1987); Peasley et al. (2012) ; Kuipers & Byun (1991) . SLAM tackles the problem of positional inference and mapping Smith et al. (2013); Durrant-Whyte et al. (2003) ; Dissanayake et al. (2000) ; Thrun et al. (2002) . While classical SLAM achieves good performances with the aid of multimodal sensors Lenac et al. (2017) , SLAM using monocular cameras still has limitations where the feature matching process relies heavily on hand-crafted features extracted from the visual scenes Zhang & Vela (2015) ; Pollefeys et al. (1999) . As great strides have been made using deep learning in computer vision tasks which results in a significant performance boost, several works endeavor to replace parts Kendall et al. (2015) ; Agrawal et al. (2015) ; Kendall & Cipolla (2016) . However, there is no existing end-to-end neural network for visual SLAM to our best knowledge.

Inspired by the neurophysiological results, we propose the first unified ESM model using deep neural networks. This model simultaneously solves the problems of positional inference, intrinsic representation of places and space geometry during the process of 2D map construction.

3. PROPOSED ARCHITECTURE:

Before we elaborate on our proposed architecture, we introduce the Egocentric Spatial Memory Network (ESMN) modeling problem and relevant notations. ESM involves an object-to-self representational system which constantly requires encoding, transforming and integrating spatial information from the first-person view into a global map. At the current time step t, the agent, equipped with one RGB camera, takes the camera view I t as the current visual input. Without the aid of any other sensors, it predicts the egomotion from the pair of camera views (I t-1 , I t ). At time step t, the agent is allowed to take only one egomotion A θ,d,l,t out of a discrete set of macro-actions which include rotating left/right by θ degrees and moving in the directions l: forward/backward/left/right by the distance of d relative to the agent's current pose. We assume the agent moves in a 2D grid world and the camera coordinate is fixed with respect to the agent's body. The starting location p 0 of the agent is always (0, 0, 0) where the triplet denotes the positions along the x and y-axis and the orientation in the world coordinate. The problem of modeling ESM is to learn a global map in the egocentric coordinate based on the visual input pairs (I t-1 , I t ) for t = 1, . . . , T . We define the global map as a top-view 2D probabilistic grid map where the probability infers the agent's belief of free space. For precise controls of the experimental variables, we consider the egocentric spatial memory (ESM) modeling problem in artificial 3D maze environments. In order to tackle this problem, we propose a unified neural network architecture named as ESMN.

3.1. OVERVIEW:

The architecture of ESMN is illustrated in Figure 1 and is elaborated in details in Figure 2 . Inspired by the navigation cells mentioned in the introduction, our proposed ESMN comprises four modules: Head Direction Unit (HDU), Boundary Vector Unit (BVU), Place Unit (PU), and Grid Unit (GU). This is to incorporate multiple objectives for modeling ESM. In this paper, we adopt a "divide and conquer" approach by composing different navigation modules within one framework systematically. The division of these modules are inspired by scientific supports which have shown the advantages in biological systems Murray et al. (2016) . Leveraging on rich features extracted from deep networks, the learnt features are suitable for recognizing visual scenes and hence, boost up the map construction and correction performances. The efficiency and robustness of our algorithm are demonstrated by comparing with other spatial navigation methods replied on visual inputs.

3.2. HEAD DIRECTION UNIT (HDU): POSITIONAL INFERENCE:

At each time step, the RGB camera image (or frame) is the only input to the agent. In order to make spatial reasoning about the topological structure of the spatially extended environment, the agent has to learn to take actions to explore its surroundings and predict their own poses by integrating the egomotion over time. The HDU module in our proposed ESMN model employs a 2D-CNN to predict the macro-action the agent has taken at the time step t based on the inputs of two camera views {I t-1 , I t }. Though there are two possible implementations for the loss in training the HDU module, i.e. regression and classification, we consider the latter in order to reduce the dimensionality of action space. The macro-actions A θ,d,l are discretized into 2 classes for rotation and 4 classes for translation as explained at the beginning of Section 3. Though we solve the problem of positional inference using a feed-forward neural network based on two most recent observations alone, the extensions to use recurrent neural network would be interesting to explore in the future.

3.3. BOUNDARY VECTOR UNIT (BVU): LOCAL MAPPER:

We explain how ESMN integrates egocentric views into a top-down 2D representation of the environment using a recurrent neural network. Similar to Gupta et al. (2017) , the BVU in ESMN serves as a local mapper and maintains the accumulative free space representations in the egocentric coordinate for a short-term period. Given the current observation I t , function g first encodes its geometric representation about space g(I t ) via a 2D-CNN and then transform g(I t ) into egocentric top-down view m t via de-convolutional layers. Together with the accumulative space representation m t-1 at the previous step and the estimated egomotion A θ,d,l,t from t -1 to t, BVU estimates the current local space representation m t using the following update rule:

EQUATION

where W is a function that transforms the previous accumulative space representation m t-1 to the current egocentric coordinate based on the estimated egomotion A θ,d,l,t . We parameterize W by using a spatial transformer network Jaderberg et al. (2015) composing of two key elements: (1) it generates the sampling grid which maps the input coordinates of m t-1 to the corresponding output locations after egomotion A θ,d,l,t transformation; (2) the sampling kernel then takes the bilinear interpolation of the values on m t-1 and outputs the transformed m t-1 in the current egocentric coordinate. U is a function which merges the free space prediction m t from the current observation with the accumulative free space representation at the previous step. Specifically, we simplify merging function U as a weighted summation parameterized by λ followed by hyperbolic tangent operation: 

EQUATION

EQUATION

where we parameterize F using a three-stream 2D-CNN where the weights are shared across streams. D is a distance measure between pairs of embedding. Here, mean squared error is used. A loop closure label equals 1 if the mean squared error is below the threshold α which is set empirically.

Apart from the similarity comparison of observations, we consider two extra criteria for determining whether the place was visited: (1) the current position of the agent p t is near to the positions visited at the earlier times. We empirically set a threshold distance between the current and the recently visited locations based on the loop closure accuracy during training. We implemented it via a binary mask in the center of the egocentric global map where the binary states denote the accepted "closeness".

(2) the agent only compares those positions which are far from the most recent visited positions to avoid trivial loop closure detection at consecutive time steps. It is implemented via another binary mask which tracks these recently visited places. These criterion largely reduce the false alarm rate and improves the searching speed during loop closure classification.

3.5. GRID UNIT (GU): GLOBAL MAPPER AND PLACE TRACKING:

While BVU provides accumulative local free space representations in high resolution for a short-term period, we augment the local mapping framework with memory for long-term integration of the local maps and storage of location representations. Different from Neural Turing Machine Graves et al. (2014) where the memory slots are arranged sequentially, our addressable memory, of size F × H × W , is indexed by spatial coordinates {(i, j) : i ∈ {1, 2, ..., H}, j ∈ {1, 2, ..., W }} with memory vector M (i, j) of size F at location (i, j). Because ESM is often expressed in the coordinate frame of the agent itself, we use location-based addressing mechanism and the locations of reading or writing heads are fixed to be always in the center of the memory. Same as BVU, all the past spatial information in the memory is transformed based on the estimated egomotion A θ,d,l,t . Mathematically, we formulate the returned reading vector r h,w as

r h,w = M (i, j) : i ∈ H 2 - h 2 , ..., H 2 + h 2 , j ∈ W 2 - w 2 , ..., W 2 + w 2 (4)

where the memory patch covers the area of memory vectors with the width w and height h. We simplify the writing mechanism for GU and use Equation 4 for writing the vector r h,w . Each maze is stimulated with normal, weak and strong lighting conditions. Maze 5_S and 5_W refers to Maze 5 with strong and weak lighting conditions respectively. Maze 1 is adopted from Willow Garage Garage (2011) . Maze 8 is inspired by radial arm maze used to test spatial memory in rats Olton & Samuelson (1976) . The digits are pasted on walls along specific pathways for loop closure classification tasks.

In our case, two writing heads and two reading heads are necessary to achieve the following objectives:

(1) one reading head returns the memory vectors m t-1 in order for BVU to predict m t using Equation 1; (2) GU performs updates by writing the predicted local accumulative space representation m t back into the memory to construct the global map in the egocentric coordinate; (3) GU keeps track of the visited places by writing the discriminative representation h(I t ) at the center of the egocentric global map denoted as ( H 2 , W 2 ); (4) GU returns the memory vectors near to the current location for loop closure classification where the size of the searching area is parameterized by w and h. The choice of w and h are application-based. We simplify the interaction between local space representations m t and m t-1 with GU and set w and h to be the same size as m t and m t-1 .

If the loop closure classifies the current observation as "visited", GU eliminates the discrepancies on the global map by merging the two places together. The corrected map has to preserve the topological structure in the discovered areas and ensure the connectivity of the different parts on the global map is maintained. To realize this, we take three inputs in a stack of 3D convolution and de-convolution layers for map correction. The inputs are: (1) the local map predicted at the anchor place; (2) the local map predicted at the recalled place in the current egocentric coordinate; (3) all the past integrated global maps. To make the training targets, we perturb the sequence of ground truth egomotions with random ones and generate synthetic integrated global maps with rotation and scaling augmentations. We minimize regression loss between the predicted maps and the ground truth.

3.6. TRAINING AND IMPLEMENTATION DETAILS:

We train ESMN end-to-end by stochastic gradient descent with learning rate 0.002 and momentum 0.5. Adam Optimizer Kingma & Ba (2014) is used. At each time step, the ground truths are provided: local map, egomotion and loop closure classification label. For faster training convergence, we first train each module separately and then load these pre-trained networks into ESMN for fine-tuning. The input frame size is 3 × 64 × 64. We normalize all the input RGB images to be within the range [-1, 1] . The batch size is 10. The discriminative representation h(I t ) is of dimension 128. The size of the local space representation m t is h × w = 32 × 32 covering the area 7.68 meters × 7.68 meters in the physical world whereas the global map (the addressable memory) is of size H × W = 500 × 500. We set λ = 0.5 in BVU and α = 0.01 in PU. The memory vector in GU is of size F = 128. Refer to Supplementary Material for detailed architecture.

4. EXPERIMENTS:

We conduct experiments on eight 3D mazes in Gazebo for robotic simulation Koenig & Howard (2004) . We will make our simulation source code public once our paper is accepted. Figure 3 shows an overview of eight mazes. They feature complex geometry and rich varieties of textures. To prevent over-fitting in a single-modality environment, we augment these observations with different illumination conditions classified into three categories: strong, normal and weak, and train our ESMN in these mixed lighting conditions. Based on the results in Section 4.1, our ESMN performs equally well in the test set across permutations of these conditions which shows its capacity of generalizing 

4.1. EVALUATIONS OF INDIVIDUAL MODULES:

Head Direction Unit (HDU): Positional Inference. Head Direction Cells fire whenever the animal's head orients in certain directions. The study McNaughton et al. (2006) suggests that the rodent's orientation system is as a result of neural integration of head angular velocities derived from vestibular system. Thus, after jointly training ESMN, we decode HDU for predicting head direction in the world coordinate by accumulating the estimated egomotions over time. Figure 4 shows the head direction prediction in the world coordinate compared with the agent's ground truth global poses. We observe that the head directions integrated from the estimated egomotions are very similar to the ground truths. Moreover, we compute the egomotion classification errors from 2 classes of rotation and 4 classes of translation under three illumination conditions, see Table 1 . There is a slight degradation of rotation + translation compared with rotation alone. One possible reason is that the change of egocentric camera views after 10 degrees of rotation is more observable than the one induced from translation by 0.1 meters. Boundary Vector Unit (BVU): Local Mapper. The firing behavior of Border Cell and Boundary Vector Cells depends on the proximity to environmental boundaries Lever et al. (2009) as well as the directions relative to the mammals' heads Burgess (2008) . In Section 3.3, we express the proximity to physical obstacles by predicting 2D top-view free space representations and accumulate the local belief maps over time based on the egomotions. Figure 5 shows example results of predicted accumulative free space representations over 32 time steps in Maze 6. See the Supplementary Material for more examples.

We also provide quantitative analysis of our predicted local maps across the first 32 time steps in Figure 6 using Mean Squared Error (MSE), Correlation (Cor), Mutual Information (MI) which are standard image similarity metrics Mitchell (2010). At each time step, the predicted local maps are compared with the ground truth maps at t = 32. As the agent continues to explore in the environment, the area of the predicted free space expands leading to the decrease of MSE and the increase of correlation and MI in our test set. This validates that ESMN is able to accurately estimate the proximity to the physical obstacles relative to the agent itself and continuously accumulate the belief of free space representations based on the egomotions.

Place Unit (PU): Loop Closure Classification. One of the critical aspects of ESM is the ability to recall and recognize a previously visited place independent of head orientation. Place cell (PC) resides in hippocampus and increases firing patterns when the animal is in specific locationsBurgess (2008) . Recent anatomical connectivity research Solstad et al. (2006) implies that grid cells (GC) are the principle cortical inputs to PC. In our proposed ESMN, we design a novel memory unit (GU) for storing the discriminative representations of visited places based on their relative locations with respect to the agent itself in the egocentric coordinate. GU interacts constantly with PU by reading and writing the memory vectors. We evaluate the learnt discriminative representations of visited places by comparing the current observation (anchor input) with all the past visited places. Figure 7 presents example pairs of observations when the loop closure is detected. Qualitative results imply that our ESMN can accurately detect loop closure when the agent is at the previously visited places irrespective of large differences between these camera views.

Grid Unit: Mapping Integration and Correction. After the loop closure is detected, ESMN performs map correction to eliminate the discrepancies during long-term mapping. Figure 8 presents the example results of the predicted global maps after map correction. It is shown that the map gets corrected at t = 448 (Column 1). Thus, the predicted global map (Row 3) is structurally more accurate compared with the one without loop closure (Row 2).

4.2. ABLATION ANALYSIS:

Our ablation analysis is as follows: (1) To study the necessity of egomotion estimation from HDU, we take a sequence of camera views at all the previous time steps as inputs to predict the global map directly. We implement this by using a feed-forward 3D convolution neural network (3D-CNN). Practically, since it is hard to take all the past camera views across very long time period, we choose the input sequence with one representative frame every 15 time steps. (2) As ESM requires sustainable mapping over long durations, we create one more baseline by taking the sequence of camera views as inputs and using Long Short Term Memory architecture to predict global maps directly (LSTM Direct). To maintain the same model complexity, we attach the same 2D-CNN in our BVU module before LSTM and fully connected layers after LSTM. (3) To explore the effect of loop closure and thus map correction, we create one ablated model with PU and GU removed (HDU + BVU). ( 4) We present the results of our integrated architecture with loop closure classification and map correction enabled (HDU + BVU + PU + GU). We report the evaluation results in Table 2 using the metrics MSE, correlation and MI as introduced in Section 4.1.

We observe that our proposed architecture surpasses the competitive baselines and the ablated models. At t = 448, compared with the first baseline (3D-CNN), there is decrease of 0.03 in MSE and increase of 0.17 in correlation and 0.09 in MI. The significant improvement infers that it is necessary to estimate egomotion for better map construction. Additionally, the integration of local maps based on the egomotion makes the computation more flexible and efficient by feeding back the accumulative maps to the system for future time steps. In the second baseline (LSTM Direct), we observe that the performance drops significantly when it constructs global maps for longer durations. As GU serves as an external memory to integrate local maps, the baseline confirms GU has advantages over LSTMDirect in terms of long-lasting memory. ---ORBslam 0.12 0.41 0.09 0.15 0.28 0.05 0.24 0.17 0.02 Table 3 : Comparison of our method with state-of-the-art SLAM algorithms. The global map results after the agent completes one loop closure in Maze 6, 7, and 8 are reported using metrics introduced in Section 4.1. The numbers highlighted in bold are the best. our proposed architecture with all four modules enabled at t = 448 and t = 1580, the decreased performance validates that these steps are necessary to eliminate the errors during long-term mapping.

4.3. COMPARISON WITH MONOCULAR VISUAL SLAMS:

We evaluate our ESMN by comparing with state-of-the-art monocular visual SLAM methods, EK-Fslam Civera et al. (2010), and ORBslam Mur-Artal et al. (2015) . We used the codes provided by the authors and replaced the intrinsic camera parameters with ours. In order to construct maps in the world scale, we provide explicit scaling factor for both methods. Results show that our ESMN significantly outperforms the rest in terms of MSE, Cor and MI as shown in Table 3 . In the experiments, we also observe that ORBslam has high false positives in loop closure detection which leads to incorrect map correction. It may be caused by the limitations of local feature descriptors. Different from them, our ESMN can robustly detect loop closure and correct maps over time. Furthermore, we notice that both SLAMs tend to fail to track feature descriptors between frames especially during rotations. The parameters of searching windows in order to match features have to be manually set and they cannot be adapted in large motion cases. The results in Maze 8 using EKFslam are not provided in Table 3 as the original algorithm requires the dense local feature matching and it is not applicable in very low texture environments.

5. CONCLUSION:

We get inspirations from neurophysiological discoveries and propose the first deep neural network architecture for modeling ESM which unifies the functionalities of the four navigation cell types: head-direction cells, border cells and boundary vector cells, place cells and grid cells. Our learnt model demonstrates the capacity of estimating the pose of the agent and constructing a top-down 2D spatial representations of the physical environments in the egocentric coordinate which could have many potential applications, such as path planning for robot agents. Our ESMN accumulates the belief about the free space by integrating egocentric views. To eliminate errors during mapping, ESMN also augments the local mapping module with an external spatial memory to keep track of the discriminative representations of the visited places for loop closure detection. We conduct exhaustive evaluation experiments by comparing our model with some competitive baselines and state-of-the-art SLAM algorithms. The experimental results demonstrate that our model surpasses all these methods. The comprehensive ablation study suggests the essential role of individual modules in our proposed architecture and the efficiency of communications among these modules. to read and write and vice versa. We use element-wise multiplication between each feature map of the external memory and the binary masking map for reading and writing operations. Refer to Table 4 for reading and writing local maps in GU, and Table 5 for reading and writing spatial representations of visited places in GU.

Figure 9 : Example results of predicted local maps over first 32 time steps in Maze 6. Frames #1, 5, 9, 13, 17, 21, 25, 29, 32 are shown (left to right columns). The topmost row shows the camera view. Row 2 shows the ground truth with red arrows denoting the agent's position and orientation from the top view. The white region denotes free space while the black denotes unknown areas. Row 3 shows the corresponding top-view accumulative belief of the predicted local maps where the red color denotes higher belief of the free space. Best viewed in color.

current camera view estimated egomotion predicted local map at previous time step nn.Sequential() nn.ParallelTable() nn. SpatialConvolution(3, 128, 4, 4, 2, 2, 1, 1) nn.AffineGridGeneratorBHWD(A, A) nn.Reshape(batchSize, 1, 32, 32) nn.ReLU(true) nn.Transpose({3,4},{2,4}) nn. SpatialConvolution(128, 256, 4, 4, 2, 2, 1, 1) nn.BilinearSamplerBHWD() nn. SpatialBatchNormalization(256, nn.Transpose({2,4},{3,4}) nn.ReLU(true) nn.Reshape(batchSize, 32, 32) nn. SpatialConvolution(256, 512, 4, 4, 2, 2, 1, 1) nn.ReLU() nn. SpatialBatchNormalization(512, nn.ReLU(true) nn. SpatialConvolution(512,1024, 4,4, 2,2, 1,1) nn.SpatialBatchNormalization(1024,1e-3) nn.ReLU(true) nn. SpatialFullConvolution(1024,512, 4,4, 2,2, 1,1) nn.SpatialBatchNormalization(512,1e-3) nn.ReLU(true) nn. SpatialFullConvolution(512, 256, 4, 4, 2, 2, 1, 1) nn.SpatialBatchNormalization(256,1e-3) nn.ReLU(true) nn. SpatialFullConvolution(256, 128, 4, 4, 2, 2, 1, 1) nn.SpatialBatchNormalization(128,1e-3) nn.ReLU(true) nn. SpatialFullConvolution(128, 1, 4, 4, 2, 2, 1, 1) nn.SpatialBatchNormalization(1,1e-3) nn.ReLU(true) nn.Squeeze() nn. View(batchSize, 32, 32) nn.CAddTable() nn.HardTanh() 5, 9, 13, 17, 21, 25, 29, 32 are shown (left to right columns). The topmost row shows the camera view. Row 2 shows the ground truth with red arrows denoting the agent's position and orientation from the top view. The white region denotes free space while the black denotes unknown areas. Row 3 shows the corresponding top-view accumulative belief of the predicted local maps where the red color denotes higher belief of the free space. Best viewed in color.

contacted two RGB camera views at t and t -1 nn.Sequential() nn. SpatialConvolution(6, 128, 4, 4, 2, 2, 1, 1) nn.ReLU(true) nn. SpatialConvolution(128, 256, 4, 4, 2, 2, 1, 1) nn.SpatialBatchNormalization(256,1e-3) nn.ReLU(true) nn. SpatialConvolution(256, 512, 4, 4, 2, 2, 1, 1) nn.SpatialBatchNormalization(512,1e-3) nn.ReLU(true) nn. SpatialConvolution(512,1024,4,4, 2,2, 1,1) nn.SpatialBatchNormalization(1024,1e-3) nn.ReLU(true) nn. SpatialConvolution(1024 SpatialConvolution( ,1024,2,2, 2,2, 0,0) ,2,2, 2,2, 0,0) nn.SpatialBatchNormalization(1024,1e-3) nn.ReLU(true) nn.Reshape(1024) nn. Linear(1024,512) nn.ReLU() nn. Linear(512, 256) nn.ReLU() nn. Linear(256, 6) nn.CrossEntropyCriterion() 

:



Figures and Tables:

Figure 2: Architecture of our proposed Egocentric Spatial Memory Network. See Section 3.1 for the overview of individual module. spatial information to the current egocentric coordinate via a 2D-CNN. (3) PU learns to encode the latent representation of visited places in a 2D-CNN pre-trained using a triplet loss. (4) GU, as a memory, integrates the predicted local maps from BVU over time and keeps track of all the visited places. In GU, we add a gating mechanism to constantly detect the loop closure and thus eliminate the accumulated errors during long-term mapping.

Figure 3: Overview of maze layouts, with differing geometries, textures and lighting conditions.Each maze is stimulated with normal, weak and strong lighting conditions. Maze 5_S and 5_W refers to Maze 5 with strong and weak lighting conditions respectively. Maze 1 is adopted from Willow GarageGarage (2011). Maze 8 is inspired by radial arm maze used to test spatial memory in ratsOlton & Samuelson (1976). The digits are pasted on walls along specific pathways for loop closure classification tasks.

Figure 4: Head direction prediction of three example paths in Maze 6,7,8 (normal lighting conditions) by accumulating the estimated egomotions across first 400 time steps. The dotted line is the prediction and the solid is the ground truth.

Figure 5: Example results of predicted local maps over first 32 time steps in Maze 6. Every 4 out of 32 frames are shown (left to right columns). Row 1 shows the camera views. Row 2 shows the ground truth with red arrows denoting the agent's position and orientation from the top view. The white region denotes free space while the black denotes unknown areas. Row 3 shows the corresponding top-view predicted local maps where the red color denotes higher belief of the free space.

Figure 6: Evaluation of Local Mapper using Mean Squared Error (MSE), Correlation, Mutual Information (MI) across first 32 time steps in Maze 6, 7, 8 under normal (N), weak (W), and strong (S) illumination conditions. The predicted local maps are compared with the ground truth at t = 32. Smaller is better for MSE. Larger is better for correlation and MI. Best viewed in color.

Figure 7: Example observation pairs when the loop closure is detected. Row 1 are the anchors (current camera views). Row 2 are the camera views from the previously visited places where the loop closure is detected. Row 3 show the agent's locations (red circle) on the ground truth maps. Row 4 show the agent's locations (white circle) on the predicted map with ground truth poses.

Figure 8: Example results of constructed global maps in the world coordinate in Maze 6 across 1580 time steps. The topmost row shows the ground truth. Row 2 and Row 3 show the corresponding top-view accumulative belief of the predicted global maps without and with loop closure classification at t = 448 respectively.

Figure 10: Example results of predicted local maps over first 32 time steps in Maze 7. Frames #1,5, 9, 13, 17, 21, 25, 29, 32  are shown (left to right columns). The topmost row shows the camera view. Row 2 shows the ground truth with red arrows denoting the agent's position and orientation from the top view. The white region denotes free space while the black denotes unknown areas. Row 3 shows the corresponding top-view accumulative belief of the predicted local maps where the red color denotes higher belief of the free space. Best viewed in color.

Figure 11: Example results of predicted local maps over first 32 time steps in Maze 8. Frames #1,5, 9, 13, 17, 21, 25, 29, 32  are shown (left to right columns). The topmost row shows the camera view. Row 2 shows the ground truth with red arrows denoting the agent's position and orientation from the top view. The white region denotes free space while the black denotes unknown areas. Row 3 shows the corresponding top-view accumulative belief of the predicted local maps where the red color denotes higher belief of the free space. Best viewed in color.

)3.4 PLACE UNIT (PU): PLACE ENCODING AND LOOP CLOSURE CLASSIFICATIONLoop closure is valuable for the agents in the navigation tasks as it encourages efficient exploration and spatial reasoning. In order to detect loop closure during an episode, given the current observation I t , ESMN learns to encode the discriminative representation h(I t ) of specific places independent of scaling and orientations via an embedding function F . Based on the similarity of all the past observations Ω

Table content: <table/>

Egomotion Classification Accuracy in Maze 6,7,8 under weak, normal, and strong lighting conditions across first 400 time steps.

Table content: <table><tr><td/><td>Weak</td><td>Normal</td><td>Strong</td></tr><tr><td>Maze 6</td><td/><td/><td/></tr><tr><td>Rotation</td><td>0.89</td><td>0.95</td><td>0.96</td></tr><tr><td>Rotation + Translation</td><td>0.87</td><td>0.94</td><td>0.93</td></tr><tr><td>Maze 7</td><td/><td/><td/></tr><tr><td>Rotation</td><td>0.99</td><td>1</td><td>0.98</td></tr><tr><td>Rotation + Translation</td><td>0.90</td><td>0.89</td><td>0.89</td></tr><tr><td>Maze 8</td><td/><td/><td/></tr><tr><td>Rotation</td><td>0.99</td><td>0.85</td><td>1</td></tr><tr><td>Rotation + Translation</td><td>0.95</td><td>0.84</td><td>0.95</td></tr></table>

Ablation study on the global map performance in Maze 6 at t = 448 and t = 1580 using metrics in Section 4.1. From top to bottom,

Table content: <table/>

To explore the effect of loop closure and thus map correction, we have the ablated model with PU and GU removed (HDU + BVU). Compared with

Table content: <table><tr><td/><td>Maze 6</td><td>Maze 7</td><td>Maze 8</td><td/></tr><tr><td>Metrics</td><td>MSE Cor</td><td>MI MSE Cor</td><td>MI MSE Cor</td><td>MI</td></tr><tr><td>Ours</td><td colspan="4">0.04 0.81 0.36 0.06 0.73 0.32 0.14 0.53 0.21</td></tr><tr><td colspan="4">EFKslam 0.10 0.65 0.25 0.10 0.70 0.31</td><td/></tr></table>

Reading Head 1 and Writing Head 1 in Grid Unit (GU). It either reads or writes the local map of size 32 × 32 from the global map of size 500 × 500 in GU.

Table content: <table><tr><td/><td/><td>Reading Head 2</td></tr><tr><td colspan="2">Writing Head 2</td><td>Global map storing all spatial representations at time t</td></tr><tr><td>binary masking map</td><td>h(It) at time step t</td><td>nn.Sequential()</td></tr><tr><td/><td>nn.Replicate(8,3,4)</td><td>nn.Reshape(batchSize, 1, 128, 500, 500)</td></tr><tr><td/><td>nn.Reshape(batchSize,128,8,1)</td><td>nn.SplitTable(4,5)</td></tr><tr><td>nn.Identity()</td><td>nn.Replicate(8,4,4)</td><td>nn.NarrowTable(123,256)</td></tr><tr><td/><td>nn.Reshape(batchSize,128,8,8)</td><td>nn.JoinTable(2,4)</td></tr><tr><td/><td>nn.Padding(3, 246, 4, 0)</td><td>nn.Reshape(batchSize, 1, 128, 256, 500)</td></tr><tr><td/><td>nn.Padding(3, -246, 4, 0)</td><td>nn.SplitTable(5,5)</td></tr><tr><td/><td>nn.Padding(4, -246, 4, 0)</td><td>nn.NarrowTable(123,256)</td></tr><tr><td/><td>nn.Padding(4, 246, 4, 0)</td><td>nn.JoinTable(2,4)</td></tr><tr><td colspan="2">nn.CMulTable()</td><td>nn.Reshape(batchSize, 128, 256, 256)</td></tr><tr><td/><td/><td>downsample tensor by scale of 8 using Spatial Transformer Network</td></tr></table>

Reading Head 2 and Writing Head 2 in Grid Unit (GU). It either reads memory vectors or writes the discriminative spatial representation h(I t ) of size 1 × 128 from or into the global map of size 128 × 500 × 500 in GU.

Table content: <table/>

Architecture of Boundary Vector Unit (BVU)

Table content: <table/>

Architecture of Head Direction Unit (HDU)

Table content: <table/>

Peer review (iclr2018):
 Significance of Contributions Unclear The paper describes a neural network architecture for monocular SLAM that is argued to take inspiration from neuroscience. The architecture is comprised of four components: one that estimates egomotion (HDU) much like prediction in a filtering framework; one that fuses the current image into a local 2D metric map (BVU); one that detects loop closures (PCU); and one that integrates local maps (GU). These modules along with their associated representations are learned in an end-to-end fashion. The method is trained and evaluated on simulated grid environments and compared to two visual SLAM algorithms. The contributions and significance of the paper are unclear. SLAM is arguably a solved problem at the scales considered here, with existing solutions capable of performing localization and mapping in large (city-scale), real-world environments. That aside, one can appreciate the merits of representation learning in the context of SLAM and a handful of neural network-based approaches to SLAM and the related problem of navigation have been proposed of-late. However, the paper doesn*t do a sufficient job making the advantages of the proposed approach over these methods clear. Further, the paper emphasizes parallels to neuroscience models for navigation as being a contribution, however these similarities are largely hand wavy and one could argue that they also exist for the many other SLAM algorithms that perform prediction (as in HDU), local/global mapping (as in BVU and GU) and loop closure detection (as in PCU). More fundamentally, the proposed method does not appear to account for motion or measurement noise that are inherent in any SLAM problem and, related, does not attempt to model the uncertainty in the resulting map or pose estimates. The paper evaluates the individual components of the architecture. The results suggest that the different modules are doing something reasonable, though the evaluation is rather limited (in terms of spatial scale) and a bit arbitrary (e.g., comparing local maps to the ground truth at a seemingly arbitrary 32s). The evaluation of the loop closure is limited to a qualitative measure and is therefore not convincing. The authors should quantitatively evaluate the performance of loop closure in terms of precision and recall (this is particularly important given effects of erroneous loop closure detections and the claims that the proposed method is robust). Meanwhile, it isn*t clear that much can be concluded from the ablation studies as there is relatively little difference in MSE between the two ablated models. Additional comments/questions: * A stated advantage of this method over that of Gupta et al. is that the agent*s motion is not assumed to be known. However, it isn*t clear whether and how the model incorporates motion or measurement uncertainty, which is fundamental to any SLAM (or navigation) framework. * Related, an important aspect of any SLAM algorithm is an explicit estimate of the uncertainty in the agent*s pose and the map, however it doesn*t seem that the proposed model attempts to express this uncertainty. * The paper claims to estimate the agent*s pose as it navigates, but it is not apparent how the pose is maintained beyond estimating egomotion by comparing the current image to a local map. * Related, it is not clear how the method balances egomotion estimates and exteroceptive measurements (e.g, as are fused with traditional filtering frameworks). There are vague references to "eliminating discrepancies" when merging measurements, but it isn*t clear what this actually means, whether the output is consistent, or how the advantages of egomotion estimation and measurements are balanced. * The BVU module is stated as generating a "local" map, but it is not clear from the discussion what limits the resulting map to the area in the vicinity of the robot vs. the entire environment. * It is not clear why previous data is transformed to the agent*s reference frame as a result of motion vs. the more traditional approach of transforming the agent*s pose to a global reference frame. * The description of loop closure detection and the associated heuristics is confusing. For example, Section 3.4 states that the agent only considers positions that are distant from the most recent visited position as a means of avoiding trival loop closures, however Section 3.4 states that GU provides memory vectors near the current location for loop closure classification. * The description of the GU module is confusing. How does spatial indexing deal with changes to the map (e.g., as a result of loop closures/measurement updates) or transformations to the robot*s frame-of-reference? What are h, H, w, and W and how are they chosen? * The architecture assumes a discrete (and course) action space, whereas actions are typically continuous. Have the authors tried regressing to continuous actions or experimenting with finer discretizations that are more suitable to real applications? * It is not clear what is meant by the statement that the PU "learns to encode the representation of visited places". * The means by which the architecture is trained is unclear. What is the loss that is optimized? How is the triplet loss (Eqn. 3) incorporated (e.g., is it weighted differently than other terms in the loss)? * Section 3.2 states that the "agent has to learn to take actions to explore its surroundings", however it isn*t apparent that the method reasons over the agent*s policy. Indeed, this is an open area of research. Instead, the results section suggests that the agent acts randomly. * Section 4.1 draws comparisons between HDU and Head Direction Cells, however the latter estimate location/orientation whereas the former (this method) predicts egomotion. While egomotion can be integrated to estimate pose (as is done in Fig 4), these are not the same thing. * The authors are encouraged to tone down claims regarding parallels to navigation models from neuroscience as they are largely unjustified. * The comparison to existing monocular SLAM baselines is surprising and the reviewer remains skeptical regarding the stated advantages of the proposed method. How much of this difference is a result of testing in simulation? It would be more convincing to compare performance in real-world environments, for which these baselines have proven effective. * Figure 1: "Border" --> "Boundary" * Figure 1: The camera image should also go to the BVU block * Many of the citations are incorrectly not parenthesized * The paper should be proof-read for grammatical errors