Selfless Sequential Learning

1 INTRODUCTION . Sequential learning , also referred to as continual , incremental , or lifelong learning ( LLL ) , studies the problem of learning a sequence of tasks , one at a time , without access to the training data of previous or future tasks . When learning a new task , a key challenge in this context is how to avoid catastrophic interference with the tasks learned previously ( French , 1999 ; Li & Hoiem , 2016 ) . Some methods exploit an additional episodic memory to store a small amount of previous tasks data to regularize future task learning ( e.g . Lopez-Paz et al . ( 2017 ) ) . Others store previous tasks models and at test time , select one model or merge the models ( Rusu et al. , 2016 ; Aljundi et al. , 2016 ; Lee et al. , 2017 ) . In contrast , in this work we are interested in the challenging situation of learning a sequence of tasks without access to any previous or future task data and restricted to a fixed model capacity , as also studied in Kirkpatrick et al . ( 2016 ) ; Aljundi et al . ( 2017 ) ; Fernando et al . ( 2017 ) ; Mallya & Lazebnik ( 2017 ) ; Serrà et al . ( 2018 ) . This scenario not only has many practical benefits , including privacy and scalability , but also resembles more closely how the mammalian brain learns tasks over time . The mammalian brain is composed of billions of neurons . Yet at any given time , information is represented by only a few active neurons resulting in a sparsity of 90-95 % ( Lennie , 2003 ) . In neural biology , lateral inhibition describes the process where an activated neuron reduces the activity of its weaker neighbors . This creates a powerful decorrelated and compact representation with minimum interference between different input patterns in the brain ( Yu et al. , 2014 ) . This is in stark contrast with artificial neural networks , which typically learn dense representations that are highly entangled ( Bengio et al. , 2009 ) . Such an entangled representation is quite sensitive to changes in the input patterns , in that it responds differently to input patterns with only small variations . French ( 1999 ) suggests that an overlapped internal representation plays a crucial role in catastrophic forgetting and reducing this overlap would result in a reduced interference . Cogswell et al . ( 2015 ) show that when the amount of overfitting in a neural network is reduced , the representation correlation is also reduced . As such , learning a disentangled representation is more powerful and less vulnerable to catastrophic interference . However , if the learned disentangled representation at a given task is not sparse , only little capacity is left for the learning of new tasks . This would in turn result in either an underfitting to the new tasks or again a forgetting of previous tasks . In contrast , a sparse and decorrelated representation would lead to a powerful representation and at the same time enough free neurons that can be changed without interference with the neural activations learned for the previous tasks . In general , sparsity in neural networks can be thought of either in terms of the network parameters or in terms of the representation ( i.e. , the activations ) . In this paper we postulate , and confirm experimentally , that a sparse and decorrelated representation is preferable over parameter sparsity in a sequential learning scenario . There are two arguments for this : first , a sparse representation is less sensitive to new and different patterns ( such as data from new tasks ) and second , the training procedure of the new tasks can use the free neurons leading to less interference with the previous tasks , hence reducing forgetting . In contrast , when the effective parameters are spread among different neurons , changing the ineffective ones would change the function of their corresponding neurons and hence interfere with previous tasks ( see also Figure 1 ) . Based on these observations , we propose a new regularizer that exhibits a behavior similar to the lateral inhibition in biological neurons . The main idea of our regularizer is to penalize neurons that are active at the same time . This leads to more sparsity and a decorrelated representation . However , complex tasks may actually require multiple active neurons in a layer at the same time to learn a strong representation . Therefore , our regularizer , Sparse coding through Local Neural Inhibition and Discounting ( SLNID ) , only penalizes neurons locally . Furthermore , we don ’ t want inhibition to affect previously learned tasks , even if later tasks use neurons from earlier tasks . An important component of SLNID is thus to discount inhibition from/to neurons which have high neuron importance – a new concept that we introduce in analogy to parameter importance ( Kirkpatrick et al. , 2016 ; Zenke et al. , 2017 ; Aljundi et al. , 2017 ) . When combined with a state-of-the-art important parameters preservation method ( Aljundi et al. , 2017 ; Kirkpatrick et al. , 2016 ) , our proposed regularizer leads to sparse and decorrelated representations which improves the lifelong learning performance . Our contribution is threefold . First , we direct attention to Selfless Sequential Learning and study a diverse set of representation based regularizers , parameter based regularizers , as well as sparsity inducing activation functions to this end . These have not been studied extensively in the lifelong learning literature before . Second , we propose a novel regularizer , SLNID , which is inspired by lateral inhibition in the brain . Third , we show that our proposed regularizer consistently outperforms alternatives on three diverse datasets ( Permuted MNIST , CIFAR , Tiny Imagenet ) and we compare to and outperform state-of-the-art LLL approaches on an 8-task object classification challenge . SLNID can be applied to different regularization based LLL approaches , and we show experiments with MAS ( Aljundi et al. , 2017 ) and EWC ( Kirkpatrick et al. , 2016 ) . In the following , we first discuss related approaches to LLL and different regularization criteria from a LLL perspective ( Section 2 ) . We proceed by introducing Selfless Sequential Learning and detailing our novel regularizer ( Section 3 ) . Section 4 describes our experimental evaluation , while Section 5 concludes the paper . 2 RELATED WORK . The goal in lifelong learning is to learn a sequence of tasks without catastrophic forgetting of previously learned ones ( Thrun & Mitchell , 1995 ) . One can identify different approaches to introducing lifelong learning in neural networks . Here , we focus on learning a sequence of tasks using a fixed model capacity , i.e . with a fixed architecture and fixed number of parameters . Under this setting , methods either follow a pseudo rehearsal approach , i.e . using the new task data to approximate the performance of the previous task ( Li & Hoiem , 2016 ; Triki et al. , 2017 ) , or aim at identifying the important parameters used by the current set of tasks and penalizing changes to those parameters by new tasks ( Kirkpatrick et al. , 2016 ; Zenke et al. , 2017 ; Aljundi et al. , 2017 ; Chaudhry et al. , 2018 ; Liu et al. , 2018 ) . To identify the important parameters for a given task , Elastic Weight Consolidation ( Kirkpatrick et al. , 2016 ) uses an approximation of the Fisher information matrix computed after training a given task . Liu et al . ( 2018 ) suggest a network reparameterization to obtain a better diagonal approximation of the Fisher Information matrix of the network parameters . Path Integral ( Zenke et al. , 2017 ) estimates the importance of the network parameters while learning a given task by accumulating the contribution of each parameter to the change in the loss . Chaudhry et al . ( 2018 ) suggest a KL-divergence based generalization of Elastic Weight Consolidation and Path Integral . Memory Aware Synapses ( Aljundi et al. , 2017 ) estimates the importance of the parameters in an online manner without supervision by measuring the sensitivity of the learned function to small perturbations on the parameters . This method is less sensitive to the data distribution shift , and a local version proposed by the authors resembles applying Hebb rule ( Hebb , 2002 ) to consolidate the important parameters , making it more biologically plausible . A common drawback of all the above methods is that learning a task could utilize a good portion of the network capacity , leaving few `` free '' neurons to be adapted by the new task . This in turn leads to inferior performance on the newly learned tasks or forgetting the previously learned ones , as we will show in the experiments . Hence , we study the role of sparsity and representation decorrelation in sequential learning . This aspect has not received much attention in the literature yet . Very recently , ( Serrà et al. , 2018 ) proposed to overcome catastrophic forgetting through learned hard attention masks for each task with L1 regularization imposed on the accumulated hard attention masks . This comes closer to our approach although we study and propose a regularization scheme on the learned representation . The concept of reducing the representation overlap has been suggested before in early attempts towards overcoming catastrophic forgetting in neural networks ( French , 1999 ) . This has led to several methods with the goal of orthogonalizing the activations ( French , 1992 ; 1994 ; Kruschke , 1992 ; 1993 ; Sloman & Rumelhart , 1992 ) . However , these approaches are mainly designed for specific architectures and activation functions , which makes it hard to integrate them in recent neural network structures . The sparsification of neural networks has mostly been studied for compression . SVD decomposition can be applied to reduce the number of effective parameters ( Xue et al. , 2013 ) . However , there is no guarantee that the training procedure converges to a low rank weight matrix . Other works iterate between pruning and retraining of a neural network as a post processing step ( Liu et al. , 2015 ; Sun et al. , 2016 ; Aghasi et al. , 2017 ; Louizos et al. , 2017 ) . While compressing a neural network by removing parameters leads to a sparser neural network , this does not necessarily lead to a sparser representation . Indeed , a weight vector can be highly sparse but spread among the different neurons . This reduces the effective size of a neural network , from a compression point of view , but it would not be beneficial for later tasks as most of the neurons are already occupied by the current set of tasks . In our experiments , we show the difference between using a sparse penalty on the representation versus applying it to the weights . 3 SELFLESS SEQUENTIAL LEARNING . One of the main challenges in single model sequential learning is to have capacity to learn new tasks and at the same time avoid catastrophic forgetting of previous tasks as a result of learning new tasks . In order to prevent catastrophic forgetting , importance weight based methods such as EWC ( Kirkpatrick et al. , 2016 ) or MAS ( Aljundi et al. , 2017 ) introduce an importance weight Ωk for each parameter θk in the network . While these methods differ in how to estimate the important parameters , all of them penalize changes to important parameters when learning a new task Tn using L2 penalty : Tn : min θ 1 M M∑ m=1 L ( ym , f ( xm , θn ) ) + λΩ ∑ k Ωk ( θ n k − θn−1k ) 2 ( 1 ) where θn−1 = { θn−1k } are the optimal parameters learned so far , i.e . before the current task . { xm } is the set of M training inputs , with { f ( xm , θn ) } and { ym } the corresponding predicted and desired outputs , respectively . λΩ is a trade-off parameter between the new task objective L and the changes on the important parameters , i.e . the amount of forgetting . In this work we introduce an additional regularizer RSSL which encourages sparsity in the activations Hl = { hmi } for each layer l. Tn : min θ 1 M M∑ m=1 L ( ym , f ( xm , θn ) ) + λΩ ∑ k Ωk ( θ n k − θn−1k ) 2 + λSSL ∑ l RSSL ( Hl ) ( 2 ) λSSL and λΩ are trade-off parameters that control the contribution of each term . When training the first task ( n = 1 ) , Ωk = 0 . 3.1 SPARSE CODING THROUGH NEURAL INHIBITION ( SNI ) Now we describe how we obtain a sparse and decorrelated representation . In the literature sparsity has been proposed by Glorot et al . ( 2011 ) to be combined with the rectifier activation function ( ReLU ) to control unbounded activations and to increase sparsity . They minimize the L1 norm of the activations ( since minimizing the L0 norm is an NP hard problem ) . However , L1 norm imposes an equal penalty on all the active neurons leading to small activation magnitude across the network . Learning a decorrelated representation has been explored before with the goal of reducing overfitting . This is usually done by minimizing the Frobenius norm of the covariance matrix corrected by the diagonal , as in Cogswell et al . ( 2015 ) or Xiong et al . ( 2016 ) . Such a penalty results in a decorrelated representation but with activations that are mostly close to a non zero mean value . We merge the two objectives of sparse and decorrelated representation resulting in the following objective : RSNI ( Hl ) = 1 M ∑ i , j ∑ m hmi h m j , i 6= j ( 3 ) where we consider a hidden layer l with activations Hl = { hmi } for a set of inputs X = { xm } and i , j ∈ 1 , .. , N running over all N neurons in the hidden layer . This formula differs from minimizing the Frobenius norm of the covariance matrix in two simple yet important aspects : ( 1 ) In the case of a ReLU activation function , used in most modern architectures , a neuron is active if its output is larger than zero , and zero otherwise . By assuming a close to zero mean of the activations , µi ' 0 ∀i ∈ 1 , .. , N , we minimize the correlation between any two active neurons . ( 2 ) By evaluating the derivative of the presented regularizer w.r.t . the activation , we get : ∂RSNI ( Hl ) ∂hmi = 1 M ∑ j 6=i hmj ( 4 ) i.e. , each active neuron receives a penalty from every other active neuron that corresponds to that other neuron ’ s activation magnitude . In other words , if a neuron fires , with a high activation value , for a given example , it will suppress firing of other neurons for that same example . Hence , this results in a decorrelated sparse representation . 3.2 SPARSE CODING THROUGH LOCAL NEURAL INHIBITION ( SLNI ) The loss imposed by the SNI objective will only be zero when there is at most one active neuron per example . This seems to be too harsh for complex tasks that need a richer representation . Thus , we suggest to relax the objective by imposing a spatial weighting to the correlation penalty . In other words , an active neuron penalizes mostly its close neighbours and this effect vanishes for neurons further away . Instead of uniformly penalizing all the correlated neurons , we weight the correlation penalty between two neurons with locations i and j using a Gaussian weighting . This gives RSLNI ( Hl ) = 1 M ∑ i , j e− ( i−j ) 2 2σ2 ∑ m hmi h m j , i 6= j ( 5 ) As such , each active neuron inhibits its neighbours , introducing a locality in the network inspired by biological neurons . While the notion of neighbouring neurons is not well established in a fully connected network , our aim is to allow few neurons to be active and not only one , thus those few activations don ’ t have to be small to compensate for the penalty . σ2 is a hyper parameter representing the scale at which neurons can affect each other . Note that this is somewhat more flexible than decorrelating neurons in fixed groups as used in Xiong et al . ( 2016 ) . Our regularizer inhibits locally the active neurons leading to a sparse coding through local neural inhibition .

Summary: This paper deals with the problem of catastrophic forgetting in lifelong learning, which has recently attracted much attention from researchers. In particular, authors propose the regularized learning strategies where we are given a fixed network structure (without requiring additional memory increases in the event of new task arriving) in the sequential learning framework, without the access to datasets of previous tasks.  Performance comparisons were performed experimentally against diverse regularization methods including ones based on representation, based on parameter itself, and the superiority of representation-based regularization techniques was verified experimentally. Based on this, authors propose a regularization scheme utilizing the correlation between hidden nodes called SNI and its local version based on Gaussian weighting. Both regularizers are even extended to consider the importance of hidden nodes. Through MNIST, CIFAR, and tiny Imagenet datasets, it has been experimentally demonstrated that the proposed regularization technique outperforms state-of-the-art in sequential learning.