{'fraction_non_alphanumeric': 0.029676538151114422, 'fraction_numerical': 0.008008940212330043, 'mean_word_length': 5.070284529866214, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Situational Fusion of Visual Representation for Visual Navigation

A complex visual navigation task puts an agent in different situations which call for a diverse range of visual perception abilities. For example, to"go to the nearest chair", the agent might need to identify a chair in a living room using semantics, follow along a hallway using vanishing point cues, and avoid obstacles using depth. Therefore, utilizing the appropriate visual perception abilities based on a situational understanding of the visual environment can empower these navigation models in unseen visual environments. We propose to train an agent to fuse a large set of visual representations that correspond to diverse visual perception abilities. To fully utilize each representation, we develop an action-level representation fusion scheme, which predicts an action candidate from each representation and adaptively consolidate these action candidates into the final action. Furthermore, we employ a data-driven inter-task affinity regularization to reduce redundancies and improve generalization. Our approach leads to a significantly improved performance in novel environments over ImageNet-pretrained baseline and other fusion methods.


Introduction
Assistive robots that can efficiently navigate an everyday home require an extensive repertoire of visual perception abilities. To "find the nearest cup", the robot needs a situational combination of different perception abilities. It needs to recognize a cup using object detection, and if no cup is present, identify and navigate to a room that may contain cups using a combination of scene semantic knowledge and geometric cues such as vanishing point and depth. Performing such a complex task in any home that may have completely different spatial layouts and appearances demands not only the generalizability of the individual visual perception modules but also the situational combination thereof.
Recently, deep reinforcement learning has made promising progress in goal-directed visual navigation with end-toend learning [21,41]. The guiding principle of imposing minimal structure to the learning algorithm and the practi-  cally unlimited synthetic training data have warranted the wide applicability of these methods. However, obviating structures and prior knowledge about visual perception can often lead to solutions that overfit to an environment. In fact, such success often reckons on training and evaluating in identical or similar environments [21,41]. Being able to perform complex navigation tasks and generalize to environments with drastically varying appearances as aforementioned is still beyond reach.
Meanwhile, visual representations extracted from a wide range of vision tasks [6,19] have been greatly effective in generalizing towards new tasks and new domains. It has been a common practice to reuse visual representations trained for standard vision tasks, such as image classification [20], in new datasets and new problems [8,33]. In this work, we endow visual navigation models with structures and priors based on a diverse set of visual representations. This leads to stronger generalization without losing the wide applicability of end-to-end learning. Our idea is motivated by the recent work of Taskonomy [38], which introduced a computational framework for studying the similarity and transferability among vision tasks. Their datadriven result shows that effective transfer of representation can happen between tasks of high affinity, which can be used to identify redundancies among tasks and significantly reduce total supervision. The repertoire of visual representations and their affinity measures from Taskonomy offer a basis for our model to learn generalizable navigation policies that transfer to unseen environments.
Thus, in order to harness visual representations for visual navigation, the primary challenge is to devise a scheme that adaptively fuses the representations based on a situational understanding of the task, while not overfitting to spurious dependencies among visual representations. To this end, we introduce an end-to-end approach that fuses visual representations at the action level and uses task affinity as regularization (see Fig. 1).We learn an action predictor for each representation, and then combine the action predictions from all representations into the final action output. We also use the data-driven task affinity discovered in Taskonomy as a source of regularization to penalize selection of redundant representations. This method ensures that the fused representation strikes a balance between being informative of the trained task and being generalizable towards new scenarios.
Prior works that addressed generalization of navigation policy [14,27] have typically focused on simulation-to-real transfer for low-level motion control tasks. We instead evaluate our approach in visual navigation tasks with higher complexity in the Gibson simulated environments [37], which were shown to transfer to the real world without further supervision [24,17]. Our policy takes as input RGB images and produces the action command for the robot. Our results indicate that the use of representations has led to substantially better generalization for a high-level navigation task in unseen environments, and fusion at the action level leads to better generalization and robustness towards noise and subsystem failure. Furthermore, the inter-task affinity regularization promotes the fusion method to select more complementary and less redundant representations.
To summarize, our contributions are twofold: 1) we propose to use visual representations from a diverse set of vision tasks as a prior to learn generalizable policies for visual navigation, and 2) we develop action-level representation fusion and regularization techniques to achieve strong zero-shot generalization results in unseen environments.

Related Work
Representation Learning. Prior work has developed various methods to learn visual representations with deep neural networks using supervised learning [6], unsupervised learning [7,29], and weakly supervised learning [16] objectives. Motivated by the success of using deep features in trans-fer learning, a series of work has developed visualization and analysis techniques to understand the characteristics of deep features [22,39] and the factors that affect the efficacy of transfer [15]. Taskonomy [38] has recently demonstrated that representations learned on 25 distinct vision tasks can transfer between similar tasks. However, it has focused on static image-based tasks. In contrast, we study how to leverage these diverse visual representations to effectively learn generalizable policies for visual navigation.
Visual Navigation. Vision-based navigation for mobile robots has been widely studied in classic robotics literature [1,35]. The recent boom of deep learning has driven a new wave of development of visual navigation methods that employ the representational power of deep networks. Deep reinforcement learning [25,26,28,41] has been successfully applied to mapless navigation, eliminating the need for an explicit environment map. Other methods have adopted planning modules in the learning pipeline [10], or tackled the navigation task along with other semantic tasks, such as language grounding [13] or visual question answering [4,9]. Most of the prior work has focused on learning these navigation models end-to-end from scratch rather than reusing visual representations learned from other vision tasks. We demonstrate that our model can effectively leverage these representations to achieve stronger generalization when navigating in an unseen environment.
Generalization in Policy Learning. A series of methods have been developed to improve the generalization of policy learning towards novel visual observations [36], noisy environment dynamics [23,30], and new task instances [31,41]. Synthetic data has been harnessed as a training source to empower the training of the data-hungry deep network policies. Accordingly, several works have introduced new techniques to close the reality gap, allowing these policies to generalize from simulation to the real world [14,27,40]. In this work, we also use simulated data to train our models. However, our simulator of choice, Gibson [37], employs 3D captures of real-world scenes and domain-adapted simulation, which has been shown effective in deploying the simulation-trained policies directly in the real world [17,24]. We focus on improving the generalization of our models across visual scenes with novel ways of fusing the diverse set of visual representations.

Situational Visual Navigation Model
Our goal is to learn visual navigation policies that generalize better to unseen environments by enabling the agent to adaptively fuse visual representations which are trained on a diverse set of vision tasks [38]. However, naïvely fusing representations results in overfitting (Table 1), and it is not robust against noise and subsystem failure (Fig. 7).
To address overfitting and to increase model robustness,  Figure 2: Three schemes of learning neural network policies from visual perception to action, including end-to-end learning with blackbox neural networks, and representation fusion methods at both feature and action levels.
we propose to combine the representations at the action level (Sec. 3.3.1), which ensures that each representation is individually trained to make meaningful prediction for the overall task. We also introduce a novel regularization over the fusion weights based on inter-task affinity (Sec. 3.3.2). It reduces the co-selection of redundant representations and diversifies the use of representations based on the characteristics of each state. Results show that the synergy of actionlevel fusion and inter-task affinity regularization ( Fig. 3) yields big performance gain over baselines.

Problem Formulation
We focus on the task of visual navigation in indoor environments. The agent perceives the environment through its on-board RGB camera [37]. Following the setup in prior work [10,41], the actions are defined as high-level commands a x,θ , where θ is the turning angle and x is the stepping distance. We assume that the environments are discretized into a regular octagonal grid, where the agent uses the high-level actions to traverse on the grid.
We formulate the learning problem as follows. At the beginning of an episode, the agent is randomly spawned at location p 0 = (x 0 , y 0 ) in an environment E. At each step, the agent receives a visual observation in the form of RGB image o t = O(p t , E), where O is a function which returns the current images at location p t in E. From each visual observation, a set of visual representations r t (o t ) can be computed from deep network models trained on a diverse set of vision tasks, where r t (o t ) = {r 1 t , r 2 t , ...}. We want to learn a closed-loop navigation policy π(a t |o t , r t ), parameterized by neural networks, to map the RGB image o t and their visual representations r t to the action a t that commands the robot to navigate in the environment. For each task, we specify a Boolean function that determines if the current location p t satisfies the goal condition. Our objective is to learn an optimal policy π * which reaches a goal location from its current location in minimum number of steps.

Representations from Diverse Vision Tasks
The visual navigation task requires a variety of visual perception abilities, thus demanding visual representations learned from a diverse set of vision tasks. We leverage the representations from Taskonomy [38], which trains deep network models for 25 distinct computer vision tasks at multiple levels of abstraction. For each task, a neural network model is trained with supervised learning to map the input RGB image into a compact representation r ∈ R 16×16×8 , which capsules the information required to solve the task. It has been shown that these representations, being compact in size, are easily transferable to other visual understanding tasks. The compactness and richness of these representations make them appealing for representing the visual perception abilities required in interactive visual tasks. Therefore, we use these 25 representations as a basis to learn our vision-based navigation policies.
Taskonomy also introduced a data-driven affinity score between each pair of the 25 vision tasks. The affinity scores estimate the correlation and redundancy of the representations across these tasks. We demonstrate in Sec. 3.3.2 that we can incorporate such affinity of representations into the process of situational fusion. This encourages the model to make a more balanced selection of representations and reduce overfitting to redundancies.

Situational Representation Fusion
A naïve approach to learn the navigation policies is to consider deep network as a black-box model and train it with end-to-end learning (Fig. 2a). While this approach can directly optimize the learning objective from pixel to control, it tends to capture spurious dependencies from limited training data, hindering its generalization ability. Prior work [38] has proposed to leverage Taskonomy representations via a simple concatenation of r t (o t ). However, it offers marginal performance gain over the black-box model ( Table 1). We hypothesize that this is due to the lack of situational use of representations.
Our key intuition is that different stages of the visual navigation task would require different visual perception skills. For instance, localizing the target object would require semantic understanding, and avoiding obstacles would require geometric reasoning. To satisfy such requirements, the model has to develop a situational understanding of its current perception for decision making. Thus, we introduce a situational-fusion module that adaptively weighs and combines the representations based on the current state.
A widely used paradigm of combining representa-  tions [5,32] is to use fused representations as joint input to neural network layers (i.e., feature-level fusion illustrated in Fig. 2b). However, as prior work [32] pointed out, such fusion method tends to bias towards a few dominating representations and is prone to poor generalization performance. This leads to the two challenges of overfitting and lack of robustness, as highlighted at the beginning of this section. We introduce two effective techniques to deal with the challenges as follows.

Fusion at the Action Level
As described at the beginning of this section, featurelevel fusion faces the challenge of overfitting, and lack of robustness towards noise and subsystem failure.
In robotics, to perform a complex task, compositionality of behaviors [2,34] promotes to learn a valid behavior for every sub-module, which ensures that all sub-modules are well trained. Then the simpler behaviors are composed at decision-output level into more complex behaviors. Since each sub-module develops a valid behavior, the overall system also becomes more robust towards sub-module errors.
Inspired by this approach, we propose an alternative way of fusing the representations at the action level (Fig. 2c). We learn a valid action-prediction model out of each representation, which ensures that all representations are well trained (Fig. 3). Formally, at any time step t, as the agent receives RGB image input o t , it uses a situational-fusion network f to output an n-dimensional vector h t = f (o t ) for the n representations. h t is then normalized with a softmax function to obtain the fusion weight g t = softmax(h t ). We use pretrained Taskonomy modules to compute the n representations for the image {r 1 t , r 2 t , . . . , r n t }. For each representation r i t , an action-prediction module π i,θ (a|r i t ) is inde-pendently trained and produces an action candidateã i t , thus not suffering from under-training. Each action candidate can be independently taken as a final action for execution, but better decision can be made by using situational-fusion weights g t to reweigh and combine the action candidates into the final action output a t : We observe that using this new fusion scheme significantly improves generalization performance over naïve fusion scheme (Table 1), and the action candidate of each branch achieves reasonable individual performance (Fig. 6). At the same time, it also offers more robustness towards noise and sub-system failure (Sec. 4.3). However, although individual branches are well developed in the action-level fusion scheme, we observe that the fusion weights still show strong bias towards a few dominating action candidates during inference. In the following section, we propose a novel regularization loss using inter-task affinity.

Inter-task Affinity Regularization
The bias of fusion weights towards a few dominating representations makes the overall model prone to overfitting. To deal with the problem, prior work [32] adopted a load-balancing loss (LBL) term to regularize on coefficients of variation L LBL = CV(g t ), where CV stands for the coefficients of variation operator. However, LBL loss promotes uniform fusion weights across all representations, and we observe that adding this regularizing term alone to our fusion model offers limited to no performance improvement for both feature-level and action-level fusion. A clear shortcoming of this technique is that it fails to take into account the correlations among representations. High correla-tion between two representations means that choosing both leads to more information redundancy, which can affect the model's generalization ability. Therefore, we further propose to design a loss that leverages correlations of representations as a prior to minimize information redundancy and balance fusion weights. Taskonomy [38] uses a data-driven approach to measure pairwise task-affinity by calculating the performance gain from using one task's representation to transfer-learn the other task. We use Taskonomy's datadriven pairwise task affinity as a surrogate for the correlations among different visual task representations.
Formally, for each time step t and fusion weight g t ∈ R n , we want to encourage large weights in g i t , g j t if task i and j have low task affinity aff(i, j), and smaller weight if task affinity is high. To achieve this, we inject a regularizer for task affinity by adding a bilinear loss term [11] between fusion-weight vector and task-affinity matrix (Fig. 3): For every pair of tasks, we measure the product of the task affinity aff(i, j) and its corresponding fusion weights g i t , g j t , and calculate L g (g t ) as sum of all such products. For example, occlusion edge detection and surface-normal estimation are two tasks with high affinity. If the model puts large weights on both tasks in g t , then the product between their task affinity and fusion weights will be large, which leads to a larger L g (g t ) and the selection will be penalized. Thus, regularizing on this loss encourages the situationalfusion network to reduce information redundancy and balance fusion weights.

Experiments
We evaluate our proposed methods of situational fusion in a set of visual navigation tasks. Throughout the experiments, we measure the generalization aspect of different navigation policies, and examine the effectiveness of actionlevel fusion and the inter-task affinity regularization.

Experiment Setup
Experimental Testbed. We conduct experiments in Gib-sonEnv [37] rendering of Matterport3D assets [3], which were captured with real-world 3D scans and labeled with semantic ground truth. We use a diverse set of 62 simulated indoor environments that contain our objects of interest. We focus on the high-level visual navigation planning and map the navigation locations to an octagonal grid. At each time step, the agent receives eight RGB images in the octagonal directions obtained from its on-board 360-degree camera. The action space consists of eight actions that step along the eight directions on the octagonal grid and a stop action. Following [10], we preprocess all traversable locations on the octagonal grid and generate a directed graph G x,θ that connects these locations. This enables us to acquire the su-pervision of optimal actions to train our policies through shortest-path algorithms. Task Setups. We follow the formulation of semantic navigation tasks [10]. The agent is commanded to "go to the closest X," where X ∈ {chair, table, bed, door}. We use the ground truth object annotation from [3] to label nodes in the graph G x,θ with object categories, and define the optimal action as stepping towards the closest instance of the object class. To ensure the plausibility of finding a solution, we ensure the agent to start in a room where at least one instance of the specified object class exists. In our tasks, the maximum shortest-path distance between the agent's starting location and a target object is 32 steps, and the minimum is 6. This setup requires the agent to learn object appearances through algorithmic supervision and find the same object class (different instances) in novel test environments. Evaluation Protocol. We follow the train/test procedures used in prior work [10]. For each task, we use on average 28 environments for training and 14 for testing. An episode is judged to be successfully completed if the agent, given a maximum of 39 steps, ends in a location within 3 steps from the specified object. During testing, we randomly sample a fixed set of 1024 starting locations in the test environments, and report the success rate of each model. Baselines. We first compare our method with three baselines which do not use situational fusion: • Random: a random walk agent that takes a uniformly random action at each time step; • ResNet: a black-box deep neural network that maps from raw pixel inputs to action labels (see Fig. 2a). We use ResNet-50 model [12] as in Taskonomy [38] with pretrained-weights from ImageNet [6]. Same data augmentation as [12] is applied. • Concat: directly concatenating all representations [38]. We then compare our method with naïve situational-fusion baselines and prior work [32]: • Feature-level Fusion: naïve situational fusion of representations at feature-level (Sec. 3.3). • LBL: adding load-balance loss [32], examined for both feature-level and action-level fusion models. We report two additional baselines for action-level fusion: • Maj.: we perform majority voting among the action candidates and select the top one. This corresponds to a simplified version of our action-fusion method where the fusion weight is set to uniform. • Top k: to understand the impact of increasing number of representations, we perform majority voting on the actions from the branches that have the k-highest individual feature success rates (Fig. 6).
Proposed Models. We examine our proposed extensions to feature-level fusion. We explore the effectiveness of fusion at action-level (Sec. 3.3.1), which combines a set of action candidates predicted from individual representations (action-level fusion). Then we investigate intertask affinity regularization (Sec. 3.3.2) that discourages redundancies in fusion weights (T.Aff). All models were trained using ADAM [18] to optimize for the loss function and trained for 16K iterations with batch size of 256 (64 for ResNet baseline). We decay the learning rate by a factor of 10 every 5k iterations. Table 1 compares among baselines and variations of our proposed model. The table consists of five main columns: random agents, ResNet baselines, concatenating representations, feature-level fusion and action-level fusion. We measure each model's performance on all four navigation tasks and report the average across tasks. The numbers are evaluated in test environments unseen during training.

Quantitative Evaluation
First, we observe a large performance gap between black-box methods that train on raw pixels and our proposed methods that situationally fuse visual representations at action-level with inter-task affinity regularization. The method achieves a 2× higher success rate than the state-ofthe-art pretrained ResNet model [12]. This indicates that correctly leveraging visual representations has a significant effect in improving generalization of the learned policy.
Second, we see that naïvely using visual representations results in limited performance increase. Directly concatenating 25 different visual representations only results in 5% performance increase over the ResNet model, and a vanilla feature-level fusion model performs similarly. As mentioned in Sec. 3, two challenges (overfitting and lack of robustness) need to be solved. We can see that adding load-balancing loss (LBL) [32] alone only offers marginal help.
Our proposed action-level fusion explicitly learns an action-prediction model for each representation. Since the load-balancing problem in training is explicitly handled, results show that action-level fusion significantly outperforms LBL loss and that adding LBL loss onto actionlevel fusion brings no further gain. As for comparing with feature-level fusion, action-level fusion shows superior performance. While both schemes have similar training performances, action-level fusion performs much better for testing (Fig. 4). We hypothesize that action-level fusion suffers less overfitting thanks to its separate handling of each representation. Fusion of the action candidates acts as a model ensemble, which can effectively factor in each representation's contribution in decision making. This hypothesis is further backed by the competitive results of the Majority Voting baseline, which combines the actions with uniform weights.
Finally, we see that adding an inter-task affinity regularization (T.Aff) improves the agent's performance in both fusion schemes. T.Aff outperforms LBL loss in both feature-level and action-level fusion. For feature-level fusion, since T.Aff is not designed for dealing with representation under-training, combining it with LBL loss gives a better performance. For action-level fusion, which is more effective towards representation under-training than LBL, incorporating T.Aff has achieved the best performance and outperformed the Majority Voting baseline by 3%. The effect is more significant for tasks of finding table and chair, where the performance boost is over 7%. Results show that the task affinity regularization is able to reduce spurious dependencies and encourage more balanced selection.

Model Analysis
Analysis of Fusion Weights: We conducted qualitative and quantitative studies on the distribution patterns of the situational-fusion weights, results shown in Fig. 5.
In the first test, we group the representations into three domains: 2D (e.g. autoencoder), 3D (e.g. depth estimation) and semantics (e.g. semantic segmentation). For each location in our environments, we record the fusion weights of our action-level fusion model. We group the weights based on the representation domains, perform normaliza- In the second test, we examine how weights are distributed between representation branches with different individual performances (see Fig. 6). We sample 100 images from each test environment, and record the fusion weights across samples. Then, for each representation, we select the top 4 images with the highest corresponding fusion weights as well as the lowest bottom 4 images, shown in the right part of Fig. 5. Due to space limit, we spread out only 4 representations of different individual-performance levels.
The columns in Fig. 5 are sorted from left to right according to individual representation performances measured in Fig. 6. As we can see, high-performing representations are highly activated when facing more complex scenes with lots of objects and varying spatial layout (Fig. 5 top left). They have relatively lower weights when the view becomes more plain (Fig. 5 bottom left). Low-performing representations, like 2D edge detection or camera pose estimation, demonstrate the opposite. This suggests that our fusion mechanism learns to put higher reliance on high-performing representations when facing hard decisions (more complex observations), and incorporate low-performing representations to hedge risks when facing simpler decisions. Analysis of Individual Representations: To investigate the contribution of each visual representation in visual navigation, we quantitatively measure the success rate of directly executing the action candidates from each branch for our action-level fusion models in Fig. 6.   As we can see, the top three best-performing representations are all 3D geometric tasks. Euclidean-Distance, being the top-performing representation, should constantly be consulted so that the agent does not collide into object. Surface-Normal Estimation, proved to be one of the best representation to transfer out [38], clearly demonstrates its usefulness in navigation tasks. Semantic representations, especially semantic segmentation, ranks relatively high. For our navigation tasks, semantic information is important in an agent's success of locating the target objects.
Low-level vision tasks, such as vanishing-point estimation and camera-pose estimation, perform poorly as an individual model. These representations have very high abstraction level, and it is hard for the agent to read out scene layout information necessary for complex behaviors.
Analysis of Model Robustness: Robustness to unexpected scenarios is very important for a navigation agent. At any moment, a representation might show out-of-distribution noise, and in extreme cases, there might be sub-system failures (such as bugs or attacks) that prevent the agent from accessing its complete representation set. If the agent is unequipped to handle noise or absence of representation, there might be severe consequences.
Action-level fusion provides a robust way to deal with such challenges. Since each representation individually produces an action output, the downstream effect of missing representations is kept to a minimum. On the other hand, any defect to representation will propagate to later layers of the policy network for feature-level fusion. To measure robustness to representation loss, we conduct two tests for the top model of feature-level fusion and of action-level fusion. In both tests, we randomly select a set of representations to be dropped at each step.
For the first test (Fig. 7 left), we assume that the loss of  representation is noticed by the agent, and it skips the given representation branch by setting the lost representations' fusion weights to zero and normalizing the remaining values.
As we see, action-level fusion handles representation loss much better than feature-level fusion. For the second test (Fig. 7 right), we randomly replace a set of representations with noise (setting all values of the representations to zero), and the agent treats the affected representation as usual. This is a more challenging setup since the agent might put high weights on the affected representations. We can see that action-level fusion is more robust than feature-level fusion, and is able to have meaningful performance when a random set of 5 representations is affected at each time step.

Conclusion
We explored the effectiveness of situationally fusing visual representations from vision tasks to improve zero-shot generalization of an interactive agent in visual navigation tasks. We proposed two novel extensions to fusing representations: action-level fusion and inter-task affinity regularization. Our results suggested that a combination of the two extensions led to better generalization and enhanced robustness of the navigation agent. In a broader scope, these promising results shed light on how to build intelligent systems that can effectively leverage internal representations from other tasks to learn new behaviors. One of the possible future directions is to apply similar principles of representation fusion to other interactive domains, such as active perception and visuomotor learning.